From b63ad48f5f42cc22a92d7597dd1331a4785f50a7 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sat, 31 Jan 2026 12:50:24 -0600 Subject: [PATCH 01/10] some updates. --- nitrogo/basic.go | 17 ++++++--------- nitrogo/client.go | 45 ++++++++++++++++++++------------------- nitrogo/client_options.go | 7 ------ nitrogo/lb.go | 34 ++++++++++++----------------- nitrogo/system.go | 36 +++++++++++++++---------------- 5 files changed, 61 insertions(+), 78 deletions(-) diff --git a/nitrogo/basic.go b/nitrogo/basic.go index 84b519e..da2b5c6 100644 --- a/nitrogo/basic.go +++ b/nitrogo/basic.go @@ -175,29 +175,26 @@ func (s *BasicService) CountServiceGroupBindings() {} func (s *BasicService) GetAllServiceGroupBinding() {} func (s *BasicService) GetServiceGroupBinding(serviceGroupName string) ([]models.ServiceGroupBinding, error) { u := fmt.Sprintf("nitro/v1/config/servicegroup_binding/%s", serviceGroupName) - v := []models.ServiceGroupBinding{} req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { - return v, err + return nil, err } resp, err := s.client.Do(req) if err != nil { - return v, err + return nil, err } - data, err := json.Marshal(resp["servicegroup_binding"]) - if err != nil { - return v, err + var result struct { + ServiceGroupBinding []models.ServiceGroupBinding `json:"servicegroup_binding"` } - err = json.Unmarshal(data, &v) - if err != nil { - return v, fmt.Errorf("failed to unmarshal: %w", err) + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return v, nil + return result.ServiceGroupBinding, nil } // servicegroup_lbmonitor_binding diff --git a/nitrogo/client.go b/nitrogo/client.go index 4362ea8..01c419b 100644 --- a/nitrogo/client.go +++ b/nitrogo/client.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "strings" "time" ) @@ -19,8 +20,8 @@ type Client struct { hostname string proxiedURL string - credential Credential - sessionid string + credential Credential + sessionid string httpClient *http.Client @@ -86,11 +87,12 @@ type Client struct { VPN *VPNService } -func NewNitroClient(username, password string, options ...ClientOptionFunc) (*Client, error) { +func NewNitroClient(host, username, password string, options ...ClientOptionFunc) (*Client, error) { c := &Client{ httpClient: &http.Client{ - Timeout: 5 * time.Second, + Timeout: 10 * time.Second, }, + baseURL: strings.TrimRight(host, "/"), } for _, opt := range options { @@ -168,7 +170,7 @@ func NewNitroClient(username, password string, options ...ClientOptionFunc) (*Cl // NewRequest - creates the http.Request and applies the relevant authorization func (c *Client) NewRequest(method, path string, body io.Reader) (*http.Request, error) { - url := fmt.Sprintf("%s/%s", c.baseURL, path) + url := fmt.Sprintf("%s/%s", c.baseURL, strings.TrimLeft(path, "/")) req, err := http.NewRequest(method, url, body) if err != nil { return nil, fmt.Errorf("failed to make new HTTP request: %w", err) @@ -192,12 +194,11 @@ func (c *Client) NewRequest(method, path string, body io.Reader) (*http.Request, return req, nil } -// Do - executes the HTTP request and unmarshals the result into r. -func (c *Client) Do(req *http.Request) (map[string]any, error) { - v := map[string]any{} +// Do - executes the HTTP request and returns the response body. +func (c *Client) Do(req *http.Request) ([]byte, error) { resp, err := c.httpClient.Do(req) if err != nil { - return v, err + return nil, err } defer func() { @@ -207,18 +208,14 @@ func (c *Client) Do(req *http.Request) (map[string]any, error) { respByte, err := io.ReadAll(resp.Body) if err != nil { - return v, fmt.Errorf("failed to read response body: %w", err) + return nil, fmt.Errorf("failed to read response body: %w", err) } if resp.StatusCode < 200 || resp.StatusCode > 299 { - return v, fmt.Errorf("request returned non-200 status code: %s", string(respByte)) + return nil, fmt.Errorf("request returned non-200 status code: %s", string(respByte)) } - if len(respByte) == 0 { - return v, nil - } - - return v, json.Unmarshal(respByte, &v) + return respByte, nil } func (c *Client) Login() error { @@ -235,11 +232,16 @@ func (c *Client) Login() error { req.Header.Del("X-Nitro-Pass") req.Header.Del("Set-Cookie") - resp, err := c.Do(req) + respByte, err := c.Do(req) if err != nil { return err } + var resp map[string]any + if err := json.Unmarshal(respByte, &resp); err != nil { + return fmt.Errorf("failed to unmarshal login response: %w", err) + } + var ok bool c.sessionid, ok = resp["sessionid"].(string) if !ok { @@ -287,10 +289,9 @@ func (c *Client) URL() string { return c.baseURL } -// SetCredential - setter for client's credential. Handles clearing and creating a new Nitro token if present. -func (c *Client) SetCredential(cred Credential) error { +// SetCredential - setter for client's credential. +func (c *Client) SetCredential(cred Credential) { c.credential = cred - return nil } // SetHostname - getter for clients's hostname @@ -298,12 +299,12 @@ func (c *Client) SetHostname(hostname string) { c.hostname = hostname } -// SetProxiedURL - setter for client's proxy URL. Handles clearing and creating a new Nitro token if present. +// SetProxiedURL - setter for client's proxy URL. func (c *Client) SetProxiedURL(proxy string) { c.proxiedURL = proxy } // SetURL - setter for the client's baseURL func (c *Client) SetURL(url string) { - c.baseURL = url + c.baseURL = strings.TrimRight(url, "/") } diff --git a/nitrogo/client_options.go b/nitrogo/client_options.go index 238c19e..2d80bf7 100644 --- a/nitrogo/client_options.go +++ b/nitrogo/client_options.go @@ -4,13 +4,6 @@ import "net/http" type ClientOptionFunc func(*Client) error -func WithBaseUrl(url string) ClientOptionFunc { - return func(c *Client) error { - c.baseURL = url - return nil - } -} - func WithHostname(hostname string) ClientOptionFunc { return func(c *Client) error { c.hostname = hostname diff --git a/nitrogo/lb.go b/nitrogo/lb.go index 46a89a1..4c41f9c 100644 --- a/nitrogo/lb.go +++ b/nitrogo/lb.go @@ -177,29 +177,26 @@ func (s *LBService) EnableLBVServer() {} func (s *LBService) DisableLBVServer() {} func (s *LBService) GetAllLBVServer() ([]models.LBVServer, error) { u := "nitro/v1/config/lbvserver" - v := []models.LBVServer{} req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { - return v, err + return nil, err } resp, err := s.client.Do(req) if err != nil { - return v, err + return nil, err } - data, err := json.Marshal(resp["lbvserver"]) - if err != nil { - return v, err + var result struct { + LBVServer []models.LBVServer `json:"lbvserver"` } - err = json.Unmarshal(data, &v) - if err != nil { - return v, fmt.Errorf("failed to unmarshal: %w", err) + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return v, nil + return result.LBVServer, nil } func (s *LBService) GetLBVServer() {} func (s *LBService) CountLBVServer() {} @@ -323,29 +320,26 @@ func (s *LBService) CountLBVServerRewritePolicyBinding() {} func (s *LBService) GetAllLBVServerServiceGroupMemberBinding() {} func (s *LBService) GetLBVServerServiceGroupMemberBinding(lbvserver string) ([]models.LBVServerServiceGroupMemberBinding, error) { u := fmt.Sprintf("nitro/v1/config/lbvserver_servicegroupmember_binding/%s", lbvserver) - v := []models.LBVServerServiceGroupMemberBinding{} req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { - return v, err + return nil, err } resp, err := s.client.Do(req) if err != nil { - return v, err + return nil, err } - data, err := json.Marshal(resp["lbvserver_servicegroupmember_binding"]) - if err != nil { - return v, err + var result struct { + Binding []models.LBVServerServiceGroupMemberBinding `json:"lbvserver_servicegroupmember_binding"` } - err = json.Unmarshal(data, &v) - if err != nil { - return v, fmt.Errorf("failed to unmarshal: %w", err) + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return v, nil + return result.Binding, nil } func (s *LBService) CountLBVServerServiceGroupMemberBinding() {} diff --git a/nitrogo/system.go b/nitrogo/system.go index 009226f..1efc437 100644 --- a/nitrogo/system.go +++ b/nitrogo/system.go @@ -71,29 +71,27 @@ func (s *SystemService) EnableSystemExtraMgmtCPU() {} func (s *SystemService) DisableSystemExtraMgmtCPU() {} func (s *SystemService) GetAllSystemExtraMgmtCPU() (models.SystemExtraMgmtCPU, error) { u := "nitro/v1/config/systemextramgmtcpu" - v := models.SystemExtraMgmtCPU{} req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { - return v, err + return models.SystemExtraMgmtCPU{}, err } resp, err := s.client.Do(req) if err != nil { - return v, err + return models.SystemExtraMgmtCPU{}, err } - data, err := json.Marshal(resp["systemextramgmtcpu"]) - if err != nil { - return v, err + var result struct { + ExtraMgmtCPU models.SystemExtraMgmtCPU `json:"systemextramgmtcpu"` } - err = json.Unmarshal(data, &v) + err = json.Unmarshal(resp, &result) if err != nil { - return v, fmt.Errorf("failed to unmarshal: %w", err) + return models.SystemExtraMgmtCPU{}, fmt.Errorf("failed to unmarshal: %w", err) } - return v, nil + return result.ExtraMgmtCPU, nil } // systemfile @@ -245,32 +243,32 @@ func (s *SystemService) GetAllSystemUserSystemGroupBinding() {} func (s *SystemService) GetSystemUserSystemGroupBinding() {} func (s *SystemService) CountSystemUserSystemGroupBinding() {} -// statistics +//////////////// +// statistics // +//////////////// // system func (s *SystemService) GetAllSystemStats() (models.SystemStatus, error) { u := "nitro/v1/stat/system" - v := models.SystemStatus{} req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { - return v, err + return models.SystemStatus{}, err } resp, err := s.client.Do(req) if err != nil { - return v, err + return models.SystemStatus{}, err } - data, err := json.Marshal(resp["system"]) - if err != nil { - return v, err + var result struct { + SystemStatus models.SystemStatus `json:"system"` } - err = json.Unmarshal(data, &v) + err = json.Unmarshal(resp, &result) if err != nil { - return v, fmt.Errorf("failed to unmarshal: %w", err) + return models.SystemStatus{}, fmt.Errorf("failed to unmarshal: %w", err) } - return v, nil + return result.SystemStatus, nil } From 52272bde87c4a9b7a89ce466c634311cc2d095c0 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Wed, 4 Feb 2026 22:06:13 -0600 Subject: [PATCH 02/10] const updates. --- nitrogo/aaa.go | 8 +- nitrogo/adm.go | 4 + nitrogo/analytics.go | 14 +- nitrogo/app.go | 4 + nitrogo/appflow.go | 20 +++ nitrogo/appfw.go | 102 +++++++++--- nitrogo/appqoe.go | 19 ++- nitrogo/audit.go | 45 +++++- nitrogo/authentication.go | 146 +++++++++++++++-- nitrogo/authorization.go | 14 ++ nitrogo/autoscale.go | 8 + nitrogo/azure.go | 5 + nitrogo/basic.go | 35 +++- nitrogo/bfd.go | 4 + nitrogo/bot.go | 25 +++ nitrogo/cache.go | 20 +++ nitrogo/client.go | 31 ++-- nitrogo/cloud.go | 23 ++- nitrogo/cluster.go | 40 +++-- nitrogo/cmp.go | 18 +++ nitrogo/content_inspection.go | 19 +++ nitrogo/cr.go | 34 +++- nitrogo/cs.go | 47 +++++- nitrogo/db.go | 5 + nitrogo/dns.go | 44 +++++ nitrogo/feo.go | 12 ++ nitrogo/glsb.go | 297 +++++++++++++++++++--------------- nitrogo/ha.go | 13 ++ nitrogo/ica.go | 14 ++ nitrogo/ipsec.go | 5 + nitrogo/ipsecalg.go | 5 + nitrogo/lb.go | 64 +++++++- nitrogo/lldp.go | 5 + nitrogo/lsn.go | 45 ++++++ nitrogo/models/lbmodels.go | 8 +- nitrogo/network.go | 114 +++++++++++++ nitrogo/ns.go | 69 ++++++++ nitrogo/ntp.go | 7 + nitrogo/pcp.go | 6 + nitrogo/policy.go | 18 +++ nitrogo/protocol.go | 4 + nitrogo/rdp.go | 6 + nitrogo/reputation.go | 4 + nitrogo/responder.go | 20 +++ nitrogo/rewrite.go | 18 +++ nitrogo/router.go | 4 + nitrogo/smpp.go | 5 + nitrogo/snmp.go | 16 ++ nitrogo/spillover.go | 9 ++ nitrogo/ssl.go | 93 +++++++++++ nitrogo/stream.go | 8 + nitrogo/subscriber.go | 10 +- nitrogo/system.go | 13 +- nitrogo/tm.go | 24 +++ nitrogo/transform.go | 19 +++ nitrogo/tunnel.go | 8 + nitrogo/ulfd.go | 4 + nitrogo/url_filtering.go | 7 + nitrogo/user.go | 5 + nitrogo/utility.go | 11 ++ nitrogo/video_optimization.go | 26 +++ nitrogo/vpn.go | 131 +++++++++++++++ 62 files changed, 1626 insertions(+), 235 deletions(-) diff --git a/nitrogo/aaa.go b/nitrogo/aaa.go index f7e99e2..182a228 100644 --- a/nitrogo/aaa.go +++ b/nitrogo/aaa.go @@ -208,7 +208,7 @@ func (s *AAAService) CountAAAGroupVPNURLBinding() {} func (s *AAAService) AddAAAKCDAccount() {} func (s *AAAService) DeleteAAAKCDAccount() {} func (s *AAAService) UpdateAAAKCDAccount() {} -func (s *AAAService) UpsetAAAKCDAccount() {} +func (s *AAAService) UnsetAAAKCDAccount() {} func (s *AAAService) GetAllAAAKCDAccount() {} func (s *AAAService) GetAAAKCDAccount() {} func (s *AAAService) CountAAAKCDAccount() {} @@ -249,9 +249,9 @@ func (s *AAAService) CountAAAPreauthenticationAction() {} // aaapreauthenticationparameter // Configuration for pre authentication parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationparameter -func (s *AAAService) UpdateAAAPreauthenticationParamter() {} -func (s *AAAService) UnsetAAAPreauthenticationParamter() {} -func (s *AAAService) GetAllAAAPreauthenticationParamter() {} +func (s *AAAService) UpdateAAAPreauthenticationParameter() {} +func (s *AAAService) UnsetAAAPreauthenticationParameter() {} +func (s *AAAService) GetAllAAAPreauthenticationParameter() {} // aaapreauthenticationpolicy // Configuration for pre authentication policy resource. diff --git a/nitrogo/adm.go b/nitrogo/adm.go index 1064481..f95a82d 100644 --- a/nitrogo/adm.go +++ b/nitrogo/adm.go @@ -1,5 +1,9 @@ package nitrogo +const ( + admParameterURL = "/nitro/v1/config/admparameter" +) + // ADM related configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/adm/adm type ADMService struct { diff --git a/nitrogo/analytics.go b/nitrogo/analytics.go index 061cf79..2bd0e9a 100644 --- a/nitrogo/analytics.go +++ b/nitrogo/analytics.go @@ -1,5 +1,11 @@ package nitrogo +const ( + analyticsProfileURL = "/nitro/v1/config/analyticsprofile" + analyticsGlobalAnalyticsProfileBindingURL = "/nitro/v1/config/analyticsglobal_analyticsprofile_binding" + analyticsGlobalBindingURL = "/nitro/v1/config/analyticsglobal_binding" +) + // Analytics configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/analytics/analytics type AnalyticsService struct { @@ -9,10 +15,10 @@ type AnalyticsService struct { // analyticsglobal_analyticsprofile_binding // Binding object showing the analyticsprofile that can be bound to analyticsglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/analytics/analyticsglobal_analyticsprofile_binding -func (s *AnalyticsService) AddAnalyticsGlobalAnalyticsProfile() {} -func (s *AnalyticsService) DeleteAnalyticsGlobalAnalyticsProfile() {} -func (s *AnalyticsService) GetAnalyticsGlobalAnalyticsProfile() {} -func (s *AnalyticsService) CountAnalyticsGlobalAnalyticsProfile() {} +func (s *AnalyticsService) AddAnalyticsGlobalAnalyticsProfileBinding() {} +func (s *AnalyticsService) DeleteAnalyticsGlobalAnalyticsProfileBinding() {} +func (s *AnalyticsService) GetAnalyticsGlobalAnalyticsProfileBinding() {} +func (s *AnalyticsService) CountAnalyticsGlobalAnalyticsProfileBinding() {} // analyticsglobal_binding // Binding object which returns the resources bound to analyticsglobal. diff --git a/nitrogo/app.go b/nitrogo/app.go index 4436f6e..74ac8de 100644 --- a/nitrogo/app.go +++ b/nitrogo/app.go @@ -1,5 +1,9 @@ package nitrogo +const ( + applicationURL = "/nitro/v1/config/application" +) + // Application // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/app/app type AppService struct { diff --git a/nitrogo/appflow.go b/nitrogo/appflow.go index ab12a47..f4c14a8 100644 --- a/nitrogo/appflow.go +++ b/nitrogo/appflow.go @@ -1,5 +1,25 @@ package nitrogo +const ( + appFlowActionURL = "/nitro/v1/config/appflowaction" + appFlowActionAnalyticsProfileBindingURL = "/nitro/v1/config/appflowaction_analyticsprofile_binding" + appFlowActionBindingURL = "/nitro/v1/config/appflowaction_binding" + appFlowCollectorURL = "/nitro/v1/config/appflowcollector" + appFlowGlobalAppFlowPolicyBindingURL = "/nitro/v1/config/appflowglobal_appflowpolicy_binding" + appFlowGlobalBindingURL = "/nitro/v1/config/appflowglobal_binding" + appFlowParamURL = "/nitro/v1/config/appflowparam" + appFlowPolicyURL = "/nitro/v1/config/appflowpolicy" + appFlowPolicyAppFlowGlobalBindingURL = "/nitro/v1/config/appflowpolicy_appflowglobal_binding" + appFlowPolicyAppFlowPolicyLabelBindingURL = "/nitro/v1/config/appflowpolicy_appflowpolicylabel_binding" + appFlowPolicyBindingURL = "/nitro/v1/config/appflowpolicy_binding" + appFlowPolicyCSVServerBindingURL = "/nitro/v1/config/appflowpolicy_csvserver_binding" + appFlowPolicyLBVServerBindingURL = "/nitro/v1/config/appflowpolicy_lbvserver_binding" + appFlowPolicyVPNVServerBindingURL = "/nitro/v1/config/appflowpolicy_vpnvserver_binding" + appFlowPolicyLabelURL = "/nitro/v1/config/appflowpolicylabel" + appFlowPolicyLabelAppFlowPolicyBindingURL = "/nitro/v1/config/appflowpolicylabel_appflowpolicy_binding" + appFlowPolicyLabelBindingURL = "/nitro/v1/config/appflowpolicylabel_binding" +) + // AppFlow configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflow type AppFlowService struct { diff --git a/nitrogo/appfw.go b/nitrogo/appfw.go index 7c0b7a0..3b3327b 100644 --- a/nitrogo/appfw.go +++ b/nitrogo/appfw.go @@ -1,5 +1,67 @@ package nitrogo +const ( + appFWArchiveURL = "/nitro/v1/config/appfwarchive" + appFWConfidFieldURL = "/nitro/v1/config/appfwconfidfield" + appFWCustomSettingsURL = "/nitro/v1/config/appfwcustomsettings" + appFWFieldTypeURL = "/nitro/v1/config/appfwfieldtype" + appFWGlobalAppFWPolicyBindingURL = "/nitro/v1/config/appfwglobal_appfwpolicy_binding" + appFWGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/appfwglobal_auditnslogpolicy_binding" + appFWGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/appfwglobal_auditsyslogpolicy_binding" + appFWGlobalBindingURL = "/nitro/v1/config/appfwglobal_binding" + appFWHTMLErrorPageURL = "/nitro/v1/config/appfwhtmlerrorpage" + appFWJSONContentTypeURL = "/nitro/v1/config/appfwjsoncontenttype" + appFWJSONErrorPageURL = "/nitro/v1/config/appfwjsonerrorpage" + appFWLearningDataURL = "/nitro/v1/config/appfwlearningdata" + appFWLearningSettingsURL = "/nitro/v1/config/appfwlearningsettings" + appFWMultipartFormContentTypeURL = "/nitro/v1/config/appfwmultipartformcontenttype" + appFWPolicyURL = "/nitro/v1/config/appfwpolicy" + appFWPolicyAppFWGlobalBindingURL = "/nitro/v1/config/appfwpolicy_appfwglobal_binding" + appFWPolicyAppFWPolicyLabelBindingURL = "/nitro/v1/config/appfwpolicy_appfwpolicylabel_binding" + appFWPolicyBindingURL = "/nitro/v1/config/appfwpolicy_binding" + appFWPolicyCSVServerBindingURL = "/nitro/v1/config/appfwpolicy_csvserver_binding" + appFWPolicyLBVServerBindingURL = "/nitro/v1/config/appfwpolicy_lbvserver_binding" + appFWPolicyLabelURL = "/nitro/v1/config/appfwpolicylabel" + appFWPolicyLabelAppFWPolicyBindingURL = "/nitro/v1/config/appfwpolicylabel_appfwpolicy_binding" + appFWPolicyLabelBindingURL = "/nitro/v1/config/appfwpolicylabel_binding" + appFWPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/appfwpolicylabel_policybinding_binding" + appFWProfileURL = "/nitro/v1/config/appfwprofile" + appFWProfileBindingURL = "/nitro/v1/config/appfwprofile_binding" + appFWProfileCMDInjectionBindingURL = "/nitro/v1/config/appfwprofile_cmdinjection_binding" + appFWProfileContentTypeBindingURL = "/nitro/v1/config/appfwprofile_contenttype_binding" + appFWProfileCookieConsistencyBindingURL = "/nitro/v1/config/appfwprofile_cookieconsistency_binding" + appFWProfileCreditCardNumberBindingURL = "/nitro/v1/config/appfwprofile_creditcardnumber_binding" + appFWProfileCrossSiteScriptingBindingURL = "/nitro/v1/config/appfwprofile_crosssitescripting_binding" + appFWProfileCSRFTagBindingURL = "/nitro/v1/config/appfwprofile_csrftag_binding" + appFWProfileDenyURLBindingURL = "/nitro/v1/config/appfwprofile_denyurl_binding" + appFWProfileExcludeRESContentTypeBindingURL = "/nitro/v1/config/appfwprofile_excluderescontenttype_binding" + appFWProfileFieldConsistencyBindingURL = "/nitro/v1/config/appfwprofile_fieldconsistency_binding" + appFWProfileFieldFormatBindingURL = "/nitro/v1/config/appfwprofile_fieldformat_binding" + appFWProfileFileUploadTypeBindingURL = "/nitro/v1/config/appfwprofile_fileuploadtype_binding" + appFWProfileJSONDOSURLBindingURL = "/nitro/v1/config/appfwprofile_jsondosurl_binding" + appFWProfileJSONSQLURLBindingURL = "/nitro/v1/config/appfwprofile_jsonsqlurl_binding" + appFWProfileJSONXSSURLBindingURL = "/nitro/v1/config/appfwprofile_jsonxssurl_binding" + appFWProfileLogExpressionBindingURL = "/nitro/v1/config/appfwprofile_logexpression_binding" + appFWProfileSafeObjectBindingURL = "/nitro/v1/config/appfwprofile_safeobject_binding" + appFWProfileSQLInjectionBindingURL = "/nitro/v1/config/appfwprofile_sqlinjection_binding" + appFWProfileStartURLBindingURL = "/nitro/v1/config/appfwprofile_starturl_binding" + appFWProfileTrustedLearningClientsBindingURL = "/nitro/v1/config/appfwprofile_trustedlearningclients_binding" + appFWProfileXMLAttachmentURLBindingURL = "/nitro/v1/config/appfwprofile_xmlattachmenturl_binding" + appFWProfileXMLDOSURLBindingURL = "/nitro/v1/config/appfwprofile_xmldosurl_binding" + appFWProfileXMLSQLInjectionBindingURL = "/nitro/v1/config/appfwprofile_xmlsqlinjection_binding" + appFWProfileXMLValidationURLBindingURL = "/nitro/v1/config/appfwprofile_xmlvalidationurl_binding" + appFWProfileXMLWSIURLBindingURL = "/nitro/v1/config/appfwprofile_xmlwsiurl_binding" + appFWProfileXMLXSSBindingURL = "/nitro/v1/config/appfwprofile_xmlxss_binding" + appFWSettingsURL = "/nitro/v1/config/appfwsettings" + appFWSignaturesURL = "/nitro/v1/config/appfwsignatures" + appFWTransactionRecordsURL = "/nitro/v1/config/appfwtransactionrecords" + appFWURLEncodedFormContentTypeURL = "/nitro/v1/config/appfwurlencodedformcontenttype" + appFWWSDLURL = "/nitro/v1/config/appfwwsdl" + appFWXMLContentTypeURL = "/nitro/v1/config/appfwxmlcontenttype" + appFWXMLErrorPageURL = "/nitro/v1/config/appfwxmlerrorpage" + appFWXMLSchemaURL = "/nitro/v1/config/appfwxmlschema" +) + // Application Firewall configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfw type AppFWService struct { @@ -183,8 +245,8 @@ func (s *AppFWService) CountAppFWPolicyAppFWPolicyLabelBinding() {} // appfwpolicy_binding // Binding object which returns the resources bound to appfwpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_binding -func (s *AppFWService) GetAllAppFWPolcyBinding() {} -func (s *AppFWService) GetAppFWPolcyBinding() {} +func (s *AppFWService) GetAllAppFWPolicyBinding() {} +func (s *AppFWService) GetAppFWPolicyBinding() {} // appfwpolicy_csvserver_binding // Binding object showing the csvserver that can be bound to appfwpolicy. @@ -196,9 +258,9 @@ func (s *AppFWService) CountAppFWPolicyCSVServerBinding() {} // appfwpolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to appfwpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_lbvserver_binding -func (s *AppFWService) GetAllAppFWPolcyLBVServerBinding() {} -func (s *AppFWService) GetAppFWPolcyLBVServerBinding() {} -func (s *AppFWService) CountAppFWPolcyLBVServerBinding() {} +func (s *AppFWService) GetAllAppFWPolicyLBVServerBinding() {} +func (s *AppFWService) GetAppFWPolicyLBVServerBinding() {} +func (s *AppFWService) CountAppFWPolicyLBVServerBinding() {} // appfwprofile // Configuration for application firewall profile resource. @@ -230,11 +292,11 @@ func (s *AppFWService) CountAppFWProfileCMDInjectionBinding() {} // appfwprofile_contenttype_binding // Binding object showing the contenttype that can be bound to appfwprofile. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_contenttype_binding -func (s *AppFWService) AddAppFWProfileContentypeBinding() {} -func (s *AppFWService) DeleteAppFWProfileContentypeBinding() {} -func (s *AppFWService) GetAllAppFWProfileContentypeBinding() {} -func (s *AppFWService) GetAppFWProfileContentypeBinding() {} -func (s *AppFWService) CountAppFWProfileContentypeBinding() {} +func (s *AppFWService) AddAppFWProfileContentTypeBinding() {} +func (s *AppFWService) DeleteAppFWProfileContentTypeBinding() {} +func (s *AppFWService) GetAllAppFWProfileContentTypeBinding() {} +func (s *AppFWService) GetAppFWProfileContentTypeBinding() {} +func (s *AppFWService) CountAppFWProfileContentTypeBinding() {} // appfwprofile_cookieconsistency_binding // Binding object showing the cookieconsistency that can be bound to appfwprofile. @@ -311,11 +373,11 @@ func (s *AppFWService) CountAppFWProfileFieldFormatBinding() {} // appfwprofile_fileuploadtype_binding // Binding object showing the fileuploadtype that can be bound to appfwprofile. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fileuploadtype_binding -func (s *AppFWService) AddAppFWProfileFielUploadTypeBinding() {} -func (s *AppFWService) DeleteAppFWProfileFielUploadTypeBinding() {} -func (s *AppFWService) GetAllAppFWProfileFielUploadTypeBinding() {} -func (s *AppFWService) GetAppFWProfileFielUploadTypeBinding() {} -func (s *AppFWService) CountAppFWProfileFielUploadTypeBinding() {} +func (s *AppFWService) AddAppFWProfileFileUploadTypeBinding() {} +func (s *AppFWService) DeleteAppFWProfileFileUploadTypeBinding() {} +func (s *AppFWService) GetAllAppFWProfileFileUploadTypeBinding() {} +func (s *AppFWService) GetAppFWProfileFileUploadTypeBinding() {} +func (s *AppFWService) CountAppFWProfileFileUploadTypeBinding() {} // appfwprofile_jsondosurl_binding // Binding object showing the jsondosurl that can be bound to appfwprofile. @@ -500,10 +562,10 @@ func (s *AppFWService) GetAppFWXMLErrorPage() {} func (s *AppFWService) ImportAppFWXMLErrorPage() {} func (s *AppFWService) ChangeAppFWXMLErrorPage() {} -// appfwxmlscheme +// appfwxmlschema // Configuration for XML schema resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwxmlschema -func (s *AppFWService) DeleteAppFWXMLScheme() {} -func (s *AppFWService) GetAllAppFWXMLScheme() {} -func (s *AppFWService) GetAppFWXMLScheme() {} -func (s *AppFWService) ImportAppFWXMLScheme() {} +func (s *AppFWService) DeleteAppFWXMLSchema() {} +func (s *AppFWService) GetAllAppFWXMLSchema() {} +func (s *AppFWService) GetAppFWXMLSchema() {} +func (s *AppFWService) ImportAppFWXMLSchema() {} diff --git a/nitrogo/appqoe.go b/nitrogo/appqoe.go index 9bbd67a..62708fd 100644 --- a/nitrogo/appqoe.go +++ b/nitrogo/appqoe.go @@ -1,5 +1,14 @@ package nitrogo +const ( + appQOEActionURL = "/nitro/v1/config/appqoeaction" + appQOECustomRespURL = "/nitro/v1/config/appqoecustomresp" + appQOEParameterURL = "/nitro/v1/config/appqoeparameter" + appQOEPolicyURL = "/nitro/v1/config/appqoepolicy" + appQOEPolicyBindingURL = "/nitro/v1/config/appqoepolicy_binding" + appQOEPolicyLBVServerBindingURL = "/nitro/v1/config/appqoepolicy_lbvserver_binding" +) + // Application Level Quality of Experience configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoe type AppQOEService struct { @@ -20,11 +29,11 @@ func (s *AppQOEService) CountAppQOEAction() {} // appqoecustomerresp // Configuration for AppQoE custom response page resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoecustomresp -func (s *AppQOEService) ImportAppQOECustomerResp() {} -func (s *AppQOEService) DeleteAppQOECustomerResp() {} -func (s *AppQOEService) GetAllAppQOECustomerResp() {} -func (s *AppQOEService) CountAppQOECustomerResp() {} -func (s *AppQOEService) ChangeAppQOECustomerResp() {} +func (s *AppQOEService) ImportAppQOECustomResp() {} +func (s *AppQOEService) DeleteAppQOECustomResp() {} +func (s *AppQOEService) GetAllAppQOECustomResp() {} +func (s *AppQOEService) CountAppQOECustomResp() {} +func (s *AppQOEService) ChangeAppQOECustomResp() {} // appqoeparameter // Configuration for QOS parameter resource. diff --git a/nitrogo/audit.go b/nitrogo/audit.go index 54fb186..d6fe779 100644 --- a/nitrogo/audit.go +++ b/nitrogo/audit.go @@ -1,5 +1,44 @@ package nitrogo +const ( + auditMessageActionURL = "/nitro/v1/config/auditmessageaction" + auditMessagesURL = "/nitro/v1/config/auditmessages" + auditNSLogActionURL = "/nitro/v1/config/auditnslogaction" + auditNSLogGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/auditnslogglobal_auditnslogpolicy_binding" + auditNSLogGlobalBindingURL = "/nitro/v1/config/auditnslogglobal_binding" + auditNSLogParamsURL = "/nitro/v1/config/auditnslogparams" + auditNSLogPolicyURL = "/nitro/v1/config/auditnslogpolicy" + auditNSLogPolicyAAAGroupBindingURL = "/nitro/v1/config/auditnslogpolicy_aaagroup_binding" + auditNSLogPolicyAAAUserBindingURL = "/nitro/v1/config/auditnslogpolicy_aaauser_binding" + auditNSLogPolicyAppFWGlobalBindingURL = "/nitro/v1/config/auditnslogpolicy_appfwglobal_binding" + auditNSLogPolicyAuditNSLogGlobalBindingURL = "/nitro/v1/config/auditnslogpolicy_auditnslogglobal_binding" + auditNSLogPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/auditnslogpolicy_authenticationvserver_binding" + auditNSLogPolicyBindingURL = "/nitro/v1/config/auditnslogpolicy_binding" + auditNSLogPolicyCSVServerBindingURL = "/nitro/v1/config/auditnslogpolicy_csvserver_binding" + auditNSLogPolicyLBVServerBindingURL = "/nitro/v1/config/auditnslogpolicy_lbvserver_binding" + auditNSLogPolicySystemGlobalBindingURL = "/nitro/v1/config/auditnslogpolicy_systemglobal_binding" + auditNSLogPolicyTMGlobalBindingURL = "/nitro/v1/config/auditnslogpolicy_tmglobal_binding" + auditNSLogPolicyVPNGlobalBindingURL = "/nitro/v1/config/auditnslogpolicy_vpnglobal_binding" + auditNSLogPolicyVPNVServerBindingURL = "/nitro/v1/config/auditnslogpolicy_vpnvserver_binding" + auditSyslogActionURL = "/nitro/v1/config/auditsyslogaction" + auditSyslogGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/auditsyslogglobal_auditsyslogpolicy_binding" + auditSyslogGlobalBindingURL = "/nitro/v1/config/auditsyslogglobal_binding" + auditSyslogParamsURL = "/nitro/v1/config/auditsyslogparams" + auditSyslogPolicyURL = "/nitro/v1/config/auditsyslogpolicy" + auditSyslogPolicyAAAGroupBindingURL = "/nitro/v1/config/auditsyslogpolicy_aaagroup_binding" + auditSyslogPolicyAAAUserBindingURL = "/nitro/v1/config/auditsyslogpolicy_aaauser_binding" + auditSyslogPolicyAuditSyslogGlobalBindingURL = "/nitro/v1/config/auditsyslogpolicy_auditsyslogglobal_binding" + auditSyslogPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/auditsyslogpolicy_authenticationvserver_binding" + auditSyslogPolicyBindingURL = "/nitro/v1/config/auditsyslogpolicy_binding" + auditSyslogPolicyCSVServerBindingURL = "/nitro/v1/config/auditsyslogpolicy_csvserver_binding" + auditSyslogPolicyLBVServerBindingURL = "/nitro/v1/config/auditsyslogpolicy_lbvserver_binding" + auditSyslogPolicyRNATGlobalBindingURL = "/nitro/v1/config/auditsyslogpolicy_rnatglobal_binding" + auditSyslogPolicySystemGlobalBindingURL = "/nitro/v1/config/auditsyslogpolicy_systemglobal_binding" + auditSyslogPolicyTMGlobalBindingURL = "/nitro/v1/config/auditsyslogpolicy_tmglobal_binding" + auditSyslogPolicyVPNGlobalBindingURL = "/nitro/v1/config/auditsyslogpolicy_vpnglobal_binding" + auditSyslogPolicyVPNVServerBindingURL = "/nitro/v1/config/auditsyslogpolicy_vpnvserver_binding" +) + // Audit configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/audit type AuditService struct { @@ -88,9 +127,9 @@ func (s *AuditService) CountAuditNSLogPolicyAppFWGlobalBinding() {} // auditnslogpolicy_auditnslogglobal_binding // Binding object showing the auditnslogglobal that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_auditnslogglobal_binding -func (s *AuditService) GetAllAuditLogPolicyAuditNSLogGlobalBinding() {} -func (s *AuditService) GetAuditLogPolicyAuditNSLogGlobalBinding() {} -func (s *AuditService) CountAuditLogPolicyAuditNSLogGlobalBinding() {} +func (s *AuditService) GetAllAuditNSLogPolicyAuditNSLogGlobalBinding() {} +func (s *AuditService) GetAuditNSLogPolicyAuditNSLogGlobalBinding() {} +func (s *AuditService) CountAuditNSLogPolicyAuditNSLogGlobalBinding() {} // auditnslogpolicy_authenticationvserver_binding // Binding object showing the authenticationvserver that can be bound to auditnslogpolicy. diff --git a/nitrogo/authentication.go b/nitrogo/authentication.go index 90e4671..111c8c3 100644 --- a/nitrogo/authentication.go +++ b/nitrogo/authentication.go @@ -1,5 +1,119 @@ package nitrogo +const ( + authenticationADFSProxyProfileURL = "/nitro/v1/config/authenticationadfsproxyprofile" + authenticationAuthnProfileURL = "/nitro/v1/config/authenticationauthnprofile" + authenticationAzureKeyVaultURL = "/nitro/v1/config/authenticationazurekeyvault" + authenticationCaptchaActionURL = "/nitro/v1/config/authenticationcaptchaaction" + authenticationCertActionURL = "/nitro/v1/config/authenticationcertaction" + authenticationCertPolicyURL = "/nitro/v1/config/authenticationcertpolicy" + authenticationCertPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationcertpolicy_authenticationvserver_binding" + authenticationCertPolicyBindingURL = "/nitro/v1/config/authenticationcertpolicy_binding" + authenticationCertPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationcertpolicy_vpnglobal_binding" + authenticationCertPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationcertpolicy_vpnvserver_binding" + authenticationCitrixAuthActionURL = "/nitro/v1/config/authenticationcitrixauthaction" + authenticationDFAActionURL = "/nitro/v1/config/authenticationdfaaction" + authenticationDFAPolicyURL = "/nitro/v1/config/authenticationdfapolicy" + authenticationDFAPolicyBindingURL = "/nitro/v1/config/authenticationdfapolicy_binding" + authenticationDFAPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationdfapolicy_vpnvserver_binding" + authenticationEmailActionURL = "/nitro/v1/config/authenticationemailaction" + authenticationEPAActionURL = "/nitro/v1/config/authenticationepaaction" + authenticationLDAPActionURL = "/nitro/v1/config/authenticationldapaction" + authenticationLDAPPolicyURL = "/nitro/v1/config/authenticationldappolicy" + authenticationLDAPPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationldappolicy_authenticationvserver_binding" + authenticationLDAPPolicyBindingURL = "/nitro/v1/config/authenticationldappolicy_binding" + authenticationLDAPPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationldappolicy_systemglobal_binding" + authenticationLDAPPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationldappolicy_vpnglobal_binding" + authenticationLDAPPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationldappolicy_vpnvserver_binding" + authenticationLocalPolicyURL = "/nitro/v1/config/authenticationlocalpolicy" + authenticationLocalPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationlocalpolicy_authenticationvserver_binding" + authenticationLocalPolicyBindingURL = "/nitro/v1/config/authenticationlocalpolicy_binding" + authenticationLocalPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationlocalpolicy_systemglobal_binding" + authenticationLocalPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationlocalpolicy_vpnglobal_binding" + authenticationLocalPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationlocalpolicy_vpnvserver_binding" + authenticationLoginSchemaURL = "/nitro/v1/config/authenticationloginschema" + authenticationLoginSchemaPolicyURL = "/nitro/v1/config/authenticationloginschemapolicy" + authenticationLoginSchemaPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationloginschemapolicy_authenticationvserver_binding" + authenticationLoginSchemaPolicyBindingURL = "/nitro/v1/config/authenticationloginschemapolicy_binding" + authenticationLoginSchemaPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationloginschemapolicy_vpnvserver_binding" + authenticationNegotiateActionURL = "/nitro/v1/config/authenticationnegotiateaction" + authenticationNegotiatePolicyURL = "/nitro/v1/config/authenticationnegotiatepolicy" + authenticationNegotiatePolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationnegotiatepolicy_authenticationvserver_binding" + authenticationNegotiatePolicyBindingURL = "/nitro/v1/config/authenticationnegotiatepolicy_binding" + authenticationNegotiatePolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationnegotiatepolicy_vpnglobal_binding" + authenticationNegotiatePolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationnegotiatepolicy_vpnvserver_binding" + authenticationNoAuthActionURL = "/nitro/v1/config/authenticationnoauthaction" + authenticationOAuthActionURL = "/nitro/v1/config/authenticationoauthaction" + authenticationOAuthIdPPolicyURL = "/nitro/v1/config/authenticationoauthidppolicy" + authenticationOAuthIdPPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationoauthidppolicy_authenticationvserver_binding" + authenticationOAuthIdPPolicyBindingURL = "/nitro/v1/config/authenticationoauthidppolicy_binding" + authenticationOAuthIdPPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationoauthidppolicy_vpnvserver_binding" + authenticationOAuthIdPProfileURL = "/nitro/v1/config/authenticationoauthidpprofile" + authenticationPolicyURL = "/nitro/v1/config/authenticationpolicy" + authenticationPolicyLabelURL = "/nitro/v1/config/authenticationpolicylabel" + authenticationPolicyLabelAuthenticationPolicyBindingURL = "/nitro/v1/config/authenticationpolicylabel_authenticationpolicy_binding" + authenticationPolicyLabelBindingURL = "/nitro/v1/config/authenticationpolicylabel_binding" + authenticationPolicyAuthenticationPolicyLabelBindingURL = "/nitro/v1/config/authenticationpolicy_authenticationpolicylabel_binding" + authenticationPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationpolicy_authenticationvserver_binding" + authenticationPolicyBindingURL = "/nitro/v1/config/authenticationpolicy_binding" + authenticationPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationpolicy_systemglobal_binding" + authenticationPushServiceURL = "/nitro/v1/config/authenticationpushservice" + authenticationRADIUSActionURL = "/nitro/v1/config/authenticationradiusaction" + authenticationRADIUSPolicyURL = "/nitro/v1/config/authenticationradiuspolicy" + authenticationRADIUSPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationradiuspolicy_authenticationvserver_binding" + authenticationRADIUSPolicyBindingURL = "/nitro/v1/config/authenticationradiuspolicy_binding" + authenticationRADIUSPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationradiuspolicy_systemglobal_binding" + authenticationRADIUSPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationradiuspolicy_vpnglobal_binding" + authenticationRADIUSPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationradiuspolicy_vpnvserver_binding" + authenticationSAMLActionURL = "/nitro/v1/config/authenticationsamlaction" + authenticationSAMLIdPPolicyURL = "/nitro/v1/config/authenticationsamlidppolicy" + authenticationSAMLIdPPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationsamlidppolicy_authenticationvserver_binding" + authenticationSAMLIdPPolicyBindingURL = "/nitro/v1/config/authenticationsamlidppolicy_binding" + authenticationSAMLIdPPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationsamlidppolicy_vpnvserver_binding" + authenticationSAMLIdPProfileURL = "/nitro/v1/config/authenticationsamlidpprofile" + authenticationSAMLPolicyURL = "/nitro/v1/config/authenticationsamlpolicy" + authenticationSAMLPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationsamlpolicy_authenticationvserver_binding" + authenticationSAMLPolicyBindingURL = "/nitro/v1/config/authenticationsamlpolicy_binding" + authenticationSAMLPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationsamlpolicy_vpnglobal_binding" + authenticationSAMLPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationsamlpolicy_vpnvserver_binding" + authenticationStoreFrontAuthActionURL = "/nitro/v1/config/authenticationstorefrontauthaction" + authenticationTACACSActionURL = "/nitro/v1/config/authenticationtacacsaction" + authenticationTACACSPolicyURL = "/nitro/v1/config/authenticationtacacspolicy" + authenticationTACACSPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationtacacspolicy_authenticationvserver_binding" + authenticationTACACSPolicyBindingURL = "/nitro/v1/config/authenticationtacacspolicy_binding" + authenticationTACACSPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationtacacspolicy_systemglobal_binding" + authenticationTACACSPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationtacacspolicy_vpnglobal_binding" + authenticationTACACSPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationtacacspolicy_vpnvserver_binding" + authenticationVServerURL = "/nitro/v1/config/authenticationvserver" + authenticationVServerAuditNSLogPolicyBindingURL = "/nitro/v1/config/authenticationvserver_auditnslogpolicy_binding" + authenticationVServerAuditSyslogPolicyBindingURL = "/nitro/v1/config/authenticationvserver_auditsyslogpolicy_binding" + authenticationVServerAuthenticationCertPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationcertpolicy_binding" + authenticationVServerAuthenticationLDAPPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationldappolicy_binding" + authenticationVServerAuthenticationLocalPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationlocalpolicy_binding" + authenticationVServerAuthenticationLoginSchemaPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationloginschemapolicy_binding" + authenticationVServerAuthenticationNegotiatePolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationnegotiatepolicy_binding" + authenticationVServerAuthenticationOAuthIdPPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationoauthidppolicy_binding" + authenticationVServerAuthenticationPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationpolicy_binding" + authenticationVServerAuthenticationRADIUSPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationradiuspolicy_binding" + authenticationVServerAuthenticationSAMLIdPPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationsamlidppolicy_binding" + authenticationVServerAuthenticationSAMLPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationsamlpolicy_binding" + authenticationVServerAuthenticationTACACSPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationtacacspolicy_binding" + authenticationVServerAuthenticationWebAuthPolicyBindingURL = "/nitro/v1/config/authenticationvserver_authenticationwebauthpolicy_binding" + authenticationVServerBindingURL = "/nitro/v1/config/authenticationvserver_binding" + authenticationVServerCachePolicyBindingURL = "/nitro/v1/config/authenticationvserver_cachepolicy_binding" + authenticationVServerCSPolicyBindingURL = "/nitro/v1/config/authenticationvserver_cspolicy_binding" + authenticationVServerResponderPolicyBindingURL = "/nitro/v1/config/authenticationvserver_responderpolicy_binding" + authenticationVServerTMSessionPolicyBindingURL = "/nitro/v1/config/authenticationvserver_tmsessionpolicy_binding" + authenticationVServerVPNPortalThemeBindingURL = "/nitro/v1/config/authenticationvserver_vpnportaltheme_binding" + authenticationWebAuthActionURL = "/nitro/v1/config/authenticationwebauthaction" + authenticationWebAuthPolicyURL = "/nitro/v1/config/authenticationwebauthpolicy" + authenticationWebAuthPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/authenticationwebauthpolicy_authenticationvserver_binding" + authenticationWebAuthPolicyBindingURL = "/nitro/v1/config/authenticationwebauthpolicy_binding" + authenticationWebAuthPolicySystemGlobalBindingURL = "/nitro/v1/config/authenticationwebauthpolicy_systemglobal_binding" + authenticationWebAuthPolicyVPNGlobalBindingURL = "/nitro/v1/config/authenticationwebauthpolicy_vpnglobal_binding" + authenticationWebAuthPolicyVPNVServerBindingURL = "/nitro/v1/config/authenticationwebauthpolicy_vpnvserver_binding" +) + // Authentication configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authentication type AuthenticationService struct { @@ -265,19 +379,19 @@ func (s *AuthenticationService) GetAllAuthenticationLocalPolicyVPNVServerBinding func (s *AuthenticationService) GetAuthenticationLocalPolicyVPNVServerBinding() {} func (s *AuthenticationService) CountAuthenticationLocalPolicyVPNVServerBinding() {} -// authenticationloginscheme -// Configuration for 0 resource. +// authenticationloginschema +// Configuration for Login Schema resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema -func (s *AuthenticationService) AddAuthenticationLoginScheme() {} -func (s *AuthenticationService) DeleteAuthenticationLoginScheme() {} -func (s *AuthenticationService) UpdateAuthenticationLoginScheme() {} -func (s *AuthenticationService) UnsetAuthenticationLoginScheme() {} -func (s *AuthenticationService) GetAllAuthenticationLoginScheme() {} -func (s *AuthenticationService) GetAuthenticationLoginScheme() {} -func (s *AuthenticationService) CountAuthenticationLoginScheme() {} +func (s *AuthenticationService) AddAuthenticationLoginSchema() {} +func (s *AuthenticationService) DeleteAuthenticationLoginSchema() {} +func (s *AuthenticationService) UpdateAuthenticationLoginSchema() {} +func (s *AuthenticationService) UnsetAuthenticationLoginSchema() {} +func (s *AuthenticationService) GetAllAuthenticationLoginSchema() {} +func (s *AuthenticationService) GetAuthenticationLoginSchema() {} +func (s *AuthenticationService) CountAuthenticationLoginSchema() {} // authenticationloginschemapolicy -// Configuration for 0 resource. +// Configuration for Login Schema Policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy func (s *AuthenticationService) AddAuthenticationLoginSchemaPolicy() {} func (s *AuthenticationService) DeleteAuthenticationLoginSchemaPolicy() {} @@ -333,9 +447,9 @@ func (s *AuthenticationService) CountAuthenticationNegotiatePolicy() {} // authenticationnegotiatepolicy_authenticationvserver_binding // Binding object showing the authenticationvserver that can be bound to authenticationnegotiatepolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyAuthencationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicyAuthencationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationNegotiatePolicyAuthencationVServerBinding() {} +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) GetAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) CountAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} // authenticationnegotiatepolicy_binding // Binding object which returns the resources bound to authenticationnegotiatepolicy. @@ -708,9 +822,9 @@ func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNGlobalBinding( // authenticationtacacspolicy_vpnvserver_binding // Binding object showing the vpnvserver that can be bound to authenticationtacacspolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNVserverBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNVserverBinding() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNVserverBinding() {} +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNVServerBinding() {} +func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNVServerBinding() {} +func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNVServerBinding() {} // authenticaitonvserver // Configuration for authentication virtual server resource. diff --git a/nitrogo/authorization.go b/nitrogo/authorization.go index c531255..84f536f 100644 --- a/nitrogo/authorization.go +++ b/nitrogo/authorization.go @@ -1,5 +1,19 @@ package nitrogo +const ( + authorizationActionURL = "/nitro/v1/config/authorizationaction" + authorizationPolicyURL = "/nitro/v1/config/authorizationpolicy" + authorizationPolicyAAAGroupBindingURL = "/nitro/v1/config/authorizationpolicy_aaagroup_binding" + authorizationPolicyAAAUserBindingURL = "/nitro/v1/config/authorizationpolicy_aaauser_binding" + authorizationPolicyLabelAuthorizationPolicyBindingURL = "/nitro/v1/config/authorizationpolicylabel_authorizationpolicy_binding" + authorizationPolicyLabelBindingURL = "/nitro/v1/config/authorizationpolicylabel_binding" + authorizationPolicyCSVServerBindingURL = "/nitro/v1/config/authorizationpolicy_csvserver_binding" + authorizationPolicyLBVServerBindingURL = "/nitro/v1/config/authorizationpolicy_lbvserver_binding" + authorizationPolicyLabelURL = "/nitro/v1/config/authorizationpolicylabel" + authorizationPolicyAuthorizationPolicyLabelBindingURL = "/nitro/v1/config/authorizationpolicy_authorizationpolicylabel_binding" + authorizationPolicyBindingURL = "/nitro/v1/config/authorizationpolicy_binding" +) + // Authorization configuration. Authorization services check which resources users are authorized to access, and grant permissions accordingly. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorization type AuthorizationService struct { diff --git a/nitrogo/autoscale.go b/nitrogo/autoscale.go index a032c41..a9d9281 100644 --- a/nitrogo/autoscale.go +++ b/nitrogo/autoscale.go @@ -1,5 +1,13 @@ package nitrogo +const ( + autoscaleActionURL = "/nitro/v1/config/autoscaleaction" + autoscalePolicyURL = "/nitro/v1/config/autoscalepolicy" + autoscalePolicyBindingURL = "/nitro/v1/config/autoscalepolicy_binding" + autoscalePolicyNSTimerBindingURL = "/nitro/v1/config/autoscalepolicy_nstimer_binding" + autoscaleProfileURL = "/nitro/v1/config/autoscaleprofile" +) + // AutoScale configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscale type AutoscaleService struct { diff --git a/nitrogo/azure.go b/nitrogo/azure.go index 5f3eedf..84644ad 100644 --- a/nitrogo/azure.go +++ b/nitrogo/azure.go @@ -1,5 +1,10 @@ package nitrogo +const ( + azureApplicationURL = "/nitro/v1/config/azureapplication" + azureKeyVaultURL = "/nitro/v1/config/azurekeyvault" +) + // Azure configuration // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/azure/azure type AzureService struct { diff --git a/nitrogo/basic.go b/nitrogo/basic.go index da2b5c6..79a0fbc 100644 --- a/nitrogo/basic.go +++ b/nitrogo/basic.go @@ -8,6 +8,37 @@ import ( "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) +const ( + dbsMonitorsURL = "/nitro/v1/config/dbsmonitors" + extendedMemoryParamURL = "/nitro/v1/config/extendedmemoryparam" + locationURL = "/nitro/v1/config/location" + locationDataURL = "/nitro/v1/config/locationdata" + locationFileURL = "/nitro/v1/config/locationfile" + locationFile6URL = "/nitro/v1/config/locationfile6" + locationParameterURL = "/nitro/v1/config/locationparameter" + nsTraceURL = "/nitro/v1/config/nstrace" + radiusNodeURL = "/nitro/v1/config/radiusnode" + reportingURL = "/nitro/v1/config/reporting" + serverURL = "/nitro/v1/config/server" + serverBindingURL = "/nitro/v1/config/server_binding" + serverGSLBServiceBindingURL = "/nitro/v1/config/server_gslbservice_binding" + serverGSLBServiceGroupBindingURL = "/nitro/v1/config/server_gslbservicegroup_binding" + serverServiceBindingURL = "/nitro/v1/config/server_service_binding" + serverServiceGroupBindingURL = "/nitro/v1/config/server_servicegroup_binding" + serviceURL = "/nitro/v1/config/service" + serviceBindingURL = "/nitro/v1/config/service_binding" + serviceGroupLBMonitorBindingURL = "/nitro/v1/config/servicegroup_lbmonitor_binding" + serviceGroupURL = "/nitro/v1/config/servicegroup" + serviceGroupBindingURL = "/nitro/v1/config/servicegroup_binding" + serviceLBMonitorBindingURL = "/nitro/v1/config/service_lbmonitor_binding" + serviceGroupServiceGroupEntityMonBindingsBindingURL = "/nitro/v1/config/servicegroup_servicegroupentitymonbindings_binding" + serviceGroupServiceGroupMemberBindingURL = "/nitro/v1/config/servicegroup_servicegroupmember_binding" + serviceGroupServiceGroupMemberListBinding = "/nitro/v1/config/servicegroup_servicegoupmemberlist_binding" + serviceGroupBindingsURL = "/nitro/v1/config/servicegroupbindings" + svcBindingsURL = "/nitro/v1/config/svcbindings" + vServerURL = "/nitro/v1/config/vserver" +) + // Basic system configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/basic type BasicService struct { @@ -174,9 +205,7 @@ func (s *BasicService) CountServiceGroupBindings() {} // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_binding func (s *BasicService) GetAllServiceGroupBinding() {} func (s *BasicService) GetServiceGroupBinding(serviceGroupName string) ([]models.ServiceGroupBinding, error) { - u := fmt.Sprintf("nitro/v1/config/servicegroup_binding/%s", serviceGroupName) - - req, err := s.client.NewRequest(http.MethodGet, u, nil) + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupBindingURL, serviceGroupName), nil) if err != nil { return nil, err } diff --git a/nitrogo/bfd.go b/nitrogo/bfd.go index 991a626..4b18301 100644 --- a/nitrogo/bfd.go +++ b/nitrogo/bfd.go @@ -1,5 +1,9 @@ package nitrogo +const ( + bfdSessionURL = "/nitro/v1/config/bfdsession" +) + // Bidirectional Forwarding Detection // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/bfd/bfd type BFDService struct { diff --git a/nitrogo/bot.go b/nitrogo/bot.go index 9fe21d5..55fa163 100644 --- a/nitrogo/bot.go +++ b/nitrogo/bot.go @@ -1,5 +1,30 @@ package nitrogo +const ( + botGlobalBindingURL = "/nitro/v1/config/botglobal_binding" + botGlobalBotPolicyBindingURL = "/nitro/v1/config/botglobal_botpolicy_binding" + botPolicyURL = "/nitro/v1/config/botpolicy" + botPolicyBindingURL = "/nitro/v1/config/botpolicy_binding" + botPolicyBotGlobalBindingURL = "/nitro/v1/config/botpolicy_botglobal_binding" + botPolicyBotPolicyLabelBindingURL = "/nitro/v1/config/botpolicy_botpolicylabel_binding" + botPolicyCSVServerBindingURL = "/nitro/v1/config/botpolicy_csvserver_binding" + botPolicyLBVServerBindingURL = "/nitro/v1/config/botpolicy_lbvserver_binding" + botPolicyLabelURL = "/nitro/v1/config/botpolicylabel" + botPolicyLabelBindingURL = "/nitro/v1/config/botpolicylabel_binding" + botPolicyLabelBotPolicyBindingURL = "/nitro/v1/config/botpolicylabel_botpolicy_binding" + botPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/botpolicylabel_policybinding_binding" + botProfileURL = "/nitro/v1/config/botprofile" + botProfileBindingURL = "/nitro/v1/config/botprofile_binding" + botProfileBlacklistBindingURL = "/nitro/v1/config/botprofile_blacklist_binding" + botProfileCaptchaBindingURL = "/nitro/v1/config/botprofile_captcha_binding" + botProfileIPReputationBindingURL = "/nitro/v1/config/botprofile_ipreputation_binding" + botProfileRatelimitBindingURL = "/nitro/v1/config/botprofile_ratelimit_binding" + botProfileTPSBindingURL = "/nitro/v1/config/botprofile_tps_binding" + botProfileWhitelistBindingURL = "/nitro/v1/config/botprofile_whitelist_binding" + botSettingsURL = "/nitro/v1/config/botsettings" + botSignatureURL = "/nitro/v1/config/botsignature" +) + // Bot Management. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/bot/bot type BotService struct { diff --git a/nitrogo/cache.go b/nitrogo/cache.go index a095184..98b22be 100644 --- a/nitrogo/cache.go +++ b/nitrogo/cache.go @@ -1,5 +1,25 @@ package nitrogo +const ( + cacheContentGroupURL = "/nitro/v1/config/cachecontentgroup" + cacheForwardProxyURL = "/nitro/v1/config/cacheforwardproxy" + cacheGlobalBindingURL = "/nitro/v1/config/cacheglobal_binding" + cacheGlobalCachePolicyBindingURL = "/nitro/v1/config/cacheglobal_cachepolicy_binding" + cacheObjectURL = "/nitro/v1/config/cacheobject" + cacheParameterURL = "/nitro/v1/config/cacheparameter" + cachePolicyURL = "/nitro/v1/config/cachepolicy" + cachePolicyBindingURL = "/nitro/v1/config/cachepolicy_binding" + cachePolicyCacheGlobalBindingURL = "/nitro/v1/config/cachepolicy_cacheglobal_binding" + cachePolicyCachePolicyLabelBindingURL = "/nitro/v1/config/cachepolicy_cachepolicylabel_binding" + cachePolicyCSVServerBindingURL = "/nitro/v1/config/cachepolicy_csvserver_binding" + cachePolicyLBVServerBindingURL = "/nitro/v1/config/cachepolicy_lbvserver_binding" + cachePolicyLabelURL = "/nitro/v1/config/cachepolicylabel" + cachePolicyLabelBindingURL = "/nitro/v1/config/cachepolicylabel_binding" + cachePolicyLabelCachePolicyBindingURL = "/nitro/v1/config/cachepolicylabel_cachepolicy_binding" + cachePolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/cachepolicylabel_policybinding_binding" + cacheSelectorURL = "/nitro/v1/config/cacheselector" +) + // Integrated Caching Configuration. The Integrated Caching feature is used to cache static and dynamic web application data. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cache/cache type CacheService struct { diff --git a/nitrogo/client.go b/nitrogo/client.go index 01c419b..bdfe3d4 100644 --- a/nitrogo/client.go +++ b/nitrogo/client.go @@ -10,6 +10,11 @@ import ( "time" ) +const ( + loginURL = "/nitro/v1/config/login" + logoutURL = "/nitro/v1/config/logout" +) + type Credential struct { username string password string @@ -50,7 +55,7 @@ type Client struct { DB *DBService DNS *DNSService FEO *FEOService - GLSB *GLSBService + GSLB *GSLBService HA *HAService ICA *ICAService IPSEC *IPSECService @@ -126,7 +131,7 @@ func NewNitroClient(host, username, password string, options ...ClientOptionFunc c.DB = &DBService{client: c} c.DNS = &DNSService{client: c} c.FEO = &FEOService{client: c} - c.GLSB = &GLSBService{client: c} + c.GSLB = &GSLBService{client: c} c.HA = &HAService{client: c} c.ICA = &ICAService{client: c} c.IPSEC = &IPSECService{client: c} @@ -218,12 +223,11 @@ func (c *Client) Do(req *http.Request) ([]byte, error) { return respByte, nil } +// Login - creates a session for the current NetScaler func (c *Client) Login() error { - u := "nitro/v1/config/login" - login := fmt.Appendf(nil, `{"login": {"username":"%s","password":"%s"}}`, c.credential.username, c.credential.password) - req, err := c.NewRequest(http.MethodPost, u, bytes.NewBuffer(login)) + req, err := c.NewRequest(http.MethodPost, loginURL, bytes.NewBuffer(login)) if err != nil { return err } @@ -251,12 +255,11 @@ func (c *Client) Login() error { return nil } +// Logout - Ends the on going session with the NetScaler func (c *Client) Logout() error { - u := "nitro/v1/config/logout" - logout := fmt.Appendf(nil, `{"logout": {}}`) - req, err := c.NewRequest(http.MethodPost, u, bytes.NewBuffer(logout)) + req, err := c.NewRequest(http.MethodPost, logoutURL, bytes.NewBuffer(logout)) if err != nil { return err } @@ -269,11 +272,6 @@ func (c *Client) Logout() error { return nil } -// Credential - getter for client's credentials -func (c *Client) Credential() Credential { - return c.credential -} - // Hostname - getter for client's hostname. func (c *Client) Hostname() string { return c.hostname @@ -290,8 +288,11 @@ func (c *Client) URL() string { } // SetCredential - setter for client's credential. -func (c *Client) SetCredential(cred Credential) { - c.credential = cred +func (c *Client) SetCredential(username, password string) { + c.credential = Credential{ + username: username, + password: password, + } } // SetHostname - getter for clients's hostname diff --git a/nitrogo/cloud.go b/nitrogo/cloud.go index c670ba8..239cc2d 100644 --- a/nitrogo/cloud.go +++ b/nitrogo/cloud.go @@ -1,14 +1,35 @@ package nitrogo +const ( + cloudAllowedNGSTicketProfileURL = "/nitro/v1/config/cloudallowedngsticketprofile" + cloudAutoscaleGroupURL = "/nitro/v1/config/cloudautoscalegroup" + cloudCredentialURL = "/nitro/v1/config/cloudcredential" + cloudParameterURL = "/nitro/v1/config/cloudparameter" + cloudParamInternalURL = "/nitro/v1/config/cloudparaminternal" + cloudProfileURL = "/nitro/v1/config/cloudprofile" + cloudServiceURL = "/nitro/v1/config/cloudservice" + cloudVServerIPURL = "/nitro/v1/config/cloudvserverip" +) + // Citrix ADC as SD proxy Configuration and cloud discovery commands. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloud type CloudService struct { client *Client } -// cloudautoscalegroup +// cloudallowedngsticketprofile // Configuration for Allowed ticket profile for NGS resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudallowedngsticketprofile +func (s *CloudService) AddCloudAllowedNGSTicketProfile() {} +func (s *CloudService) DeleteCloudAllowedNGSTicketProfile() {} +func (s *CloudService) UpdateCloudAllowedNGSTicketProfile() {} +func (s *CloudService) GetAllCloudAllowedNGSTicketProfile() {} +func (s *CloudService) GetCloudAllowedNGSTicketProfile() {} +func (s *CloudService) CountCloudAllowedNGSTicketProfile() {} + +// cloudautoscalegroup +// Configuration for Cloud Autoscale Group resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudautoscalegroup func (s *CloudService) GetAllCloudAutoscaleGroup() {} func (s *CloudService) GetCloudAutoscaleGroup() {} func (s *CloudService) CountCloudAutoscaleGroup() {} diff --git a/nitrogo/cluster.go b/nitrogo/cluster.go index b1c6983..666e0d1 100644 --- a/nitrogo/cluster.go +++ b/nitrogo/cluster.go @@ -1,5 +1,30 @@ package nitrogo +const ( + clusterFilesURL = "/nitro/v1/config/clusterfiles" + clusterInstanceURL = "/nitro/v1/config/clusterinstance" + clusterInstanceBindingURL = "/nitro/v1/config/clusterinstance_binding" + clusterInstanceClusterNodeBindingURL = "/nitro/v1/config/clusterinstance_clusternode_binding" + clusterNodeURL = "/nitro/v1/config/clusternode" + clusterNodeBindingURL = "/nitro/v1/config/clusternode_binding" + clusterNodeRouteMonitorBindingURL = "/nitro/v1/config/clusternode_routemonitor_binding" + clusterNodeGroupURL = "/nitro/v1/config/clusternodegroup" + clusterNodeGroupAuthenticationVServerBindingURL = "/nitro/v1/config/clusternodegroup_authenticationvserver_binding" + clusterNodeGroupBindingURL = "/nitro/v1/config/clusternodegroup_binding" + clusterNodeGroupClusterNodeBindingURL = "/nitro/v1/config/clusternodegroup_clusternode_binding" + clusterNodeGroupCRVServerBindingURL = "/nitro/v1/config/clusternodegroup_crvserver_binding" + clusterNodeGroupCSVServerBindingURL = "/nitro/v1/config/clusternodegroup_csvserver_binding" + clusterNodeGroupGSLBSiteBindingURL = "/nitro/v1/config/clusternodegroup_gslbsite_binding" + clusterNodeGroupGSLBVServerBindingURL = "/nitro/v1/config/clusternodegroup_gslbvserver_binding" + clusterNodeGroupLBVServerBindingURL = "/nitro/v1/config/clusternodegroup_lbvserver_binding" + clusterNodeGroupNSLimitIdentifierBindingURL = "/nitro/v1/config/clusternodegroup_nslimitidentifier_binding" + clusterNodeGroupServiceBindingURL = "/nitro/v1/config/clusternodegroup_service_binding" + clusterNodeGroupStreamIdentifierBindingURL = "/nitro/v1/config/clusternodegroup_streamidentifier_binding" + clusterNodeGroupVPNVServerBindingURL = "/nitro/v1/config/clusternodegroup_vpnvserver_binding" + clusterPropStatusURL = "/nitro/v1/config/clusterpropstatus" + clusterSyncURL = "/nitro/v1/config/clustersync" +) + // Configuration for 0 resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cluster/cluster type ClusterService struct { @@ -80,13 +105,13 @@ func (s *ClusterService) GetClusterNodeGroupCSVServerBinding() {} func (s *ClusterService) CountClusterNodeGroupCSVServerBinding() {} // clusternodegroup_gslbsite_binding -func (s *ClusterService) AddClusterNodeGroupGLSBSiteBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupGLSBSiteBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupGLSBSiteBinding() {} -func (s *ClusterService) GetClusterNodeGroupGLSBSiteBinding() {} -func (s *ClusterService) CountClusterNodeGroupGLSBSiteBinding() {} +func (s *ClusterService) AddClusterNodeGroupGSLBSiteBinding() {} +func (s *ClusterService) DeleteClusterNodeGroupGSLBSiteBinding() {} +func (s *ClusterService) GetAllClusterNodeGroupGSLBSiteBinding() {} +func (s *ClusterService) GetClusterNodeGroupGSLBSiteBinding() {} +func (s *ClusterService) CountClusterNodeGroupGSLBSiteBinding() {} -// clusternodegroup_glsbvserver_binding +// clusternodegroup_gslbvserver_binding func (s *ClusterService) AddClusterNodeGroupGSLBVServerBinding() {} func (s *ClusterService) DeleteClusterNodeGroupGSLBVServerBinding() {} func (s *ClusterService) GetAllClusterNodeGroupGSLBVServerBinding() {} @@ -146,6 +171,3 @@ func (s *ClusterService) ClearClusterPropStatus() {} // clustersync func (s *ClusterService) ForceClusterSync() {} - -// cluster_grp -// Documentation page doesn't work diff --git a/nitrogo/cmp.go b/nitrogo/cmp.go index b71b539..02c403f 100644 --- a/nitrogo/cmp.go +++ b/nitrogo/cmp.go @@ -1,5 +1,23 @@ package nitrogo +const ( + cmpActionURL = "/nitro/v1/config/cmpaction" + cmpGlobalBindingURL = "/nitro/v1/config/cmpglobal_binding" + cmpGlobalCMPPolicyBindingURL = "/nitro/v1/config/cmpglobal_cmppolicy_binding" + cmpParameterURL = "/nitro/v1/config/cmpparameter" + cmpPolicyURL = "/nitro/v1/config/cmppolicy" + cmpPolicyLabelURL = "/nitro/v1/config/cmppolicylabel" + cmpPolicyLabelBindingURL = "/nitro/v1/config/cmppolicylabel_binding" + cmpPolicyLabelCMPPolicyBindingURL = "/nitro/v1/config/cmppolicylabel_cmppolicy_binding" + cmpPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/cmppolicylabel_policybinding_binding" + cmpPolicyBindingURL = "/nitro/v1/config/cmppolicy_binding" + cmpPolicyCMPGlobalBindingURL = "/nitro/v1/config/cmppolicy_cmpglobal_binding" + cmpPolicyCMPPolicyLabelBindingURL = "/nitro/v1/config/cmppolicy_cmppolicylabel_binding" + cmpPolicyCRVServerBindingURL = "/nitro/v1/config/cmppolicy_crvserver_binding" + cmpPolicyCSVServerBindingURL = "/nitro/v1/config/cmppolicy_csvserver_binding" + cmpPolicyLBVServerBindingURL = "/nitro/v1/config/cmppolicy_lbvserver_binding" +) + // Compression configuration. The system’s feature for compressing HTTP responses to compression-aware browsers. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cmp/cmp type CMPService struct { diff --git a/nitrogo/content_inspection.go b/nitrogo/content_inspection.go index 1f97e92..e1c08a2 100644 --- a/nitrogo/content_inspection.go +++ b/nitrogo/content_inspection.go @@ -1,5 +1,24 @@ package nitrogo +const ( + contentInspectionActionURL = "/nitro/v1/config/contentinspectionaction" + contentInspectionCalloutURL = "/nitro/v1/config/contentinspectioncallout" + contentInspectionGlobalBindingURL = "/nitro/v1/config/contentinspectionglobal_binding" + contentInspectionGlobalContentInspectionPolicyBindingURL = "/nitro/v1/config/contentinspectionglobal_contentinspectionpolicy_binding" + contentInspectionParameterURL = "/nitro/v1/config/contentinspectionparameter" + contentInspectionPolicyURL = "/nitro/v1/config/contentinspectionpolicy" + contentInspectionPolicyLabelURL = "/nitro/v1/config/contentinspectionpolicylabel" + contentInspectionPolicyLabelBindingURL = "/nitro/v1/config/contentinspectionpolicylabel_binding" + contentInspectionPolicyLabelContentInspectionPolicyBindingURL = "/nitro/v1/config/contentinspectionpolicylabel_contentinspectionpolicy_binding" + contentInspectionPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/contentinspectionpolicylabel_policybinding_binding" + contentInspectionPolicyBindingURL = "/nitro/v1/config/contentinspectionpolicy_binding" + contentInspectionPolicyContentInspectionGlobalBindingURL = "/nitro/v1/config/contentinspectionpolicy_contentinspectionglobal_binding" + contentInspectionPolicyContentInspectionPolicyLabelBindingURL = "/nitro/v1/config/contentinspectionpolicy_contentinspectionpolicylabel_binding" + contentInspectionPolicyCSVServerBindingURL = "/nitro/v1/config/contentinspectionpolicy_csvserver_binding" + contentInspectionPolicyLBVServerBindingURL = "/nitro/v1/config/contentinspectionpolicy_lbvserver_binding" + contentInspectionProfileURL = "/nitro/v1/config/contentinspectionprofile" +) + // Content Inspection // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/contentinspection/contentinspection type ContentInspectionService struct { diff --git a/nitrogo/cr.go b/nitrogo/cr.go index a3784ce..b16374b 100644 --- a/nitrogo/cr.go +++ b/nitrogo/cr.go @@ -1,5 +1,29 @@ package nitrogo +const ( + crActionURL = "/nitro/v1/config/craction" + crPolicyURL = "/nitro/v1/config/crpolicy" + crPolicyBindingURL = "/nitro/v1/config/crpolicy_binding" + crPolicyCRVServerBindingURL = "/nitro/v1/config/crpolicy_crvserver_binding" + crVServerURL = "/nitro/v1/config/crvserver" + crVServerAnalyticsProfileBindingURL = "/nitro/v1/config/crvserver_analyticsprofile_binding" + crVServerAppFlowPolicyBindingURL = "/nitro/v1/config/crvserver_appflowpolicy_binding" + crVServerAppFWPolicyBindingURL = "/nitro/v1/config/crvserver_appfwpolicy_binding" + crVServerAppQOEPolicyBindingURL = "/nitro/v1/config/crvserver_appqoepolicy_binding" + crVServerBindingURL = "/nitro/v1/config/crvserver_binding" + crVServerCachePolicyBindingURL = "/nitro/v1/config/crvserver_cachepolicy_binding" + crVServerCMPPolicyBindingURL = "/nitro/v1/config/crvserver_cmppolicy_binding" + crVServerCRPolicyBindingURL = "/nitro/v1/config/crvserver_crpolicy_binding" + crVServerCSPolicyBindingURL = "/nitro/v1/config/crvserver_cspolicy_binding" + crVServerFEOPolicyBindingURL = "/nitro/v1/config/crvserver_feopolicy_binding" + crVServerICAPolicyBindingURL = "/nitro/v1/config/crvserver_icapolicy_binding" + crVServerLBVServerBindingURL = "/nitro/v1/config/crvserver_lbvserver_binding" + crVServerPolicyMapBindingURL = "/nitro/v1/config/crvserver_policymap_binding" + crVServerResponderPolicyBindingURL = "/nitro/v1/config/crvserver_responderpolicy_binding" + crVServerRewritePolicyBindingURL = "/nitro/v1/config/crvserver_rewritepolicy_binding" + crVServerSpilloverPolicyBindingURL = "/nitro/v1/config/crvserver_spilloverpolicy_binding" +) + // Cache redirection configuration. The cache redirection feature can transparently redirect cacheable HTTP // requests to a cache and send non-cacheable or dynamic HTTP requests to the origin server. A cache stores // or caches frequently requested web content and serves such web content to a client on behalf of the origin @@ -141,11 +165,11 @@ func (s *CRService) GetCRVServerResponderPolicyBinding() {} func (s *CRService) CountCRVServerResponderPolicyBinding() {} // crvserver_rewritepolicy_binding -func (s *CRService) AddCRVServerRewritePolcyBinding() {} -func (s *CRService) DeleteCRVServerRewritePolcyBinding() {} -func (s *CRService) GetAllCRVServerRewritePolcyBinding() {} -func (s *CRService) GetCRVServerRewritePolcyBinding() {} -func (s *CRService) CountCRVServerRewritePolcyBinding() {} +func (s *CRService) AddCRVServerRewritePolicyBinding() {} +func (s *CRService) DeleteCRVServerRewritePolicyBinding() {} +func (s *CRService) GetAllCRVServerRewritePolicyBinding() {} +func (s *CRService) GetCRVServerRewritePolicyBinding() {} +func (s *CRService) CountCRVServerRewritePolicyBinding() {} // crvserver_spilloverpolicy_binding func (s *CRService) AddCRVServerSpilloverPolicyBinding() {} diff --git a/nitrogo/cs.go b/nitrogo/cs.go index 80a9e8a..fe08dcf 100644 --- a/nitrogo/cs.go +++ b/nitrogo/cs.go @@ -1,5 +1,42 @@ package nitrogo +const ( + csActionURL = "/nitro/v1/config/csaction" + csParameterURL = "/nitro/v1/config/csparameter" + csPolicyURL = "/nitro/v1/config/cspolicy" + csPolicyLabelURL = "/nitro/v1/config/cspolicylabel" + csPolicyLabelBindingURL = "/nitro/v1/config/cspolicylabel_binding" + csPolicyLabelCSPolicyBindingURL = "/nitro/v1/config/cspolicylabel_cspolicy_binding" + csPolicyBindingURL = "/nitro/v1/config/cspolicy_binding" + csPolicyCRVServerBindingURL = "/nitro/v1/config/cspolicy_crvserver_binding" + csPolicyCSPolicyLabelBindingURL = "/nitro/v1/config/cspolicy_cspolicylabel_binding" + csPolicyCSVServerBindingURL = "/nitro/v1/config/cspolicy_csvserver_binding" + csVServerURL = "/nitro/v1/config/csvserver" + csVServerAnalyticsProfileBindingURL = "/nitro/v1/config/csvserver_analyticsprofile_binding" + csVServerAppFlowPolicyBindingURL = "/nitro/v1/config/csvserver_appflowpolicy_binding" + csVServerAppFWPolicyBindingURL = "/nitro/v1/config/csvserver_appfwpolicy_binding" + csVServerAppQOEPolicyBindingURL = "/nitro/v1/config/csvserver_appqoepolicy_binding" + csVServerAuditNSLogPolicyBindingURL = "/nitro/v1/config/csvserver_auditnslogpolicy_binding" + csVServerAuditSyslogPolicyBindingURL = "/nitro/v1/config/csvserver_auditsyslogpolicy_binding" + csVServerAuthorizationPolicyBindingURL = "/nitro/v1/config/csvserver_authorizationpolicy_binding" + csVServerBindingURL = "/nitro/v1/config/csvserver_binding" + csVServerBotPolicyBindingURL = "/nitro/v1/config/csvserver_botpolicy_binding" + csVServerCachePolicyBindingURL = "/nitro/v1/config/csvserver_cachepolicy_binding" + csVServerCMPPolicyBindingURL = "/nitro/v1/config/csvserver_cmppolicy_binding" + csVServerContentInspectionPolicyBindingURL = "/nitro/v1/config/csvserver_contentinspectionpolicy_binding" + csVServerCSPolicyBindingURL = "/nitro/v1/config/csvserver_cspolicy_binding" + csVServerDomainBindingURL = "/nitro/v1/config/csvserver_domain_binding" + csVServerFEOPolicyBindingURL = "/nitro/v1/config/csvserver_feopolicy_binding" + csVServerGSLBVServerBindingURL = "/nitro/v1/config/csvserver_gslbvserver_binding" + csVServerLBVServerBindingURL = "/nitro/v1/config/csvserver_lbvserver_binding" + csVServerResponderPolicyBindingURL = "/nitro/v1/config/csvserver_responderpolicy_binding" + csVServerRewritePolicyBindingURL = "/nitro/v1/config/csvserver_rewritepolicy_binding" + csVServerSpilloverPolicyBindingURL = "/nitro/v1/config/csvserver_spilloverpolicy_binding" + csVServerTMTrafficPolicyBindingURL = "/nitro/v1/config/csvserver_tmtrafficpolicy_binding" + csVServerTransformPolicyBindingURL = "/nitro/v1/config/csvserver_transformpolicy_binding" + csVServerVPNVServerBindingURL = "/nitro/v1/config/csvserver_vpnvserver_binding" +) + // Content Switching configuration. Content Switching feature that enables you to direct traffic to servers on the basis of content. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cs/cs type CSService struct { @@ -177,11 +214,11 @@ func (s *CSService) GetCSVServerDomainBinding() {} func (s *CSService) CountCSVServerDomainBinding() {} // csvserver_feopolicy_binding -func (s *CSService) AddCSVServerFeoPolicyBinding() {} -func (s *CSService) DeleteCSVServerFeoPolicyBinding() {} -func (s *CSService) GetAllCSVServerFeoPolicyBinding() {} -func (s *CSService) GetCSVServerFeoPolicyBinding() {} -func (s *CSService) CountCSVServerFeoPolicyBinding() {} +func (s *CSService) AddCSVServerFEOPolicyBinding() {} +func (s *CSService) DeleteCSVServerFEOPolicyBinding() {} +func (s *CSService) GetAllCSVServerFEOPolicyBinding() {} +func (s *CSService) GetCSVServerFEOPolicyBinding() {} +func (s *CSService) CountCSVServerFEOPolicyBinding() {} // csvserver_gslbvserver_binding func (s *CSService) AddCSVServerGSLBVServerBinding() {} diff --git a/nitrogo/db.go b/nitrogo/db.go index 6f958b2..84815ec 100644 --- a/nitrogo/db.go +++ b/nitrogo/db.go @@ -1,5 +1,10 @@ package nitrogo +const ( + dbDBProfileURL = "/nitro/v1/config/dbdbprofile" + dbUserURL = "/nitro/v1/config/dbuser" +) + // All the commands associated with database user // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/db/db type DBService struct { diff --git a/nitrogo/dns.go b/nitrogo/dns.go index 4c6ad1a..f58793a 100644 --- a/nitrogo/dns.go +++ b/nitrogo/dns.go @@ -1,5 +1,49 @@ package nitrogo +const ( + dnsAAAARecURL = "/nitro/v1/config/dnsaaaarec" + dnsActionURL = "/nitro/v1/config/dnsaction" + dnsAction64URL = "/nitro/v1/config/dnsaction64" + dnsAddRecURL = "/nitro/v1/config/dnsaddrec" + dnsCNameRecURL = "/nitro/v1/config/dnscnamerec" + dnsGlobalBindingURL = "/nitro/v1/config/dnsglobal_binding" + dnsGlobalDNSPolicyBindingURL = "/nitro/v1/config/dnsglobal_dnspolicy_binding" + dnsKeyURL = "/nitro/v1/config/dnskey" + dnsMXRecURL = "/nitro/v1/config/dnsmxrec" + dnsNameServerURL = "/nitro/v1/config/dnsnameserver" + dnsNAPTRRecURL = "/nitro/v1/config/dnsnaptrrec" + dnsNSECRecURL = "/nitro/v1/config/dnsnsecrec" + dnsNSRecURL = "/nitro/v1/config/dnsnsrec" + dnsParameterURL = "/nitro/v1/config/dnsparameter" + dnsPolicyURL = "/nitro/v1/config/dnspolicy" + dnsPolicy64URL = "/nitro/v1/config/dnspolicy64" + dnsPolicy64BindingURL = "/nitro/v1/config/dnspolicy64_binding" + dnsPolicy64LBVServerBindingURL = "/nitro/v1/config/dnspolicy64_lbvserver_binding" + dnsPolicyLabelURL = "/nitro/v1/config/dnspolicylabel" + dnsPolicyLabelBindingURL = "/nitro/v1/config/dnspolicylabel_binding" + dnsPolicyLabelDNSPolicyBindingURL = "/nitro/v1/config/dnspolicylabel_dnspolicy_binding" + dnsPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/dnspolicylabel_policybinding_binding" + dnsPolicyBindingURL = "/nitro/v1/config/dnspolicy_binding" + dnsPolicyDNSGlobalBindingURL = "/nitro/v1/config/dnspolicy_dnsglobal_binding" + dnsPolicyDNSPolicyLabelBindingURL = "/nitro/v1/config/dnspolicy_dnspolicylabel_binding" + dnsProfileURL = "/nitro/v1/config/dnsprofile" + dnsProxyRecordsURL = "/nitro/v1/config/dnsproxyrecords" + dnsPTRRecURL = "/nitro/v1/config/dnsptrrec" + dnsSOARecURL = "/nitro/v1/config/dnssoarec" + dnsSRVRecURL = "/nitro/v1/config/dnssrvrec" + dnsSubnetCacheURL = "/nitro/v1/config/dnssubnetcache" + dnsSuffixURL = "/nitro/v1/config/dnssuffix" + dnsTXTRecURL = "/nitro/v1/config/dnstxtrec" + dnsViewURL = "/nitro/v1/config/dnsview" + dnsViewBindingURL = "/nitro/v1/config/dnsview_binding" + dnsViewDNSPolicyBindingURL = "/nitro/v1/config/dnsview_dnspolicy_binding" + dnsViewGSLBServiceBindingURL = "/nitro/v1/config/dnsview_gslbservice_binding" + dnsZoneURL = "/nitro/v1/config/dnszone" + dnsZoneBindingURL = "/nitro/v1/config/dnszone_binding" + dnsZoneDNSKeyBindingURL = "/nitro/v1/config/dnszone_dnskey_binding" + dnsZoneDomainBindingURL = "/nitro/v1/config/dnszone_domain_binding" +) + // Domain Name Service(DNS) configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/dns/dns type DNSService struct { diff --git a/nitrogo/feo.go b/nitrogo/feo.go index 47f5857..bac2346 100644 --- a/nitrogo/feo.go +++ b/nitrogo/feo.go @@ -1,5 +1,17 @@ package nitrogo +const ( + feoActionURL = "/nitro/v1/config/feoaction" + feoGlobalBindingURL = "/nitro/v1/config/feoglobal_binding" + feoGlobalFEOPolicyBindingURL = "/nitro/v1/config/feoglobal_feopolicy_binding" + feoParameterURL = "/nitro/v1/config/feoparameter" + feoPolicyURL = "/nitro/v1/config/feopolicy" + feoPolicyBindingURL = "/nitro/v1/config/feopolicy_binding" + feoPolicyCSVServerBindingURL = "/nitro/v1/config/feopolicy_csvserver_binding" + feoPolicyFEOGlobalBindingURL = "/nitro/v1/config/feopolicy_feoglobal_binding" + feoPolicyLBVServerBindingURL = "/nitro/v1/config/feopolicy_lbvserver_binding" +) + // Front end optimization configuration. The system’s feature to optimize Web content for performance. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feo type FEOService struct { diff --git a/nitrogo/glsb.go b/nitrogo/glsb.go index 77320ee..82b52fc 100644 --- a/nitrogo/glsb.go +++ b/nitrogo/glsb.go @@ -1,205 +1,242 @@ package nitrogo +const ( + gslbConfigURL = "/nitro/v1/config/gslbconfig" + gslbDomainURL = "/nitro/v1/config/gslbdomain" + gslbDomainBindingURL = "/nitro/v1/config/gslbdomain_binding" + gslbDomainGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroupmember_binding" + gslbDomainGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroup_binding" + gslbDomainGSLBServiceBindingURL = "/nitro/v1/config/gslbdomain_gslbservice_binding" + gslbDomainGSLBVServerBindingURL = "/nitro/v1/config/gslbdomain_gslbvserver_binding" + gslbDomainLBMonitorBindingURL = "/nitro/v1/config/gslbdomain_lbmonitor_binding" + gslbDNSEntriesURL = "/nitro/v1/config/gslbdnsentries" + gslbDNSEntryURL = "/nitro/v1/config/gslbdnsentry" + gslbParameterURL = "/nitro/v1/config/gslbparameter" + gslbRunningConfigURL = "/nitro/v1/config/gslbrunningconfig" + gslbServiceURL = "/nitro/v1/config/gslbservice" + gslbServiceGroupURL = "/nitro/v1/config/gslbservicegroup" + gslbServiceGroupBindingURL = "/nitro/v1/config/gslbservicegroup_binding" + gslbServiceGroupGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbservicegroup_gslbservicegroupmember_binding" + gslbServiceGroupLBMonitorBindingURL = "/nitro/v1/config/gslbservicegroup_lbmonitor_binding" + gslbServiceGroupServiceGroupEntityMonBindingsBindingURL = "/nitro/v1/config/gslbservicegroup_servicegroupentitymonbindings_binding" + gslbServiceBindingURL = "/nitro/v1/config/gslbservice_binding" + gslbServiceDNSViewBindingURL = "/nitro/v1/config/gslbservice_dnsview_binding" + gslbServiceLBMonitorBindingURL = "/nitro/v1/config/gslbservice_lbmonitor_binding" + gslbSiteURL = "/nitro/v1/config/gslbsite" + gslbSiteBindingURL = "/nitro/v1/config/gslbsite_binding" + gslbSiteGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroupmember_binding" + gslbSiteGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroup_binding" + gslbSiteGSLBServiceBindingURL = "/nitro/v1/config/gslbsite_gslbservice_binding" + gslbSyncStatusURL = "/nitro/v1/config/gslbsyncstatus" + gslbVServerURL = "/nitro/v1/config/gslbvserver" + gslbVServerBindingURL = "/nitro/v1/config/gslbvserver_binding" + gslbVServerDomainBindingURL = "/nitro/v1/config/gslbvserver_domain_binding" + gslbVServerGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroupmember_binding" + gslbVServerGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroup_binding" + gslbVServerGSLBServiceBindingURL = "/nitro/v1/config/gslbvserver_gslbservice_binding" + gslbVServerSpilloverPolicyBindingURL = "/nitro/v1/config/gslbvserver_spilloverpolicy_binding" +) + // Global Server Load Balancing (GSLB) configuration. GSLB feature ensures that client requests are // directed to a best performing site available in a global enterprise and distributed Internet environment. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/gslb/gslb -type GLSBService struct { +type GSLBService struct { client *Client } // gslbconfig -func (s *GLSBService) SyncGSLBConfig() {} +func (s *GSLBService) SyncGSLBConfig() {} // gslbdomain -func (s *GLSBService) GetAllGSLBDomain() {} -func (s *GLSBService) GetGSLBDomain() {} -func (s *GLSBService) CountGSLBDomain() {} +func (s *GSLBService) GetAllGSLBDomain() {} +func (s *GSLBService) GetGSLBDomain() {} +func (s *GSLBService) CountGSLBDomain() {} // gslbdomain_binding -func (s *GLSBService) GetAllGSLBDomainBinding() {} -func (s *GLSBService) GetGSLBDomainBinding() {} +func (s *GSLBService) GetAllGSLBDomainBinding() {} +func (s *GSLBService) GetGSLBDomainBinding() {} // dslbdomain_gslbservicegroupmember_binding -func (s *GLSBService) GetAllGSLBDomainGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) GetGSLBDomainGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) CountGSLBDomainGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetGSLBDomainGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) CountGSLBDomainGSLBServiceGroupMemberBinding() {} // gslbdomain_gslbservicegroup_binding -func (s *GLSBService) GetAllGSLBDomainGSLBServiceGroupBinding() {} -func (s *GLSBService) GetGSLBDomainGSLBServiceGroupBinding() {} -func (s *GLSBService) CountGSLBDomainGSLBServiceGroupBinding() {} +func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupBinding() {} +func (s *GSLBService) GetGSLBDomainGSLBServiceGroupBinding() {} +func (s *GSLBService) CountGSLBDomainGSLBServiceGroupBinding() {} // dslbdomain_gslbservice_binding -func (s *GLSBService) GetAllGSLBDomainGSLBServiceBinding() {} -func (s *GLSBService) GetGSLBDomainGSLBServiceBinding() {} -func (s *GLSBService) CountGSLBDomainGSLBServiceBinding() {} +func (s *GSLBService) GetAllGSLBDomainGSLBServiceBinding() {} +func (s *GSLBService) GetGSLBDomainGSLBServiceBinding() {} +func (s *GSLBService) CountGSLBDomainGSLBServiceBinding() {} // gslbdomain_gslbvserver_binding -func (s *GLSBService) GetAllGSLBDomainGSLBVServerBinding() {} -func (s *GLSBService) GetGSLBDomainGSLBVServerBinding() {} -func (s *GLSBService) CountGSLBDomainGSLBVServerBinding() {} +func (s *GSLBService) GetAllGSLBDomainGSLBVServerBinding() {} +func (s *GSLBService) GetGSLBDomainGSLBVServerBinding() {} +func (s *GSLBService) CountGSLBDomainGSLBVServerBinding() {} // gslbdomain_lbmonitor_binding -func (s *GLSBService) GetAllGSLBDomainLBMonitorBinding() {} -func (s *GLSBService) GetGSLBDomainLBMonitorBinding() {} -func (s *GLSBService) CountGSLBDomainLBMonitorBinding() {} +func (s *GSLBService) GetAllGSLBDomainLBMonitorBinding() {} +func (s *GSLBService) GetGSLBDomainLBMonitorBinding() {} +func (s *GSLBService) CountGSLBDomainLBMonitorBinding() {} // gslbdnsentries -func (s *GLSBService) ClearGSLBDNSEntries() {} -func (s *GLSBService) GetAllGSLBDNSEntries() {} -func (s *GLSBService) CountGSLBDNSEntries() {} +func (s *GSLBService) ClearGSLBDNSEntries() {} +func (s *GSLBService) GetAllGSLBDNSEntries() {} +func (s *GSLBService) CountGSLBDNSEntries() {} // gslbdnsentry -func (s *GLSBService) DeleteGSLBDNSEntry() {} +func (s *GSLBService) DeleteGSLBDNSEntry() {} // gslbparameter -func (s *GLSBService) UpdateGSLBParameter() {} -func (s *GLSBService) UnsetGSLBParameter() {} -func (s *GLSBService) GetAllGSLBParameter() {} +func (s *GSLBService) UpdateGSLBParameter() {} +func (s *GSLBService) UnsetGSLBParameter() {} +func (s *GSLBService) GetAllGSLBParameter() {} // gslbrunningconfig -func (s *GLSBService) GetAllGSLBRunningConfig() {} +func (s *GSLBService) GetAllGSLBRunningConfig() {} // gslbservice -func (s *GLSBService) AddGSLBService() {} -func (s *GLSBService) DeleteGSLBService() {} -func (s *GLSBService) UpdateGSLBService() {} -func (s *GLSBService) UnsetGSLBService() {} -func (s *GLSBService) GetAllGSLBService() {} -func (s *GLSBService) GetGSLBService() {} -func (s *GLSBService) CountGSLBService() {} -func (s *GLSBService) RenameGSLBService() {} +func (s *GSLBService) AddGSLBService() {} +func (s *GSLBService) DeleteGSLBService() {} +func (s *GSLBService) UpdateGSLBService() {} +func (s *GSLBService) UnsetGSLBService() {} +func (s *GSLBService) GetAllGSLBService() {} +func (s *GSLBService) GetGSLBService() {} +func (s *GSLBService) CountGSLBService() {} +func (s *GSLBService) RenameGSLBService() {} // gslbservicegroup -func (s *GLSBService) AddGSLBServiceGroup() {} -func (s *GLSBService) DeleteGSLBServiceGroup() {} -func (s *GLSBService) UpdateGSLBServiceGroup() {} -func (s *GLSBService) UnsetGSLBServiceGroup() {} -func (s *GLSBService) EnableGSLBServiceGroup() {} -func (s *GLSBService) DisableGSLBServiceGroup() {} -func (s *GLSBService) GetAllGSLBServiceGroup() {} -func (s *GLSBService) GetGSLBServiceGroup() {} -func (s *GLSBService) CountGSLBServiceGroup() {} -func (s *GLSBService) RenameGSLBServiceGroup() {} +func (s *GSLBService) AddGSLBServiceGroup() {} +func (s *GSLBService) DeleteGSLBServiceGroup() {} +func (s *GSLBService) UpdateGSLBServiceGroup() {} +func (s *GSLBService) UnsetGSLBServiceGroup() {} +func (s *GSLBService) EnableGSLBServiceGroup() {} +func (s *GSLBService) DisableGSLBServiceGroup() {} +func (s *GSLBService) GetAllGSLBServiceGroup() {} +func (s *GSLBService) GetGSLBServiceGroup() {} +func (s *GSLBService) CountGSLBServiceGroup() {} +func (s *GSLBService) RenameGSLBServiceGroup() {} // gslbservicegroup_binding -func (s *GLSBService) GetAllGSLBServiceGroupBinding() {} -func (s *GLSBService) GetGSLBServiceGroupBinding() {} +func (s *GSLBService) GetAllGSLBServiceGroupBinding() {} +func (s *GSLBService) GetGSLBServiceGroupBinding() {} // gslbservicegroup_gslbservicegroupmember_binding -func (s *GLSBService) AddGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) DeleteGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) GetAllGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) GetGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) CountGSLBServiceGroupGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) AddGSLBServiceGroupGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) DeleteGSLBServiceGroupGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetAllGSLBServiceGroupGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetGSLBServiceGroupGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) CountGSLBServiceGroupGSLBServiceGroupMemberBinding() {} // gslbservicegroup_lbmonitor_binding -func (s *GLSBService) AddGSLBServiceGroupLBMonitorBinding() {} -func (s *GLSBService) DeleteGSLBServiceGroupLBMonitorBinding() {} -func (s *GLSBService) GetAllGSLBServiceGroupLBMonitorBinding() {} -func (s *GLSBService) GetGSLBServiceGroupLBMonitorBinding() {} -func (s *GLSBService) CountGSLBServiceGroupLBMonitorBinding() {} +func (s *GSLBService) AddGSLBServiceGroupLBMonitorBinding() {} +func (s *GSLBService) DeleteGSLBServiceGroupLBMonitorBinding() {} +func (s *GSLBService) GetAllGSLBServiceGroupLBMonitorBinding() {} +func (s *GSLBService) GetGSLBServiceGroupLBMonitorBinding() {} +func (s *GSLBService) CountGSLBServiceGroupLBMonitorBinding() {} // gslbservicegroup_servicegroupentitymonbindings_binding -func (s *GLSBService) GetAllGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *GLSBService) GetGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *GLSBService) CountGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} +func (s *GSLBService) GetAllGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} +func (s *GSLBService) GetGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} +func (s *GSLBService) CountGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} // gslbservice_binding -func (s *GLSBService) GetAllGSLBServiceBinding() {} -func (s *GLSBService) GetGSLBServiceBinding() {} +func (s *GSLBService) GetAllGSLBServiceBinding() {} +func (s *GSLBService) GetGSLBServiceBinding() {} // gslbservice_dnsview_binding -func (s *GLSBService) AddGSLBServiceDNSViewBinding() {} -func (s *GLSBService) DeleteGSLBServiceDNSViewBinding() {} -func (s *GLSBService) GetAllGSLBServiceDNSViewBinding() {} -func (s *GLSBService) GetGSLBServiceDNSViewBinding() {} -func (s *GLSBService) CountGSLBServiceDNSViewBinding() {} +func (s *GSLBService) AddGSLBServiceDNSViewBinding() {} +func (s *GSLBService) DeleteGSLBServiceDNSViewBinding() {} +func (s *GSLBService) GetAllGSLBServiceDNSViewBinding() {} +func (s *GSLBService) GetGSLBServiceDNSViewBinding() {} +func (s *GSLBService) CountGSLBServiceDNSViewBinding() {} // dslbservice_lbmonitor_binding -func (s *GLSBService) AddGSLBServiceLBMonitorBinding() {} -func (s *GLSBService) DeleteGSLBServiceLBMonitorBinding() {} -func (s *GLSBService) GetAllGSLBServiceLBMonitorBinding() {} -func (s *GLSBService) GetGSLBServiceLBMonitorBinding() {} -func (s *GLSBService) CountGSLBServiceLBMonitorBinding() {} +func (s *GSLBService) AddGSLBServiceLBMonitorBinding() {} +func (s *GSLBService) DeleteGSLBServiceLBMonitorBinding() {} +func (s *GSLBService) GetAllGSLBServiceLBMonitorBinding() {} +func (s *GSLBService) GetGSLBServiceLBMonitorBinding() {} +func (s *GSLBService) CountGSLBServiceLBMonitorBinding() {} // gslbsite -func (s *GLSBService) AddGSLBSite() {} -func (s *GLSBService) DeleteGSLBSite() {} -func (s *GLSBService) UpdateGSLBSite() {} -func (s *GLSBService) UnsetGSLBSite() {} -func (s *GLSBService) GetAllGSLBSite() {} -func (s *GLSBService) GetGSLBSite() {} -func (s *GLSBService) CountGSLBSite() {} -func (s *GLSBService) RenameGSLBSite() {} +func (s *GSLBService) AddGSLBSite() {} +func (s *GSLBService) DeleteGSLBSite() {} +func (s *GSLBService) UpdateGSLBSite() {} +func (s *GSLBService) UnsetGSLBSite() {} +func (s *GSLBService) GetAllGSLBSite() {} +func (s *GSLBService) GetGSLBSite() {} +func (s *GSLBService) CountGSLBSite() {} +func (s *GSLBService) RenameGSLBSite() {} // gslbsite_binding -func (s *GLSBService) GetAllGSLBSiteBinding() {} -func (s *GLSBService) GetGSLBSiteBinding() {} +func (s *GSLBService) GetAllGSLBSiteBinding() {} +func (s *GSLBService) GetGSLBSiteBinding() {} // gslbsite_gslbservicegroupmember_binding -func (s *GLSBService) GetAllGSLBSiteGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) GetGSLBSiteGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) CountGSLBSiteGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetGSLBSiteGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) CountGSLBSiteGSLBServiceGroupMemberBinding() {} // gslbsite_gslbservicegroup_binding -func (s *GLSBService) GetAllGSLBSiteGSLBServiceGroupBinding() {} -func (s *GLSBService) GetGSLBSiteGSLBServiceGroupBinding() {} -func (s *GLSBService) CountGSLBSiteGSLBServiceGroupBinding() {} +func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupBinding() {} +func (s *GSLBService) GetGSLBSiteGSLBServiceGroupBinding() {} +func (s *GSLBService) CountGSLBSiteGSLBServiceGroupBinding() {} // gslbsite_gslbservice_binding -func (s *GLSBService) GetAllGSLBSiteGSLBServiceBinding() {} -func (s *GLSBService) GetGSLBSiteGSLBServiceBinding() {} -func (s *GLSBService) CountGSLBSiteGSLBServiceBinding() {} +func (s *GSLBService) GetAllGSLBSiteGSLBServiceBinding() {} +func (s *GSLBService) GetGSLBSiteGSLBServiceBinding() {} +func (s *GSLBService) CountGSLBSiteGSLBServiceBinding() {} // gslbsyncstatus -func (s *GLSBService) GetAllGSLBSyncStatus() {} +func (s *GSLBService) GetAllGSLBSyncStatus() {} // gslbvserver -func (s *GLSBService) AddGSLBVServer() {} -func (s *GLSBService) DeleteGSLBVServer() {} -func (s *GLSBService) UpdateGSLBVServer() {} -func (s *GLSBService) UnsetGSLBVServer() {} -func (s *GLSBService) EnableGSLBVServer() {} -func (s *GLSBService) DisableGSLBVServer() {} -func (s *GLSBService) GetAllGSLBVServer() {} -func (s *GLSBService) GetGSLBVServer() {} -func (s *GLSBService) CountGSLBVServer() {} -func (s *GLSBService) RenameGSLBVServer() {} +func (s *GSLBService) AddGSLBVServer() {} +func (s *GSLBService) DeleteGSLBVServer() {} +func (s *GSLBService) UpdateGSLBVServer() {} +func (s *GSLBService) UnsetGSLBVServer() {} +func (s *GSLBService) EnableGSLBVServer() {} +func (s *GSLBService) DisableGSLBVServer() {} +func (s *GSLBService) GetAllGSLBVServer() {} +func (s *GSLBService) GetGSLBVServer() {} +func (s *GSLBService) CountGSLBVServer() {} +func (s *GSLBService) RenameGSLBVServer() {} // gslbvserver_binding -func (s *GLSBService) GetAllGSLBVServerBinding() {} -func (s *GLSBService) GetGSLBVServerBinding() {} +func (s *GSLBService) GetAllGSLBVServerBinding() {} +func (s *GSLBService) GetGSLBVServerBinding() {} // gslbvserver_domain_binding -func (s *GLSBService) AddGSLBVServerDomainBinding() {} -func (s *GLSBService) DeleteGSLBVServerDomainBinding() {} -func (s *GLSBService) GetAllGSLBVServerDomainBinding() {} -func (s *GLSBService) GetGSLBVServerDomainBinding() {} -func (s *GLSBService) CountGSLBVServerDomainBinding() {} +func (s *GSLBService) AddGSLBVServerDomainBinding() {} +func (s *GSLBService) DeleteGSLBVServerDomainBinding() {} +func (s *GSLBService) GetAllGSLBVServerDomainBinding() {} +func (s *GSLBService) GetGSLBVServerDomainBinding() {} +func (s *GSLBService) CountGSLBVServerDomainBinding() {} // gslbvserver_gslbservicegroupmember_binding -func (s *GLSBService) GetAllGSLBVServerGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) GetGSLBVServerGSLBServiceGroupMemberBinding() {} -func (s *GLSBService) CountGSLBVServerGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) GetGSLBVServerGSLBServiceGroupMemberBinding() {} +func (s *GSLBService) CountGSLBVServerGSLBServiceGroupMemberBinding() {} // gslbvserver_gslbservicegroup_binding -func (s *GLSBService) AddGSLBVServerGSLBServiceGroupBinding() {} -func (s *GLSBService) DeleteGSLBVServerGSLBServiceGroupBinding() {} -func (s *GLSBService) GetAllGSLBVServerGSLBServiceGroupBinding() {} -func (s *GLSBService) GetGSLBVServerGSLBServiceGroupBinding() {} -func (s *GLSBService) CountGSLBVServerGSLBServiceGroupBinding() {} +func (s *GSLBService) AddGSLBVServerGSLBServiceGroupBinding() {} +func (s *GSLBService) DeleteGSLBVServerGSLBServiceGroupBinding() {} +func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupBinding() {} +func (s *GSLBService) GetGSLBVServerGSLBServiceGroupBinding() {} +func (s *GSLBService) CountGSLBVServerGSLBServiceGroupBinding() {} // gslbvserver_gslbservice_binding -func (s *GLSBService) AddGSLBVServerGSLBServiceBinding() {} -func (s *GLSBService) DeleteGSLBVServerGSLBServiceBinding() {} -func (s *GLSBService) GetAllGSLBVServerGSLBServiceBinding() {} -func (s *GLSBService) GetGSLBVServerGSLBServiceBinding() {} -func (s *GLSBService) CountGSLBVServerGSLBServiceBinding() {} +func (s *GSLBService) AddGSLBVServerGSLBServiceBinding() {} +func (s *GSLBService) DeleteGSLBVServerGSLBServiceBinding() {} +func (s *GSLBService) GetAllGSLBVServerGSLBServiceBinding() {} +func (s *GSLBService) GetGSLBVServerGSLBServiceBinding() {} +func (s *GSLBService) CountGSLBVServerGSLBServiceBinding() {} // gslbvserver_spilloverpolicy_binding -func (s *GLSBService) AddGSLBVServerSpilloverPolicyBinding() {} -func (s *GLSBService) DeleteGSLBVServerSpilloverPolicyBinding() {} -func (s *GLSBService) GetAllGSLBVServerSpilloverPolicyBinding() {} -func (s *GLSBService) GetGSLBVServerSpilloverPolicyBinding() {} -func (s *GLSBService) CountGSLBVServerSpilloverPolicyBinding() {} +func (s *GSLBService) AddGSLBVServerSpilloverPolicyBinding() {} +func (s *GSLBService) DeleteGSLBVServerSpilloverPolicyBinding() {} +func (s *GSLBService) GetAllGSLBVServerSpilloverPolicyBinding() {} +func (s *GSLBService) GetGSLBVServerSpilloverPolicyBinding() {} +func (s *GSLBService) CountGSLBVServerSpilloverPolicyBinding() {} diff --git a/nitrogo/ha.go b/nitrogo/ha.go index 8b3483c..fd88e44 100644 --- a/nitrogo/ha.go +++ b/nitrogo/ha.go @@ -1,5 +1,18 @@ package nitrogo +const ( + haFilesURL = "/nitro/v1/config/hafiles" + haNodeURL = "/nitro/v1/config/hanode" + haNodeBindingURL = "/nitro/v1/config/hanode_binding" + haNodeCIBindingURL = "/nitro/v1/config/hanode_ci_binding" + haNodeFISBindingURL = "/nitro/v1/config/hanode_fis_binding" + haNodePartialFailureInterfacesBindingURL = "/nitro/v1/config/hanode_partialfailureinterfaces_binding" + haNodeRouteMonitor6BindingURL = "/nitro/v1/config/hanode_routemonitor6_binding" + haNodeRouteMonitorBindingURL = "/nitro/v1/config/hanode_routemonitor_binding" + haSyncURL = "/nitro/v1/config/hasync" + haSyncFailuresURL = "/nitro/v1/config/hasyncfailures" +) + // Configuration for failover resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ha/hafailover type HAService struct { diff --git a/nitrogo/ica.go b/nitrogo/ica.go index 39b0b09..bad48e2 100644 --- a/nitrogo/ica.go +++ b/nitrogo/ica.go @@ -1,5 +1,19 @@ package nitrogo +const ( + icaAccessProfileURL = "/nitro/v1/config/icaaccessprofile" + icaActionURL = "/nitro/v1/config/icaaction" + icaGlobalBindingURL = "/nitro/v1/config/icaglobal_binding" + icaGlobalICAPolicyBindingURL = "/nitro/v1/config/icaglobal_icapolicy_binding" + icaLatencyProfileURL = "/nitro/v1/config/icalatencyprofile" + icaParameterURL = "/nitro/v1/config/icaparameter" + icaPolicyURL = "/nitro/v1/config/icapolicy" + icaPolicyBindingURL = "/nitro/v1/config/icapolicy_binding" + icaPolicyCRVServerBindingURL = "/nitro/v1/config/icapolicy_crvserver_binding" + icaPolicyICAGlobalBindingURL = "/nitro/v1/config/icapolicy_icaglobal_binding" + icaPolicyVPNVServerBindingURL = "/nitro/v1/config/icapolicy_vpnvserver_binding" +) + // ICA configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ica/ica type ICAService struct { diff --git a/nitrogo/ipsec.go b/nitrogo/ipsec.go index d75c50c..da05a7f 100644 --- a/nitrogo/ipsec.go +++ b/nitrogo/ipsec.go @@ -1,5 +1,10 @@ package nitrogo +const ( + ipsecParameterURL = "/nitro/v1/config/ipsecparameter" + ipsecProfileURL = "/nitro/v1/config/ipsecprofile" +) + // IPSEC configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsec/ipsec type IPSECService struct { diff --git a/nitrogo/ipsecalg.go b/nitrogo/ipsecalg.go index 5acac00..78e7405 100644 --- a/nitrogo/ipsecalg.go +++ b/nitrogo/ipsecalg.go @@ -1,5 +1,10 @@ package nitrogo +const ( + ipsecALGProfileURL = "/nitro/v1/config/ipsecalgprofile" + ipsecALGSessionURL = "/nitro/v1/config/ipsecalgsession" +) + // IPSECALG configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsecalg/ipsecalg type IPSECALGService struct { diff --git a/nitrogo/lb.go b/nitrogo/lb.go index 4c41f9c..f65160b 100644 --- a/nitrogo/lb.go +++ b/nitrogo/lb.go @@ -8,6 +8,64 @@ import ( "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) +const ( + lbActionURL = "/nitro/v1/config/lbaction" + lbGlobalBindingURL = "/nitro/v1/config/lbglobal_binding" + lbGlobalLBPolicyBindingURL = "/nitro/v1/config/lbglobal_lbpolicy_binding" + lbGroupURL = "/nitro/v1/config/lbgroup" + lbGroupBindingURL = "/nitro/v1/config/lbgroup_binding" + lbGroupLBVServerBindingURL = "/nitro/v1/config/lbgroup_lbvserver_binding" + lbMetricTableURL = "/nitro/v1/config/lbmetrictable" + lbMetricTableBindingURL = "/nitro/v1/config/lbmetrictable_binding" + lbMetricTableMetricBindingURL = "/nitro/v1/config/lbmetrictable_metric_binding" + lbMonBindingsURL = "/nitro/v1/config/lbmonbindings" + lbMonBindingsBindingURL = "/nitro/v1/config/lbmonbindings_binding" + lbMonBindingsGSLBServiceGroupBindingURL = "/nitro/v1/config/lbmonbindings_gslbservicegroup_binding" + lbMonBindingsServiceBindingURL = "/nitro/v1/config/lbmonbindings_service_binding" + lbMonBindingsServiceGroupBindingURL = "/nitro/v1/config/lbmonbindings_servicegroup_binding" + lbMonitorURL = "/nitro/v1/config/lbmonitor" + lbMonitorBindingURL = "/nitro/v1/config/lbmonitor_binding" + lbMonitorMetricBindingURL = "/nitro/v1/config/lbmonitor_metric_binding" + lbMonitorServiceBindingURL = "/nitro/v1/config/lbmonitor_service_binding" + lbMonitorServiceGroupBindingURL = "/nitro/v1/config/lbmonitor_servicegroup_binding" + lbMonitorSSLCertKeyBindingURL = "/nitro/v1/config/lbmonitor_sslcertkey_binding" + lbParameterURL = "/nitro/v1/config/lbparameter" + lbPersistentSessionsURL = "/nitro/v1/config/lbpersistentsessions" + lbProfileURL = "/nitro/v1/config/lbprofile" + lbRouteURL = "/nitro/v1/config/lbroute" + lbRoute6URL = "/nitro/v1/config/lbroute6" + lbSIPParametersURL = "/nitro/v1/config/lbsipparameters" + lbVServerURL = "/nitro/v1/config/lbvserver" + lbVServerAnalyticsProfileBindingURL = "/nitro/v1/config/lbvserver_analyticsprofile_binding" + lbVServerAppFlowPolicyBindingURL = "/nitro/v1/config/lbvserver_appflowpolicy_binding" + lbVServerAppFWPolicyBindingURL = "/nitro/v1/config/lbvserver_appfwpolicy_binding" + lbVServerAppQOEPolicyBindingURL = "/nitro/v1/config/lbvserver_appqoepolicy_binding" + lbVServerAuditNSLogPolicyBindingURL = "/nitro/v1/config/lbvserver_auditnslogpolicy_binding" + lbVServerAuditSyslogPolicyBindingURL = "/nitro/v1/config/lbvserver_auditsyslogpolicy_binding" + lbVServerAuthorizationPolicyBindingURL = "/nitro/v1/config/lbvserver_authorizationpolicy_binding" + lbVServerBindingURL = "/nitro/v1/config/lbvserver_binding" + lbVServerBotPolicyBindingURL = "/nitro/v1/config/lbvserver_botpolicy_binding" + lbVServerCachePolicyBindingURL = "/nitro/v1/config/lbvserver_cachepolicy_binding" + lbVServerCMPPolicyBindingURL = "/nitro/v1/config/lbvserver_cmppolicy_binding" + lbVServerContentInspectionPolicyBindingURL = "/nitro/v1/config/lbvserver_contentinspectionpolicy_binding" + lbVServerCSVServerBindingURL = "/nitro/v1/config/lbvserver_csvserver_binding" + lbVServerDNSPolicy64BindingURL = "/nitro/v1/config/lbvserver_dnspolicy64_binding" + lbVServerFEOPolicyBindingURL = "/nitro/v1/config/lbvserver_feopolicy_binding" + lbVServerResponderPolicyBindingURL = "/nitro/v1/config/lbvserver_responderpolicy_binding" + lbVServerRewritePolicyBindingURL = "/nitro/v1/config/lbvserver_rewritepolicy_binding" + lbVServerServiceBindingURL = "/nitro/v1/config/lbvserver_service_binding" + lbVServerServiceGroupBindingURL = "/nitro/v1/config/lbvserver_servicegroup_binding" + lbVServerServiceGroupMemberBindingURL = "/nitro/v1/config/lbvserver_servicegroupmember_binding" + lbVServerSpilloverPolicyBindingURL = "/nitro/v1/config/lbvserver_spilloverpolicy_binding" + lbVServerTMTrafficPolicyBindingURL = "/nitro/v1/config/lbvserver_tmtrafficpolicy_binding" + lbVServerTransformPolicyBindingURL = "/nitro/v1/config/lbvserver_transformpolicy_binding" + lbVServerVideoOptimizationDetectionPolicyBindingURL = "/nitro/v1/config/lbvserver_videooptimizationdetectionpolicy_binding" + lbVServerVideoOptimizationPacingPolicyBindingURL = "/nitro/v1/config/lbvserver_videooptimizationpacingpolicy_binding" + lbWLMURL = "/nitro/v1/config/lbwlm" + lbWLMBindingURL = "/nitro/v1/config/lbwlm_binding" + lbWLMLBVServerBindingURL = "/nitro/v1/config/lbwlm_lbvserver_binding" +) + // Load Balancing configuration. The load balancing methods manage the selection of an appropriate physical server in a server farm. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/lb/lb type LBService struct { @@ -176,9 +234,7 @@ func (s *LBService) UnsetLBVServer() {} func (s *LBService) EnableLBVServer() {} func (s *LBService) DisableLBVServer() {} func (s *LBService) GetAllLBVServer() ([]models.LBVServer, error) { - u := "nitro/v1/config/lbvserver" - - req, err := s.client.NewRequest(http.MethodGet, u, nil) + req, err := s.client.NewRequest(http.MethodGet, lbVServerURL, nil) if err != nil { return nil, err } @@ -319,7 +375,7 @@ func (s *LBService) CountLBVServerRewritePolicyBinding() {} // lbvserver_servicegroupmember_binding func (s *LBService) GetAllLBVServerServiceGroupMemberBinding() {} func (s *LBService) GetLBVServerServiceGroupMemberBinding(lbvserver string) ([]models.LBVServerServiceGroupMemberBinding, error) { - u := fmt.Sprintf("nitro/v1/config/lbvserver_servicegroupmember_binding/%s", lbvserver) + u := fmt.Sprintf("%s/%s", lbVServerServiceGroupMemberBindingURL, lbvserver) req, err := s.client.NewRequest(http.MethodGet, u, nil) if err != nil { diff --git a/nitrogo/lldp.go b/nitrogo/lldp.go index 8b63e0f..1c4013f 100644 --- a/nitrogo/lldp.go +++ b/nitrogo/lldp.go @@ -1,5 +1,10 @@ package nitrogo +const ( + lldpNeighborsURL = "/nitro/v1/config/lldpneighbors" + lldpParamURL = "/nitro/v1/config/lldpparam" +) + // Link Layer Discovery Protocol. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/lldp/lldp type LLDPService struct { diff --git a/nitrogo/lsn.go b/nitrogo/lsn.go index c3e0b94..6b4625b 100644 --- a/nitrogo/lsn.go +++ b/nitrogo/lsn.go @@ -1,5 +1,50 @@ package nitrogo +const ( + lsnAppsAttributesURL = "/nitro/v1/config/lsnappsattributes" + lsnAppsProfileURL = "/nitro/v1/config/lsnappsprofile" + lsnAppsProfileBindingURL = "/nitro/v1/config/lsnappsprofile_binding" + lsnAppsProfileLSNAppsAttributesBindingURL = "/nitro/v1/config/lsnappsprofile_lsnappsattributes_binding" + lsnAppsProfilePortBindingURL = "/nitro/v1/config/lsnappsprofile_port_binding" + lsnClientURL = "/nitro/v1/config/lsnclient" + lsnClientBindingURL = "/nitro/v1/config/lsnclient_binding" + lsnClientNetwork6BindingURL = "/nitro/v1/config/lsnclient_network6_binding" + lsnClientNetworkBindingURL = "/nitro/v1/config/lsnclient_network_binding" + lsnClientNSACL6BindingURL = "/nitro/v1/config/lsnclient_nsacl6_binding" + lsnClientNSACLBindingURL = "/nitro/v1/config/lsnclient_nsacl_binding" + lsnDeterministicNATURL = "/nitro/v1/config/lsndeterministicnat" + lsnGroupURL = "/nitro/v1/config/lsngroup" + lsnGroupBindingURL = "/nitro/v1/config/lsngroup_binding" + lsnGroupIPSecALGProfileBindingURL = "/nitro/v1/config/lsngroup_ipsecalgprofile_binding" + lsnGroupLSNAppsProfileBindingURL = "/nitro/v1/config/lsngroup_lsnappsprofile_binding" + lsnGroupLSNHTTPHDRLogProfileBindingURL = "/nitro/v1/config/lsngroup_lsnhttphdrlogprofile_binding" + lsnGroupLSNLogProfileBindingURL = "/nitro/v1/config/lsngroup_lsnlogprofile_binding" + lsnGroupLSNPoolBindingURL = "/nitro/v1/config/lsngroup_lsnpool_binding" + lsnGroupLSNRTSPALGProfileBindingURL = "/nitro/v1/config/lsngroup_lsnrtspalgprofile_binding" + lsnGroupLSNSIPALGProfileBindingURL = "/nitro/v1/config/lsngroup_lsnsipalgprofile_binding" + lsnGroupLSNTransportProfileBindingURL = "/nitro/v1/config/lsngroup_lsntransportprofile_binding" + lsnGroupPCPServerBindingURL = "/nitro/v1/config/lsngroup_pcpserver_binding" + lsnHTTPHDRLogProfileURL = "/nitro/v1/config/lsnhttphdrlogprofile" + lsnIP6ProfileURL = "/nitro/v1/config/lsnip6profile" + lsnLogProfileURL = "/nitro/v1/config/lsnlogprofile" + lsnParameterURL = "/nitro/v1/config/lsnparameter" + lsnPoolURL = "/nitro/v1/config/lsnpool" + lsnPoolBindingURL = "/nitro/v1/config/lsnpool_binding" + lsnPoolLSNIPBindingURL = "/nitro/v1/config/lsnpool_lsnip_binding" + lsnRTSPALGProfileURL = "/nitro/v1/config/lsnrtspalgprofile" + lsnRTSPALGSessionURL = "/nitro/v1/config/lsnrtspalgsession" + lsnRTSPALGSessionBindingURL = "/nitro/v1/config/lsnrtspalgsession_binding" + lsnRTSPALGSessionDataChannelBindingURL = "/nitro/v1/config/lsnrtspalgsession_datachannel_binding" + lsnSessionURL = "/nitro/v1/config/lsnsession" + lsnSIPALGCallURL = "/nitro/v1/config/lsnsipalgcall" + lsnSIPALGCallBindingURL = "/nitro/v1/config/lsnsipalgcall_binding" + lsnSIPALGCallControlChannelBindingURL = "/nitro/v1/config/lsnsipalgcall_controlchannel_binding" + lsnSIPALGCallDataChannelBindingURL = "/nitro/v1/config/lsnsipalgcall_datachannel_binding" + lsnSIPALGProfileURL = "/nitro/v1/config/lsnsipalgprofile" + lsnStaticURL = "/nitro/v1/config/lsnstatic" + lsnTransportProfileURL = "/nitro/v1/config/lsntransportprofile" +) + // Large Scale NAT commands type LSNService struct { client *Client diff --git a/nitrogo/models/lbmodels.go b/nitrogo/models/lbmodels.go index d165c0d..32903b6 100644 --- a/nitrogo/models/lbmodels.go +++ b/nitrogo/models/lbmodels.go @@ -35,7 +35,7 @@ type LBVServer struct { HealthThreshold string `json:"healththreshold,omitempty"` HTTPProfileName string `json:"httpprofilename,omitempty"` HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` - ICMPVSRresponse string `json:"icmpvsrresponse,omitempty"` + ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` InsertVServerIPPort string `json:"insertvserveripport,omitempty"` IPMask string `json:"ipmask,omitempty"` IPPattern string `json:"ippattern,omitempty"` @@ -113,8 +113,8 @@ type LBVServer struct { VIPHeader string `json:"vipheader,omitempty"` Weight int `json:"weight,omitempty"` - ActiveAervices string `json:"activeservices,omitempty"` - BackupvAerverAtatus string `json:"backupvserverstatus,omitempty"` + ActiveServices string `json:"activeservices,omitempty"` + BackupvServerStatus string `json:"backupvserverstatus,omitempty"` BindPoint string `json:"bindpoint,omitempty"` CacheVServer string `json:"cachevserver,omitempty"` ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` @@ -130,7 +130,7 @@ type LBVServer struct { Health string `json:"health,omitempty"` Homepage string `json:"homepage,omitempty"` IPMapping string `json:"ipmapping,omitempty"` - IsGLSB bool `json:"isgslb,omitempty"` + IsGSLB bool `json:"isgslb,omitempty"` LBRRReason int `json:"lbrrreason,omitempty"` Map string `json:"map,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` diff --git a/nitrogo/network.go b/nitrogo/network.go index 1dc9248..7ce1eb5 100644 --- a/nitrogo/network.go +++ b/nitrogo/network.go @@ -1,5 +1,119 @@ package nitrogo +const ( + appAlgParamURL = "/nitro/v1/config/appalgparam" + arpURL = "/nitro/v1/config/arp" + arpParamURL = "/nitro/v1/config/arpparam" + bridgeGroupURL = "/nitro/v1/config/bridgegroup" + bridgeGroupBindingURL = "/nitro/v1/config/bridgegroup_binding" + bridgeGroupNSIP6BindingURL = "/nitro/v1/config/bridgegroup_nsip6_binding" + bridgeGroupNSIPBindingURL = "/nitro/v1/config/bridgegroup_nsip_binding" + bridgeGroupVLANBindingURL = "/nitro/v1/config/bridgegroup_vlan_binding" + bridgeGroupVXLANBindingURL = "/nitro/v1/config/bridgegroup_vxlan_binding" + bridgeTableURL = "/nitro/v1/config/bridgetable" + channelURL = "/nitro/v1/config/channel" + channelBindingURL = "/nitro/v1/config/channel_binding" + channelInterfaceBindingURL = "/nitro/v1/config/channel_interface_binding" + ciURL = "/nitro/v1/config/ci" + fisURL = "/nitro/v1/config/fis" + fisBindingURL = "/nitro/v1/config/fis_binding" + fisChannelBindingURL = "/nitro/v1/config/fis_channel_binding" + fisInterfaceBindingURL = "/nitro/v1/config/fis_interface_binding" + forwardingSessionURL = "/nitro/v1/config/forwardingsession" + inatURL = "/nitro/v1/config/inat" + inatParamURL = "/nitro/v1/config/inatparam" + interfaceURL = "/nitro/v1/config/interface" + interfaceBindingURL = "/nitro/v1/config/interface_binding" + interfacePairURL = "/nitro/v1/config/interfacepair" + ip6TunnelURL = "/nitro/v1/config/ip6tunnel" + ip6TunnelParamURL = "/nitro/v1/config/ip6tunnelparam" + ipSetURL = "/nitro/v1/config/ipset" + ipSetBindingURL = "/nitro/v1/config/ipset_binding" + ipSetNSIP6BindingURL = "/nitro/v1/config/ipset_nsip6_binding" + ipSetNSIPBindingURL = "/nitro/v1/config/ipset_nsip_binding" + ipTunnelURL = "/nitro/v1/config/iptunnel" + ipTunnelParamURL = "/nitro/v1/config/iptunnelparam" + ipv6URL = "/nitro/v1/config/ipv6" + l2ParamURL = "/nitro/v1/config/l2param" + l3ParamURL = "/nitro/v1/config/l3param" + l4ParamURL = "/nitro/v1/config/l4param" + lacpURL = "/nitro/v1/config/lacp" + linkSetURL = "/nitro/v1/config/linkset" + linkSetBindingURL = "/nitro/v1/config/linkset_binding" + linkSetChannelBindingURL = "/nitro/v1/config/linkset_channel_binding" + linkSetInterfaceBindingURL = "/nitro/v1/config/linkset_interface_binding" + mapBMRURL = "/nitro/v1/config/mapbmr" + mapBMRBindingURL = "/nitro/v1/config/mapbmr_binding" + mapBMRBMRV4NetworkBindingURL = "/nitro/v1/config/mapbmr_bmrv4network_binding" + mapDMRURL = "/nitro/v1/config/mapdmr" + mapDomainURL = "/nitro/v1/config/mapdomain" + mapDomainBindingURL = "/nitro/v1/config/mapdomain_binding" + mapDomainMapBMRBindingURL = "/nitro/v1/config/mapdomain_mapbmr_binding" + nat64URL = "/nitro/v1/config/nat64" + nat64ParamURL = "/nitro/v1/config/nat64param" + nd6URL = "/nitro/v1/config/nd6" + nd6RAVariablesURL = "/nitro/v1/config/nd6ravariables" + nd6RAVariablesBindingURL = "/nitro/v1/config/nd6ravariables_binding" + nd6RAVariablesOnLinkIPV6PrefixBindingURL = "/nitro/v1/config/nd6ravariables_onlinkipv6prefix_binding" + netBridgeURL = "/nitro/v1/config/netbridge" + netBridgeBindingURL = "/nitro/v1/config/netbridge_binding" + netBridgeIPTunnelBindingURL = "/nitro/v1/config/netbridge_iptunnel_binding" + netBridgeNSIP6BindingURL = "/nitro/v1/config/netbridge_nsip6_binding" + netBridgeNSIPBindingURL = "/nitro/v1/config/netbridge_nsip_binding" + netBridgeVLANBindingURL = "/nitro/v1/config/netbridge_vlan_binding" + netProfileURL = "/nitro/v1/config/netprofile" + netProfileBindingURL = "/nitro/v1/config/netprofile_binding" + netProfileNATRuleBindingURL = "/nitro/v1/config/netprofile_natrule_binding" + netProfileSrcPortSetBindingURL = "/nitro/v1/config/netprofile_srcportset_binding" + onLinkIPV6PrefixURL = "/nitro/v1/config/onlinkipv6prefix" + ptpURL = "/nitro/v1/config/ptp" + rnatURL = "/nitro/v1/config/rnat" + rnatBindingURL = "/nitro/v1/config/rnat_binding" + rnatNSIPBindingURL = "/nitro/v1/config/rnat_nsip_binding" + rnatRetainSourcePortSetBindingURL = "/nitro/v1/config/rnat_retainsourceportset_binding" + rnat6URL = "/nitro/v1/config/rnat6" + rnat6BindingURL = "/nitro/v1/config/rnat6_binding" + rnat6NSIP6BindingURL = "/nitro/v1/config/rnat6_nsip6_binding" + rnatGlobalBindingURL = "/nitro/v1/config/rnatglobal_binding" + rnatGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/rnatglobal_auditsyslogpolicy_binding" + rnatParamURL = "/nitro/v1/config/rnatparam" + rnatSessionURL = "/nitro/v1/config/rnatsession" + routeURL = "/nitro/v1/config/route" + route6URL = "/nitro/v1/config/route6" + rssKeyTypeURL = "/nitro/v1/config/rsskeytype" + vlanURL = "/nitro/v1/config/vlan" + vlanBindingURL = "/nitro/v1/config/vlan_binding" + vlanChannelBindingURL = "/nitro/v1/config/vlan_channel_binding" + vlanInterfaceBindingURL = "/nitro/v1/config/vlan_interface_binding" + vlanLinkSetBindingURL = "/nitro/v1/config/vlan_linkset_binding" + vlanNSIP6BindingURL = "/nitro/v1/config/vlan_nsip6_binding" + vlanNSIPBindingURL = "/nitro/v1/config/vlan_nsip_binding" + vrIDURL = "/nitro/v1/config/vrid" + vrIDBindingURL = "/nitro/v1/config/vrid_binding" + vrIDChannelBindingURL = "/nitro/v1/config/vrid_channel_binding" + vrIDInterfaceBindingURL = "/nitro/v1/config/vrid_interface_binding" + vrIDNSIP6BindingURL = "/nitro/v1/config/vrid_nsip6_binding" + vrIDNSIPBindingURL = "/nitro/v1/config/vrid_nsip_binding" + vrIDTrackInterfaceBindingURL = "/nitro/v1/config/vrid_trackinterface_binding" + vrID6URL = "/nitro/v1/config/vrid6" + vrID6BindingURL = "/nitro/v1/config/vrid6_binding" + vrID6ChannelBindingURL = "/nitro/v1/config/vrid6_channel_binding" + vrID6InterfaceBindingURL = "/nitro/v1/config/vrid6_interface_binding" + vrID6NSIP6BindingURL = "/nitro/v1/config/vrid6_nsip6_binding" + vrID6NSIPBindingURL = "/nitro/v1/config/vrid6_nsip_binding" + vrID6TrackInterfaceBindingURL = "/nitro/v1/config/vrid6_trackinterface_binding" + vrIDParamURL = "/nitro/v1/config/vridparam" + vxlanURL = "/nitro/v1/config/vxlan" + vxlanBindingURL = "/nitro/v1/config/vxlan_binding" + vxlanIPTunnelBindingURL = "/nitro/v1/config/vxlan_iptunnel_binding" + vxlanNSIP6BindingURL = "/nitro/v1/config/vxlan_nsip6_binding" + vxlanNSIPBindingURL = "/nitro/v1/config/vxlan_nsip_binding" + vxlanSrcIPBindingURL = "/nitro/v1/config/vxlan_srcip_binding" + vxlanVLANMapURL = "/nitro/v1/config/vxlanvlanmap" + vxlanVLANMapBindingURL = "/nitro/v1/config/vxlanvlanmap_binding" + vxlanVLANMapVXLANBindingURL = "/nitro/v1/config/vxlanvlanmap_vxlan_binding" +) + type NetworkService struct { client *Client } diff --git a/nitrogo/ns.go b/nitrogo/ns.go index f4fe6d2..43e1a9e 100644 --- a/nitrogo/ns.go +++ b/nitrogo/ns.go @@ -1,5 +1,74 @@ package nitrogo +const ( + nsACLURL = "/nitro/v1/config/nsacl" + nsACL6URL = "/nitro/v1/config/nsacl6" + nsAppFlowCollectorURL = "/nitro/v1/config/nsappflowcollector" + nsAppFlowParamURL = "/nitro/v1/config/nsappflowparam" + nsCapacityURL = "/nitro/v1/config/nscapacity" + nsConfigURL = "/nitro/v1/config/nsconfig" + nsConnectionTableURL = "/nitro/v1/config/nsconnectiontable" + nsConsoleLoginPromptURL = "/nitro/v1/config/nsconsoleloginprompt" + nsDHCPParamsURL = "/nitro/v1/config/nsdhcpparams" + nsDialogURL = "/nitro/v1/config/nsdialog" + nsEncryptionParamsURL = "/nitro/v1/config/nsencryptionparams" + nsEventsURL = "/nitro/v1/config/nsevents" + nsExtensionURL = "/nitro/v1/config/nsextension" + nsExtensionBindingURL = "/nitro/v1/config/nsextension_binding" + nsExtensionExtensionFunctionBindingURL = "/nitro/v1/config/nsextension_extensionfunction_binding" + nsFeatureURL = "/nitro/v1/config/nsfeature" + nsHardwareURL = "/nitro/v1/config/nshardware" + nsHostNameURL = "/nitro/v1/config/nshostname" + nsHTTPParamURL = "/nitro/v1/config/nshttpparam" + nsHTTPProfileURL = "/nitro/v1/config/nshttpprofile" + nsICAPProfileURL = "/nitro/v1/config/nsicapprofile" + nsIPURL = "/nitro/v1/config/nsip" + nsIP6URL = "/nitro/v1/config/nsip6" + nsLicenseURL = "/nitro/v1/config/nslicense" + nsLicenseParametersURL = "/nitro/v1/config/nslicenseparameters" + nsLicenseServerURL = "/nitro/v1/config/nslicenseserver" + nsLimitIdentifierURL = "/nitro/v1/config/nslimitidentifier" + nsLimitSelectorURL = "/nitro/v1/config/nslimitselector" + nsLimitSessionsURL = "/nitro/v1/config/nslimitsessions" + nsLogActionURL = "/nitro/v1/config/nslogaction" + nsLogGlobalBindingURL = "/nitro/v1/config/nslogglobal_binding" + nsLogGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/nslogglobal_auditnslogpolicy_binding" + nsLogParamsURL = "/nitro/v1/config/nslogparams" + nsLogPolicyURL = "/nitro/v1/config/nslogpolicy" + nsLogPolicyBindingURL = "/nitro/v1/config/nslogpolicy_binding" + nsModeURL = "/nitro/v1/config/nsmode" + nsParamURL = "/nitro/v1/config/nsparam" + nsPartitionURL = "/nitro/v1/config/nspartition" + nsPartitionBindingURL = "/nitro/v1/config/nspartition_binding" + nsPartitionBridgeGroupBindingURL = "/nitro/v1/config/nspartition_bridgegroup_binding" + nsPartitionVLANBindingURL = "/nitro/v1/config/nspartition_vlan_binding" + nsPartitionVXLANBindingURL = "/nitro/v1/config/nspartition_vxlan_binding" + nsRateControlURL = "/nitro/v1/config/nsratecontrol" + nsRPCNodeURL = "/nitro/v1/config/nsrpcnode" + nsRunningConfigURL = "/nitro/v1/config/nsrunningconfig" + nsSavedConfigURL = "/nitro/v1/config/nssavedconfig" + nsServicePathURL = "/nitro/v1/config/nsservicepath" + nsSimpleACLURL = "/nitro/v1/config/nssimpleacl" + nsSimpleACL6URL = "/nitro/v1/config/nssimpleacl6" + nsSPParamsURL = "/nitro/v1/config/nsspparams" + nsSurgeProtectionURL = "/nitro/v1/config/nssurgeprotection" + nsTCPBufParamURL = "/nitro/v1/config/nstcpbufparam" + nsTCPParamURL = "/nitro/v1/config/nstcpparam" + nsTCPProfileURL = "/nitro/v1/config/nstcpprofile" + nsTimeoutURL = "/nitro/v1/config/nstimeout" + nsTimerURL = "/nitro/v1/config/nstimer" + nsTrafficDomainURL = "/nitro/v1/config/nstrafficdomain" + nsTrafficDomainBindingURL = "/nitro/v1/config/nstrafficdomain_binding" + nsTrafficDomainBridgeGroupBindingURL = "/nitro/v1/config/nstrafficdomain_bridgegroup_binding" + nsTrafficDomainVLANBindingURL = "/nitro/v1/config/nstrafficdomain_vlan_binding" + nsTrafficDomainVXLANBindingURL = "/nitro/v1/config/nstrafficdomain_vxlan_binding" + nsVariableURL = "/nitro/v1/config/nsvariable" + nsVersionURL = "/nitro/v1/config/nsversion" + nsWebLogParamURL = "/nitro/v1/config/nsweblogparam" + nsXMLNamespaceURL = "/nitro/v1/config/nsxmlnamespace" + nsXMLSchemaURL = "/nitro/v1/config/nsxmlschema" +) + // ns // System/Global level configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ns/ns diff --git a/nitrogo/ntp.go b/nitrogo/ntp.go index a552e8b..94efdc4 100644 --- a/nitrogo/ntp.go +++ b/nitrogo/ntp.go @@ -1,5 +1,12 @@ package nitrogo +const ( + ntpParamURL = "/nitro/v1/config/ntpparam" + ntpServerURL = "/nitro/v1/config/ntpserver" + ntpStatusURL = "/nitro/v1/config/ntpstatus" + ntpSyncURL = "/nitro/v1/config/ntpsync" +) + // NTP configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ntp/ntp type NTPService struct { diff --git a/nitrogo/pcp.go b/nitrogo/pcp.go index f29d3aa..2af6daf 100644 --- a/nitrogo/pcp.go +++ b/nitrogo/pcp.go @@ -1,5 +1,11 @@ package nitrogo +const ( + pcpMapURL = "/nitro/v1/config/pcpmap" + pcpProfileURL = "/nitro/v1/config/pcpprofile" + pcpServerURL = "/nitro/v1/config/pcpserver" +) + // Port Control Protocol Configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/pcp/pcp type PCPService struct { diff --git a/nitrogo/policy.go b/nitrogo/policy.go index 680cad0..c576331 100644 --- a/nitrogo/policy.go +++ b/nitrogo/policy.go @@ -1,5 +1,23 @@ package nitrogo +const ( + policyDatasetURL = "/nitro/v1/config/policydataset" + policyDatasetBindingURL = "/nitro/v1/config/policydataset_binding" + policyDatasetValueBindingURL = "/nitro/v1/config/policydataset_value_binding" + policyEvaluationURL = "/nitro/v1/config/policyevaluation" + policyExpressionURL = "/nitro/v1/config/policyexpression" + policyHTTPCalloutURL = "/nitro/v1/config/policyhttpcallout" + policyMapURL = "/nitro/v1/config/policymap" + policyParamURL = "/nitro/v1/config/policyparam" + policyPATSetURL = "/nitro/v1/config/policypatset" + policyPATSetBindingURL = "/nitro/v1/config/policypatset_binding" + policyPATSetPatternBindingURL = "/nitro/v1/config/policypatset_pattern_binding" + policyStringMapURL = "/nitro/v1/config/policystringmap" + policyStringMapBindingURL = "/nitro/v1/config/policystringmap_binding" + policyStringMapPatternBindingURL = "/nitro/v1/config/policystringmap_pattern_binding" + policyURLSetURL = "/nitro/v1/config/policyurlset" +) + // Policy configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/policy/policy type PolicyService struct { diff --git a/nitrogo/protocol.go b/nitrogo/protocol.go index f0e26da..a7f1337 100644 --- a/nitrogo/protocol.go +++ b/nitrogo/protocol.go @@ -1,5 +1,9 @@ package nitrogo +const ( + protocolHTTPBandURL = "/nitro/v1/config/protocolhttpband" +) + // Protocol Configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/protocol/protocol type ProtocolService struct { diff --git a/nitrogo/rdp.go b/nitrogo/rdp.go index 7e07af1..0d41c7b 100644 --- a/nitrogo/rdp.go +++ b/nitrogo/rdp.go @@ -1,5 +1,11 @@ package nitrogo +const ( + rdpClientProfileURL = "/nitro/v1/config/rdpclientprofile" + rdpConnectionsURL = "/nitro/v1/config/rdpconnections" + rdpServerProfileURL = "/nitro/v1/config/rdpserverprofile" +) + // RDP configuration // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/rdp/rdp type RDPService struct { diff --git a/nitrogo/reputation.go b/nitrogo/reputation.go index 6aa58c8..435e80a 100644 --- a/nitrogo/reputation.go +++ b/nitrogo/reputation.go @@ -1,5 +1,9 @@ package nitrogo +const ( + reputationSettingsURL = "/nitro/v1/config/reputationsettings" +) + // Reputation services configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/reputation/reputation type ReputationService struct { diff --git a/nitrogo/responder.go b/nitrogo/responder.go index f8a63e6..66fdb47 100644 --- a/nitrogo/responder.go +++ b/nitrogo/responder.go @@ -1,5 +1,25 @@ package nitrogo +const ( + responderActionURL = "/nitro/v1/config/responderaction" + responderGlobalBindingURL = "/nitro/v1/config/responderglobal_binding" + responderGlobalResponderPolicyBindingURL = "/nitro/v1/config/responderglobal_responderpolicy_binding" + responderHTMLPageURL = "/nitro/v1/config/responderhtmlpage" + responderParamURL = "/nitro/v1/config/responderparam" + responderPolicyURL = "/nitro/v1/config/responderpolicy" + responderPolicyLabelURL = "/nitro/v1/config/responderpolicylabel" + responderPolicyLabelBindingURL = "/nitro/v1/config/responderpolicylabel_binding" + responderPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/responderpolicylabel_policybinding_binding" + responderPolicyLabelResponderPolicyBindingURL = "/nitro/v1/config/responderpolicylabel_responderpolicy_binding" + responderPolicyBindingURL = "/nitro/v1/config/responderpolicy_binding" + responderPolicyCRVServerBindingURL = "/nitro/v1/config/responderpolicy_crvserver_binding" + responderPolicyCSVServerBindingURL = "/nitro/v1/config/responderpolicy_csvserver_binding" + responderPolicyLBVServerBindingURL = "/nitro/v1/config/responderpolicy_lbvserver_binding" + responderPolicyResponderGlobalBindingURL = "/nitro/v1/config/responderpolicy_responderglobal_binding" + responderPolicyResponderPolicyLabelBindingURL = "/nitro/v1/config/responderpolicy_responderpolicylabel_binding" + responderPolicyVPNVServerBindingURL = "/nitro/v1/config/responderpolicy_vpnvserver_binding" +) + // Responder configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/responder/responder type ResponderService struct { diff --git a/nitrogo/rewrite.go b/nitrogo/rewrite.go index a43d4be..9b52677 100644 --- a/nitrogo/rewrite.go +++ b/nitrogo/rewrite.go @@ -1,5 +1,23 @@ package nitrogo +const ( + rewriteActionURL = "/nitro/v1/config/rewriteaction" + rewriteGlobalBindingURL = "/nitro/v1/config/rewriteglobal_binding" + rewriteGlobalRewritePolicyBindingURL = "/nitro/v1/config/rewriteglobal_rewritepolicy_binding" + rewriteParamURL = "/nitro/v1/config/rewriteparam" + rewritePolicyURL = "/nitro/v1/config/rewritepolicy" + rewritePolicyLabelURL = "/nitro/v1/config/rewritepolicylabel" + rewritePolicyLabelBindingURL = "/nitro/v1/config/rewritepolicylabel_binding" + rewritePolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/rewritepolicylabel_policybinding_binding" + rewritePolicyLabelRewritePolicyBindingURL = "/nitro/v1/config/rewritepolicylabel_rewritepolicy_binding" + rewritePolicyBindingURL = "/nitro/v1/config/rewritepolicy_binding" + rewritePolicyCSVServerBindingURL = "/nitro/v1/config/rewritepolicy_csvserver_binding" + rewritePolicyLBVServerBindingURL = "/nitro/v1/config/rewritepolicy_lbvserver_binding" + rewritePolicyRewriteGlobalBindingURL = "/nitro/v1/config/rewritepolicy_rewriteglobal_binding" + rewritePolicyRewritePolicyLabelBindingURL = "/nitro/v1/config/rewritepolicy_rewritepolicylabel_binding" + rewritePolicyVPNVServerBindingURL = "/nitro/v1/config/rewritepolicy_vpnvserver_binding" +) + // Rewrite configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/rewrite/rewrite type RewriteService struct { diff --git a/nitrogo/router.go b/nitrogo/router.go index 087dcdb..d57920d 100644 --- a/nitrogo/router.go +++ b/nitrogo/router.go @@ -1,5 +1,9 @@ package nitrogo +const ( + routerDynamicRoutingURL = "/nitro/v1/config/routerdynamicrouting" +) + // Router configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/router/router type RouterService struct { diff --git a/nitrogo/smpp.go b/nitrogo/smpp.go index ea3eb5f..71f0c7c 100644 --- a/nitrogo/smpp.go +++ b/nitrogo/smpp.go @@ -1,5 +1,10 @@ package nitrogo +const ( + smppParamURL = "/nitro/v1/config/smppparam" + smppUserURL = "/nitro/v1/config/smppuser" +) + // All the commands associated with SMPP. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/smpp/smpp type SMPPService struct { diff --git a/nitrogo/snmp.go b/nitrogo/snmp.go index 35e31d0..7fc0ac8 100644 --- a/nitrogo/snmp.go +++ b/nitrogo/snmp.go @@ -1,5 +1,21 @@ package nitrogo +const ( + snmpAlarmURL = "/nitro/v1/config/snmpalarm" + snmpCommunityURL = "/nitro/v1/config/snmpcommunity" + snmpEngineIdURL = "/nitro/v1/config/snmpengineid" + snmpGroupURL = "/nitro/v1/config/snmpgroup" + snmpManagerURL = "/nitro/v1/config/snmpmanager" + snmpMIBURL = "/nitro/v1/config/snmpmib" + snmpOIDURL = "/nitro/v1/config/snmpoid" + snmpOptionURL = "/nitro/v1/config/snmpoption" + snmpTrapURL = "/nitro/v1/config/snmptrap" + snmpTrapBindingURL = "/nitro/v1/config/snmptrap_binding" + snmpTrapSNMPUserBindingURL = "/nitro/v1/config/snmptrap_snmpuser_binding" + snmpUserURL = "/nitro/v1/config/snmpuser" + snmpViewURL = "/nitro/v1/config/snmpview" +) + // SNMP(Simple Network Management Protocol) configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/snmp/snmp type SNMPService struct { diff --git a/nitrogo/spillover.go b/nitrogo/spillover.go index acf7e95..9b7c316 100644 --- a/nitrogo/spillover.go +++ b/nitrogo/spillover.go @@ -1,5 +1,14 @@ package nitrogo +const ( + spilloverActionURL = "/nitro/v1/config/spilloveraction" + spilloverPolicyURL = "/nitro/v1/config/spilloverpolicy" + spilloverPolicyBindingURL = "/nitro/v1/config/spilloverpolicy_binding" + spilloverPolicyCSVServerBindingURL = "/nitro/v1/config/spilloverpolicy_csvserver_binding" + spilloverPolicyGSLBVServerBindingURL = "/nitro/v1/config/spilloverpolicy_gslbvserver_binding" + spilloverPolicyLBVServerBindingURL = "/nitro/v1/config/spilloverpolicy_lbvserver_binding" +) + // Spillover policies and actions. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spillover type SpilloverService struct { diff --git a/nitrogo/ssl.go b/nitrogo/ssl.go index aab6180..1912231 100644 --- a/nitrogo/ssl.go +++ b/nitrogo/ssl.go @@ -1,5 +1,98 @@ package nitrogo +const ( + sslActionURL = "/nitro/v1/config/sslaction" + sslCACertGroupURL = "/nitro/v1/config/sslcacertgroup" + sslCACertGroupBindingURL = "/nitro/v1/config/sslcacertgroup_binding" + sslCACertGroupSSLCertKeyBindingURL = "/nitro/v1/config/sslcacertgroup_sslcertkey_binding" + sslCertURL = "/nitro/v1/config/sslcert" + sslCertBundleURL = "/nitro/v1/config/sslcertbundle" + sslCertChainURL = "/nitro/v1/config/sslcertchain" + sslCertChainBindingURL = "/nitro/v1/config/sslcertchain_binding" + sslCertChainSSLCertKeyBindingURL = "/nitro/v1/config/sslcertchain_sslcertkey_binding" + sslCertFileURL = "/nitro/v1/config/sslcertfile" + sslCertificateChainURL = "/nitro/v1/config/sslcertificatechain" + sslCertKeyURL = "/nitro/v1/config/sslcertkey" + sslCertKeyBindingURL = "/nitro/v1/config/sslcertkey_binding" + sslCertKeyCRLDistributionBindingURL = "/nitro/v1/config/sslcertkey_crldistribution_binding" + sslCertKeyServiceBindingURL = "/nitro/v1/config/sslcertkey_service_binding" + sslCertKeySSLOCSPResponderBindingURL = "/nitro/v1/config/sslcertkey_sslocspresponder_binding" + sslCertKeySSLProfileBindingURL = "/nitro/v1/config/sslcertkey_sslprofile_binding" + sslCertKeySSLVServerBindingURL = "/nitro/v1/config/sslcertkey_sslvserver_binding" + sslCertLinkURL = "/nitro/v1/config/sslcertlink" + sslCertReqURL = "/nitro/v1/config/sslcertreq" + sslCipherURL = "/nitro/v1/config/sslcipher" + sslCipherSuiteURL = "/nitro/v1/config/sslciphersuite" + sslCipherBindingURL = "/nitro/v1/config/sslcipher_binding" + sslCipherIndividualCipherBindingURL = "/nitro/v1/config/sslcipher_individualcipher_binding" + sslCipherServiceGroupBindingURL = "/nitro/v1/config/sslcipher_servicegroup_binding" + sslCipherServiceBindingURL = "/nitro/v1/config/sslcipher_service_binding" + sslCipherSSLCipherSuiteBindingURL = "/nitro/v1/config/sslcipher_sslciphersuite_binding" + sslCipherSSLProfileBindingURL = "/nitro/v1/config/sslcipher_sslprofile_binding" + sslCipherSSLVServerBindingURL = "/nitro/v1/config/sslcipher_sslvserver_binding" + sslCRLURL = "/nitro/v1/config/sslcrl" + sslCRLFileURL = "/nitro/v1/config/sslcrlfile" + sslCRLBindingURL = "/nitro/v1/config/sslcrl_binding" + sslCRLSerialNumberBindingURL = "/nitro/v1/config/sslcrl_serialnumber_binding" + sslDHFileURL = "/nitro/v1/config/ssldhfile" + sslDHParamURL = "/nitro/v1/config/ssldhparam" + sslDTLSProfileURL = "/nitro/v1/config/ssldtlsprofile" + sslECDSAKeyURL = "/nitro/v1/config/sslecdsakey" + sslFIPSURL = "/nitro/v1/config/sslfips" + sslFIPSKeyURL = "/nitro/v1/config/sslfipskey" + sslFIPSSIMSourceURL = "/nitro/v1/config/sslfipssimsource" + sslFIPSSIMTargetURL = "/nitro/v1/config/sslfipssimtarget" + sslGlobalBindingURL = "/nitro/v1/config/sslglobal_binding" + sslGlobalSSLPolicyBindingURL = "/nitro/v1/config/sslglobal_sslpolicy_binding" + sslHSMKeyURL = "/nitro/v1/config/sslhsmkey" + sslKeyFileURL = "/nitro/v1/config/sslkeyfile" + sslLogProfileURL = "/nitro/v1/config/ssllogprofile" + sslOCSPResponderURL = "/nitro/v1/config/sslocspresponder" + sslParameterURL = "/nitro/v1/config/sslparameter" + sslPKCS12URL = "/nitro/v1/config/sslpkcs12" + sslPKCS8URL = "/nitro/v1/config/sslpkcs8" + sslPolicyURL = "/nitro/v1/config/sslpolicy" + sslPolicyLabelURL = "/nitro/v1/config/sslpolicylabel" + sslPolicyLabelBindingURL = "/nitro/v1/config/sslpolicylabel_binding" + sslPolicyLabelSSLPolicyBindingURL = "/nitro/v1/config/sslpolicylabel_sslpolicy_binding" + sslPolicyBindingURL = "/nitro/v1/config/sslpolicy_binding" + sslPolicyCSVServerBindingURL = "/nitro/v1/config/sslpolicy_csvserver_binding" + sslPolicyLBVServerBindingURL = "/nitro/v1/config/sslpolicy_lbvserver_binding" + sslPolicySSLGlobalBindingURL = "/nitro/v1/config/sslpolicy_sslglobal_binding" + sslPolicySSLPolicyLabelBindingURL = "/nitro/v1/config/sslpolicy_sslpolicylabel_binding" + sslPolicySSLServiceBindingURL = "/nitro/v1/config/sslpolicy_sslservice_binding" + sslPolicySSLVServerBindingURL = "/nitro/v1/config/sslpolicy_sslvserver_binding" + sslProfileURL = "/nitro/v1/config/sslprofile" + sslProfileBindingURL = "/nitro/v1/config/sslprofile_binding" + sslProfileECCCurveBindingURL = "/nitro/v1/config/sslprofile_ecccurve_binding" + sslProfileSSLCertKeyBindingURL = "/nitro/v1/config/sslprofile_sslcertkey_binding" + sslProfileSSLCipherSuiteBindingURL = "/nitro/v1/config/sslprofile_sslciphersuite_binding" + sslProfileSSLCipherBindingURL = "/nitro/v1/config/sslprofile_sslcipher_binding" + sslProfileSSLVServerBindingURL = "/nitro/v1/config/sslprofile_sslvserver_binding" + sslRSAKeyURL = "/nitro/v1/config/sslrsakey" + sslServiceURL = "/nitro/v1/config/sslservice" + sslServiceGroupURL = "/nitro/v1/config/sslservicegroup" + sslServiceGroupBindingURL = "/nitro/v1/config/sslservicegroup_binding" + sslServiceGroupECCCurveBindingURL = "/nitro/v1/config/sslservicegroup_ecccurve_binding" + sslServiceGroupSSLCertKeyBindingURL = "/nitro/v1/config/sslservicegroup_sslcertkey_binding" + sslServiceGroupSSLCipherSuiteBindingURL = "/nitro/v1/config/sslservicegroup_sslciphersuite_binding" + sslServiceGroupSSLCipherBindingURL = "/nitro/v1/config/sslservicegroup_sslcipher_binding" + sslServiceBindingURL = "/nitro/v1/config/sslservice_binding" + sslServiceECCCurveBindingURL = "/nitro/v1/config/sslservice_ecccurve_binding" + sslServiceSSLCertKeyBindingURL = "/nitro/v1/config/sslservice_sslcertkey_binding" + sslServiceSSLCipherSuiteBindingURL = "/nitro/v1/config/sslservice_sslciphersuite_binding" + sslServiceSSLCipherBindingURL = "/nitro/v1/config/sslservice_sslcipher_binding" + sslServiceSSLPolicyBindingURL = "/nitro/v1/config/sslservice_sslpolicy_binding" + sslVServerURL = "/nitro/v1/config/sslvserver" + sslVServerBindingURL = "/nitro/v1/config/sslvserver_binding" + sslVServerECCCurveBindingURL = "/nitro/v1/config/sslvserver_ecccurve_binding" + sslVServerSSLCertKeyBindingURL = "/nitro/v1/config/sslvserver_sslcertkey_binding" + sslVServerSSLCipherSuiteBindingURL = "/nitro/v1/config/sslvserver_sslciphersuite_binding" + sslVServerSSLCipherBindingURL = "/nitro/v1/config/sslvserver_sslcipher_binding" + sslVServerSSLPolicyBindingURL = "/nitro/v1/config/sslvserver_sslpolicy_binding" + sslWrapKeyURL = "/nitro/v1/config/sslwrapkey" +) + // SSL // SSL Configuration // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ssl/ssl diff --git a/nitrogo/stream.go b/nitrogo/stream.go index dd9cf39..ff6ef84 100644 --- a/nitrogo/stream.go +++ b/nitrogo/stream.go @@ -1,5 +1,13 @@ package nitrogo +const ( + streamIdentifierURL = "/nitro/v1/config/streamidentifier" + streamIdentifierBindingURL = "/nitro/v1/config/streamidentifier_binding" + streamIdentifierStreamSessionBindingURL = "/nitro/v1/config/streamidentifier_streamsession_binding" + streamSelectorURL = "/nitro/v1/config/streamselector" + streamSessionURL = "/nitro/v1/config/streamsession" +) + // Stream configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/stream type StreamService struct { diff --git a/nitrogo/subscriber.go b/nitrogo/subscriber.go index 54e563a..0ddcae7 100644 --- a/nitrogo/subscriber.go +++ b/nitrogo/subscriber.go @@ -1,5 +1,13 @@ package nitrogo +const ( + subscriberGxInterfaceURL = "/nitro/v1/config/subscribergxinterface" + subscriberParamURL = "/nitro/v1/config/subscriberparam" + subscriberProfileURL = "/nitro/v1/config/subscriberprofile" + subscriberRADIUSInterfaceURL = "/nitro/v1/config/subscriberradiusinterface" + subscriberSessionsURL = "/nitro/v1/config/subscribersessions" +) + // Subscriber configuration // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscriber type SubscriberService struct { @@ -30,7 +38,7 @@ func (s *SubscriberService) UnsetSubscriberProfile() {} func (s *SubscriberService) GetAllSubscriberProfile() {} func (s *SubscriberService) CountSubscriberProfile() {} -// subscriverradiusinterface +// subscriberradiusinterface // Configuration for RADIUS interface Parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscriberradiusinterface func (s *SubscriberService) UpdateSubscriberRADIUSInterface() {} diff --git a/nitrogo/system.go b/nitrogo/system.go index 1efc437..5577a27 100644 --- a/nitrogo/system.go +++ b/nitrogo/system.go @@ -8,6 +8,11 @@ import ( "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) +const ( + systemExtraMgmtCPUURL = "/nitro/v1/config/systemextramgmtcpu" + systemStatsURL = "/nitro/v1/stat/system" +) + // System // System configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/system @@ -70,9 +75,7 @@ func (s *SystemService) GetAllSystemEventHistory() {} func (s *SystemService) EnableSystemExtraMgmtCPU() {} func (s *SystemService) DisableSystemExtraMgmtCPU() {} func (s *SystemService) GetAllSystemExtraMgmtCPU() (models.SystemExtraMgmtCPU, error) { - u := "nitro/v1/config/systemextramgmtcpu" - - req, err := s.client.NewRequest(http.MethodGet, u, nil) + req, err := s.client.NewRequest(http.MethodGet, systemExtraMgmtCPUURL, nil) if err != nil { return models.SystemExtraMgmtCPU{}, err } @@ -249,9 +252,7 @@ func (s *SystemService) CountSystemUserSystemGroupBinding() {} // system func (s *SystemService) GetAllSystemStats() (models.SystemStatus, error) { - u := "nitro/v1/stat/system" - - req, err := s.client.NewRequest(http.MethodGet, u, nil) + req, err := s.client.NewRequest(http.MethodGet, systemStatsURL, nil) if err != nil { return models.SystemStatus{}, err } diff --git a/nitrogo/tm.go b/nitrogo/tm.go index 42214f6..e4e575d 100644 --- a/nitrogo/tm.go +++ b/nitrogo/tm.go @@ -1,5 +1,29 @@ package nitrogo +const ( + tmFormSSOActionURL = "/nitro/v1/config/tmformssoaction" + tmGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/tmglobal_auditnslogpolicy_binding" + tmGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/tmglobal_auditsyslogpolicy_binding" + tmGlobalBindingURL = "/nitro/v1/config/tmglobal_binding" + tmGlobalTMSessionPolicyBindingURL = "/nitro/v1/config/tmglobal_tmsessionpolicy_binding" + tmGlobalTMTrafficPolicyBindingURL = "/nitro/v1/config/tmglobal_tmtrafficpolicy_binding" + tmSAMLSSOProfileURL = "/nitro/v1/config/tmsamlssoprofile" + tmSessionActionURL = "/nitro/v1/config/tmsessionaction" + tmSessionParameterURL = "/nitro/v1/config/tmsessionparameter" + tmSessionPolicyURL = "/nitro/v1/config/tmsessionpolicy" + tmSessionPolicyAAAGroupBindingURL = "/nitro/v1/config/tmsessionpolicy_aaagroup_binding" + tmSessionPolicyAAAUserBindingURL = "/nitro/v1/config/tmsessionpolicy_aaauser_binding" + tmSessionPolicyAuthenticationVServerBindingURL = "/nitro/v1/config/tmsessionpolicy_authenticationvserver_binding" + tmSessionPolicyBindingURL = "/nitro/v1/config/tmsessionpolicy_binding" + tmSessionPolicyTMGlobalBindingURL = "/nitro/v1/config/tmsessionpolicy_tmglobal_binding" + tmTrafficActionURL = "/nitro/v1/config/tmtrafficaction" + tmTrafficPolicyURL = "/nitro/v1/config/tmtrafficpolicy" + tmTrafficPolicyBindingURL = "/nitro/v1/config/tmtrafficpolicy_binding" + tmTrafficPolicyCSVServerBindingURL = "/nitro/v1/config/tmtrafficpolicy_csvserver_binding" + tmTrafficPolicyLBVServerBindingURL = "/nitro/v1/config/tmtrafficpolicy_lbvserver_binding" + tmTrafficPolicyTMGlobalBindingURL = "/nitro/v1/config/tmtrafficpolicy_tmglobal_binding" +) + // Traffic Management // TM session/policy configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tm/tm diff --git a/nitrogo/transform.go b/nitrogo/transform.go index fd8a481..9590432 100644 --- a/nitrogo/transform.go +++ b/nitrogo/transform.go @@ -1,5 +1,24 @@ package nitrogo +const ( + transformActionURL = "/nitro/v1/config/transformaction" + transformGlobalBindingURL = "/nitro/v1/config/transformglobal_binding" + transformGlobalTransformPolicyBindingURL = "/nitro/v1/config/transformglobal_transformpolicy_binding" + transformPolicyURL = "/nitro/v1/config/transformpolicy" + transformPolicyLabelURL = "/nitro/v1/config/transformpolicylabel" + transformPolicyLabelBindingURL = "/nitro/v1/config/transformpolicylabel_binding" + transformPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/transformpolicylabel_policybinding_binding" + transformPolicyLabelTransformPolicyBindingURL = "/nitro/v1/config/transformpolicylabel_transformpolicy_binding" + transformPolicyBindingURL = "/nitro/v1/config/transformpolicy_binding" + transformPolicyCSVServerBindingURL = "/nitro/v1/config/transformpolicy_csvserver_binding" + transformPolicyLBVServerBindingURL = "/nitro/v1/config/transformpolicy_lbvserver_binding" + transformPolicyTransformGlobalBindingURL = "/nitro/v1/config/transformpolicy_transformglobal_binding" + transformPolicyTransformPolicyLabelBindingURL = "/nitro/v1/config/transformpolicy_transformpolicylabel_binding" + transformProfileURL = "/nitro/v1/config/transformprofile" + transformProfileBindingURL = "/nitro/v1/config/transformprofile_binding" + transformProfileTransformActionBindingURL = "/nitro/v1/config/transformprofile_transformaction_binding" +) + // Transform // URL Transformation configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/transform/transform diff --git a/nitrogo/tunnel.go b/nitrogo/tunnel.go index e530164..d14e0e6 100644 --- a/nitrogo/tunnel.go +++ b/nitrogo/tunnel.go @@ -1,5 +1,13 @@ package nitrogo +const ( + tunnelGlobalBindingURL = "/nitro/v1/config/tunnelglobal_binding" + tunnelGlobalTunnelTrafficPolicyBindingURL = "/nitro/v1/config/tunnelglobal_tunneltrafficpolicy_binding" + tunnelTrafficPolicyURL = "/nitro/v1/config/tunneltrafficpolicy" + tunnelTrafficPolicyBindingURL = "/nitro/v1/config/tunneltrafficpolicy_binding" + tunnelTrafficPolicyTunnelGlobalBindingURL = "/nitro/v1/config/tunneltrafficpolicy_tunnelglobal_binding" +) + // SSL VPN Tunnel Configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunnel type TunnelService struct { diff --git a/nitrogo/ulfd.go b/nitrogo/ulfd.go index ccded5d..331c9e0 100644 --- a/nitrogo/ulfd.go +++ b/nitrogo/ulfd.go @@ -1,5 +1,9 @@ package nitrogo +const ( + ulfdServerURL = "/nitro/v1/config/ulfdserver" +) + // ULFD server configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ulfd/ulfd type ULFDService struct { diff --git a/nitrogo/url_filtering.go b/nitrogo/url_filtering.go index 6276f75..c89e0c4 100644 --- a/nitrogo/url_filtering.go +++ b/nitrogo/url_filtering.go @@ -1,5 +1,12 @@ package nitrogo +const ( + urlFilteringCategoriesURL = "/nitro/v1/config/urlfilteringcategories" + urlFilteringCategorizationURL = "/nitro/v1/config/urlfilteringcategorization" + urlFilteringCategoryGroupsURL = "/nitro/v1/config/urlfilteringcategorygroups" + urlFilteringParameterURL = "/nitro/v1/config/urlfilteringparameter" +) + // URL Filtering feature is used control access to webpages based on category. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/urlfiltering/urlfiltering type URLFilteringService struct { diff --git a/nitrogo/user.go b/nitrogo/user.go index 8abd1f5..9eba3ed 100644 --- a/nitrogo/user.go +++ b/nitrogo/user.go @@ -1,5 +1,10 @@ package nitrogo +const ( + userProtocolURL = "/nitro/v1/config/userprotocol" + userVServerURL = "/nitro/v1/config/uservserver" +) + // User protocol configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/user/user type UserService struct { diff --git a/nitrogo/utility.go b/nitrogo/utility.go index 9083276..266e570 100644 --- a/nitrogo/utility.go +++ b/nitrogo/utility.go @@ -1,5 +1,16 @@ package nitrogo +const ( + callHomeURL = "/nitro/v1/config/callhome" + installURL = "/nitro/v1/config/install" + pingURL = "/nitro/v1/config/ping" + ping6URL = "/nitro/v1/config/ping6" + raidURL = "/nitro/v1/config/raid" + techSupportURL = "/nitro/v1/config/techsupport" + traceRouteURL = "/nitro/v1/config/traceroute" + traceRoute6URL = "/nitro/v1/config/traceroute6" +) + // Utilities. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/utility/utility type UtilityService struct { diff --git a/nitrogo/video_optimization.go b/nitrogo/video_optimization.go index 01dd46b..9f54484 100644 --- a/nitrogo/video_optimization.go +++ b/nitrogo/video_optimization.go @@ -1,5 +1,31 @@ package nitrogo +const ( + videoOptimizationDetectionActionURL = "/nitro/v1/config/videooptimizationdetectionaction" + videoOptimizationDetectionPolicyURL = "/nitro/v1/config/videooptimizationdetectionpolicy" + videoOptimizationDetectionPolicyLabelURL = "/nitro/v1/config/videooptimizationdetectionpolicylabel" + videoOptimizationDetectionPolicyLabelBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicylabel_binding" + videoOptimizationDetectionPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicylabel_policybinding_binding" + videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding" + videoOptimizationDetectionPolicyBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicy_binding" + videoOptimizationDetectionPolicyLBVServerBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicy_lbvserver_binding" + videoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBindingURL = "/nitro/v1/config/videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding" + videoOptimizationGlobalDetectionBindingURL = "/nitro/v1/config/videooptimizationglobaldetection_binding" + videoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBindingURL = "/nitro/v1/config/videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding" + videoOptimizationGlobalPacingBindingURL = "/nitro/v1/config/videooptimizationglobalpacing_binding" + videoOptimizationGlobalPacingVideoOptimizationPacingPolicyBindingURL = "/nitro/v1/config/videooptimizationglobalpacing_videooptimizationpacingpolicy_binding" + videoOptimizationPacingActionURL = "/nitro/v1/config/videooptimizationpacingaction" + videoOptimizationPacingPolicyURL = "/nitro/v1/config/videooptimizationpacingpolicy" + videoOptimizationPacingPolicyLabelURL = "/nitro/v1/config/videooptimizationpacingpolicylabel" + videoOptimizationPacingPolicyLabelBindingURL = "/nitro/v1/config/videooptimizationpacingpolicylabel_binding" + videoOptimizationPacingPolicyLabelPolicyBindingBindingURL = "/nitro/v1/config/videooptimizationpacingpolicylabel_policybinding_binding" + videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL = "/nitro/v1/config/videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding" + videoOptimizationPacingPolicyBindingURL = "/nitro/v1/config/videooptimizationpacingpolicy_binding" + videoOptimizationPacingPolicyLBVServerBindingURL = "/nitro/v1/config/videooptimizationpacingpolicy_lbvserver_binding" + videoOptimizationPacingPolicyVideoOptimizationGlobalPacingBindingURL = "/nitro/v1/config/videooptimizationpacingpolicy_videooptimizationglobalpacing_binding" + videoOptimizationParameterURL = "/nitro/v1/config/videooptimizationparameter" +) + // VideoOptimization // Video optimization feature is used to show (i) the stats of different media types that are being served by the Citrix ADC and (ii) the details of optimization applied on ABR videos // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/videooptimization/videooptimization diff --git a/nitrogo/vpn.go b/nitrogo/vpn.go index 03389a9..3582784 100644 --- a/nitrogo/vpn.go +++ b/nitrogo/vpn.go @@ -1,5 +1,136 @@ package nitrogo +const ( + vpnAlwaysOnProfileURL = "/nitro/v1/config/vpnalwaysonprofile" + vpnClientlessAccessPolicyURL = "/nitro/v1/config/vpnclientlessaccesspolicy" + vpnClientlessAccessPolicyBindingURL = "/nitro/v1/config/vpnclientlessaccesspolicy_binding" + vpnClientlessAccessPolicyVPNGlobalBindingURL = "/nitro/v1/config/vpnclientlessaccesspolicy_vpnglobal_binding" + vpnClientlessAccessPolicyVPNVServerBindingURL = "/nitro/v1/config/vpnclientlessaccesspolicy_vpnvserver_binding" + vpnClientlessAccessProfileURL = "/nitro/v1/config/vpnclientlessaccessprofile" + vpnEPAProfileURL = "/nitro/v1/config/vpnepaprofile" + vpnEULAURL = "/nitro/v1/config/vpneula" + vpnFormSSOActionURL = "/nitro/v1/config/vpnformssoaction" + vpnFormSSOProfileURL = "/nitro/v1/config/vpnformssoprofile" + vpnGlobalBindingURL = "/nitro/v1/config/vpnglobal_binding" + vpnGlobalAppControllerBindingURL = "/nitro/v1/config/vpnglobal_appcontroller_binding" + vpnGlobalAppFlowPolicyBindingURL = "/nitro/v1/config/vpnglobal_appflowpolicy_binding" + vpnGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/vpnglobal_auditnslogpolicy_binding" + vpnGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/vpnglobal_auditsyslogpolicy_binding" + vpnGlobalAuthenticationCertPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationcertpolicy_binding" + vpnGlobalAuthenticationLDAPPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationldappolicy_binding" + vpnGlobalAuthenticationLocalPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationlocalpolicy_binding" + vpnGlobalAuthenticationNegotiatePolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationnegotiatepolicy_binding" + vpnGlobalAuthenticationPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationpolicy_binding" + vpnGlobalAuthenticationRADIUSPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationradiuspolicy_binding" + vpnGlobalAuthenticationSAMLPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationsamlpolicy_binding" + vpnGlobalAuthenticationTACACSPolicyBindingURL = "/nitro/v1/config/vpnglobal_authenticationtacacspolicy_binding" + vpnGlobalDomainBindingURL = "/nitro/v1/config/vpnglobal_domain_binding" + vpnGlobalIntranetIP6BindingURL = "/nitro/v1/config/vpnglobal_intranetip6_binding" + vpnGlobalIntranetIPBindingURL = "/nitro/v1/config/vpnglobal_intranetip_binding" + vpnGlobalShareFileServerBindingURL = "/nitro/v1/config/vpnglobal_sharefileserver_binding" + vpnGlobalSSLCertKeyBindingURL = "/nitro/v1/config/vpnglobal_sslcertkey_binding" + vpnGlobalSTAServerBindingURL = "/nitro/v1/config/vpnglobal_staserver_binding" + vpnGlobalVPNClientlessAccessPolicyBindingURL = "/nitro/v1/config/vpnglobal_vpnclientlessaccesspolicy_binding" + vpnGlobalVPNEULABindingURL = "/nitro/v1/config/vpnglobal_vpneula_binding" + vpnGlobalVPNIntranetApplicationBindingURL = "/nitro/v1/config/vpnglobal_vpnintranetapplication_binding" + vpnGlobalVPNNextHopServerBindingURL = "/nitro/v1/config/vpnglobal_vpnnexthopserver_binding" + vpnGlobalVPNPortalThemeBindingURL = "/nitro/v1/config/vpnglobal_vpnportaltheme_binding" + vpnGlobalVPNSessionPolicyBindingURL = "/nitro/v1/config/vpnglobal_vpnsessionpolicy_binding" + vpnGlobalVPNTrafficPolicyBindingURL = "/nitro/v1/config/vpnglobal_vpntrafficpolicy_binding" + vpnGlobalVPNURLPolicyBindingURL = "/nitro/v1/config/vpnglobal_vpnurlpolicy_binding" + vpnGlobalVPNURLBindingURL = "/nitro/v1/config/vpnglobal_vpnurl_binding" + vpnICAConnectionURL = "/nitro/v1/config/vpnicaconnection" + vpnICADTLSConnectionURL = "/nitro/v1/config/vpnicadtlsconnection" + vpnIntranetApplicationURL = "/nitro/v1/config/vpnintranetapplication" + vpnIntranetApplicationBindingURL = "/nitro/v1/config/vpnintranetapplication_binding" + vpnIntranetApplicationVPNURLBindingURL = "/nitro/v1/config/vpnintranetapplication_vpnurl_binding" + vpnNextHopServerURL = "/nitro/v1/config/vpnnexthopserver" + vpnNextGenVServerURL = "/nitro/v1/config/vpnnextgenvserver" + vpnParameterURL = "/nitro/v1/config/vpnparameter" + vpnPCoIPConnectionURL = "/nitro/v1/config/vpnpcoipconnection" + vpnPCoIPProfileURL = "/nitro/v1/config/vpnpcoipprofile" + vpnPCoIPVServerProfileURL = "/nitro/v1/config/vpnpcoipvserverprofile" + vpnPortalThemeURL = "/nitro/v1/config/vpnportaltheme" + vpnSAMLSSOProfileURL = "/nitro/v1/config/vpnsamlssoprofile" + vpnSessionActionURL = "/nitro/v1/config/vpnsessionaction" + vpnSessionPolicyURL = "/nitro/v1/config/vpnsessionpolicy" + vpnSessionPolicyBindingURL = "/nitro/v1/config/vpnsessionpolicy_binding" + vpnSessionPolicyAAAGroupBindingURL = "/nitro/v1/config/vpnsessionpolicy_aaagroup_binding" + vpnSessionPolicyAAAUserBindingURL = "/nitro/v1/config/vpnsessionpolicy_aaauser_binding" + vpnSessionPolicyVPNGlobalBindingURL = "/nitro/v1/config/vpnsessionpolicy_vpnglobal_binding" + vpnSessionPolicyVPNVServerBindingURL = "/nitro/v1/config/vpnsessionpolicy_vpnvserver_binding" + vpnSFConfigURL = "/nitro/v1/config/vpnsfconfig" + vpnStoreInfoURL = "/nitro/v1/config/vpnstoreinfo" + vpnTrafficActionURL = "/nitro/v1/config/vpntrafficaction" + vpnTrafficPolicyURL = "/nitro/v1/config/vpntrafficpolicy" + vpnTrafficPolicyBindingURL = "/nitro/v1/config/vpntrafficpolicy_binding" + vpnTrafficPolicyAAAGroupBindingURL = "/nitro/v1/config/vpntrafficpolicy_aaagroup_binding" + vpnTrafficPolicyAAAUserBindingURL = "/nitro/v1/config/vpntrafficpolicy_aaauser_binding" + vpnTrafficPolicyVPNGlobalBindingURL = "/nitro/v1/config/vpntrafficpolicy_vpnglobal_binding" + vpnTrafficPolicyVPNVServerBindingURL = "/nitro/v1/config/vpntrafficpolicy_vpnvserver_binding" + vpnURLURL = "/nitro/v1/config/vpnurl" + vpnURLActionURL = "/nitro/v1/config/vpnurlaction" + vpnURLBindingURL = "/nitro/v1/config/vpnurl_binding" + vpnURLMemberBindingURL = "/nitro/v1/config/vpnurl_member_binding" + vpnURLVPNIntranetApplicationBindingURL = "/nitro/v1/config/vpnurl_vpnintranetapplication_binding" + vpnURLPolicyURL = "/nitro/v1/config/vpnurlpolicy" + vpnURLPolicyBindingURL = "/nitro/v1/config/vpnurlpolicy_binding" + vpnURLPolicyAAAGroupBindingURL = "/nitro/v1/config/vpnurlpolicy_aaagroup_binding" + vpnURLPolicyAAAUserBindingURL = "/nitro/v1/config/vpnurlpolicy_aaauser_binding" + vpnURLPolicyVPNGlobalBindingURL = "/nitro/v1/config/vpnurlpolicy_vpnglobal_binding" + vpnURLPolicyVPNVServerBindingURL = "/nitro/v1/config/vpnurlpolicy_vpnvserver_binding" + vpnVServerURL = "/nitro/v1/config/vpnvserver" + vpnVServerBindingURL = "/nitro/v1/config/vpnvserver_binding" + vpnVServerAAAGroupBindingURL = "/nitro/v1/config/vpnvserver_aaagroup_binding" + vpnVServerAAAPreauthenticationPolicyBindingURL = "/nitro/v1/config/vpnvserver_aaapreauthenticationpolicy_binding" + vpnVServerAAAUserBindingURL = "/nitro/v1/config/vpnvserver_aaauser_binding" + vpnVServerAnalyticsProfileBindingURL = "/nitro/v1/config/vpnvserver_analyticsprofile_binding" + vpnVServerAppControllerBindingURL = "/nitro/v1/config/vpnvserver_appcontroller_binding" + vpnVServerAppFlowPolicyBindingURL = "/nitro/v1/config/vpnvserver_appflowpolicy_binding" + vpnVServerAppQOEPolicyBindingURL = "/nitro/v1/config/vpnvserver_appqoepolicy_binding" + vpnVServerAuditNSLogPolicyBindingURL = "/nitro/v1/config/vpnvserver_auditnslogpolicy_binding" + vpnVServerAuditSyslogPolicyBindingURL = "/nitro/v1/config/vpnvserver_auditsyslogpolicy_binding" + vpnVServerAuthenticationCertPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationcertpolicy_binding" + vpnVServerAuthenticationFAPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationfapolicy_binding" + vpnVServerAuthenticationLDAPPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationldappolicy_binding" + vpnVServerAuthenticationLocalPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationlocalpolicy_binding" + vpnVServerAuthenticationLoginSchemaPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationloginschemapolicy_binding" + vpnVServerAuthenticationNegotiatePolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationnegotiatepolicy_binding" + vpnVServerAuthenticationOAuthIDPPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationoauthidppolicy_binding" + vpnVServerAuthenticationPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationpolicy_binding" + vpnVServerAuthenticationRADIUSPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationradiuspolicy_binding" + vpnVServerAuthenticationSAMLIDPPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationsamlidppolicy_binding" + vpnVServerAuthenticationSAMLPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationsamlpolicy_binding" + vpnVServerAuthenticationTACACSPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationtacacspolicy_binding" + vpnVServerAuthenticationWebAuthPolicyBindingURL = "/nitro/v1/config/vpnvserver_authenticationwebauthpolicy_binding" + vpnVServerCachePolicyBindingURL = "/nitro/v1/config/vpnvserver_cachepolicy_binding" + vpnVServerCMPPolicyBindingURL = "/nitro/v1/config/vpnvserver_cmppolicy_binding" + vpnVServerCSPolicyBindingURL = "/nitro/v1/config/vpnvserver_cspolicy_binding" + vpnVServerFEOPolicyBindingURL = "/nitro/v1/config/vpnvserver_feopolicy_binding" + vpnVServerICAPolicyBindingURL = "/nitro/v1/config/vpnvserver_icapolicy_binding" + vpnVServerIntranetIP6BindingURL = "/nitro/v1/config/vpnvserver_intranetip6_binding" + vpnVServerIntranetIPBindingURL = "/nitro/v1/config/vpnvserver_intranetip_binding" + vpnVServerLBVServerBindingURL = "/nitro/v1/config/vpnvserver_lbvserver_binding" + vpnVServerNextHopVPNVServerBindingURL = "/nitro/v1/config/vpnvserver_nexthopvpnvserver_binding" + vpnVServerResponderPolicyBindingURL = "/nitro/v1/config/vpnvserver_responderpolicy_binding" + vpnVServerRewritePolicyBindingURL = "/nitro/v1/config/vpnvserver_rewritepolicy_binding" + vpnVServerShareFileServerBindingURL = "/nitro/v1/config/vpnvserver_sharefileserver_binding" + vpnVServerSTAServerBindingURL = "/nitro/v1/config/vpnvserver_staserver_binding" + vpnVServerTMTrafficPolicyBindingURL = "/nitro/v1/config/vpnvserver_tmtrafficpolicy_binding" + vpnVServerURLFilteringPolicyBindingURL = "/nitro/v1/config/vpnvserver_urlfilteringpolicy_binding" + vpnVServerVPNClientlessAccessPolicyBindingURL = "/nitro/v1/config/vpnvserver_vpnclientlessaccesspolicy_binding" + vpnVServerVPNEPAProfileBindingURL = "/nitro/v1/config/vpnvserver_vpnepaprofile_binding" + vpnVServerVPNEULABindingURL = "/nitro/v1/config/vpnvserver_vpneula_binding" + vpnVServerVPNIntranetApplicationBindingURL = "/nitro/v1/config/vpnvserver_vpnintranetapplication_binding" + vpnVServerVPNNextHopServerBindingURL = "/nitro/v1/config/vpnvserver_vpnnexthopserver_binding" + vpnVServerVPNNextGenVServerBindingURL = "/nitro/v1/config/vpnvserver_vpnnextgenvserver_binding" + vpnVServerVPNPortalThemeBindingURL = "/nitro/v1/config/vpnvserver_vpnportaltheme_binding" + vpnVServerVPNSessionPolicyBindingURL = "/nitro/v1/config/vpnvserver_vpnsessionpolicy_binding" + vpnVServerVPNTrafficPolicyBindingURL = "/nitro/v1/config/vpnvserver_vpntrafficpolicy_binding" + vpnVServerVPNURLBindingURL = "/nitro/v1/config/vpnvserver_vpnurl_binding" + vpnVServerVPNURLPolicyBindingURL = "/nitro/v1/config/vpnvserver_vpnurlpolicy_binding" +) + // SSL VPN // Virtual Private Network configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/vpn/vpn From fc4bed4ba960eb9d52c8c7276c9676c6f0e8a443 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Mon, 9 Feb 2026 22:00:47 -0600 Subject: [PATCH 03/10] base lb functions. --- nitrogo/lb.go | 4268 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 3963 insertions(+), 305 deletions(-) diff --git a/nitrogo/lb.go b/nitrogo/lb.go index f65160b..5021a2b 100644 --- a/nitrogo/lb.go +++ b/nitrogo/lb.go @@ -1,9 +1,11 @@ package nitrogo import ( + "bytes" "encoding/json" "fmt" "net/http" + "strings" "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) @@ -75,166 +77,149 @@ type LBService struct { // lbaction // Configuration for lb action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/lb/lbaction -func (s *LBService) AddLBAction() {} -func (s *LBService) DeleteLBAction() {} -func (s *LBService) UpdateLBAction() {} -func (s *LBService) UnsetLBAction() {} -func (s *LBService) GetAllLBAction() {} -func (s *LBService) GetLBAction() {} -func (s *LBService) CountLBAction() {} -func (s *LBService) RenameLBAction() {} +func (s *LBService) AddLBAction(resource map[string]any) error { + payload := map[string]any{"lbaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbglobal_binding -func (s *LBService) GetLBGlobalBinding() {} + req, err := s.client.NewRequest(http.MethodPost, lbActionURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lbglobal_lbpolicy_binding -func (s *LBService) AddLBGlobalLBPolicyBinding() {} -func (s *LBService) DeleteLBGlobalLBPolicyBinding() {} -func (s *LBService) GetLBGlobalLBPolicyBinding() {} -func (s *LBService) CountLBGlobalLBPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbgroup -func (s *LBService) AddLBGroup() {} -func (s *LBService) DeleteLBGroup() {} -func (s *LBService) UpdateLBGroup() {} -func (s *LBService) UnsetLBGroup() {} -func (s *LBService) GetAllLBGroup() {} -func (s *LBService) GetLBGroup() {} -func (s *LBService) CountLBGroup() {} -func (s *LBService) RenameLBGroup() {} +func (s *LBService) DeleteLBAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbActionURL, name), nil) + if err != nil { + return err + } -// lbgroup_binding -func (s *LBService) GetAllLBGroupBinding() {} -func (s *LBService) GetLBGroupBinding() {} + _, err = s.client.Do(req) + return err +} -// lbgroup_lbvserver_binding -func (s *LBService) AddLBGroupLBVServerBinding() {} -func (s *LBService) DeleteLBGroupLBVServerBinding() {} -func (s *LBService) GetAllLBGroupLBVServerBinding() {} -func (s *LBService) GetLBGroupLBVServerBinding() {} -func (s *LBService) CountLBGroupLBVServerBinding() {} +func (s *LBService) UpdateLBAction(resource map[string]any) error { + payload := map[string]any{"lbaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbmetrictable -func (s *LBService) AddLBMetricTable() {} -func (s *LBService) DeleteLBMetricTable() {} -func (s *LBService) UpdateLBMetricTable() {} -func (s *LBService) GetAllLBMetricTable() {} -func (s *LBService) GetLBMetricTable() {} -func (s *LBService) CountLBMetricTable() {} + req, err := s.client.NewRequest(http.MethodPut, lbActionURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lbmetrictable_binding -func (s *LBService) GetAllLBMetricTableBinding() {} -func (s *LBService) GetLBMetricTableBinding() {} + _, err = s.client.Do(req) + return err +} -// lbmetrictable_metric_binding -func (s *LBService) AddLBMetricTableMetricBinding() {} -func (s *LBService) DeleteLBMetricTableMetricBinding() {} -func (s *LBService) GetAllLBMetricTableMetricBinding() {} -func (s *LBService) GetLBMetricTableMetricBinding() {} -func (s *LBService) CountLBMetricTableMetricBinding() {} +func (s *LBService) UnsetLBAction(resource map[string]any) error { + payload := map[string]any{"lbaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbmonbindings -func (s *LBService) GetAllLBMonBindings() {} -func (s *LBService) GetLBMonBindings() {} -func (s *LBService) CountLBMonBindings() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbActionURL), bytes.NewReader(data)) + if err != nil { + return err + } -// lbmonbindings_binding -func (s *LBService) GetLBMonBindingsBinding() {} + _, err = s.client.Do(req) + return err +} -// lbmonbindings_gslbservicegroup_binding -func (s *LBService) GetLBMonBindingsGSLBServiceGroupBinding() {} -func (s *LBService) CountLBMonBindingsGSLBServiceGroupBinding() {} +func (s *LBService) GetAllLBAction() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbActionURL, nil) + if err != nil { + return nil, err + } -// lbmonbindings_servicegroup_binding -func (s *LBService) GetLBMonBindingsServiceGroupBinding() {} -func (s *LBService) CountLBMonBindingsServiceGroupBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lbmonbindings_service_binding -func (s *LBService) GetLBMonBindingsServiceBinding() {} -func (s *LBService) CountLBMonBindingsServiceBinding() {} + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lbmonitor -func (s *LBService) AddLBMonitor() {} -func (s *LBService) DeleteLBMonitor() {} -func (s *LBService) UpdateLBMonitor() {} -func (s *LBService) UnsetLBMonitor() {} -func (s *LBService) EnableLBMonitor() {} -func (s *LBService) DisableLBMonitor() {} -func (s *LBService) GetAllLBMonitor() {} -func (s *LBService) GetLBMonitor() {} -func (s *LBService) CountLBMonitor() {} + return result["lbaction"], nil +} -// lbmonitor_binding -func (s *LBService) GetAllLBMonitorBinding() {} -func (s *LBService) GetLBMonitorBinding() {} +func (s *LBService) GetLBAction(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbActionURL, name), nil) + if err != nil { + return nil, err + } -// lbmonitor_metric_binding -func (s *LBService) AddLBMonitorMetricBinding() {} -func (s *LBService) DeleteLBMonitorMetricBinding() {} -func (s *LBService) GetAllLBMonitorMetricBinding() {} -func (s *LBService) GetLBMonitorMetricBinding() {} -func (s *LBService) CountLBMonitorMetricBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lbmonitor_servicegroup_binding -func (s *LBService) AddLBMonitorServiceGroupBinding() {} -func (s *LBService) DeleteLBMonitorServiceGroupBinding() {} + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lbmonitor_service_binding -func (s *LBService) AddLBMonitorServiceBinding() {} -func (s *LBService) DeleteLBMonitorServiceBinding() {} + if len(result["lbaction"]) == 0 { + return nil, fmt.Errorf("lbaction %s not found", name) + } -// lbmonitor_sslcertkey_binding -func (s *LBService) AddLBMonitorSSLCertKeyBinding() {} -func (s *LBService) DeleteLBMonitorSSLCertKeyBinding() {} -func (s *LBService) GetAllLBMonitorSSLCertKeyBinding() {} -func (s *LBService) GetLBMonitorSSLCertKeyBinding() {} -func (s *LBService) CountLBMonitorSSLCertKeyBinding() {} + return result["lbaction"][0], nil +} -// lbparameter -func (s *LBService) UpdateLBParameter() {} -func (s *LBService) UnsetLBParameter() {} -func (s *LBService) GetAllLBParameter() {} +func (s *LBService) CountLBAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbActionURL), nil) + if err != nil { + return 0, err + } -// lbpersistentsessions -func (s *LBService) GetAllLBPersistentSessions() {} -func (s *LBService) CountLBPersistentSessions() {} -func (s *LBService) ClearLBPersistentSessions() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// lbprofile -func (s *LBService) AddLBProfile() {} -func (s *LBService) DeleteLBProfile() {} -func (s *LBService) UpdateLBProfile() {} -func (s *LBService) UnsetLBProfile() {} -func (s *LBService) GetAllLBProfile() {} -func (s *LBService) GetLBProfile() {} -func (s *LBService) CountLBProfile() {} + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// lbroute -func (s *LBService) AddLBRoute() {} -func (s *LBService) DeleteLBRoute() {} -func (s *LBService) GetAllLBRoute() {} -func (s *LBService) CountLBRoute() {} + if len(result["lbaction"]) > 0 { + if count, ok := result["lbaction"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} -// lbroute6 -func (s *LBService) AddLBRoute6() {} -func (s *LBService) DeleteLBRoute6() {} -func (s *LBService) GetAllLBRoute6() {} -func (s *LBService) CountLBRoute6() {} +func (s *LBService) RenameLBAction(name, newName string) error { + payload := map[string]any{"lbaction": map[string]string{"name": name, "newname": newName}} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbsipparameters -func (s *LBService) UpdateLBSIPParameters() {} -func (s *LBService) UnsetLBSIPParameters() {} -func (s *LBService) GetAllLBSIPParameters() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", lbActionURL), bytes.NewReader(data)) + if err != nil { + return err + } -// lbvserver -func (s *LBService) AddLBVServer() {} -func (s *LBService) DeleteLBVServer() {} -func (s *LBService) UpdateLBVServer() {} -func (s *LBService) UnsetLBVServer() {} -func (s *LBService) EnableLBVServer() {} -func (s *LBService) DisableLBVServer() {} -func (s *LBService) GetAllLBVServer() ([]models.LBVServer, error) { - req, err := s.client.NewRequest(http.MethodGet, lbVServerURL, nil) + _, err = s.client.Do(req) + return err +} + +// lbglobal_binding +func (s *LBService) GetLBGlobalBinding() (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbGlobalBindingURL, nil) if err != nil { return nil, err } @@ -244,140 +229,176 @@ func (s *LBService) GetAllLBVServer() ([]models.LBVServer, error) { return nil, err } - var result struct { - LBVServer []models.LBVServer `json:"lbvserver"` + var result map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if val, ok := result["lbglobal_binding"]; ok { + return val.(map[string]any), nil + } + return nil, fmt.Errorf("lbglobal_binding not found") +} + +// lbglobal_lbpolicy_binding +func (s *LBService) AddLBGlobalLBPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbglobal_lbpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err } + req, err := s.client.NewRequest(http.MethodPost, lbGlobalLBPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBGlobalLBPolicyBinding(args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s%s", lbGlobalLBPolicyBindingURL, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBGlobalLBPolicyBinding() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbGlobalLBPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any if err := json.Unmarshal(resp, &result); err != nil { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return result.LBVServer, nil + return result["lbglobal_lbpolicy_binding"], nil } -func (s *LBService) GetLBVServer() {} -func (s *LBService) CountLBVServer() {} -func (s *LBService) RenameLBVServer() {} -// lbvserver_analyticsprofile_binding -func (s *LBService) AddLBVServerAnalyticsProfileBinding() {} -func (s *LBService) DeleteLBVServerAnalyticsProfileBinding() {} -func (s *LBService) GetAllLBVServerAnalyticsProfileBinding() {} -func (s *LBService) GetLBVServerAnalyticsProfileBinding() {} -func (s *LBService) CountLBVServerAnalyticsProfileBinding() {} +func (s *LBService) CountLBGlobalLBPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbGlobalLBPolicyBindingURL), nil) + if err != nil { + return 0, err + } -// lbvserver_appflowpolicy_binding -func (s *LBService) AddLBVServerAppFlowPolicyBinding() {} -func (s *LBService) DeleteLBVServerAppFlowPolicyBinding() {} -func (s *LBService) GetAllLBVServerAppFlowPolicyBinding() {} -func (s *LBService) GetLBVServerAppFlowPolicyBinding() {} -func (s *LBService) CountLBVServerAppFlowPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// lbvserver_appfwpolicy_binding -func (s *LBService) AddLBVServerAppFWPolicyBinding() {} -func (s *LBService) DeleteLBVServerAppFWPolicyBinding() {} -func (s *LBService) GetAllLBVServerAppFWPolicyBinding() {} -func (s *LBService) GetLBVServerAppFWPolicyBinding() {} -func (s *LBService) CountLBVServerAppFWPolicyBinding() {} + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// lbvserver_appqoepolicy_binding -func (s *LBService) AddLBVServerAppQOEPolicyBinding() {} -func (s *LBService) DeleteLBVServerAppQOEPolicyBinding() {} -func (s *LBService) GetAllLBVServerAppQOEPolicyBinding() {} -func (s *LBService) GetLBVServerAppQOEPolicyBinding() {} -func (s *LBService) CountLBVServerAppQOEPolicyBinding() {} + if len(result["lbglobal_lbpolicy_binding"]) > 0 { + if count, ok := result["lbglobal_lbpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} -// lbvserver_auditnslogpolicy_binding -func (s *LBService) AddLBVServerAuditNSLogPolicyBinding() {} -func (s *LBService) DeleteLBVServerAuditNSLogPolicyBinding() {} -func (s *LBService) GetAllLBVServerAuditNSLogPolicyBinding() {} -func (s *LBService) GetLBVServerAuditNSLogPolicyBinding() {} -func (s *LBService) CountLBVServerAuditNSLogPolicyBinding() {} +// lbgroup +func (s *LBService) AddLBGroup(resource map[string]any) error { + payload := map[string]any{"lbgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbvserver_auditsyslogpolicy_binding -func (s *LBService) AddLBVServerAuditSyslogPolicyBinding() {} -func (s *LBService) DeleteLBVServerAuditSyslogPolicyBinding() {} -func (s *LBService) GetAllLBVServerAuditSyslogPolicyBinding() {} -func (s *LBService) GetLBVServerAuditSyslogPolicyBinding() {} -func (s *LBService) CountLBVServerAuditSyslogPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, lbGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lbvserver_authorizationpolicy_binding -func (s *LBService) AddLBVServerAuthorizationPolicyBinding() {} -func (s *LBService) DeleteLBVServerAuthorizationPolicyBinding() {} -func (s *LBService) GetAllLBVServerAuthorizationPolicyBinding() {} -func (s *LBService) GetLBVServerAuthorizationPolicyBinding() {} -func (s *LBService) CountLBVServerAuthorizationPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_binding -func (s *LBService) GetAllLBVServerBinding() {} -func (s *LBService) GetLBVServerBinding() {} +func (s *LBService) DeleteLBGroup(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbGroupURL, name), nil) + if err != nil { + return err + } -// lbvserver_botpolicy_binding -func (s *LBService) AddLBVServerBotPolicyBinding() {} -func (s *LBService) DeleteLBVServerBotPolicyBinding() {} -func (s *LBService) GetAllLBVServerBotPolicyBinding() {} -func (s *LBService) GetLBVServerBotPolicyBinding() {} -func (s *LBService) CountLBVServerBotPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_cachepolicy_binding -func (s *LBService) AddLBVServerCachePolicyBinding() {} -func (s *LBService) DeleteLBVServerCachePolicyBinding() {} -func (s *LBService) GetAllLBVServerCachePolicyBinding() {} -func (s *LBService) GetLBVServerCachePolicyBinding() {} -func (s *LBService) CountLBVServerCachePolicyBinding() {} +func (s *LBService) UpdateLBGroup(resource map[string]any) error { + payload := map[string]any{"lbgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbvserver_cmppolicy_binding -func (s *LBService) AddLBVServerCMPPolicyBinding() {} -func (s *LBService) DeleteLBVServerCMPPolicyBinding() {} -func (s *LBService) GetAllLBVServerCMPPolicyBinding() {} -func (s *LBService) GetLBVServerCMPPolicyBinding() {} -func (s *LBService) CountLBVServerCMPPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPut, lbGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lbvserver_contentinspectionpolicy_binding -func (s *LBService) AddLBVServerContentInspectionPolicyBinding() {} -func (s *LBService) DeleteLBVServerContentInspectionPolicyBinding() {} -func (s *LBService) GetAllLBVServerContentInspectionPolicyBinding() {} -func (s *LBService) GetLBVServerContentInspectionPolicyBinding() {} -func (s *LBService) CountLBVServerContentInspectionPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_csvserver_binding -func (s *LBService) GetAllLBVServerCSVServerBinding() {} -func (s *LBService) GetLBVServerCSVServerBinding() {} -func (s *LBService) CountLBVServerCSVServerBinding() {} +func (s *LBService) UnsetLBGroup(resource map[string]any) error { + payload := map[string]any{"lbgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbvserver_dnspolicy64_binding -func (s *LBService) AddLBVServerDNSPolicy64Binding() {} -func (s *LBService) DeleteLBVServerDNSPolicy64Binding() {} -func (s *LBService) GetAllLBVServerDNSPolicy64Binding() {} -func (s *LBService) GetLBVServerDNSPolicy64Binding() {} -func (s *LBService) CountLBVServerDNSPolicy64Binding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } -// lbvserver_feopolicy_binding -func (s *LBService) AddLBVServerFEOPolicyBinding() {} -func (s *LBService) DeleteLBVServerFEOPolicyBinding() {} -func (s *LBService) GetAllLBVServerFEOPolicyBinding() {} -func (s *LBService) GetLBVServerFEOPolicyBinding() {} -func (s *LBService) CountLBVServerFEOPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_responderpolicy_binding -func (s *LBService) AddLBVServerResponderPolicyBinding() {} -func (s *LBService) DeleteLBVServerResponderPolicyBinding() {} -func (s *LBService) GetAllLBVServerResponderPolicyBinding() {} -func (s *LBService) GetLBVServerResponderPolicyBinding() {} -func (s *LBService) CountLBVServerResponderPolicyBinding() {} +func (s *LBService) GetAllLBGroup() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbGroupURL, nil) + if err != nil { + return nil, err + } -// lbvserver_rewritepolicy_binding -func (s *LBService) AddLBVServerRewritePolicyBinding() {} -func (s *LBService) DeleteLBVServerRewritePolicyBinding() {} -func (s *LBService) GetAllLBVServerRewritePolicyBinding() {} -func (s *LBService) GetLBVServerRewritePolicyBinding() {} -func (s *LBService) CountLBVServerRewritePolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lbvserver_servicegroupmember_binding -func (s *LBService) GetAllLBVServerServiceGroupMemberBinding() {} -func (s *LBService) GetLBVServerServiceGroupMemberBinding(lbvserver string) ([]models.LBVServerServiceGroupMemberBinding, error) { - u := fmt.Sprintf("%s/%s", lbVServerServiceGroupMemberBindingURL, lbvserver) + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } - req, err := s.client.NewRequest(http.MethodGet, u, nil) + return result["lbgroup"], nil +} + +func (s *LBService) GetLBGroup(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbGroupURL, name), nil) if err != nil { return nil, err } @@ -387,83 +408,3720 @@ func (s *LBService) GetLBVServerServiceGroupMemberBinding(lbvserver string) ([]m return nil, err } - var result struct { - Binding []models.LBVServerServiceGroupMemberBinding `json:"lbvserver_servicegroupmember_binding"` + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbgroup"]) == 0 { + return nil, fmt.Errorf("lbgroup %s not found", name) + } + + return result["lbgroup"][0], nil +} + +func (s *LBService) CountLBGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbgroup"]) > 0 { + if count, ok := result["lbgroup"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LBService) RenameLBGroup(name, newName string) error { + payload := map[string]any{"lbgroup": map[string]string{"name": name, "newname": newName}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", lbGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lbgroup_binding +func (s *LBService) GetLBGroupBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err } + var result map[string][]map[string]any if err := json.Unmarshal(resp, &result); err != nil { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return result.Binding, nil + if len(result["lbgroup_binding"]) == 0 { + return nil, fmt.Errorf("lbgroup_binding %s not found", name) + } + + return result["lbgroup_binding"][0], nil } -func (s *LBService) CountLBVServerServiceGroupMemberBinding() {} -// lbvserver_servicegroup_binding -func (s *LBService) AddLBVServerServiceGroupBinding() {} -func (s *LBService) DeleteLBVServerServiceGroupBinding() {} -func (s *LBService) GetAllLBVServerServiceGroupBinding() {} -func (s *LBService) GetLBVServerServiceGroupBinding() {} -func (s *LBService) CountLBVServerServiceGroupBinding() {} +// lbgroup_lbvserver_binding +func (s *LBService) AddLBGroupLBVServerBinding(resource map[string]any) error { + payload := map[string]any{"lbgroup_lbvserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lbvserver_service_binding -func (s *LBService) AddLBVServerServiceBinding() {} -func (s *LBService) DeleteLBVServerServiceBinding() {} -func (s *LBService) GetAllLBVServerServiceBinding() {} -func (s *LBService) GetLBVServerServiceBinding() {} -func (s *LBService) CountLBVServerServiceBinding() {} + req, err := s.client.NewRequest(http.MethodPost, lbGroupLBVServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lbvserver_spilloverpolicy_binding -func (s *LBService) AddLBVServerSpilloverPolicyBinding() {} -func (s *LBService) DeleteLBVServerSpilloverPolicyBinding() {} -func (s *LBService) GetAllLBVServerSpilloverPolicyBinding() {} -func (s *LBService) GetLBVServerSpilloverPolicyBinding() {} -func (s *LBService) CountLBVServerSpilloverPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_tmtrafficpolicy_binding -func (s *LBService) AddLBVServerTMTrafficPolicyBinding() {} -func (s *LBService) DeleteLBVServerTMTrafficPolicyBinding() {} -func (s *LBService) GetAllLBVServerTMTrafficPolicyBinding() {} -func (s *LBService) GetLBVServerTMTrafficPolicyBinding() {} -func (s *LBService) CountLBVServerTMTrafficPolicyBinding() {} +func (s *LBService) DeleteLBGroupLBVServerBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } -// lbvserver_transformpolicy_binding -func (s *LBService) AddLBVServerTransformPolicyBinding() {} -func (s *LBService) DeleteLBVServerTransformPolicyBinding() {} -func (s *LBService) GetAllLBVServerTransformPolicyBinding() {} -func (s *LBService) GetLBVServerTransformPolicyBinding() {} -func (s *LBService) CountLBVServerTransformPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbGroupLBVServerBindingURL, name, argsStr), nil) + if err != nil { + return err + } -// lbvserver_videooptimizationdetectionpolicy_binding -func (s *LBService) AddLBVServerVideoOptimizationDetectionPolicyBinding() {} -func (s *LBService) DeleteLBVServerVideoOptimizationDetectionPolicyBinding() {} -func (s *LBService) GetAllLBVServerVideoOptimizationDetectionPolicyBinding() {} -func (s *LBService) GetLBVServerVideoOptimizationDetectionPolicyBinding() {} -func (s *LBService) CountLBVServerVideoOptimizationDetectionPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// lbvserver_videooptimizationpacingpolicy_binding -func (s *LBService) AddLBVServerVideoOptimizationPacingPolicyBinding() {} -func (s *LBService) DeleteLBVServerVideoOptimizationPacingPolicyBinding() {} -func (s *LBService) GetAllLBVServerVideoOptimizationPacingPolicyBinding() {} -func (s *LBService) GetLBVServerVideoOptimizationPacingPolicyBinding() {} -func (s *LBService) CountLBVServerVideoOptimizationPacingPolicyBinding() {} +func (s *LBService) GetLBGroupLBVServerBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbGroupLBVServerBindingURL, name), nil) + if err != nil { + return nil, err + } -// lbwlm -func (s *LBService) AddLBWLM() {} -func (s *LBService) DeleteLBWLM() {} -func (s *LBService) UpdateLBWLM() {} -func (s *LBService) UnsetLBWLM() {} -func (s *LBService) GetAllLBWLM() {} -func (s *LBService) GetLBWLM() {} -func (s *LBService) CountLBWLM() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lbwlm_binding -func (s *LBService) GetAllLBWLMBinding() {} -func (s *LBService) GetLBWLMBinding() {} + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lbwlm_lbvserver_binding -func (s *LBService) AddLBWLMLBVServerBinding() {} -func (s *LBService) DeleteLBWLMLBVServerBinding() {} -func (s *LBService) GetAllLBWLMLBVServerBinding() {} -func (s *LBService) GetLBWLMLBVServerBinding() {} -func (s *LBService) CountLBWLMLBVServerBinding() {} + return result["lbgroup_lbvserver_binding"], nil +} + +func (s *LBService) CountLBGroupLBVServerBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbGroupLBVServerBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbgroup_lbvserver_binding"]) > 0 { + if count, ok := result["lbgroup_lbvserver_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmetrictable +func (s *LBService) AddLBMetricTable(resource map[string]any) error { + payload := map[string]any{"lbmetrictable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMetricTableURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMetricTable(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbMetricTableURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UpdateLBMetricTable(resource map[string]any) error { + payload := map[string]any{"lbmetrictable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbMetricTableURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBMetricTable() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbMetricTableURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmetrictable"], nil +} + +func (s *LBService) GetLBMetricTable(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMetricTableURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmetrictable"]) == 0 { + return nil, fmt.Errorf("lbmetrictable %s not found", name) + } + + return result["lbmetrictable"][0], nil +} + +func (s *LBService) CountLBMetricTable() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbMetricTableURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmetrictable"]) > 0 { + if count, ok := result["lbmetrictable"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmetrictable_binding +func (s *LBService) GetLBMetricTableBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMetricTableBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmetrictable_binding"]) == 0 { + return nil, fmt.Errorf("lbmetrictable_binding %s not found", name) + } + + return result["lbmetrictable_binding"][0], nil +} + +// lbmetrictable_metric_binding +func (s *LBService) AddLBMetricTableMetricBinding(resource map[string]any) error { + payload := map[string]any{"lbmetrictable_metric_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMetricTableMetricBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMetricTableMetricBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbMetricTableMetricBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBMetricTableMetricBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMetricTableMetricBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmetrictable_metric_binding"], nil +} + +func (s *LBService) CountLBMetricTableMetricBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMetricTableMetricBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmetrictable_metric_binding"]) > 0 { + if count, ok := result["lbmetrictable_metric_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonbindings +func (s *LBService) GetAllLBMonBindings() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbMonBindingsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonbindings"], nil +} + +func (s *LBService) GetLBMonBindings(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonBindingsURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings"]) == 0 { + return nil, fmt.Errorf("lbmonbindings %s not found", name) + } + + return result["lbmonbindings"][0], nil +} + +func (s *LBService) CountLBMonBindings() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbMonBindingsURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings"]) > 0 { + if count, ok := result["lbmonbindings"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonbindings_binding +func (s *LBService) GetLBMonBindingsBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonBindingsBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings_binding"]) == 0 { + return nil, fmt.Errorf("lbmonbindings_binding %s not found", name) + } + + return result["lbmonbindings_binding"][0], nil +} + +// lbmonbindings_gslbservicegroup_binding +func (s *LBService) GetLBMonBindingsGSLBServiceGroupBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonBindingsGSLBServiceGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonbindings_gslbservicegroup_binding"], nil +} + +func (s *LBService) CountLBMonBindingsGSLBServiceGroupBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMonBindingsGSLBServiceGroupBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings_gslbservicegroup_binding"]) > 0 { + if count, ok := result["lbmonbindings_gslbservicegroup_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonbindings_servicegroup_binding +func (s *LBService) GetLBMonBindingsServiceGroupBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonBindingsServiceGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonbindings_servicegroup_binding"], nil +} + +func (s *LBService) CountLBMonBindingsServiceGroupBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMonBindingsServiceGroupBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings_servicegroup_binding"]) > 0 { + if count, ok := result["lbmonbindings_servicegroup_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonbindings_service_binding +func (s *LBService) GetLBMonBindingsServiceBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonBindingsServiceBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonbindings_service_binding"], nil +} + +func (s *LBService) CountLBMonBindingsServiceBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMonBindingsServiceBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonbindings_service_binding"]) > 0 { + if count, ok := result["lbmonbindings_service_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonitor +func (s *LBService) AddLBMonitor(resource map[string]any) error { + payload := map[string]any{"lbmonitor": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMonitorURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMonitor(name string, resource map[string]any) error { + // lbmonitor delete might require type, so we allow resource map for query params or payload if needed. + // Standard delete is by name. + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbMonitorURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UpdateLBMonitor(resource map[string]any) error { + payload := map[string]any{"lbmonitor": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbMonitorURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBMonitor(resource map[string]any) error { + payload := map[string]any{"lbmonitor": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbMonitorURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) EnableLBMonitor(name string) error { + payload := map[string]any{"lbmonitor": map[string]string{"monitorname": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", lbMonitorURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DisableLBMonitor(name string) error { + payload := map[string]any{"lbmonitor": map[string]string{"monitorname": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", lbMonitorURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBMonitor() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbMonitorURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonitor"], nil +} + +func (s *LBService) GetLBMonitor(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonitorURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonitor"]) == 0 { + return nil, fmt.Errorf("lbmonitor %s not found", name) + } + + return result["lbmonitor"][0], nil +} + +func (s *LBService) CountLBMonitor() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbMonitorURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonitor"]) > 0 { + if count, ok := result["lbmonitor"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonitor_binding +func (s *LBService) GetLBMonitorBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonitorBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonitor_binding"]) == 0 { + return nil, fmt.Errorf("lbmonitor_binding %s not found", name) + } + + return result["lbmonitor_binding"][0], nil +} + +// lbmonitor_metric_binding +func (s *LBService) AddLBMonitorMetricBinding(resource map[string]any) error { + payload := map[string]any{"lbmonitor_metric_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMonitorMetricBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMonitorMetricBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbMonitorMetricBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBMonitorMetricBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonitorMetricBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonitor_metric_binding"], nil +} + +func (s *LBService) CountLBMonitorMetricBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMonitorMetricBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonitor_metric_binding"]) > 0 { + if count, ok := result["lbmonitor_metric_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbmonitor_servicegroup_binding +func (s *LBService) AddLBMonitorServiceGroupBinding(resource map[string]any) error { + payload := map[string]any{"lbmonitor_servicegroup_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMonitorServiceGroupBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMonitorServiceGroupBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbMonitorServiceGroupBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lbmonitor_service_binding +func (s *LBService) AddLBMonitorServiceBinding(resource map[string]any) error { + payload := map[string]any{"lbmonitor_service_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMonitorServiceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMonitorServiceBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbMonitorServiceBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lbmonitor_sslcertkey_binding +func (s *LBService) AddLBMonitorSSLCertKeyBinding(resource map[string]any) error { + payload := map[string]any{"lbmonitor_sslcertkey_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbMonitorSSLCertKeyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBMonitorSSLCertKeyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbMonitorSSLCertKeyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBMonitorSSLCertKeyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbMonitorSSLCertKeyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbmonitor_sslcertkey_binding"], nil +} + +func (s *LBService) CountLBMonitorSSLCertKeyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbMonitorSSLCertKeyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbmonitor_sslcertkey_binding"]) > 0 { + if count, ok := result["lbmonitor_sslcertkey_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbparameter +func (s *LBService) UpdateLBParameter(resource map[string]any) error { + payload := map[string]any{"lbparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBParameter(resource map[string]any) error { + payload := map[string]any{"lbparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBParameter() (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbParameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if val, ok := result["lbparameter"]; ok { + return val.(map[string]any), nil + } + return nil, fmt.Errorf("lbparameter not found in response") +} + +// lbpersistentsessions +func (s *LBService) GetAllLBPersistentSessions() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbPersistentSessionsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbpersistentsessions"], nil +} + +func (s *LBService) CountLBPersistentSessions() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbPersistentSessionsURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbpersistentsessions"]) > 0 { + if count, ok := result["lbpersistentsessions"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LBService) ClearLBPersistentSessions(resource map[string]any) error { + payload := map[string]any{"lbpersistentsessions": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", lbPersistentSessionsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lbprofile +func (s *LBService) AddLBProfile(resource map[string]any) error { + payload := map[string]any{"lbprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UpdateLBProfile(resource map[string]any) error { + payload := map[string]any{"lbprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBProfile(resource map[string]any) error { + payload := map[string]any{"lbprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBProfile() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbprofile"], nil +} + +func (s *LBService) GetLBProfile(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbprofile"]) == 0 { + return nil, fmt.Errorf("lbprofile %s not found", name) + } + + return result["lbprofile"][0], nil +} + +func (s *LBService) CountLBProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbprofile"]) > 0 { + if count, ok := result["lbprofile"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbroute +func (s *LBService) AddLBRoute(resource map[string]any) error { + payload := map[string]any{"lbroute": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbRouteURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBRoute(network string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbRouteURL, network, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBRoute() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbRouteURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbroute"], nil +} + +func (s *LBService) CountLBRoute() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbRouteURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbroute"]) > 0 { + if count, ok := result["lbroute"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbroute6 +func (s *LBService) AddLBRoute6(resource map[string]any) error { + payload := map[string]any{"lbroute6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbRoute6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBRoute6(network string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbRoute6URL, network, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBRoute6() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbRoute6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbroute6"], nil +} + +func (s *LBService) CountLBRoute6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbRoute6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbroute6"]) > 0 { + if count, ok := result["lbroute6"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbsipparameters +func (s *LBService) UpdateLBSIPParameters(resource map[string]any) error { + payload := map[string]any{"lbsipparameters": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbSIPParametersURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBSIPParameters(resource map[string]any) error { + payload := map[string]any{"lbsipparameters": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbSIPParametersURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBSIPParameters() (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbSIPParametersURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if val, ok := result["lbsipparameters"]; ok { + return val.(map[string]any), nil + } + return nil, fmt.Errorf("lbsipparameters not found in response") +} + +// lbvserver +func (s *LBService) AddLBVServer(resource map[string]any) error { + payload := map[string]any{"lbvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbVServerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UpdateLBVServer(resource map[string]any) error { + payload := map[string]any{"lbvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBVServer(resource map[string]any) error { + payload := map[string]any{"lbvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) EnableLBVServer(name string) error { + payload := map[string]any{"lbvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", lbVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DisableLBVServer(name string) error { + payload := map[string]any{"lbvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", lbVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBVServer() ([]models.LBVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, lbVServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + LBVServer []models.LBVServer `json:"lbvserver"` + } + + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.LBVServer, nil +} + +func (s *LBService) GetLBVServer(name string) (models.LBVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerURL, name), nil) + if err != nil { + return models.LBVServer{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LBVServer{}, err + } + + var result struct { + LBVServer []models.LBVServer `json:"lbvserver"` + } + + if err := json.Unmarshal(resp, &result); err != nil { + return models.LBVServer{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.LBVServer) == 0 { + return models.LBVServer{}, fmt.Errorf("lbvserver %s not found", name) + } + + return result.LBVServer[0], nil +} + +func (s *LBService) CountLBVServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbVServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver"]) > 0 { + if count, ok := result["lbvserver"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LBService) RenameLBVServer(name, newName string) error { + payload := map[string]any{"lbvserver": map[string]string{"name": name, "newname": newName}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", lbVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lbvserver_analyticsprofile_binding +func (s *LBService) AddLBVServerAnalyticsProfileBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_analyticsprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAnalyticsProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAnalyticsProfileBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAnalyticsProfileBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAnalyticsProfileBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAnalyticsProfileBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_analyticsprofile_binding"], nil +} + +func (s *LBService) CountLBVServerAnalyticsProfileBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAnalyticsProfileBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_analyticsprofile_binding"]) > 0 { + if count, ok := result["lbvserver_analyticsprofile_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_appflowpolicy_binding +func (s *LBService) AddLBVServerAppFlowPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_appflowpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAppFlowPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAppFlowPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAppFlowPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAppFlowPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAppFlowPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_appflowpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAppFlowPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAppFlowPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_appflowpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_appflowpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_appfwpolicy_binding +func (s *LBService) AddLBVServerAppFWPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_appfwpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAppFWPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAppFWPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAppFWPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAppFWPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAppFWPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_appfwpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAppFWPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAppFWPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_appfwpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_appfwpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_appqoepolicy_binding +func (s *LBService) AddLBVServerAppQOEPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_appqoepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAppQOEPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAppQOEPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAppQOEPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAppQOEPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAppQOEPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_appqoepolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAppQOEPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAppQOEPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_appqoepolicy_binding"]) > 0 { + if count, ok := result["lbvserver_appqoepolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_auditnslogpolicy_binding +func (s *LBService) AddLBVServerAuditNSLogPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAuditNSLogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAuditNSLogPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAuditNSLogPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAuditNSLogPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAuditNSLogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_auditnslogpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAuditNSLogPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAuditNSLogPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_auditnslogpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_auditnslogpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_auditsyslogpolicy_binding +func (s *LBService) AddLBVServerAuditSyslogPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAuditSyslogPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAuditSyslogPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAuditSyslogPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAuditSyslogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_auditsyslogpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAuditSyslogPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAuditSyslogPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_auditsyslogpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_auditsyslogpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_authorizationpolicy_binding +func (s *LBService) AddLBVServerAuthorizationPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_authorizationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerAuthorizationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerAuthorizationPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerAuthorizationPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerAuthorizationPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerAuthorizationPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_authorizationpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerAuthorizationPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerAuthorizationPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_authorizationpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_authorizationpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_binding +func (s *LBService) GetLBVServerBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_binding"]) == 0 { + return nil, fmt.Errorf("lbvserver_binding %s not found", name) + } + + return result["lbvserver_binding"][0], nil +} + +// lbvserver_botpolicy_binding +func (s *LBService) AddLBVServerBotPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_botpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerBotPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerBotPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerBotPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerBotPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerBotPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_botpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerBotPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerBotPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_botpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_botpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_cachepolicy_binding +func (s *LBService) AddLBVServerCachePolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_cachepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerCachePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerCachePolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerCachePolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerCachePolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerCachePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_cachepolicy_binding"], nil +} + +func (s *LBService) CountLBVServerCachePolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerCachePolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_cachepolicy_binding"]) > 0 { + if count, ok := result["lbvserver_cachepolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_cmppolicy_binding +func (s *LBService) AddLBVServerCMPPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_cmppolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerCMPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerCMPPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerCMPPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerCMPPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerCMPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_cmppolicy_binding"], nil +} + +func (s *LBService) CountLBVServerCMPPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerCMPPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_cmppolicy_binding"]) > 0 { + if count, ok := result["lbvserver_cmppolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_contentinspectionpolicy_binding +func (s *LBService) AddLBVServerContentInspectionPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_contentinspectionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerContentInspectionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerContentInspectionPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerContentInspectionPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerContentInspectionPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerContentInspectionPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_contentinspectionpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerContentInspectionPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerContentInspectionPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_contentinspectionpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_contentinspectionpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_csvserver_binding +func (s *LBService) GetLBVServerCSVServerBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerCSVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_csvserver_binding"], nil +} + +func (s *LBService) CountLBVServerCSVServerBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerCSVServerBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_csvserver_binding"]) > 0 { + if count, ok := result["lbvserver_csvserver_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_dnspolicy64_binding +func (s *LBService) AddLBVServerDNSPolicy64Binding(resource map[string]any) error { + payload := map[string]any{"lbvserver_dnspolicy64_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerDNSPolicy64BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerDNSPolicy64Binding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerDNSPolicy64BindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerDNSPolicy64Binding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerDNSPolicy64BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_dnspolicy64_binding"], nil +} + +func (s *LBService) CountLBVServerDNSPolicy64Binding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerDNSPolicy64BindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_dnspolicy64_binding"]) > 0 { + if count, ok := result["lbvserver_dnspolicy64_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_feopolicy_binding +func (s *LBService) AddLBVServerFEOPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_feopolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerFEOPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerFEOPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerFEOPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerFEOPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerFEOPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_feopolicy_binding"], nil +} + +func (s *LBService) CountLBVServerFEOPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerFEOPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_feopolicy_binding"]) > 0 { + if count, ok := result["lbvserver_feopolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_responderpolicy_binding +func (s *LBService) AddLBVServerResponderPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_responderpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerResponderPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerResponderPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerResponderPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerResponderPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerResponderPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_responderpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerResponderPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerResponderPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_responderpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_responderpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_rewritepolicy_binding +func (s *LBService) AddLBVServerRewritePolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_rewritepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerRewritePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerRewritePolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerRewritePolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerRewritePolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerRewritePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_rewritepolicy_binding"], nil +} + +func (s *LBService) CountLBVServerRewritePolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerRewritePolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_rewritepolicy_binding"]) > 0 { + if count, ok := result["lbvserver_rewritepolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_servicegroupmember_binding +func (s *LBService) GetLBVServerServiceGroupMemberBinding(lbvserver string) ([]models.LBVServerServiceGroupMemberBinding, error) { + u := fmt.Sprintf("%s/%s", lbVServerServiceGroupMemberBindingURL, lbvserver) + + req, err := s.client.NewRequest(http.MethodGet, u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Binding []models.LBVServerServiceGroupMemberBinding `json:"lbvserver_servicegroupmember_binding"` + } + + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Binding, nil +} + +func (s *LBService) CountLBVServerServiceGroupMemberBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerServiceGroupMemberBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_servicegroupmember_binding"]) > 0 { + if count, ok := result["lbvserver_servicegroupmember_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_servicegroup_binding +func (s *LBService) AddLBVServerServiceGroupBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_servicegroup_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerServiceGroupBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerServiceGroupBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerServiceGroupBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerServiceGroupBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerServiceGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_servicegroup_binding"], nil +} + +func (s *LBService) CountLBVServerServiceGroupBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerServiceGroupBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_servicegroup_binding"]) > 0 { + if count, ok := result["lbvserver_servicegroup_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_service_binding +func (s *LBService) AddLBVServerServiceBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_service_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerServiceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerServiceBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerServiceBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerServiceBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerServiceBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_service_binding"], nil +} + +func (s *LBService) CountLBVServerServiceBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerServiceBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_service_binding"]) > 0 { + if count, ok := result["lbvserver_service_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_spilloverpolicy_binding +func (s *LBService) AddLBVServerSpilloverPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_spilloverpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerSpilloverPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerSpilloverPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerSpilloverPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerSpilloverPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerSpilloverPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_spilloverpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerSpilloverPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerSpilloverPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_spilloverpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_spilloverpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_tmtrafficpolicy_binding +func (s *LBService) AddLBVServerTMTrafficPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_tmtrafficpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerTMTrafficPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerTMTrafficPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerTMTrafficPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerTMTrafficPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerTMTrafficPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_tmtrafficpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerTMTrafficPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerTMTrafficPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_tmtrafficpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_tmtrafficpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_transformpolicy_binding +func (s *LBService) AddLBVServerTransformPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_transformpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerTransformPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerTransformPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerTransformPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerTransformPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerTransformPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_transformpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerTransformPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerTransformPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_transformpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_transformpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_videooptimizationdetectionpolicy_binding +func (s *LBService) AddLBVServerVideoOptimizationDetectionPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_videooptimizationdetectionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerVideoOptimizationDetectionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerVideoOptimizationDetectionPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerVideoOptimizationDetectionPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerVideoOptimizationDetectionPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerVideoOptimizationDetectionPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_videooptimizationdetectionpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerVideoOptimizationDetectionPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerVideoOptimizationDetectionPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_videooptimizationdetectionpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_videooptimizationdetectionpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbvserver_videooptimizationpacingpolicy_binding +func (s *LBService) AddLBVServerVideoOptimizationPacingPolicyBinding(resource map[string]any) error { + payload := map[string]any{"lbvserver_videooptimizationpacingpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbVServerVideoOptimizationPacingPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBVServerVideoOptimizationPacingPolicyBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbVServerVideoOptimizationPacingPolicyBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBVServerVideoOptimizationPacingPolicyBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbVServerVideoOptimizationPacingPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbvserver_videooptimizationpacingpolicy_binding"], nil +} + +func (s *LBService) CountLBVServerVideoOptimizationPacingPolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbVServerVideoOptimizationPacingPolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbvserver_videooptimizationpacingpolicy_binding"]) > 0 { + if count, ok := result["lbvserver_videooptimizationpacingpolicy_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbwlm +func (s *LBService) AddLBWLM(resource map[string]any) error { + payload := map[string]any{"lbwlm": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbWLMURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBWLM(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lbWLMURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UpdateLBWLM(resource map[string]any) error { + payload := map[string]any{"lbwlm": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lbWLMURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) UnsetLBWLM(resource map[string]any) error { + payload := map[string]any{"lbwlm": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lbWLMURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetAllLBWLM() ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, lbWLMURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbwlm"], nil +} + +func (s *LBService) GetLBWLM(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbWLMURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbwlm"]) == 0 { + return nil, fmt.Errorf("lbwlm %s not found", name) + } + + return result["lbwlm"][0], nil +} + +func (s *LBService) CountLBWLM() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lbWLMURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbwlm"]) > 0 { + if count, ok := result["lbwlm"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} + +// lbwlm_binding +func (s *LBService) GetLBWLMBinding(name string) (map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbWLMBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbwlm_binding"]) == 0 { + return nil, fmt.Errorf("lbwlm_binding %s not found", name) + } + + return result["lbwlm_binding"][0], nil +} + +// lbwlm_lbvserver_binding +func (s *LBService) AddLBWLMLBVServerBinding(resource map[string]any) error { + payload := map[string]any{"lbwlm_lbvserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lbWLMLBVServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) DeleteLBWLMLBVServerBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lbWLMLBVServerBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LBService) GetLBWLMLBVServerBinding(name string) ([]map[string]any, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lbWLMLBVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result["lbwlm_lbvserver_binding"], nil +} + +func (s *LBService) CountLBWLMLBVServerBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lbWLMLBVServerBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result map[string][]map[string]any + if err := json.Unmarshal(resp, &result); err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result["lbwlm_lbvserver_binding"]) > 0 { + if count, ok := result["lbwlm_lbvserver_binding"][0]["__count"].(float64); ok { + return int(count), nil + } + } + return 0, fmt.Errorf("failed to parse count") +} From ff7ad49d613cb21e5fbdb7e0803763e9034831f1 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sat, 14 Feb 2026 15:45:23 -0600 Subject: [PATCH 04/10] models. --- nitrogo/models/aaa.go | 620 +++++++++ nitrogo/models/adm.go | 11 + nitrogo/models/analytics.go | 62 + nitrogo/models/api.go | 50 + nitrogo/models/app.go | 11 + nitrogo/models/appflow.go | 278 ++++ nitrogo/models/appfw.go | 1190 ++++++++++++++++++ nitrogo/models/appqoe.go | 68 + nitrogo/models/audit.go | 433 +++++++ nitrogo/models/authentication.go | 1715 +++++++++++++++++++++++++ nitrogo/models/authorization.go | 118 ++ nitrogo/models/autoscale.go | 56 + nitrogo/models/azure.go | 23 + nitrogo/models/bfd.go | 30 + nitrogo/models/bot.go | 339 +++++ nitrogo/models/cache.go | 348 +++++ nitrogo/models/cloud.go | 86 ++ nitrogo/models/cloudtunnel.go | 30 + nitrogo/models/cluster.go | 246 ++++ nitrogo/models/cmp.go | 219 ++++ nitrogo/models/contentinspection.go | 223 ++++ nitrogo/models/cr.go | 370 ++++++ nitrogo/models/cs.go | 589 +++++++++ nitrogo/models/db.go | 23 + nitrogo/models/dns.go | 558 ++++++++ nitrogo/models/dos.go | 11 + nitrogo/models/endpoint.go | 13 + nitrogo/models/feo.go | 131 ++ nitrogo/models/filter.go | 113 ++ nitrogo/models/gslb.go | 778 ++++++++++++ nitrogo/models/ha.go | 97 ++ nitrogo/models/ica.go | 150 +++ nitrogo/models/ipsec.go | 40 + nitrogo/models/ipsecalg.go | 26 + nitrogo/models/kafka.go | 23 + nitrogo/models/lb.go | 1109 ++++++++++++++++ nitrogo/models/lbmodels.go | 170 --- nitrogo/models/lldp.go | 48 + nitrogo/models/lsn.go | 419 ++++++ nitrogo/models/metrics.go | 77 ++ nitrogo/models/network.go | 1294 +++++++++++++++++++ nitrogo/models/ns.go | 1790 ++++++++++++++++++++++++++ nitrogo/models/ntp.go | 34 + nitrogo/models/pcp.go | 41 + nitrogo/models/policy.go | 214 ++++ nitrogo/models/pq.go | 26 + nitrogo/models/protocol.go | 24 + nitrogo/models/quic.go | 35 + nitrogo/models/quicbridge.go | 13 + nitrogo/models/rdp.go | 54 + nitrogo/models/reputation.go | 13 + nitrogo/models/responder.go | 227 ++++ nitrogo/models/rewrite.go | 213 ++++ nitrogo/models/router.go | 12 + nitrogo/models/sc.go | 23 + nitrogo/models/smpp.go | 21 + nitrogo/models/snmp.go | 137 ++ nitrogo/models/spillover.go | 71 ++ nitrogo/models/ssl.go | 1445 +++++++++++++++++++++ nitrogo/models/stream.go | 54 + nitrogo/models/subscriber.go | 92 ++ nitrogo/models/tm.go | 338 +++++ nitrogo/models/transform.go | 234 ++++ nitrogo/models/tunnel.go | 76 ++ nitrogo/models/ulfd.go | 11 + nitrogo/models/urlfiltering.go | 36 + nitrogo/models/user.go | 31 + nitrogo/models/utility.go | 142 +++ nitrogo/models/videooptimization.go | 305 +++++ nitrogo/models/vpn.go | 1819 +++++++++++++++++++++++++++ 70 files changed, 19556 insertions(+), 170 deletions(-) create mode 100644 nitrogo/models/aaa.go create mode 100644 nitrogo/models/adm.go create mode 100644 nitrogo/models/analytics.go create mode 100644 nitrogo/models/api.go create mode 100644 nitrogo/models/app.go create mode 100644 nitrogo/models/appflow.go create mode 100644 nitrogo/models/appfw.go create mode 100644 nitrogo/models/appqoe.go create mode 100644 nitrogo/models/audit.go create mode 100644 nitrogo/models/authentication.go create mode 100644 nitrogo/models/authorization.go create mode 100644 nitrogo/models/autoscale.go create mode 100644 nitrogo/models/azure.go create mode 100644 nitrogo/models/bfd.go create mode 100644 nitrogo/models/bot.go create mode 100644 nitrogo/models/cache.go create mode 100644 nitrogo/models/cloud.go create mode 100644 nitrogo/models/cloudtunnel.go create mode 100644 nitrogo/models/cluster.go create mode 100644 nitrogo/models/cmp.go create mode 100644 nitrogo/models/contentinspection.go create mode 100644 nitrogo/models/cr.go create mode 100644 nitrogo/models/cs.go create mode 100644 nitrogo/models/db.go create mode 100644 nitrogo/models/dns.go create mode 100644 nitrogo/models/dos.go create mode 100644 nitrogo/models/endpoint.go create mode 100644 nitrogo/models/feo.go create mode 100644 nitrogo/models/filter.go create mode 100644 nitrogo/models/gslb.go create mode 100644 nitrogo/models/ha.go create mode 100644 nitrogo/models/ica.go create mode 100644 nitrogo/models/ipsec.go create mode 100644 nitrogo/models/ipsecalg.go create mode 100644 nitrogo/models/kafka.go create mode 100644 nitrogo/models/lb.go delete mode 100644 nitrogo/models/lbmodels.go create mode 100644 nitrogo/models/lldp.go create mode 100644 nitrogo/models/lsn.go create mode 100644 nitrogo/models/metrics.go create mode 100644 nitrogo/models/network.go create mode 100644 nitrogo/models/ns.go create mode 100644 nitrogo/models/ntp.go create mode 100644 nitrogo/models/pcp.go create mode 100644 nitrogo/models/policy.go create mode 100644 nitrogo/models/pq.go create mode 100644 nitrogo/models/protocol.go create mode 100644 nitrogo/models/quic.go create mode 100644 nitrogo/models/quicbridge.go create mode 100644 nitrogo/models/rdp.go create mode 100644 nitrogo/models/reputation.go create mode 100644 nitrogo/models/responder.go create mode 100644 nitrogo/models/rewrite.go create mode 100644 nitrogo/models/router.go create mode 100644 nitrogo/models/sc.go create mode 100644 nitrogo/models/smpp.go create mode 100644 nitrogo/models/snmp.go create mode 100644 nitrogo/models/spillover.go create mode 100644 nitrogo/models/ssl.go create mode 100644 nitrogo/models/stream.go create mode 100644 nitrogo/models/subscriber.go create mode 100644 nitrogo/models/tm.go create mode 100644 nitrogo/models/transform.go create mode 100644 nitrogo/models/tunnel.go create mode 100644 nitrogo/models/ulfd.go create mode 100644 nitrogo/models/urlfiltering.go create mode 100644 nitrogo/models/user.go create mode 100644 nitrogo/models/utility.go create mode 100644 nitrogo/models/videooptimization.go create mode 100644 nitrogo/models/vpn.go diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go new file mode 100644 index 0000000..c46b9a6 --- /dev/null +++ b/nitrogo/models/aaa.go @@ -0,0 +1,620 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Aaaglobalauthenticationnegotiateactionbinding struct { + Windowsprofile string `json:"windowsprofile,omitempty"` +} + +type Aaagroupintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaaldapparams struct { + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Ldapbase string `json:"ldapbase,omitempty"` + Ldapbinddn string `json:"ldapbinddn,omitempty"` + Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` + Ldaploginname string `json:"ldaploginname,omitempty"` + Searchfilter string `json:"searchfilter,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Subattributename string `json:"subattributename,omitempty"` + Sectype string `json:"sectype,omitempty"` + Svrtype string `json:"svrtype,omitempty"` + Ssonameattribute string `json:"ssonameattribute,omitempty"` + Passwdchange string `json:"passwdchange,omitempty"` + Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` + Maxnestinglevel int `json:"maxnestinglevel,omitempty"` + Groupnameidentifier string `json:"groupnameidentifier,omitempty"` + Groupsearchattribute string `json:"groupsearchattribute,omitempty"` + Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` + Groupsearchfilter string `json:"groupsearchfilter,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Groupauthname string `json:"groupauthname,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaaotpparameter struct { + Encryption string `json:"encryption,omitempty"` + Maxotpdevices int `json:"maxotpdevices,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaasession struct { + Username string `json:"username,omitempty"` + Groupname string `json:"groupname,omitempty"` + Iip string `json:"iip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Sessionkey string `json:"sessionkey,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + All bool `json:"all,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport string `json:"publicport,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port string `json:"port,omitempty"` + Privateip string `json:"privateip,omitempty"` + Privateport string `json:"privateport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + Intranetip6 string `json:"intranetip6,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauserauditsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupauthorizationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Aaagroupsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaaparameter struct { + Enablestaticpagecaching string `json:"enablestaticpagecaching,omitempty"` + Enableenhancedauthfeedback string `json:"enableenhancedauthfeedback,omitempty"` + Defaultauthtype string `json:"defaultauthtype,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + Aaadnatip string `json:"aaadnatip,omitempty"` + Enablesessionstickiness string `json:"enablesessionstickiness,omitempty"` + Aaasessionloglevel string `json:"aaasessionloglevel,omitempty"` + Aaadloglevel string `json:"aaadloglevel,omitempty"` + Dynaddr string `json:"dynaddr,omitempty"` + Ftmode string `json:"ftmode,omitempty"` + Maxsamldeflatesize int `json:"maxsamldeflatesize,omitempty"` + Persistentloginattempts string `json:"persistentloginattempts,omitempty"` + Pwdexpirynotificationdays int `json:"pwdexpirynotificationdays,omitempty"` + Maxkbquestions int `json:"maxkbquestions,omitempty"` + Loginencryption string `json:"loginencryption,omitempty"` + Samesite string `json:"samesite,omitempty"` + Apitokencache string `json:"apitokencache,omitempty"` + Tokenintrospectioninterval int `json:"tokenintrospectioninterval,omitempty"` + Defaultcspheader string `json:"defaultcspheader,omitempty"` + Httponlycookie string `json:"httponlycookie,omitempty"` + Enhancedepa string `json:"enhancedepa,omitempty"` + Wafprotection []string `json:"wafprotection,omitempty"` + Securityinsights string `json:"securityinsights,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauserbinding struct { + Username string `json:"username,omitempty"` +} + +type Aaausersyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaausertrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaauservpnurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupuserbinding struct { + Username string `json:"username,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationpolicyaaaglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Aaaglobalbinding struct { +} + +type Aaagroupintranetip6binding struct { + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagrouppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Aaagroupsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupvpnurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupvpnurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaakcdaccount struct { + Kcdaccount string `json:"kcdaccount,omitempty"` + Keytab string `json:"keytab,omitempty"` + Realmstr string `json:"realmstr,omitempty"` + Delegateduser string `json:"delegateduser,omitempty"` + Kcdpassword string `json:"kcdpassword,omitempty"` + Usercert string `json:"usercert,omitempty"` + Cacert string `json:"cacert,omitempty"` + Userrealm string `json:"userrealm,omitempty"` + Enterpriserealm string `json:"enterpriserealm,omitempty"` + Servicespn string `json:"servicespn,omitempty"` + Principle string `json:"principle,omitempty"` + Kcdspn string `json:"kcdspn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaatacacsparams struct { + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Tacacssecret string `json:"tacacssecret,omitempty"` + Authorization string `json:"authorization,omitempty"` + Accounting string `json:"accounting,omitempty"` + Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauservpntrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaacertparams struct { + Usernamefield string `json:"usernamefield,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Twofactor string `json:"twofactor,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaaglobalaaapreauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` +} + +type Aaagroupauditsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaauservpnintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaauservpnsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaagroup struct { + Groupname string `json:"groupname,omitempty"` + Weight int `json:"weight,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauserpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Username string `json:"username,omitempty"` +} + +type Aaauservpnurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaaglobalnegotiateactionbinding struct { + Windowsprofile string `json:"windowsprofile,omitempty"` +} + +type Aaagroupaaauserbinding struct { + Username string `json:"username,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationparameter struct { + Preauthenticationaction string `json:"preauthenticationaction,omitempty"` + Rule string `json:"rule,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaassoprofile struct { + Name string `json:"name,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauser struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauserintranetip6binding struct { + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagrouptmsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaauserintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaauserurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupauditnslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationaction struct { + Name string `json:"name,omitempty"` + Preauthenticationaction string `json:"preauthenticationaction,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Defaultepagroup string `json:"defaultepagroup,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaaradiusparams struct { + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radvendorid int `json:"radvendorid,omitempty"` + Radattributetype int `json:"radattributetype,omitempty"` + Radgroupsprefix string `json:"radgroupsprefix,omitempty"` + Radgroupseparator string `json:"radgroupseparator,omitempty"` + Passencoding string `json:"passencoding,omitempty"` + Ipvendorid int `json:"ipvendorid,omitempty"` + Ipattributetype int `json:"ipattributetype,omitempty"` + Accounting string `json:"accounting,omitempty"` + Pwdvendorid int `json:"pwdvendorid,omitempty"` + Pwdattributetype int `json:"pwdattributetype,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Callingstationid string `json:"callingstationid,omitempty"` + Authservretry int `json:"authservretry,omitempty"` + Authentication string `json:"authentication,omitempty"` + Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` + Messageauthenticator string `json:"messageauthenticator,omitempty"` + Groupauthname string `json:"groupauthname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaaglobalpreauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` +} + +type Aaagroupbinding struct { + Groupname string `json:"groupname,omitempty"` +} + +type Aaagroupurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Hits string `json:"hits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Aaauseraaagroupbinding struct { + Groupname string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagrouptrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Aaagroupnslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupvpntrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaapreauthenticationpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Aaauserauthorizationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Username string `json:"username,omitempty"` +} + +type Aaausersessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaagroupvpnsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaapreauthenticationpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Aaapreauthenticationpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Aaauserauditnslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaausernslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaausertmsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` +} + +type Aaauserurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Username string `json:"username,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaauserintranetipbinding struct { + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupintranetipbinding struct { + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaagroupvpnintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype int `json:"acttype,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Aaausergroupbinding struct { + Groupname string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} diff --git a/nitrogo/models/adm.go b/nitrogo/models/adm.go new file mode 100644 index 0000000..998c91a --- /dev/null +++ b/nitrogo/models/adm.go @@ -0,0 +1,11 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Admparameter struct { + Admserviceconnect string `json:"admserviceconnect,omitempty"` + Lowtouchonboard string `json:"lowtouchonboard,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/analytics.go b/nitrogo/models/analytics.go new file mode 100644 index 0000000..9e4a698 --- /dev/null +++ b/nitrogo/models/analytics.go @@ -0,0 +1,62 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Analyticsglobalbinding struct { +} + +type Analyticsglobalprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` +} + +type Analyticsprofile struct { + Name string `json:"name,omitempty"` + Collectors string `json:"collectors,omitempty"` + Type string `json:"type,omitempty"` + Httpclientsidemeasurements string `json:"httpclientsidemeasurements,omitempty"` + Httppagetracking string `json:"httppagetracking,omitempty"` + Httpurl string `json:"httpurl,omitempty"` + Httphost string `json:"httphost,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httpreferer string `json:"httpreferer,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httplocation string `json:"httplocation,omitempty"` + Urlcategory string `json:"urlcategory,omitempty"` + Allhttpheaders string `json:"allhttpheaders,omitempty"` + Httpcontenttype string `json:"httpcontenttype,omitempty"` + Httpauthentication string `json:"httpauthentication,omitempty"` + Httpvia string `json:"httpvia,omitempty"` + Httpxforwardedforheader string `json:"httpxforwardedforheader,omitempty"` + Httpsetcookie string `json:"httpsetcookie,omitempty"` + Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` + Httpdomainname string `json:"httpdomainname,omitempty"` + Httpurlquery string `json:"httpurlquery,omitempty"` + Tcpburstreporting string `json:"tcpburstreporting,omitempty"` + Cqareporting string `json:"cqareporting,omitempty"` + Integratedcache string `json:"integratedcache,omitempty"` + Grpcstatus string `json:"grpcstatus,omitempty"` + Outputmode string `json:"outputmode,omitempty"` + Metrics string `json:"metrics,omitempty"` + Events string `json:"events,omitempty"` + Auditlogs string `json:"auditlogs,omitempty"` + Servemode string `json:"servemode,omitempty"` + Schemafile string `json:"schemafile,omitempty"` + Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` + Analyticsendpointmetadata string `json:"analyticsendpointmetadata,omitempty"` + Dataformatfile string `json:"dataformatfile,omitempty"` + Topn string `json:"topn,omitempty"` + Httpcustomheaders []string `json:"httpcustomheaders,omitempty"` + Managementlog []string `json:"managementlog,omitempty"` + Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` + Analyticsendpointurl string `json:"analyticsendpointurl,omitempty"` + Analyticsendpointcontenttype string `json:"analyticsendpointcontenttype,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Analyticsglobalanalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` +} diff --git a/nitrogo/models/api.go b/nitrogo/models/api.go new file mode 100644 index 0000000..783cb3c --- /dev/null +++ b/nitrogo/models/api.go @@ -0,0 +1,50 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Apiprofileapispecbinding struct { + Apispec string `json:"apispec,omitempty"` + Name string `json:"name,omitempty"` +} + +type Apiprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Apispec struct { + Name string `json:"name,omitempty"` + File string `json:"file,omitempty"` + Type string `json:"type,omitempty"` + Skipvalidation string `json:"skipvalidation,omitempty"` + Encrypted bool `json:"encrypted,omitempty"` + Builtin string `json:"builtin,omitempty"` + Ready string `json:"ready,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Apispecbinding struct { + Name string `json:"name,omitempty"` +} + +type Apispecspecendpointbinding struct { + Apiname string `json:"apiname,omitempty"` + Apiservice string `json:"apiservice,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httpurlpath string `json:"httpurlpath,omitempty"` + Name string `json:"name,omitempty"` +} + +type Apispecfile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Apiprofile struct { + Name string `json:"name,omitempty"` + Apivisibility string `json:"apivisibility,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/app.go b/nitrogo/models/app.go new file mode 100644 index 0000000..fedbc85 --- /dev/null +++ b/nitrogo/models/app.go @@ -0,0 +1,11 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Application struct { + Apptemplatefilename string `json:"apptemplatefilename,omitempty"` + Appname string `json:"appname,omitempty"` + Deploymentfilename string `json:"deploymentfilename,omitempty"` +} diff --git a/nitrogo/models/appflow.go b/nitrogo/models/appflow.go new file mode 100644 index 0000000..ed8dabe --- /dev/null +++ b/nitrogo/models/appflow.go @@ -0,0 +1,278 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Appflowcollector struct { + Name string `json:"name,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Transport string `json:"transport,omitempty"` + Newname string `json:"newname,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appflowglobalbinding struct { +} + +type Appflowpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appflowpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Appflowpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicyappflowglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicyappflowpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appflowactionbinding struct { + Name string `json:"name,omitempty"` +} + +type Appflowparam struct { + Templaterefresh int `json:"templaterefresh,omitempty"` + Appnamerefresh int `json:"appnamerefresh,omitempty"` + Flowrecordinterval int `json:"flowrecordinterval,omitempty"` + Securityinsightrecordinterval int `json:"securityinsightrecordinterval,omitempty"` + Udppmtu int `json:"udppmtu,omitempty"` + Httpurl string `json:"httpurl,omitempty"` + Aaausername string `json:"aaausername,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httpreferer string `json:"httpreferer,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httphost string `json:"httphost,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Clienttrafficonly string `json:"clienttrafficonly,omitempty"` + Httpcontenttype string `json:"httpcontenttype,omitempty"` + Httpauthorization string `json:"httpauthorization,omitempty"` + Httpvia string `json:"httpvia,omitempty"` + Httpxforwardedfor string `json:"httpxforwardedfor,omitempty"` + Httplocation string `json:"httplocation,omitempty"` + Httpsetcookie string `json:"httpsetcookie,omitempty"` + Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` + Connectionchaining string `json:"connectionchaining,omitempty"` + Httpdomain string `json:"httpdomain,omitempty"` + Skipcacheredirectionhttptransaction string `json:"skipcacheredirectionhttptransaction,omitempty"` + Identifiername string `json:"identifiername,omitempty"` + Identifiersessionname string `json:"identifiersessionname,omitempty"` + Observationdomainid int `json:"observationdomainid,omitempty"` + Observationdomainname string `json:"observationdomainname,omitempty"` + Subscriberawareness string `json:"subscriberawareness,omitempty"` + Subscriberidobfuscation string `json:"subscriberidobfuscation,omitempty"` + Subscriberidobfuscationalgo string `json:"subscriberidobfuscationalgo,omitempty"` + Gxsessionreporting string `json:"gxsessionreporting,omitempty"` + Securityinsighttraffic string `json:"securityinsighttraffic,omitempty"` + Cacheinsight string `json:"cacheinsight,omitempty"` + Videoinsight string `json:"videoinsight,omitempty"` + Httpquerywithurl string `json:"httpquerywithurl,omitempty"` + Urlcategory string `json:"urlcategory,omitempty"` + Lsnlogging string `json:"lsnlogging,omitempty"` + Cqareporting string `json:"cqareporting,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Usagerecordinterval int `json:"usagerecordinterval,omitempty"` + Websaasappusagereporting string `json:"websaasappusagereporting,omitempty"` + Metrics string `json:"metrics,omitempty"` + Events string `json:"events,omitempty"` + Auditlogs string `json:"auditlogs,omitempty"` + Observationpointid int `json:"observationpointid,omitempty"` + Distributedtracing string `json:"distributedtracing,omitempty"` + Disttracingsamplingrate int `json:"disttracingsamplingrate,omitempty"` + Tcpattackcounterinterval int `json:"tcpattackcounterinterval,omitempty"` + Logstreamovernsip string `json:"logstreamovernsip,omitempty"` + Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` + Timeseriesovernsip string `json:"timeseriesovernsip,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Tcpburstreporting string `json:"tcpburstreporting,omitempty"` + Tcpburstreportingthreshold string `json:"tcpburstreportingthreshold,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appflowpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicylabelappflowpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appflowpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Appflowaction struct { + Name string `json:"name,omitempty"` + Collectors []string `json:"collectors,omitempty"` + Clientsidemeasurements string `json:"clientsidemeasurements,omitempty"` + Pagetracking string `json:"pagetracking,omitempty"` + Webinsight string `json:"webinsight,omitempty"` + Securityinsight string `json:"securityinsight,omitempty"` + Botinsight string `json:"botinsight,omitempty"` + Ciinsight string `json:"ciinsight,omitempty"` + Videoanalytics string `json:"videoanalytics,omitempty"` + Distributionalgorithm string `json:"distributionalgorithm,omitempty"` + Metricslog bool `json:"metricslog,omitempty"` + Transactionlog string `json:"transactionlog,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appflowactionanalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowglobalappflowpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Appflowglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Appflowpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appflowpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appflowactionprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/appfw.go b/nitrogo/models/appfw.go new file mode 100644 index 0000000..73df16a --- /dev/null +++ b/nitrogo/models/appfw.go @@ -0,0 +1,1190 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Appfwlearningdata struct { + Profilename string `json:"profilename,omitempty"` + Starturl string `json:"starturl,omitempty"` + Cookieconsistency string `json:"cookieconsistency,omitempty"` + Fieldconsistency string `json:"fieldconsistency,omitempty"` + Formactionurlffc string `json:"formactionurl_ffc,omitempty"` + Contenttype string `json:"contenttype,omitempty"` + Crosssitescripting string `json:"crosssitescripting,omitempty"` + Formactionurlxss string `json:"formactionurl_xss,omitempty"` + Asscanlocationxss string `json:"as_scan_location_xss,omitempty"` + Asvaluetypexss string `json:"as_value_type_xss,omitempty"` + Asvalueexprxss string `json:"as_value_expr_xss,omitempty"` + Sqlinjection string `json:"sqlinjection,omitempty"` + Formactionurlsql string `json:"formactionurl_sql,omitempty"` + Asscanlocationsql string `json:"as_scan_location_sql,omitempty"` + Asvaluetypesql string `json:"as_value_type_sql,omitempty"` + Asvalueexprsql string `json:"as_value_expr_sql,omitempty"` + Fieldformat string `json:"fieldformat,omitempty"` + Formactionurlff string `json:"formactionurl_ff,omitempty"` + Csrftag string `json:"csrftag,omitempty"` + Csrfformoriginurl string `json:"csrfformoriginurl,omitempty"` + Creditcardnumber string `json:"creditcardnumber,omitempty"` + Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` + Xmldoscheck string `json:"xmldoscheck,omitempty"` + Xmlwsicheck string `json:"xmlwsicheck,omitempty"` + Xmlattachmentcheck string `json:"xmlattachmentcheck,omitempty"` + Totalxmlrequests bool `json:"totalxmlrequests,omitempty"` + Securitycheck string `json:"securitycheck,omitempty"` + Target string `json:"target,omitempty"` + Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + Fieldtype string `json:"fieldtype,omitempty"` + Fieldformatminlength string `json:"fieldformatminlength,omitempty"` + Fieldformatmaxlength string `json:"fieldformatmaxlength,omitempty"` + Fieldformatcharmappcre string `json:"fieldformatcharmappcre,omitempty"` + Valuetype string `json:"value_type,omitempty"` + Value string `json:"value,omitempty"` + Hits string `json:"hits,omitempty"` + Data string `json:"data,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwprofilefileuploadtypebinding struct { + Fileuploadtype string `json:"fileuploadtype,omitempty"` + Asfileuploadtypesurl string `json:"as_fileuploadtypes_url,omitempty"` + Isnameregex string `json:"isnameregex,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Filetype []string `json:"filetype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Isregexfileuploadtypesurl string `json:"isregex_fileuploadtypes_url,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilerestvalidationbinding struct { + Restvalidation string `json:"restvalidation,omitempty"` + Restvalidationaction string `json:"rest_validation_action,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwxmlcontenttype struct { + Xmlcontenttypevalue string `json:"xmlcontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwxmlschema struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwprofilecontenttypebinding struct { + Contenttype string `json:"contenttype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofiledenyurlbinding struct { + Denyurl string `json:"denyurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwmultipartformcontenttype struct { + Multipartformcontenttypevalue string `json:"multipartformcontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwcustomsettings struct { + Name string `json:"name,omitempty"` + Target string `json:"target,omitempty"` +} + +type Appfwgrpcwebtextcontenttype struct { + Grpcwebtextcontenttypevalue string `json:"grpcwebtextcontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwprofile struct { + Name string `json:"name,omitempty"` + Defaults string `json:"defaults,omitempty"` + Starturlaction []string `json:"starturlaction,omitempty"` + Infercontenttypexmlpayloadaction []string `json:"infercontenttypexmlpayloadaction,omitempty"` + Contenttypeaction []string `json:"contenttypeaction,omitempty"` + Inspectcontenttypes []string `json:"inspectcontenttypes,omitempty"` + Starturlclosure string `json:"starturlclosure,omitempty"` + Denyurlaction []string `json:"denyurlaction,omitempty"` + Refererheadercheck string `json:"refererheadercheck,omitempty"` + Cookieconsistencyaction []string `json:"cookieconsistencyaction,omitempty"` + Cookiehijackingaction []string `json:"cookiehijackingaction,omitempty"` + Cookietransforms string `json:"cookietransforms,omitempty"` + Cookieencryption string `json:"cookieencryption,omitempty"` + Cookieproxying string `json:"cookieproxying,omitempty"` + Addcookieflags string `json:"addcookieflags,omitempty"` + Fieldconsistencyaction []string `json:"fieldconsistencyaction,omitempty"` + Csrftagaction []string `json:"csrftagaction,omitempty"` + Crosssitescriptingaction []string `json:"crosssitescriptingaction,omitempty"` + Crosssitescriptingtransformunsafehtml string `json:"crosssitescriptingtransformunsafehtml,omitempty"` + Crosssitescriptingcheckcompleteurls string `json:"crosssitescriptingcheckcompleteurls,omitempty"` + Sqlinjectionaction []string `json:"sqlinjectionaction,omitempty"` + Cmdinjectionaction []string `json:"cmdinjectionaction,omitempty"` + Cmdinjectiontype string `json:"cmdinjectiontype,omitempty"` + Sqlinjectiongrammar string `json:"sqlinjectiongrammar,omitempty"` + Cmdinjectiongrammar string `json:"cmdinjectiongrammar,omitempty"` + Fieldscan string `json:"fieldscan,omitempty"` + Fieldscanlimit int `json:"fieldscanlimit,omitempty"` + Jsonfieldscan string `json:"jsonfieldscan,omitempty"` + Jsonfieldscanlimit int `json:"jsonfieldscanlimit,omitempty"` + Messagescan string `json:"messagescan,omitempty"` + Messagescanlimit int `json:"messagescanlimit,omitempty"` + Jsonmessagescan string `json:"jsonmessagescan,omitempty"` + Jsonmessagescanlimit int `json:"jsonmessagescanlimit,omitempty"` + Messagescanlimitcontenttypes []string `json:"messagescanlimitcontenttypes,omitempty"` + Sqlinjectiontransformspecialchars string `json:"sqlinjectiontransformspecialchars,omitempty"` + Sqlinjectiononlycheckfieldswithsqlchars string `json:"sqlinjectiononlycheckfieldswithsqlchars,omitempty"` + Sqlinjectiontype string `json:"sqlinjectiontype,omitempty"` + Sqlinjectionchecksqlwildchars string `json:"sqlinjectionchecksqlwildchars,omitempty"` + Fieldformataction []string `json:"fieldformataction,omitempty"` + Defaultfieldformattype string `json:"defaultfieldformattype,omitempty"` + Defaultfieldformatminlength int `json:"defaultfieldformatminlength,omitempty"` + Defaultfieldformatmaxlength int `json:"defaultfieldformatmaxlength,omitempty"` + Defaultfieldformatmaxoccurrences int `json:"defaultfieldformatmaxoccurrences,omitempty"` + Bufferoverflowaction []string `json:"bufferoverflowaction,omitempty"` + Grpcaction []string `json:"grpcaction,omitempty"` + Restaction []string `json:"restaction,omitempty"` + Bufferoverflowmaxurllength int `json:"bufferoverflowmaxurllength,omitempty"` + Bufferoverflowmaxheaderlength int `json:"bufferoverflowmaxheaderlength,omitempty"` + Bufferoverflowmaxcookielength int `json:"bufferoverflowmaxcookielength,omitempty"` + Bufferoverflowmaxquerylength int `json:"bufferoverflowmaxquerylength,omitempty"` + Bufferoverflowmaxtotalheaderlength int `json:"bufferoverflowmaxtotalheaderlength,omitempty"` + Creditcardaction []string `json:"creditcardaction,omitempty"` + Creditcard []string `json:"creditcard,omitempty"` + Creditcardmaxallowed int `json:"creditcardmaxallowed,omitempty"` + Creditcardxout string `json:"creditcardxout,omitempty"` + Dosecurecreditcardlogging string `json:"dosecurecreditcardlogging,omitempty"` + Streaming string `json:"streaming,omitempty"` + Trace string `json:"trace,omitempty"` + Requestcontenttype string `json:"requestcontenttype,omitempty"` + Responsecontenttype string `json:"responsecontenttype,omitempty"` + Jsonerrorobject string `json:"jsonerrorobject,omitempty"` + Apispec string `json:"apispec,omitempty"` + Protofileobject string `json:"protofileobject,omitempty"` + Jsonerrorstatuscode int `json:"jsonerrorstatuscode,omitempty"` + Jsonerrorstatusmessage string `json:"jsonerrorstatusmessage,omitempty"` + Jsondosaction []string `json:"jsondosaction,omitempty"` + Jsonsqlinjectionaction []string `json:"jsonsqlinjectionaction,omitempty"` + Jsonsqlinjectiontype string `json:"jsonsqlinjectiontype,omitempty"` + Jsonsqlinjectiongrammar string `json:"jsonsqlinjectiongrammar,omitempty"` + Jsoncmdinjectionaction []string `json:"jsoncmdinjectionaction,omitempty"` + Jsoncmdinjectiontype string `json:"jsoncmdinjectiontype,omitempty"` + Jsoncmdinjectiongrammar string `json:"jsoncmdinjectiongrammar,omitempty"` + Jsonxssaction []string `json:"jsonxssaction,omitempty"` + Xmldosaction []string `json:"xmldosaction,omitempty"` + Xmlformataction []string `json:"xmlformataction,omitempty"` + Xmlsqlinjectionaction []string `json:"xmlsqlinjectionaction,omitempty"` + Xmlsqlinjectiononlycheckfieldswithsqlchars string `json:"xmlsqlinjectiononlycheckfieldswithsqlchars,omitempty"` + Xmlsqlinjectiontype string `json:"xmlsqlinjectiontype,omitempty"` + Xmlsqlinjectionchecksqlwildchars string `json:"xmlsqlinjectionchecksqlwildchars,omitempty"` + Xmlsqlinjectionparsecomments string `json:"xmlsqlinjectionparsecomments,omitempty"` + Xmlxssaction []string `json:"xmlxssaction,omitempty"` + Xmlwsiaction []string `json:"xmlwsiaction,omitempty"` + Xmlattachmentaction []string `json:"xmlattachmentaction,omitempty"` + Xmlvalidationaction []string `json:"xmlvalidationaction,omitempty"` + Xmlerrorobject string `json:"xmlerrorobject,omitempty"` + Xmlerrorstatuscode int `json:"xmlerrorstatuscode,omitempty"` + Xmlerrorstatusmessage string `json:"xmlerrorstatusmessage,omitempty"` + Customsettings string `json:"customsettings,omitempty"` + Signatures string `json:"signatures,omitempty"` + Xmlsoapfaultaction []string `json:"xmlsoapfaultaction,omitempty"` + Usehtmlerrorobject string `json:"usehtmlerrorobject,omitempty"` + Errorurl string `json:"errorurl,omitempty"` + Htmlerrorobject string `json:"htmlerrorobject,omitempty"` + Htmlerrorstatuscode int `json:"htmlerrorstatuscode,omitempty"` + Htmlerrorstatusmessage string `json:"htmlerrorstatusmessage,omitempty"` + Logeverypolicyhit string `json:"logeverypolicyhit,omitempty"` + Stripcomments string `json:"stripcomments,omitempty"` + Striphtmlcomments string `json:"striphtmlcomments,omitempty"` + Stripxmlcomments string `json:"stripxmlcomments,omitempty"` + Exemptclosureurlsfromsecuritychecks string `json:"exemptclosureurlsfromsecuritychecks,omitempty"` + Defaultcharset string `json:"defaultcharset,omitempty"` + Clientipexpression string `json:"clientipexpression,omitempty"` + Dynamiclearning []string `json:"dynamiclearning,omitempty"` + Postbodylimit int `json:"postbodylimit,omitempty"` + Postbodylimitaction []string `json:"postbodylimitaction,omitempty"` + Postbodylimitsignature int `json:"postbodylimitsignature,omitempty"` + Fileuploadmaxnum int `json:"fileuploadmaxnum,omitempty"` + Canonicalizehtmlresponse string `json:"canonicalizehtmlresponse,omitempty"` + Enableformtagging string `json:"enableformtagging,omitempty"` + Sessionlessfieldconsistency string `json:"sessionlessfieldconsistency,omitempty"` + Sessionlessurlclosure string `json:"sessionlessurlclosure,omitempty"` + Semicolonfieldseparator string `json:"semicolonfieldseparator,omitempty"` + Excludefileuploadfromchecks string `json:"excludefileuploadfromchecks,omitempty"` + Sqlinjectionparsecomments string `json:"sqlinjectionparsecomments,omitempty"` + Invalidpercenthandling string `json:"invalidpercenthandling,omitempty"` + Type []string `json:"type,omitempty"` + Checkrequestheaders string `json:"checkrequestheaders,omitempty"` + Inspectquerycontenttypes []string `json:"inspectquerycontenttypes,omitempty"` + Optimizepartialreqs string `json:"optimizepartialreqs,omitempty"` + Urldecoderequestcookies string `json:"urldecoderequestcookies,omitempty"` + Comment string `json:"comment,omitempty"` + Percentdecoderecursively string `json:"percentdecoderecursively,omitempty"` + Multipleheaderaction []string `json:"multipleheaderaction,omitempty"` + Rfcprofile string `json:"rfcprofile,omitempty"` + Fileuploadtypesaction []string `json:"fileuploadtypesaction,omitempty"` + Verboseloglevel string `json:"verboseloglevel,omitempty"` + Insertcookiesamesiteattribute string `json:"insertcookiesamesiteattribute,omitempty"` + Cookiesamesiteattribute string `json:"cookiesamesiteattribute,omitempty"` + Sqlinjectionruletype string `json:"sqlinjectionruletype,omitempty"` + Fakeaccountdetection string `json:"fakeaccountdetection,omitempty"` + Geolocationlogging string `json:"geolocationlogging,omitempty"` + Ceflogging string `json:"ceflogging,omitempty"` + Blockkeywordaction []string `json:"blockkeywordaction,omitempty"` + Jsonblockkeywordaction []string `json:"jsonblockkeywordaction,omitempty"` + Asprofbypasslistenable string `json:"as_prof_bypass_list_enable,omitempty"` + Asprofdenylistenable string `json:"as_prof_deny_list_enable,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Archivename string `json:"archivename,omitempty"` + Relaxationrules bool `json:"relaxationrules,omitempty"` + Importprofilename string `json:"importprofilename,omitempty"` + Matchurlstring string `json:"matchurlstring,omitempty"` + Replaceurlstring string `json:"replaceurlstring,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Augment bool `json:"augment,omitempty"` + State string `json:"state,omitempty"` + Learning string `json:"learning,omitempty"` + Csrftag string `json:"csrftag,omitempty"` + Builtin string `json:"builtin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwglobalauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwglobalbinding struct { +} + +type Appfwpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwprofileblockkeywordbinding struct { + Blockkeyword string `json:"blockkeyword,omitempty"` + Asblockkeywordformurl string `json:"as_blockkeyword_formurl,omitempty"` + Fieldname string `json:"fieldname,omitempty"` + Asfieldnameisregexblockkeyword string `json:"as_fieldname_isregex_blockkeyword,omitempty"` + Blockkeywordtype string `json:"blockkeywordtype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwglobalauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwprofilexmlvalidationurlbinding struct { + Xmlvalidationurl string `json:"xmlvalidationurl,omitempty"` + Xmlvalidateresponse string `json:"xmlvalidateresponse,omitempty"` + Xmlwsdl string `json:"xmlwsdl,omitempty"` + Xmladditionalsoapheaders string `json:"xmladditionalsoapheaders,omitempty"` + Xmlendpointcheck string `json:"xmlendpointcheck,omitempty"` + Xmlrequestschema string `json:"xmlrequestschema,omitempty"` + Xmlresponseschema string `json:"xmlresponseschema,omitempty"` + Xmlvalidatesoapenvelope string `json:"xmlvalidatesoapenvelope,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilexmlwsiurlbinding struct { + Xmlwsiurl string `json:"xmlwsiurl,omitempty"` + Xmlwsichecks string `json:"xmlwsichecks,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwfieldtype struct { + Name string `json:"name,omitempty"` + Regex string `json:"regex,omitempty"` + Priority int `json:"priority,omitempty"` + Comment string `json:"comment,omitempty"` + Nocharmaps bool `json:"nocharmaps,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + State string `json:"state,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Appfwpolicylabelappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwprofilecreditcardnumberbinding struct { + Creditcardnumber string `json:"creditcardnumber,omitempty"` + Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Profilename string `json:"profilename,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Policytype string `json:"policytype,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwhtmlerrorpage struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwprofileappfwconfidfieldbinding struct { + Confidfield string `json:"confidfield,omitempty"` + Isregexcffield string `json:"isregex_cffield,omitempty"` + Cffieldurl string `json:"cffield_url,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilexmlxssbinding struct { + Xmlxss string `json:"xmlxss,omitempty"` + Isregexxmlxss string `json:"isregex_xmlxss,omitempty"` + Asscanlocationxmlxss string `json:"as_scan_location_xmlxss,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwurlencodedformcontenttype struct { + Urlencodedformcontenttypevalue string `json:"urlencodedformcontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwprofilecookieconsistencybinding struct { + Cookieconsistency string `json:"cookieconsistency,omitempty"` + Isregex string `json:"isregex,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilecrosssitescriptingbinding struct { + Crosssitescripting string `json:"crosssitescripting,omitempty"` + Isregexxss string `json:"isregex_xss,omitempty"` + Formactionurlxss string `json:"formactionurl_xss,omitempty"` + Asscanlocationxss string `json:"as_scan_location_xss,omitempty"` + Asvaluetypexss string `json:"as_value_type_xss,omitempty"` + Asvalueexprxss string `json:"as_value_expr_xss,omitempty"` + Isvalueregexxss string `json:"isvalueregex_xss,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilexmlsqlinjectionbinding struct { + Xmlsqlinjection string `json:"xmlsqlinjection,omitempty"` + Isregexxmlsql string `json:"isregex_xmlsql,omitempty"` + Asscanlocationxmlsql string `json:"as_scan_location_xmlsql,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwsignatures struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Xslt string `json:"xslt,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Merge bool `json:"merge,omitempty"` + Preservedefactions bool `json:"preservedefactions,omitempty"` + Sha1 string `json:"sha1,omitempty"` + Vendortype string `json:"vendortype,omitempty"` + Autoenablenewsignatures string `json:"autoenablenewsignatures,omitempty"` + Ruleid []int `json:"ruleid,omitempty"` + Category string `json:"category,omitempty"` + Enabled string `json:"enabled,omitempty"` + Action []string `json:"action,omitempty"` + Mergedefault bool `json:"mergedefault,omitempty"` + Response string `json:"response,omitempty"` + Encryptedversion string `json:"encryptedversion,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Appfwprofileexcluderescontenttypebinding struct { + Excluderescontenttype string `json:"excluderescontenttype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilefakeaccountbinding struct { + Fakeaccount string `json:"fakeaccount,omitempty"` + Isfieldnameregex string `json:"isfieldnameregex,omitempty"` + Formurlfad string `json:"formurl_fad,omitempty"` + Formexpression string `json:"formexpression,omitempty"` + Tag string `json:"tag,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilefieldconsistencybinding struct { + Fieldconsistency string `json:"fieldconsistency,omitempty"` + Isregexffc string `json:"isregex_ffc,omitempty"` + Formactionurlffc string `json:"formactionurl_ffc,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilejsonxssurlbinding struct { + Jsonxssurl string `json:"jsonxssurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Iskeyregexjsonxss string `json:"iskeyregex_json_xss,omitempty"` + Keynamejsonxss string `json:"keyname_json_xss,omitempty"` + Asvaluetypejsonxss string `json:"as_value_type_json_xss,omitempty"` + Asvalueexprjsonxss string `json:"as_value_expr_json_xss,omitempty"` + Isvalueregexjsonxss string `json:"isvalueregex_json_xss,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilexmlattachmenturlbinding struct { + Xmlattachmenturl string `json:"xmlattachmenturl,omitempty"` + Xmlmaxattachmentsizecheck string `json:"xmlmaxattachmentsizecheck,omitempty"` + Xmlmaxattachmentsize int `json:"xmlmaxattachmentsize,omitempty"` + Xmlattachmentcontenttypecheck string `json:"xmlattachmentcontenttypecheck,omitempty"` + Xmlattachmentcontenttype string `json:"xmlattachmentcontenttype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofiledenylistbinding struct { + Asdenylist string `json:"as_deny_list,omitempty"` + Asdenylistvaluetype string `json:"as_deny_list_value_type,omitempty"` + Asdenylistaction []string `json:"as_deny_list_action,omitempty"` + Asdenylistlocation string `json:"as_deny_list_location,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilejsonblockkeywordbinding struct { + Jsonblockkeyword string `json:"jsonblockkeyword,omitempty"` + Jsonblockkeywordurl string `json:"jsonblockkeywordurl,omitempty"` + Keynamejsonblockkeyword string `json:"keyname_json_blockkeyword,omitempty"` + Iskeyregexjsonblockkeyword string `json:"iskeyregex_json_blockkeyword,omitempty"` + Jsonblockkeywordtype string `json:"jsonblockkeywordtype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwglobalsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Description string `json:"description,omitempty"` + Policytype string `json:"policytype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwprofilecmdinjectionbinding struct { + Cmdinjection string `json:"cmdinjection,omitempty"` + Isregexcmd string `json:"isregex_cmd,omitempty"` + Formactionurlcmd string `json:"formactionurl_cmd,omitempty"` + Asscanlocationcmd string `json:"as_scan_location_cmd,omitempty"` + Asvaluetypecmd string `json:"as_value_type_cmd,omitempty"` + Asvalueexprcmd string `json:"as_value_expr_cmd,omitempty"` + Isvalueregexcmd string `json:"isvalueregex_cmd,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilelogexpressionbinding struct { + Logexpression string `json:"logexpression,omitempty"` + Aslogexpression string `json:"as_logexpression,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwconfidfield struct { + Fieldname string `json:"fieldname,omitempty"` + Url string `json:"url,omitempty"` + Isregex string `json:"isregex,omitempty"` + Comment string `json:"comment,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicyappfwglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Appfwprofilebypasslistbinding struct { + Asbypasslist string `json:"as_bypass_list,omitempty"` + Asbypasslistvaluetype string `json:"as_bypass_list_value_type,omitempty"` + Asbypasslistaction string `json:"as_bypass_list_action,omitempty"` + Asbypasslistlocation string `json:"as_bypass_list_location,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilecsrftagbinding struct { + Csrftag string `json:"csrftag,omitempty"` + Csrfformactionurl string `json:"csrfformactionurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwtransactionrecords struct { + Nodeid int `json:"nodeid,omitempty"` + Httptransactionid string `json:"httptransactionid,omitempty"` + Packetengineid string `json:"packetengineid,omitempty"` + Appfwsessionid string `json:"appfwsessionid,omitempty"` + Profilename string `json:"profilename,omitempty"` + Url string `json:"url,omitempty"` + Clientip string `json:"clientip,omitempty"` + Destip string `json:"destip,omitempty"` + Starttime string `json:"starttime,omitempty"` + Endtime string `json:"endtime,omitempty"` + Requestcontentlength string `json:"requestcontentlength,omitempty"` + Requestyields string `json:"requestyields,omitempty"` + Requestmaxprocessingtime string `json:"requestmaxprocessingtime,omitempty"` + Responsecontentlength string `json:"responsecontentlength,omitempty"` + Responseyields string `json:"responseyields,omitempty"` + Responsemaxprocessingtime string `json:"responsemaxprocessingtime,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwgrpcwebjsoncontenttype struct { + Grpcwebjsoncontenttypevalue string `json:"grpcwebjsoncontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicyappfwpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwprofilejsoncmdurlbinding struct { + Jsoncmdurl string `json:"jsoncmdurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Iskeyregexjsoncmd string `json:"iskeyregex_json_cmd,omitempty"` + Keynamejsoncmd string `json:"keyname_json_cmd,omitempty"` + Asvaluetypejsoncmd string `json:"as_value_type_json_cmd,omitempty"` + Asvalueexprjsoncmd string `json:"as_value_expr_json_cmd,omitempty"` + Isvalueregexjsoncmd string `json:"isvalueregex_json_cmd,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilejsonsqlurlbinding struct { + Jsonsqlurl string `json:"jsonsqlurl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Iskeyregexjsonsql string `json:"iskeyregex_json_sql,omitempty"` + Keynamejsonsql string `json:"keyname_json_sql,omitempty"` + Asvaluetypejsonsql string `json:"as_value_type_json_sql,omitempty"` + Asvalueexprjsonsql string `json:"as_value_expr_json_sql,omitempty"` + Isvalueregexjsonsql string `json:"isvalueregex_json_sql,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprotofile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Comment string `json:"comment,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwsettings struct { + Defaultprofile string `json:"defaultprofile,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Learnratelimit int `json:"learnratelimit,omitempty"` + Sessionlifetime int `json:"sessionlifetime"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Clientiploggingheader string `json:"clientiploggingheader,omitempty"` + Importsizelimit int `json:"importsizelimit,omitempty"` + Signatureautoupdate string `json:"signatureautoupdate,omitempty"` + Signatureurl string `json:"signatureurl,omitempty"` + Cookiepostencryptprefix string `json:"cookiepostencryptprefix,omitempty"` + Logmalformedreq string `json:"logmalformedreq,omitempty"` + Geolocationlogging string `json:"geolocationlogging,omitempty"` + Ceflogging string `json:"ceflogging,omitempty"` + Entitydecoding string `json:"entitydecoding,omitempty"` + Useconfigurablesecretkey string `json:"useconfigurablesecretkey,omitempty"` + Sessionlimit int `json:"sessionlimit"` + Malformedreqaction []string `json:"malformedreqaction,omitempty"` + Centralizedlearning string `json:"centralizedlearning,omitempty"` + Proxyserver string `json:"proxyserver,omitempty"` + Proxyport int `json:"proxyport,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Cookieflags string `json:"cookieflags,omitempty"` + Learning string `json:"learning,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwglobalnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Appfwjsoncontenttype struct { + Jsoncontenttypevalue string `json:"jsoncontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwprofilestarturlbinding struct { + Starturl string `json:"starturl,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Appfwarchive struct { + Name string `json:"name,omitempty"` + Target string `json:"target,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwglobalappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + State string `json:"state,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Type string `json:"type,omitempty"` + Policytype string `json:"policytype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Appfwgrpccontenttype struct { + Grpccontenttypevalue string `json:"grpccontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwjsonerrorpage struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwprofiletrustedlearningclientsbinding struct { + Trustedlearningclients string `json:"trustedlearningclients,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilexmldosurlbinding struct { + Xmldosurl string `json:"xmldosurl,omitempty"` + Xmlmaxelementdepthcheck string `json:"xmlmaxelementdepthcheck,omitempty"` + Xmlmaxelementdepth int `json:"xmlmaxelementdepth,omitempty"` + Xmlmaxelementnamelengthcheck string `json:"xmlmaxelementnamelengthcheck,omitempty"` + Xmlmaxelementnamelength int `json:"xmlmaxelementnamelength,omitempty"` + Xmlmaxelementscheck string `json:"xmlmaxelementscheck,omitempty"` + Xmlmaxelements int `json:"xmlmaxelements,omitempty"` + Xmlmaxelementchildrencheck string `json:"xmlmaxelementchildrencheck,omitempty"` + Xmlmaxelementchildren int `json:"xmlmaxelementchildren,omitempty"` + Xmlmaxnodescheck string `json:"xmlmaxnodescheck,omitempty"` + Xmlmaxnodes int `json:"xmlmaxnodes,omitempty"` + Xmlmaxentityexpansionscheck string `json:"xmlmaxentityexpansionscheck,omitempty"` + Xmlmaxentityexpansions int `json:"xmlmaxentityexpansions,omitempty"` + Xmlmaxentityexpansiondepthcheck string `json:"xmlmaxentityexpansiondepthcheck,omitempty"` + Xmlmaxentityexpansiondepth int `json:"xmlmaxentityexpansiondepth,omitempty"` + Xmlmaxattributescheck string `json:"xmlmaxattributescheck,omitempty"` + Xmlmaxattributes int `json:"xmlmaxattributes,omitempty"` + Xmlmaxattributenamelengthcheck string `json:"xmlmaxattributenamelengthcheck,omitempty"` + Xmlmaxattributenamelength int `json:"xmlmaxattributenamelength,omitempty"` + Xmlmaxattributevaluelengthcheck string `json:"xmlmaxattributevaluelengthcheck,omitempty"` + Xmlmaxattributevaluelength int `json:"xmlmaxattributevaluelength,omitempty"` + Xmlmaxnamespacescheck string `json:"xmlmaxnamespacescheck,omitempty"` + Xmlmaxnamespaces int `json:"xmlmaxnamespaces,omitempty"` + Xmlmaxnamespaceurilengthcheck string `json:"xmlmaxnamespaceurilengthcheck,omitempty"` + Xmlmaxnamespaceurilength int `json:"xmlmaxnamespaceurilength,omitempty"` + Xmlmaxchardatalengthcheck string `json:"xmlmaxchardatalengthcheck,omitempty"` + Xmlmaxchardatalength int `json:"xmlmaxchardatalength,omitempty"` + Xmlmaxfilesizecheck string `json:"xmlmaxfilesizecheck,omitempty"` + Xmlmaxfilesize int `json:"xmlmaxfilesize,omitempty"` + Xmlminfilesizecheck string `json:"xmlminfilesizecheck,omitempty"` + Xmlminfilesize int `json:"xmlminfilesize,omitempty"` + Xmlblockpi string `json:"xmlblockpi,omitempty"` + Xmlblockdtd string `json:"xmlblockdtd,omitempty"` + Xmlblockexternalentities string `json:"xmlblockexternalentities,omitempty"` + Xmlsoaparraycheck string `json:"xmlsoaparraycheck,omitempty"` + Xmlmaxsoaparraysize int `json:"xmlmaxsoaparraysize,omitempty"` + Xmlmaxsoaparrayrank int `json:"xmlmaxsoaparrayrank,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilefieldformatbinding struct { + Fieldformat string `json:"fieldformat,omitempty"` + Isregexff string `json:"isregex_ff,omitempty"` + Formactionurlff string `json:"formactionurl_ff,omitempty"` + Fieldtype string `json:"fieldtype,omitempty"` + Fieldformatminlength int `json:"fieldformatminlength,omitempty"` + Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilesafeobjectbinding struct { + Safeobject string `json:"safeobject,omitempty"` + Asexpression string `json:"as_expression,omitempty"` + Maxmatchlength int `json:"maxmatchlength,omitempty"` + Action []string `json:"action,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilesqlinjectionbinding struct { + Sqlinjection string `json:"sqlinjection,omitempty"` + Isregexsql string `json:"isregex_sql,omitempty"` + Formactionurlsql string `json:"formactionurl_sql,omitempty"` + Asscanlocationsql string `json:"as_scan_location_sql,omitempty"` + Asvaluetypesql string `json:"as_value_type_sql,omitempty"` + Asvalueexprsql string `json:"as_value_expr_sql,omitempty"` + Isvalueregexsql string `json:"isvalueregex_sql,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwlearningsettings struct { + Profilename string `json:"profilename,omitempty"` + Starturlminthreshold int `json:"starturlminthreshold,omitempty"` + Starturlpercentthreshold int `json:"starturlpercentthreshold,omitempty"` + Cookieconsistencyminthreshold int `json:"cookieconsistencyminthreshold,omitempty"` + Cookieconsistencypercentthreshold int `json:"cookieconsistencypercentthreshold,omitempty"` + Csrftagminthreshold int `json:"csrftagminthreshold,omitempty"` + Csrftagpercentthreshold int `json:"csrftagpercentthreshold,omitempty"` + Fieldconsistencyminthreshold int `json:"fieldconsistencyminthreshold,omitempty"` + Fieldconsistencypercentthreshold int `json:"fieldconsistencypercentthreshold,omitempty"` + Crosssitescriptingminthreshold int `json:"crosssitescriptingminthreshold,omitempty"` + Crosssitescriptingpercentthreshold int `json:"crosssitescriptingpercentthreshold,omitempty"` + Sqlinjectionminthreshold int `json:"sqlinjectionminthreshold,omitempty"` + Sqlinjectionpercentthreshold int `json:"sqlinjectionpercentthreshold,omitempty"` + Fieldformatminthreshold int `json:"fieldformatminthreshold,omitempty"` + Fieldformatpercentthreshold int `json:"fieldformatpercentthreshold,omitempty"` + Creditcardnumberminthreshold int `json:"creditcardnumberminthreshold,omitempty"` + Creditcardnumberpercentthreshold int `json:"creditcardnumberpercentthreshold,omitempty"` + Contenttypeminthreshold int `json:"contenttypeminthreshold,omitempty"` + Contenttypepercentthreshold int `json:"contenttypepercentthreshold,omitempty"` + Xmlwsiminthreshold int `json:"xmlwsiminthreshold,omitempty"` + Xmlwsipercentthreshold int `json:"xmlwsipercentthreshold,omitempty"` + Xmlattachmentminthreshold int `json:"xmlattachmentminthreshold,omitempty"` + Xmlattachmentpercentthreshold int `json:"xmlattachmentpercentthreshold,omitempty"` + Fieldformatautodeploygraceperiod int `json:"fieldformatautodeploygraceperiod,omitempty"` + Sqlinjectionautodeploygraceperiod int `json:"sqlinjectionautodeploygraceperiod,omitempty"` + Crosssitescriptingautodeploygraceperiod int `json:"crosssitescriptingautodeploygraceperiod,omitempty"` + Starturlautodeploygraceperiod int `json:"starturlautodeploygraceperiod,omitempty"` + Cookieconsistencyautodeploygraceperiod int `json:"cookieconsistencyautodeploygraceperiod,omitempty"` + Csrftagautodeploygraceperiod int `json:"csrftagautodeploygraceperiod,omitempty"` + Fieldconsistencyautodeploygraceperiod int `json:"fieldconsistencyautodeploygraceperiod,omitempty"` + Contenttypeautodeploygraceperiod int `json:"contenttypeautodeploygraceperiod,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appfwprofilegrpcvalidationbinding struct { + Grpcvalidation string `json:"grpcvalidation,omitempty"` + Grpcrelaxvalidationaction string `json:"grpc_relax_validation_action,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwprofilejsondosurlbinding struct { + Jsondosurl string `json:"jsondosurl,omitempty"` + Jsonmaxdocumentlengthcheck string `json:"jsonmaxdocumentlengthcheck,omitempty"` + Jsonmaxdocumentlength int `json:"jsonmaxdocumentlength,omitempty"` + Jsonmaxcontainerdepthcheck string `json:"jsonmaxcontainerdepthcheck,omitempty"` + Jsonmaxcontainerdepth int `json:"jsonmaxcontainerdepth,omitempty"` + Jsonmaxobjectkeycountcheck string `json:"jsonmaxobjectkeycountcheck,omitempty"` + Jsonmaxobjectkeycount int `json:"jsonmaxobjectkeycount,omitempty"` + Jsonmaxobjectkeylengthcheck string `json:"jsonmaxobjectkeylengthcheck,omitempty"` + Jsonmaxobjectkeylength int `json:"jsonmaxobjectkeylength,omitempty"` + Jsonmaxarraylengthcheck string `json:"jsonmaxarraylengthcheck,omitempty"` + Jsonmaxarraylength int `json:"jsonmaxarraylength,omitempty"` + Jsonmaxstringlengthcheck string `json:"jsonmaxstringlengthcheck,omitempty"` + Jsonmaxstringlength int `json:"jsonmaxstringlength,omitempty"` + State string `json:"state,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Name string `json:"name,omitempty"` + Ruletype string `json:"ruletype,omitempty"` +} + +type Appfwwsdl struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appfwxmlerrorpage struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/appqoe.go b/nitrogo/models/appqoe.go new file mode 100644 index 0000000..ef8b042 --- /dev/null +++ b/nitrogo/models/appqoe.go @@ -0,0 +1,68 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Appqoepolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Appqoepolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Bindpriority int `json:"bindpriority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appqoepolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Bindpriority uint32 `json:"bindpriority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Appqoeaction struct { + Name string `json:"name,omitempty"` + Priority string `json:"priority,omitempty"` + Respondwith string `json:"respondwith,omitempty"` + Customfile string `json:"customfile,omitempty"` + Altcontentsvcname string `json:"altcontentsvcname,omitempty"` + Altcontentpath string `json:"altcontentpath,omitempty"` + Polqdepth int `json:"polqdepth"` + Priqdepth int `json:"priqdepth"` + Maxconn int `json:"maxconn,omitempty"` + Delay int `json:"delay,omitempty"` + Dostrigexpression string `json:"dostrigexpression,omitempty"` + Dosaction string `json:"dosaction,omitempty"` + Tcpprofile string `json:"tcpprofile,omitempty"` + Retryonreset string `json:"retryonreset,omitempty"` + Retryontimeout int `json:"retryontimeout,omitempty"` + Numretries int `json:"numretries"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appqoecustomresp struct { + Src string `json:"src,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appqoeparameter struct { + Sessionlife int `json:"sessionlife,omitempty"` + Avgwaitingclient int `json:"avgwaitingclient"` + Maxaltrespbandwidth int `json:"maxaltrespbandwidth,omitempty"` + Dosattackthresh int `json:"dosattackthresh"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Appqoepolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/audit.go b/nitrogo/models/audit.go new file mode 100644 index 0000000..07986ce --- /dev/null +++ b/nitrogo/models/audit.go @@ -0,0 +1,433 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Auditnslogpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Auditmessages struct { + Loglevel []string `json:"loglevel,omitempty"` + Numofmesgs int `json:"numofmesgs,omitempty"` + Value string `json:"value,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditnslogglobalbinding struct { +} + +type Auditnslogpolicytmglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogglobalauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` +} + +type Auditsyslogpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyauditsyslogglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicysyslogglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogglobalnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Builtin []string `json:"builtin,omitempty"` +} + +type Auditnslogpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogglobalbinding struct { +} + +type Auditsyslogpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicytmglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverdomainname string `json:"serverdomainname,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Lbvservername string `json:"lbvservername,omitempty"` + Serverport int `json:"serverport,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Managementlog []string `json:"managementlog,omitempty"` + Mgmtloglevel []string `json:"mgmtloglevel,omitempty"` + Syslogcompliance string `json:"syslogcompliance,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Tcp string `json:"tcp,omitempty"` + Acl string `json:"acl,omitempty"` + Timezone string `json:"timezone,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Lsn string `json:"lsn,omitempty"` + Alg string `json:"alg,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Transport string `json:"transport,omitempty"` + Httpauthtoken string `json:"httpauthtoken,omitempty"` + Httpendpointurl string `json:"httpendpointurl,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Maxlogdatasizetohold int `json:"maxlogdatasizetohold,omitempty"` + Dns string `json:"dns,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Streamanalytics string `json:"streamanalytics,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Domainresolvenow bool `json:"domainresolvenow,omitempty"` + Ip string `json:"ip,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditnslogpolicyappfwglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyauditnslogglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicynslogglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyrnatglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverdomainname string `json:"serverdomainname,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Serverport int `json:"serverport,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Tcp string `json:"tcp,omitempty"` + Acl string `json:"acl,omitempty"` + Timezone string `json:"timezone,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Lsn string `json:"lsn,omitempty"` + Alg string `json:"alg,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Domainresolvenow bool `json:"domainresolvenow,omitempty"` + Ip string `json:"ip,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditnslogpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogpolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogglobalsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` +} + +type Auditsyslogparams struct { + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Tcp string `json:"tcp,omitempty"` + Acl string `json:"acl,omitempty"` + Timezone string `json:"timezone,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Lsn string `json:"lsn,omitempty"` + Alg string `json:"alg,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Dns string `json:"dns,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Streamanalytics string `json:"streamanalytics,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditsyslogpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditmessageaction struct { + Name string `json:"name,omitempty"` + Loglevel string `json:"loglevel,omitempty"` + Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` + Logtonewnslog string `json:"logtonewnslog,omitempty"` + Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` + Loglevel1 string `json:"loglevel1,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditnslogpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditsyslogpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Auditnslogglobalauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Builtin []string `json:"builtin,omitempty"` +} + +type Auditnslogparams struct { + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Tcp string `json:"tcp,omitempty"` + Acl string `json:"acl,omitempty"` + Timezone string `json:"timezone,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Lsn string `json:"lsn,omitempty"` + Alg string `json:"alg,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Auditnslogpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/authentication.go b/nitrogo/models/authentication.go new file mode 100644 index 0000000..7831506 --- /dev/null +++ b/nitrogo/models/authentication.go @@ -0,0 +1,1715 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Authenticationwebauthpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationwebauthpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationcertpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserverrewritepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` +} + +type Authenticationvserversessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationcertpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationldappolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationloginschemapolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlidppolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationradiuspolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationvserverauthenticationldappolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationldappolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationlocalpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationloginschemapolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationtacacsaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Tacacssecret string `json:"tacacssecret,omitempty"` + Authorization string `json:"authorization,omitempty"` + Accounting string `json:"accounting,omitempty"` + Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attributes string `json:"attributes,omitempty"` + Success string `json:"success,omitempty"` + Failure string `json:"failure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationtacacspolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserversamlidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationldapaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Ldapbase string `json:"ldapbase,omitempty"` + Ldapbinddn string `json:"ldapbinddn,omitempty"` + Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` + Ldaploginname string `json:"ldaploginname,omitempty"` + Searchfilter string `json:"searchfilter,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Subattributename string `json:"subattributename,omitempty"` + Sectype string `json:"sectype,omitempty"` + Svrtype string `json:"svrtype,omitempty"` + Ssonameattribute string `json:"ssonameattribute,omitempty"` + Authentication string `json:"authentication,omitempty"` + Requireuser string `json:"requireuser,omitempty"` + Passwdchange string `json:"passwdchange,omitempty"` + Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` + Maxnestinglevel int `json:"maxnestinglevel,omitempty"` + Followreferrals string `json:"followreferrals,omitempty"` + Maxldapreferrals int `json:"maxldapreferrals,omitempty"` + Referraldnslookup string `json:"referraldnslookup,omitempty"` + Mssrvrecordlocation string `json:"mssrvrecordlocation,omitempty"` + Validateservercert string `json:"validateservercert,omitempty"` + Ldaphostname string `json:"ldaphostname,omitempty"` + Groupnameidentifier string `json:"groupnameidentifier,omitempty"` + Groupsearchattribute string `json:"groupsearchattribute,omitempty"` + Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` + Groupsearchfilter string `json:"groupsearchfilter,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attributes string `json:"attributes,omitempty"` + Sshpublickey string `json:"sshpublickey,omitempty"` + Pushservice string `json:"pushservice,omitempty"` + Otpsecret string `json:"otpsecret,omitempty"` + Email string `json:"email,omitempty"` + Kbattribute string `json:"kbattribute,omitempty"` + Alternateemailattr string `json:"alternateemailattr,omitempty"` + Cloudattributes string `json:"cloudattributes,omitempty"` + Success string `json:"success,omitempty"` + Failure string `json:"failure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationldappolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationlocalpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationoauthidppolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationcaptchaaction struct { + Name string `json:"name,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Secretkey string `json:"secretkey,omitempty"` + Sitekey string `json:"sitekey,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Scorethreshold int `json:"scorethreshold,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationloginschemapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserverloginschemapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationcertpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationoauthidpprofile struct { + Name string `json:"name,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Issuer string `json:"issuer,omitempty"` + Configservice string `json:"configservice,omitempty"` + Audience string `json:"audience,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Relyingpartymetadataurl string `json:"relyingpartymetadataurl,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Encrypttoken string `json:"encrypttoken,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Attributes string `json:"attributes,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Oauthstatus string `json:"oauthstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationradiuspolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationsmartaccesspolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationsmartaccesspolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationvserverauditsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvservervpnportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationazurekeyvault struct { + Name string `json:"name,omitempty"` + Vaultname string `json:"vaultname,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Servicekeyname string `json:"servicekeyname,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Pushservice string `json:"pushservice,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Authentication string `json:"authentication,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationldappolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationloginschemapolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationloginschemapolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationoauthidppolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpolicylabelauthenticationpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Authenticationvserverldappolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationnegotiatepolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsmartaccessprofile struct { + Name string `json:"name,omitempty"` + Tags string `json:"tags,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationwebauthpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvservernegotiatepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationsamlpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserverauthenticationsmartaccesspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvservertmsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverwebauthpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationadfsproxyprofile struct { + Name string `json:"name,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Adfstruststatus string `json:"adfstruststatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationcertaction struct { + Name string `json:"name,omitempty"` + Twofactor string `json:"twofactor,omitempty"` + Usernamefield string `json:"usernamefield,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationoauthidppolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationcertpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationprotecteduseraction struct { + Name string `json:"name,omitempty"` + Realmstr string `json:"realmstr,omitempty"` + Maxconcurrentusers int `json:"maxconcurrentusers,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationdfapolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationdfapolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiatepolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationradiuspolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvservertacacspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Description string `json:"description,omitempty"` + Policysubtype string `json:"policysubtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Type string `json:"type,omitempty"` + Comment string `json:"comment,omitempty"` + Loginschema string `json:"loginschema,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationsamlidpprofile struct { + Name string `json:"name,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Samlidpcertname string `json:"samlidpcertname,omitempty"` + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Rejectunsignedrequests string `json:"rejectunsignedrequests,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Audience string `json:"audience,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Samlbinding string `json:"samlbinding,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Serviceproviderid string `json:"serviceproviderid,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Keytransportalg string `json:"keytransportalg,omitempty"` + Splogouturl string `json:"splogouturl,omitempty"` + Logoutbinding string `json:"logoutbinding,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Samlsigningcertversion string `json:"samlsigningcertversion,omitempty"` + Samlspcertversion string `json:"samlspcertversion,omitempty"` + Acsurlrule string `json:"acsurlrule,omitempty"` + Metadataimportstatus string `json:"metadataimportstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationoauthaction struct { + Name string `json:"name,omitempty"` + Oauthtype string `json:"oauthtype,omitempty"` + Authorizationendpoint string `json:"authorizationendpoint,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Idtokendecryptendpoint string `json:"idtokendecryptendpoint,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Oauthmiscflags []string `json:"oauthmiscflags,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attributes string `json:"attributes,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Graphendpoint string `json:"graphendpoint,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Certendpoint string `json:"certendpoint,omitempty"` + Audience string `json:"audience,omitempty"` + Usernamefield string `json:"usernamefield,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Issuer string `json:"issuer,omitempty"` + Userinfourl string `json:"userinfourl,omitempty"` + Certfilepath string `json:"certfilepath,omitempty"` + Granttype string `json:"granttype,omitempty"` + Authentication string `json:"authentication,omitempty"` + Introspecturl string `json:"introspecturl,omitempty"` + Allowedalgorithms []string `json:"allowedalgorithms,omitempty"` + Pkce string `json:"pkce,omitempty"` + Tokenendpointauthmethod string `json:"tokenendpointauthmethod,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Resourceuri string `json:"resourceuri,omitempty"` + Requestattribute string `json:"requestattribute,omitempty"` + Intunedeviceidexpression string `json:"intunedeviceidexpression,omitempty"` + Oauthstatus string `json:"oauthstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationtacacspolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvservercspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationwebauthpolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiatepolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationoauthidppolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpolicyauthenticationpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationradiusaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radvendorid int `json:"radvendorid,omitempty"` + Radattributetype int `json:"radattributetype,omitempty"` + Radgroupsprefix string `json:"radgroupsprefix,omitempty"` + Radgroupseparator string `json:"radgroupseparator,omitempty"` + Passencoding string `json:"passencoding,omitempty"` + Ipvendorid int `json:"ipvendorid,omitempty"` + Ipattributetype int `json:"ipattributetype,omitempty"` + Accounting string `json:"accounting,omitempty"` + Pwdvendorid int `json:"pwdvendorid,omitempty"` + Pwdattributetype int `json:"pwdattributetype,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Callingstationid string `json:"callingstationid,omitempty"` + Authservretry int `json:"authservretry,omitempty"` + Authentication string `json:"authentication,omitempty"` + Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` + Transport string `json:"transport,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Messageauthenticator string `json:"messageauthenticator,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Success string `json:"success,omitempty"` + Failure string `json:"failure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationsamlpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationdfapolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationlocalpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiatepolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlidppolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationwebauthpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationcertpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationlocalpolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationoauthidppolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationradiuspolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationcitrixauthaction struct { + Name string `json:"name,omitempty"` + Authenticationtype string `json:"authenticationtype,omitempty"` + Authentication string `json:"authentication,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationnegotiatepolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiatepolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpushservice struct { + Name string `json:"name,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Customerid string `json:"customerid,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Namespace string `json:"Namespace,omitempty"` + Hubname string `json:"hubname,omitempty"` + Servicekey string `json:"servicekey,omitempty"` + Servicekeyname string `json:"servicekeyname,omitempty"` + Certendpoint string `json:"certendpoint,omitempty"` + Pushservicestatus string `json:"pushservicestatus,omitempty"` + Trustservice string `json:"trustservice,omitempty"` + Pushcloudserverstatus string `json:"pushcloudserverstatus,omitempty"` + Signingkeyname string `json:"signingkeyname,omitempty"` + Signingkey string `json:"signingkey,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationradiuspolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserversamlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationwebauthpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiateaction struct { + Name string `json:"name,omitempty"` + Domain string `json:"domain,omitempty"` + Domainuser string `json:"domainuser,omitempty"` + Domainuserpasswd string `json:"domainuserpasswd,omitempty"` + Ou string `json:"ou,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Keytab string `json:"keytab,omitempty"` + Ntlmpath string `json:"ntlmpath,omitempty"` + Kcdspn string `json:"kcdspn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationnegotiatepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationepaaction struct { + Name string `json:"name,omitempty"` + Csecexpr string `json:"csecexpr,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Defaultepagroup string `json:"defaultepagroup,omitempty"` + Quarantinegroup string `json:"quarantinegroup,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationradiuspolicysystemglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationstorefrontauthaction struct { + Name string `json:"name,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Domain string `json:"domain,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Success string `json:"success,omitempty"` + Failure string `json:"failure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverauthenticationsamlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvservercertpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationcertpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationcertpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationldappolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserversyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationemailaction struct { + Name string `json:"name,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Content string `json:"content,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Timeout int `json:"timeout,omitempty"` + Type string `json:"type,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationlocalpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserverpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Authenticationvserverresponderpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` +} + +type Authenticationsamlaction struct { + Name string `json:"name,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Samlidpcertname string `json:"samlidpcertname,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Samlredirecturl string `json:"samlredirecturl,omitempty"` + Samlacsindex int `json:"samlacsindex,omitempty"` + Samluserfield string `json:"samluserfield,omitempty"` + Samlrejectunsignedassertion string `json:"samlrejectunsignedassertion,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Samltwofactor string `json:"samltwofactor,omitempty"` + Preferredbindtype []string `json:"preferredbindtype,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attributes string `json:"attributes,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Requestedauthncontext string `json:"requestedauthncontext,omitempty"` + Authnctxclassref []string `json:"authnctxclassref,omitempty"` + Customauthnctxclassref string `json:"customauthnctxclassref,omitempty"` + Samlbinding string `json:"samlbinding,omitempty"` + Attributeconsumingserviceindex int `json:"attributeconsumingserviceindex,omitempty"` + Sendthumbprint string `json:"sendthumbprint,omitempty"` + Enforceusername string `json:"enforceusername,omitempty"` + Logouturl string `json:"logouturl,omitempty"` + Artifactresolutionserviceurl string `json:"artifactresolutionserviceurl,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Logoutbinding string `json:"logoutbinding,omitempty"` + Forceauthn string `json:"forceauthn,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` + Audience string `json:"audience,omitempty"` + Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` + Storesamlresponse string `json:"storesamlresponse,omitempty"` + Statechecks string `json:"statechecks,omitempty"` + Metadataimportstatus string `json:"metadataimportstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauditnslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverauthenticationtacacspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationcertpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationdfapolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationlocalpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationloginschema struct { + Name string `json:"name,omitempty"` + Authenticationschema string `json:"authenticationschema,omitempty"` + Userexpression string `json:"userexpression,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Usercredentialindex int `json:"usercredentialindex,omitempty"` + Passwordcredentialindex int `json:"passwordcredentialindex,omitempty"` + Authenticationstrength int `json:"authenticationstrength,omitempty"` + Ssocredentials string `json:"ssocredentials,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationsamlidppolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvservernslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationwebauthpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationwebauthpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationlocalpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationnegotiatepolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationradiuspolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationradiuspolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlidppolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationauthnprofile struct { + Name string `json:"name,omitempty"` + Authnvsname string `json:"authnvsname,omitempty"` + Authenticationhost string `json:"authenticationhost,omitempty"` + Authenticationdomain string `json:"authenticationdomain,omitempty"` + Authenticationlevel int `json:"authenticationlevel,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationnoauthaction struct { + Name string `json:"name,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Authenticationsamlpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserverauthenticationoauthidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverauthenticationradiuspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverauthenticationsamlidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationvserverlocalpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationdfaaction struct { + Name string `json:"name,omitempty"` + Clientid string `json:"clientid,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Passphrase string `json:"passphrase,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Success string `json:"success,omitempty"` + Failure string `json:"failure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationldappolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationsamlidppolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationsamlpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserver struct { + Name string `json:"name,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Range int `json:"range,omitempty"` + Port int `json:"port,omitempty"` + State string `json:"state,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authenticationdomain string `json:"authenticationdomain,omitempty"` + Comment string `json:"comment,omitempty"` + Td int `json:"td,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + Certkeynames string `json:"certkeynames,omitempty"` + Samesite string `json:"samesite,omitempty"` + Newname string `json:"newname,omitempty"` + Ip string `json:"ip,omitempty"` + Value string `json:"value,omitempty"` + Type string `json:"type,omitempty"` + Curstate string `json:"curstate,omitempty"` + Status string `json:"status,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Redirect string `json:"redirect,omitempty"` + Precedence string `json:"precedence,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Curaaausers string `json:"curaaausers,omitempty"` + Policy string `json:"policy,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight string `json:"weight,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Clttimeout string `json:"clttimeout,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sothreshold string `json:"sothreshold,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout string `json:"sopersistencetimeout,omitempty"` + Priority string `json:"priority,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority string `json:"listenpriority,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Vstype string `json:"vstype,omitempty"` + Ngname string `json:"ngname,omitempty"` + Secondary string `json:"secondary,omitempty"` + Groupextraction string `json:"groupextraction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverradiuspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationldappolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Authenticationsmartaccesspolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvserveroauthidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationldappolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationlocalpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationvserverauthenticationlocalpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Authenticationwebauthaction struct { + Name string `json:"name,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Fullreqexpr string `json:"fullreqexpr,omitempty"` + Scheme string `json:"scheme,omitempty"` + Successrule string `json:"successrule,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authenticationwebauthpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authenticationloginschemapolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationtacacspolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authenticationvservercachepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` +} diff --git a/nitrogo/models/authorization.go b/nitrogo/models/authorization.go new file mode 100644 index 0000000..307d480 --- /dev/null +++ b/nitrogo/models/authorization.go @@ -0,0 +1,118 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Authorizationpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicylabelauthorizationpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Invoke bool `json:"invoke,omitempty"` +} + +type Authorizationpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Newname string `json:"newname,omitempty"` + Activepolicy string `json:"activepolicy,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authorizationpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Authorizationpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationaction struct { + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authorizationpolicyauthorizationpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Authorizationpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Authorizationpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Invoke bool `json:"invoke,omitempty"` +} + +type Authorizationpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Authorizationpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/autoscale.go b/nitrogo/models/autoscale.go new file mode 100644 index 0000000..e3971d6 --- /dev/null +++ b/nitrogo/models/autoscale.go @@ -0,0 +1,56 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Autoscaleaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Profilename string `json:"profilename,omitempty"` + Parameters string `json:"parameters,omitempty"` + Vmdestroygraceperiod int `json:"vmdestroygraceperiod,omitempty"` + Quiettime int `json:"quiettime,omitempty"` + Vserver string `json:"vserver,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Autoscalepolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Priority string `json:"priority,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Autoscalepolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Autoscalepolicynstimerbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Autoscalepolicytimerbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Autoscaleprofile struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Url string `json:"url,omitempty"` + Apikey string `json:"apikey,omitempty"` + Sharedsecret string `json:"sharedsecret,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/azure.go b/nitrogo/models/azure.go new file mode 100644 index 0000000..c4486b1 --- /dev/null +++ b/nitrogo/models/azure.go @@ -0,0 +1,23 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Azureapplication struct { + Name string `json:"name,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Vaultresource string `json:"vaultresource,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Azurekeyvault struct { + Name string `json:"name,omitempty"` + Azurevaultname string `json:"azurevaultname,omitempty"` + Azureapplication string `json:"azureapplication,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/bfd.go b/nitrogo/models/bfd.go new file mode 100644 index 0000000..35e5f79 --- /dev/null +++ b/nitrogo/models/bfd.go @@ -0,0 +1,30 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Bfdsession struct { + Localip string `json:"localip,omitempty"` + Remoteip string `json:"remoteip,omitempty"` + State string `json:"state,omitempty"` + Localport string `json:"localport,omitempty"` + Remoteport string `json:"remoteport,omitempty"` + Minimumtransmitinterval string `json:"minimumtransmitinterval,omitempty"` + Negotiatedminimumtransmitinterval string `json:"negotiatedminimumtransmitinterval,omitempty"` + Minimumreceiveinterval string `json:"minimumreceiveinterval,omitempty"` + Negotiatedminimumreceiveinterval string `json:"negotiatedminimumreceiveinterval,omitempty"` + Multiplier string `json:"multiplier,omitempty"` + Remotemultiplier string `json:"remotemultiplier,omitempty"` + Vlan string `json:"vlan,omitempty"` + Localdiagnotic string `json:"localdiagnotic,omitempty"` + Localdiscriminator string `json:"localdiscriminator,omitempty"` + Remotediscriminator string `json:"remotediscriminator,omitempty"` + Passive string `json:"passive,omitempty"` + Multihop string `json:"multihop,omitempty"` + Admindown string `json:"admindown,omitempty"` + Originalownerpe string `json:"originalownerpe,omitempty"` + Currentownerpe string `json:"currentownerpe,omitempty"` + Ownernode string `json:"ownernode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/bot.go b/nitrogo/models/bot.go new file mode 100644 index 0000000..1656015 --- /dev/null +++ b/nitrogo/models/bot.go @@ -0,0 +1,339 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Botprofileblacklistbinding struct { + Botblacklist bool `json:"bot_blacklist,omitempty"` + Botblacklisttype string `json:"bot_blacklist_type,omitempty"` + Botblacklistenabled string `json:"bot_blacklist_enabled,omitempty"` + Botblacklistvalue string `json:"bot_blacklist_value,omitempty"` + Botblacklistaction []string `json:"bot_blacklist_action,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botsignature struct { + Src string `json:"src,omitempty"` + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Botpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Botpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofilecaptchabinding struct { + Captcharesource bool `json:"captcharesource,omitempty"` + Botcaptchaurl string `json:"bot_captcha_url,omitempty"` + Botcaptchaenabled string `json:"bot_captcha_enabled,omitempty"` + Waittime int `json:"waittime,omitempty"` + Graceperiod int `json:"graceperiod,omitempty"` + Muteperiod int `json:"muteperiod,omitempty"` + Requestsizelimit int `json:"requestsizelimit,omitempty"` + Retryattempts int `json:"retryattempts,omitempty"` + Botcaptchaaction []string `json:"bot_captcha_action,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofiletpsbinding struct { + Bottps bool `json:"bot_tps,omitempty"` + Bottpstype string `json:"bot_tps_type,omitempty"` + Threshold int `json:"threshold,omitempty"` + Percentage int `json:"percentage,omitempty"` + Bottpsaction []string `json:"bot_tps_action,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Bottpsenabled string `json:"bot_tps_enabled,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botpolicybotpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botpolicylabelbotpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Botglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Botpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofilelogexpressionbinding struct { + Logexpression bool `json:"logexpression,omitempty"` + Botlogexpressionname string `json:"bot_log_expression_name,omitempty"` + Botlogexpressionvalue string `json:"bot_log_expression_value,omitempty"` + Botlogexpressionenabled string `json:"bot_log_expression_enabled,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` + Logmessage string `json:"logmessage,omitempty"` +} + +type Botpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Botpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Botprofileratelimitbinding struct { + Botratelimit bool `json:"bot_ratelimit,omitempty"` + Botratelimittype string `json:"bot_rate_limit_type,omitempty"` + Botratelimitenabled string `json:"bot_rate_limit_enabled,omitempty"` + Botratelimiturl string `json:"bot_rate_limit_url,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Countrycode string `json:"countrycode,omitempty"` + Rate int `json:"rate,omitempty"` + Timeslice int `json:"timeslice,omitempty"` + Limittype string `json:"limittype,omitempty"` + Condition string `json:"condition,omitempty"` + Botratelimitaction []string `json:"bot_rate_limit_action,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botsettings struct { + Defaultprofile string `json:"defaultprofile,omitempty"` + Defaultnonintrusiveprofile string `json:"defaultnonintrusiveprofile,omitempty"` + Javascriptname string `json:"javascriptname,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Dfprequestlimit int `json:"dfprequestlimit,omitempty"` + Signatureautoupdate string `json:"signatureautoupdate,omitempty"` + Signatureurl string `json:"signatureurl,omitempty"` + Proxyserver string `json:"proxyserver,omitempty"` + Proxyport int `json:"proxyport,omitempty"` + Trapurlautogenerate string `json:"trapurlautogenerate,omitempty"` + Trapurlinterval int `json:"trapurlinterval,omitempty"` + Trapurllength int `json:"trapurllength,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Botpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Botpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Botprofileipreputationbinding struct { + Botipreputation bool `json:"bot_ipreputation,omitempty"` + Category string `json:"category,omitempty"` + Botiprepenabled string `json:"bot_iprep_enabled,omitempty"` + Botiprepaction []string `json:"bot_iprep_action,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofiletrapinsertionurlbinding struct { + Trapinsertionurl bool `json:"trapinsertionurl,omitempty"` + Bottrapurl string `json:"bot_trap_url,omitempty"` + Bottrapurlinsertionenabled string `json:"bot_trap_url_insertion_enabled,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` + Logmessage string `json:"logmessage,omitempty"` +} + +type Botprofilewhitelistbinding struct { + Botwhitelist bool `json:"bot_whitelist,omitempty"` + Botwhitelisttype string `json:"bot_whitelist_type,omitempty"` + Botwhitelistenabled string `json:"bot_whitelist_enabled,omitempty"` + Botwhitelistvalue string `json:"bot_whitelist_value,omitempty"` + Log string `json:"log,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Botglobalbinding struct { +} + +type Botglobalbotpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Botpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Profilename string `json:"profilename,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Botprofilekmdetectionexprbinding struct { + Kmdetectionexpr bool `json:"kmdetectionexpr,omitempty"` + Botkmexpressionname string `json:"bot_km_expression_name,omitempty"` + Botkmexpressionvalue string `json:"bot_km_expression_value,omitempty"` + Botkmdetectionenabled string `json:"bot_km_detection_enabled,omitempty"` + Botbindcomment string `json:"bot_bind_comment,omitempty"` + Name string `json:"name,omitempty"` + Logmessage string `json:"logmessage,omitempty"` +} + +type Botpolicybotglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Botprofile struct { + Name string `json:"name,omitempty"` + Signature string `json:"signature,omitempty"` + Errorurl string `json:"errorurl,omitempty"` + Trapurl string `json:"trapurl,omitempty"` + Comment string `json:"comment,omitempty"` + Botenablewhitelist string `json:"bot_enable_white_list,omitempty"` + Botenableblacklist string `json:"bot_enable_black_list,omitempty"` + Botenableratelimit string `json:"bot_enable_rate_limit,omitempty"` + Devicefingerprint string `json:"devicefingerprint,omitempty"` + Devicefingerprintaction []string `json:"devicefingerprintaction,omitempty"` + Botenableipreputation string `json:"bot_enable_ip_reputation,omitempty"` + Trap string `json:"trap,omitempty"` + Trapaction []string `json:"trapaction,omitempty"` + Signaturenouseragentheaderaction []string `json:"signaturenouseragentheaderaction,omitempty"` + Signaturemultipleuseragentheaderaction []string `json:"signaturemultipleuseragentheaderaction,omitempty"` + Botenabletps string `json:"bot_enable_tps,omitempty"` + Devicefingerprintmobile []string `json:"devicefingerprintmobile,omitempty"` + Headlessbrowserdetection string `json:"headlessbrowserdetection,omitempty"` + Clientipexpression string `json:"clientipexpression,omitempty"` + Kmjavascriptname string `json:"kmjavascriptname,omitempty"` + Kmdetection string `json:"kmdetection,omitempty"` + Kmeventspostbodylimit int `json:"kmeventspostbodylimit,omitempty"` + Verboseloglevel string `json:"verboseloglevel,omitempty"` + Spoofedreqaction []string `json:"spoofedreqaction,omitempty"` + Dfprequestlimit int `json:"dfprequestlimit,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Addcookieflags string `json:"addcookieflags,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/cache.go b/nitrogo/models/cache.go new file mode 100644 index 0000000..90e4a19 --- /dev/null +++ b/nitrogo/models/cache.go @@ -0,0 +1,348 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Cacheglobalbinding struct { +} + +type Cacheglobalcachepolicybinding struct { + Policy string `json:"policy,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Precededefrules string `json:"precededefrules,omitempty"` +} + +type Cacheobject struct { + Url string `json:"url,omitempty"` + Locator int `json:"locator,omitempty"` + Httpstatus int `json:"httpstatus,omitempty"` + Host string `json:"host,omitempty"` + Port int `json:"port,omitempty"` + Groupname string `json:"groupname,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Group string `json:"group,omitempty"` + Ignoremarkerobjects string `json:"ignoremarkerobjects,omitempty"` + Includenotreadyobjects string `json:"includenotreadyobjects,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Tosecondary string `json:"tosecondary,omitempty"` + Cacheressize string `json:"cacheressize,omitempty"` + Cachereshdrsize string `json:"cachereshdrsize,omitempty"` + Cacheetag string `json:"cacheetag,omitempty"` + Httpstatusoutput string `json:"httpstatusoutput,omitempty"` + Cachereslastmod string `json:"cachereslastmod,omitempty"` + Cachecontrol string `json:"cachecontrol,omitempty"` + Cacheresdate string `json:"cacheresdate,omitempty"` + Contentgroup string `json:"contentgroup,omitempty"` + Destipv46 string `json:"destipv46,omitempty"` + Destport string `json:"destport,omitempty"` + Cachecellcomplex string `json:"cachecellcomplex,omitempty"` + Hitparams string `json:"hitparams,omitempty"` + Hitvalues string `json:"hitvalues,omitempty"` + Cachecellreqtime string `json:"cachecellreqtime,omitempty"` + Cachecellrestime string `json:"cachecellrestime,omitempty"` + Cachecurage string `json:"cachecurage,omitempty"` + Cachecellexpires string `json:"cachecellexpires,omitempty"` + Cachecellexpiresmillisec string `json:"cachecellexpiresmillisec,omitempty"` + Flushed string `json:"flushed,omitempty"` + Prefetch string `json:"prefetch,omitempty"` + Prefetchperiod string `json:"prefetchperiod,omitempty"` + Prefetchperiodmillisec string `json:"prefetchperiodmillisec,omitempty"` + Cachecellcurreaders string `json:"cachecellcurreaders,omitempty"` + Cachecellcurmisses string `json:"cachecellcurmisses,omitempty"` + Cachecellhits string `json:"cachecellhits,omitempty"` + Cachecellmisses string `json:"cachecellmisses,omitempty"` + Cachecelldhits string `json:"cachecelldhits,omitempty"` + Cachecellcompressionformat string `json:"cachecellcompressionformat,omitempty"` + Cachecellappfwmetadataexists string `json:"cachecellappfwmetadataexists,omitempty"` + Cachecellhttp11 string `json:"cachecellhttp11,omitempty"` + Cachecellweaketag string `json:"cachecellweaketag,omitempty"` + Cachecellresbadsize string `json:"cachecellresbadsize,omitempty"` + Markerreason string `json:"markerreason,omitempty"` + Cachecellpolleverytime string `json:"cachecellpolleverytime,omitempty"` + Cachecelletaginserted string `json:"cachecelletaginserted,omitempty"` + Cachecellreadywithlastbyte string `json:"cachecellreadywithlastbyte,omitempty"` + Cacheinmemory string `json:"cacheinmemory,omitempty"` + Cacheindisk string `json:"cacheindisk,omitempty"` + Cacheinsecondary string `json:"cacheinsecondary,omitempty"` + Cachedirname string `json:"cachedirname,omitempty"` + Cachefilename string `json:"cachefilename,omitempty"` + Cachecelldestipverified string `json:"cachecelldestipverified,omitempty"` + Cachecellfwpxyobj string `json:"cachecellfwpxyobj,omitempty"` + Cachecellbasefile string `json:"cachecellbasefile,omitempty"` + Cachecellminhitflag string `json:"cachecellminhitflag,omitempty"` + Cachecellminhit string `json:"cachecellminhit,omitempty"` + Policy string `json:"policy,omitempty"` + Policyname string `json:"policyname,omitempty"` + Selectorname string `json:"selectorname,omitempty"` + Rule string `json:"rule,omitempty"` + Selectorvalue string `json:"selectorvalue,omitempty"` + Cacheurls string `json:"cacheurls,omitempty"` + Warnbucketskip string `json:"warnbucketskip,omitempty"` + Totalobjs string `json:"totalobjs,omitempty"` + Httpcalloutcell string `json:"httpcalloutcell,omitempty"` + Httpcalloutname string `json:"httpcalloutname,omitempty"` + Returntype string `json:"returntype,omitempty"` + Httpcalloutresult string `json:"httpcalloutresult,omitempty"` + Locatorshow string `json:"locatorshow,omitempty"` + Ceflags string `json:"ceflags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cacheparameter struct { + Memlimit int `json:"memlimit,omitempty"` + Via string `json:"via,omitempty"` + Verifyusing string `json:"verifyusing,omitempty"` + Maxpostlen int `json:"maxpostlen"` + Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` + Enablebypass string `json:"enablebypass,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Enablehaobjpersist string `json:"enablehaobjpersist,omitempty"` + Cacheevictionpolicy string `json:"cacheevictionpolicy,omitempty"` + Disklimit string `json:"disklimit,omitempty"` + Maxdisklimit string `json:"maxdisklimit,omitempty"` + Memlimitactive string `json:"memlimitactive,omitempty"` + Maxmemlimit string `json:"maxmemlimit,omitempty"` + Prefetchcur string `json:"prefetchcur,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cachepolicy struct { + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Storeingroup string `json:"storeingroup,omitempty"` + Invalgroups []string `json:"invalgroups,omitempty"` + Invalobjects []string `json:"invalobjects,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Flags string `json:"flags,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cachepolicybinding struct { + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicycacheglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Cachecontentgroup struct { + Name string `json:"name,omitempty"` + Weakposrelexpiry int `json:"weakposrelexpiry"` + Heurexpiryparam int `json:"heurexpiryparam"` + Relexpiry int `json:"relexpiry"` + Relexpirymillisec int `json:"relexpirymillisec"` + Absexpiry []string `json:"absexpiry,omitempty"` + Absexpirygmt []string `json:"absexpirygmt,omitempty"` + Weaknegrelexpiry int `json:"weaknegrelexpiry"` + Hitparams []string `json:"hitparams,omitempty"` + Invalparams []string `json:"invalparams,omitempty"` + Ignoreparamvaluecase string `json:"ignoreparamvaluecase,omitempty"` + Matchcookies string `json:"matchcookies,omitempty"` + Invalrestrictedtohost string `json:"invalrestrictedtohost,omitempty"` + Polleverytime string `json:"polleverytime,omitempty"` + Ignorereloadreq string `json:"ignorereloadreq,omitempty"` + Removecookies string `json:"removecookies,omitempty"` + Prefetch string `json:"prefetch,omitempty"` + Prefetchperiod int `json:"prefetchperiod"` + Prefetchperiodmillisec int `json:"prefetchperiodmillisec"` + Prefetchmaxpending int `json:"prefetchmaxpending"` + Flashcache string `json:"flashcache,omitempty"` + Expireatlastbyte string `json:"expireatlastbyte,omitempty"` + Insertvia string `json:"insertvia,omitempty"` + Insertage string `json:"insertage,omitempty"` + Insertetag string `json:"insertetag,omitempty"` + Cachecontrol string `json:"cachecontrol,omitempty"` + Quickabortsize int `json:"quickabortsize"` + Minressize int `json:"minressize"` + Maxressize int `json:"maxressize,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Ignorereqcachinghdrs string `json:"ignorereqcachinghdrs,omitempty"` + Minhits int `json:"minhits"` + Alwaysevalpolicies string `json:"alwaysevalpolicies,omitempty"` + Persistha string `json:"persistha,omitempty"` + Pinned string `json:"pinned,omitempty"` + Lazydnsresolve string `json:"lazydnsresolve,omitempty"` + Hitselector string `json:"hitselector,omitempty"` + Invalselector string `json:"invalselector,omitempty"` + Type string `json:"type,omitempty"` + Query string `json:"query,omitempty"` + Host string `json:"host,omitempty"` + Selectorvalue string `json:"selectorvalue,omitempty"` + Tosecondary string `json:"tosecondary,omitempty"` + Flags string `json:"flags,omitempty"` + Prefetchcur string `json:"prefetchcur,omitempty"` + Memusage string `json:"memusage,omitempty"` + Memdusage string `json:"memdusage,omitempty"` + Disklimit string `json:"disklimit,omitempty"` + Cachenon304hits string `json:"cachenon304hits,omitempty"` + Cache304hits string `json:"cache304hits,omitempty"` + Cachecells string `json:"cachecells,omitempty"` + Cachegroupincarnation string `json:"cachegroupincarnation,omitempty"` + Persist string `json:"persist,omitempty"` + Policyname string `json:"policyname,omitempty"` + Cachenuminvalpolicy string `json:"cachenuminvalpolicy,omitempty"` + Markercells string `json:"markercells,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cacheforwardproxy struct { + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cachepolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Evaluates string `json:"evaluates,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cachepolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cacheselector struct { + Selectorname string `json:"selectorname,omitempty"` + Rule []string `json:"rule,omitempty"` + Flags string `json:"flags,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cacheglobalpolicybinding struct { + Policy string `json:"policy,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Precededefrules string `json:"precededefrules,omitempty"` +} + +type Cachepolicycachepolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cachepolicylabelcachepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cachepolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} diff --git a/nitrogo/models/cloud.go b/nitrogo/models/cloud.go new file mode 100644 index 0000000..3eebb3a --- /dev/null +++ b/nitrogo/models/cloud.go @@ -0,0 +1,86 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Cloudservice struct { + Response string `json:"response,omitempty"` +} + +type Cloudvserverip struct { + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudautoscalegroup struct { + Name string `json:"name,omitempty"` + Azcount string `json:"azcount,omitempty"` + Aznames string `json:"aznames,omitempty"` + Graceful string `json:"graceful,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudcredential struct { + Tenantidentifier string `json:"tenantidentifier,omitempty"` + Applicationid string `json:"applicationid,omitempty"` + Applicationsecret string `json:"applicationsecret,omitempty"` + Isset string `json:"isset,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudngsparameter struct { + Blockonallowedngstktprof string `json:"blockonallowedngstktprof,omitempty"` + Allowedudtversion string `json:"allowedudtversion,omitempty"` + Csvserverticketingdecouple string `json:"csvserverticketingdecouple,omitempty"` + Allowdtls12 string `json:"allowdtls12,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudparaminternal struct { + Nonftumode string `json:"nonftumode,omitempty"` + Iamperm string `json:"iamperm,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudallowedngsticketprofile struct { + Name string `json:"name,omitempty"` + Creator string `json:"creator,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudawsparam struct { + Rolearn string `json:"rolearn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudparameter struct { + Controllerfqdn string `json:"controllerfqdn,omitempty"` + Controllerport int `json:"controllerport,omitempty"` + Instanceid string `json:"instanceid,omitempty"` + Customerid string `json:"customerid,omitempty"` + Resourcelocation string `json:"resourcelocation,omitempty"` + Activationcode string `json:"activationcode,omitempty"` + Deployment string `json:"deployment,omitempty"` + Connectorresidence string `json:"connectorresidence,omitempty"` + Controlconnectionstatus string `json:"controlconnectionstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudprofile struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Boundservicegroupsvctype string `json:"boundservicegroupsvctype,omitempty"` + Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + Graceful string `json:"graceful,omitempty"` + Delay int `json:"delay,omitempty"` + Azuretagname string `json:"azuretagname,omitempty"` + Azuretagvalue string `json:"azuretagvalue,omitempty"` + Azurepollperiod int `json:"azurepollperiod,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/cloudtunnel.go b/nitrogo/models/cloudtunnel.go new file mode 100644 index 0000000..298ccbd --- /dev/null +++ b/nitrogo/models/cloudtunnel.go @@ -0,0 +1,30 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Cloudtunnelvserver struct { + Name string `json:"name,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + State string `json:"state,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Type string `json:"type,omitempty"` + Ip string `json:"ip,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Ippattern string `json:"ippattern,omitempty"` + Port string `json:"port,omitempty"` + Range string `json:"range,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudtunnelparameter struct { + Controllerfqdn string `json:"controllerfqdn,omitempty"` + Fqdn string `json:"fqdn,omitempty"` + Resourcelocation string `json:"resourcelocation,omitempty"` + Subnetresourcelocationmappings string `json:"subnetresourcelocationmappings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/cluster.go b/nitrogo/models/cluster.go new file mode 100644 index 0000000..5256219 --- /dev/null +++ b/nitrogo/models/cluster.go @@ -0,0 +1,246 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Clusternodegroup struct { + Name string `json:"name,omitempty"` + Strict string `json:"strict,omitempty"` + Sticky string `json:"sticky,omitempty"` + State string `json:"state,omitempty"` + Priority int `json:"priority,omitempty"` + Currentnodemask string `json:"currentnodemask,omitempty"` + Backupnodemask string `json:"backupnodemask,omitempty"` + Boundedentitiescntfrompe string `json:"boundedentitiescntfrompe,omitempty"` + Activelist string `json:"activelist,omitempty"` + Backuplist string `json:"backuplist,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Clusternodegroupauthenticationvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupcsvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegrouplimitidentifierbinding struct { + Identifiername string `json:"identifiername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clustersyncfailures struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Clusterinstance struct { + Clid int `json:"clid,omitempty"` + Deadinterval int `json:"deadinterval,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Preemption string `json:"preemption,omitempty"` + Quorumtype string `json:"quorumtype,omitempty"` + Inc string `json:"inc,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` + Backplanebasedview string `json:"backplanebasedview,omitempty"` + Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` + Dfdretainl2params string `json:"dfdretainl2params,omitempty"` + Clusterproxyarp string `json:"clusterproxyarp,omitempty"` + Secureheartbeats string `json:"secureheartbeats,omitempty"` + Nodegroup string `json:"nodegroup,omitempty"` + Adminstate string `json:"adminstate,omitempty"` + Propstate string `json:"propstate,omitempty"` + Validmtu string `json:"validmtu,omitempty"` + Heterogeneousflag string `json:"heterogeneousflag,omitempty"` + Operationalstate string `json:"operationalstate,omitempty"` + Status string `json:"status,omitempty"` + Rsskeymismatch string `json:"rsskeymismatch,omitempty"` + Penummismatch string `json:"penummismatch,omitempty"` + Nodegroupstatewarning string `json:"nodegroupstatewarning,omitempty"` + Licensemismatch string `json:"licensemismatch,omitempty"` + Jumbonotsupported string `json:"jumbonotsupported,omitempty"` + Clustertunnelmodemismatch string `json:"clustertunnelmodemismatch,omitempty"` + Clusternoheartbeatonnode string `json:"clusternoheartbeatonnode,omitempty"` + Clusternolinksetmbf string `json:"clusternolinksetmbf,omitempty"` + Clusternospottedip string `json:"clusternospottedip,omitempty"` + Clusterclipfailure string `json:"clusterclipfailure,omitempty"` + Clusterhbhmacerrordetected string `json:"clusterhbhmacerrordetected,omitempty"` + Nodepenummismatch string `json:"nodepenummismatch,omitempty"` + Operationalpropstate string `json:"operationalpropstate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Clusterinstancenodebinding struct { + Nodeid uint32 `json:"nodeid,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Health string `json:"health,omitempty"` + Clusterhealth string `json:"clusterhealth,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Masterstate string `json:"masterstate,omitempty"` + State string `json:"state,omitempty"` + Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` + Islocalnode bool `json:"islocalnode,omitempty"` + Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` + Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` + Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` + Clid uint32 `json:"clid,omitempty"` +} + +type Clusternodegroupcrvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupnslimitidentifierbinding struct { + Identifiername string `json:"identifiername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusterfiles struct { + Mode []string `json:"mode,omitempty"` +} + +type Clusterinstancebinding struct { + Clid int `json:"clid,omitempty"` +} + +type Clusternodegroupnodebinding struct { + Node uint32 `json:"node,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupgslbvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegrouplbvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupvpnvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cluster struct { + Clip string `json:"clip,omitempty"` + Password string `json:"password,omitempty"` +} + +type Clusternode struct { + Nodeid int `json:"nodeid"` + Ipaddress string `json:"ipaddress,omitempty"` + State string `json:"state,omitempty"` + Backplane string `json:"backplane,omitempty"` + Priority int `json:"priority,omitempty"` + Nodegroup string `json:"nodegroup,omitempty"` + Delay int `json:"delay,omitempty"` + Tunnelmode string `json:"tunnelmode,omitempty"` + Clearnodegroupconfig string `json:"clearnodegroupconfig,omitempty"` + Force bool `json:"force,omitempty"` + Clusterhealth string `json:"clusterhealth,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Operationalsyncstate string `json:"operationalsyncstate,omitempty"` + Syncfailurereason string `json:"syncfailurereason,omitempty"` + Masterstate string `json:"masterstate,omitempty"` + Health string `json:"health,omitempty"` + Syncstate string `json:"syncstate,omitempty"` + Isconfigurationcoordinator string `json:"isconfigurationcoordinator,omitempty"` + Islocalnode string `json:"islocalnode,omitempty"` + Nodersskeymismatch string `json:"nodersskeymismatch,omitempty"` + Nodelicensemismatch string `json:"nodelicensemismatch,omitempty"` + Nodejumbonotsupported string `json:"nodejumbonotsupported,omitempty"` + Nodelist string `json:"nodelist,omitempty"` + Ifaceslist string `json:"ifaceslist,omitempty"` + Enabledifaces string `json:"enabledifaces,omitempty"` + Disabledifaces string `json:"disabledifaces,omitempty"` + Partialfailifaces string `json:"partialfailifaces,omitempty"` + Hamonifaces string `json:"hamonifaces,omitempty"` + Name string `json:"name,omitempty"` + Cfgflags string `json:"cfgflags,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Clusternodegroupgslbsitebinding struct { + Gslbsite string `json:"gslbsite,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupservicebinding struct { + Service string `json:"service,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clustersync struct { +} + +type Clusterinstanceclusternodebinding struct { + Nodeid int `json:"nodeid,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Health string `json:"health,omitempty"` + Clusterhealth string `json:"clusterhealth,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Masterstate string `json:"masterstate,omitempty"` + State string `json:"state,omitempty"` + Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` + Islocalnode bool `json:"islocalnode,omitempty"` + Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` + Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` + Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` + Clid int `json:"clid,omitempty"` +} + +type Clusternodegroupclusternodebinding struct { + Node int `json:"node,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupidentifierbinding struct { + Identifiername string `json:"identifiername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupsitebinding struct { + Gslbsite string `json:"gslbsite,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusternodegroupstreamidentifierbinding struct { + Identifiername string `json:"identifiername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Clusterpropstatus struct { + Nodeid int `json:"nodeid,omitempty"` + Numpropcmdfailed string `json:"numpropcmdfailed,omitempty"` + Cmdstrs string `json:"cmdstrs,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Clusternodebinding struct { + Nodeid int `json:"nodeid,omitempty"` +} + +type Clusternoderoutemonitorbinding struct { + Routemonitor string `json:"routemonitor,omitempty"` + Netmask string `json:"netmask,omitempty"` + Routemonstate int `json:"routemonstate,omitempty"` + Nodeid int `json:"nodeid,omitempty"` +} + +type Clusternodegroupbinding struct { + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/cmp.go b/nitrogo/models/cmp.go new file mode 100644 index 0000000..3744cb9 --- /dev/null +++ b/nitrogo/models/cmp.go @@ -0,0 +1,219 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Cmpparameter struct { + Cmplevel string `json:"cmplevel,omitempty"` + Quantumsize int `json:"quantumsize,omitempty"` + Servercmp string `json:"servercmp,omitempty"` + Heurexpiry string `json:"heurexpiry,omitempty"` + Heurexpirythres int `json:"heurexpirythres,omitempty"` + Heurexpiryhistwt int `json:"heurexpiryhistwt,omitempty"` + Minressize int `json:"minressize,omitempty"` + Cmpbypasspct int `json:"cmpbypasspct,omitempty"` + Cmponpush string `json:"cmponpush,omitempty"` + Policytype string `json:"policytype,omitempty"` + Addvaryheader string `json:"addvaryheader,omitempty"` + Varyheadervalue string `json:"varyheadervalue,omitempty"` + Externalcache string `json:"externalcache,omitempty"` + Randomgzipfilename string `json:"randomgzipfilename,omitempty"` + Randomgzipfilenameminlength int `json:"randomgzipfilenameminlength,omitempty"` + Randomgzipfilenamemaxlength int `json:"randomgzipfilenamemaxlength,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cmppolicycmpglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cmpglobalbinding struct { +} + +type Cmppolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Resaction string `json:"resaction,omitempty"` + Newname string `json:"newname,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Hits string `json:"hits,omitempty"` + Txbytes string `json:"txbytes,omitempty"` + Rxbytes string `json:"rxbytes,omitempty"` + Clientttlb string `json:"clientttlb,omitempty"` + Clienttransactions string `json:"clienttransactions,omitempty"` + Serverttlb string `json:"serverttlb,omitempty"` + Servertransactions string `json:"servertransactions,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cmppolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Type string `json:"type,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cmppolicylabelcmppolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cmppolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cmpglobalcmppolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Type string `json:"type,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cmppolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Cmppolicycmppolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmpaction struct { + Name string `json:"name,omitempty"` + Cmptype string `json:"cmptype,omitempty"` + Addvaryheader string `json:"addvaryheader,omitempty"` + Varyheadervalue string `json:"varyheadervalue,omitempty"` + Deltatype string `json:"deltatype,omitempty"` + Newname string `json:"newname,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cmpglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Policytype string `json:"policytype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cmppolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cmppolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} diff --git a/nitrogo/models/contentinspection.go b/nitrogo/models/contentinspection.go new file mode 100644 index 0000000..9da872d --- /dev/null +++ b/nitrogo/models/contentinspection.go @@ -0,0 +1,223 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Contentinspectionpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectionpolicycontentinspectionglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Type string `json:"type,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectionpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Contentinspectionglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Contentinspectionpolicycontentinspectionpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionprofile struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Ingressinterface string `json:"ingressinterface,omitempty"` + Ingressvlan int `json:"ingressvlan,omitempty"` + Egressinterface string `json:"egressinterface,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Egressvlan int `json:"egressvlan,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectioncallout struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Profilename string `json:"profilename,omitempty"` + Servername string `json:"servername,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Returntype string `json:"returntype,omitempty"` + Resultexpr string `json:"resultexpr,omitempty"` + Comment string `json:"comment,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Undefreason string `json:"undefreason,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectionpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Contentinspectionpolicylabelcontentinspectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Contentinspectionaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Servername string `json:"servername,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Icapprofilename string `json:"icapprofilename,omitempty"` + Ifserverdown string `json:"ifserverdown,omitempty"` + Reqtimeout string `json:"reqtimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectionglobalbinding struct { +} + +type Contentinspectionglobalcontentinspectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Contentinspectionparameter struct { + Undefaction string `json:"undefaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Contentinspectionpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Contentinspectionpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} diff --git a/nitrogo/models/cr.go b/nitrogo/models/cr.go new file mode 100644 index 0000000..426adcc --- /dev/null +++ b/nitrogo/models/cr.go @@ -0,0 +1,370 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Craction struct { + Name string `json:"name,omitempty"` + Crtype string `json:"crtype,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Crpolicybinding struct { + Policyname string `json:"policyname,omitempty"` +} + +type Crpolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Bindhits int `json:"bindhits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Crvserverappflowpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Crvservercmppolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Inherited string `json:"inherited,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crvserverlbvserverbinding struct { + Lbvserver string `json:"lbvserver,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvserverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Inherited string `json:"inherited,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvserverprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvservericapolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvservermapbinding struct { + Policyname string `json:"policyname,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Name string `json:"name,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvserverpolicymapbinding struct { + Policyname string `json:"policyname,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvserverrewritepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crpolicy struct { + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Boundto string `json:"boundto,omitempty"` + Vstype string `json:"vstype,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Activepolicy string `json:"activepolicy,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Crpolicyvserverbinding struct { + Domain string `json:"domain,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Pihits uint32 `json:"pihits,omitempty"` + Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Crvserver struct { + Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Port int `json:"port,omitempty"` + Ipset string `json:"ipset,omitempty"` + Range int `json:"range,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Redirect string `json:"redirect,omitempty"` + Onpolicymatch string `json:"onpolicymatch,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Precedence string `json:"precedence,omitempty"` + Arp string `json:"arp,omitempty"` + Ghost string `json:"ghost,omitempty"` + Map string `json:"map,omitempty"` + Format string `json:"format,omitempty"` + Via string `json:"via,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Destinationvserver string `json:"destinationvserver,omitempty"` + Domain string `json:"domain,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + Reuse string `json:"reuse,omitempty"` + State string `json:"state,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Backendssl string `json:"backendssl,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Comment string `json:"comment,omitempty"` + Srcipexpr string `json:"srcipexpr,omitempty"` + Originusip string `json:"originusip,omitempty"` + Useportrange string `json:"useportrange,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Useoriginipportforcache string `json:"useoriginipportforcache,omitempty"` + Tcpprobeport int `json:"tcpprobeport,omitempty"` + Probeprotocol string `json:"probeprotocol,omitempty"` + Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + Probeport int `json:"probeport,omitempty"` + Disallowserviceaccess string `json:"disallowserviceaccess,omitempty"` + Newname string `json:"newname,omitempty"` + Ip string `json:"ip,omitempty"` + Value string `json:"value,omitempty"` + Ngname string `json:"ngname,omitempty"` + Type string `json:"type,omitempty"` + Curstate string `json:"curstate,omitempty"` + Status string `json:"status,omitempty"` + Authentication string `json:"authentication,omitempty"` + Homepage string `json:"homepage,omitempty"` + Rule string `json:"rule,omitempty"` + Policyname string `json:"policyname,omitempty"` + Pipolicyhits string `json:"pipolicyhits,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight string `json:"weight,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Priority string `json:"priority,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke string `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Crvserveranalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvserverappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crvserverappqoepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Crvservercachepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crvservercrpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Crvservercspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvserverfeopolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvserverfilterpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Inherited string `json:"inherited,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvserverresponderpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Crvserverspilloverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Crvservervserverbinding struct { + Lbvserver string `json:"lbvserver,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/cs.go b/nitrogo/models/cs.go new file mode 100644 index 0000000..937619c --- /dev/null +++ b/nitrogo/models/cs.go @@ -0,0 +1,589 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Csvserverresponderpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvserversyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cspolicy struct { + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Vstype string `json:"vstype,omitempty"` + Hits string `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Priority string `json:"priority,omitempty"` + Activepolicy string `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cspolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cspolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Action string `json:"action,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Bindhits int `json:"bindhits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cspolicypolicylabelbinding struct { + Domain string `json:"domain,omitempty"` + Url string `json:"url,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Csvserver struct { + Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Targettype string `json:"targettype,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Ippattern string `json:"ippattern,omitempty"` + Ipmask string `json:"ipmask,omitempty"` + Range int `json:"range,omitempty"` + Port int `json:"port,omitempty"` + Ipset string `json:"ipset,omitempty"` + State string `json:"state,omitempty"` + Stateupdate string `json:"stateupdate,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Precedence string `json:"precedence,omitempty"` + Casesensitive string `json:"casesensitive,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + Sobackupaction string `json:"sobackupaction,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Insertvserveripport string `json:"insertvserveripport,omitempty"` + Vipheader string `json:"vipheader,omitempty"` + Rtspnat string `json:"rtspnat,omitempty"` + Authenticationhost string `json:"authenticationhost,omitempty"` + Authentication string `json:"authentication,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Authn401 string `json:"authn401,omitempty"` + Authnvsname string `json:"authnvsname,omitempty"` + Push string `json:"push,omitempty"` + Pushvserver string `json:"pushvserver,omitempty"` + Pushlabel string `json:"pushlabel,omitempty"` + Pushmulticlients string `json:"pushmulticlients,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Dbprofilename string `json:"dbprofilename,omitempty"` + Oracleserverversion string `json:"oracleserverversion,omitempty"` + Comment string `json:"comment,omitempty"` + Mssqlserverversion string `json:"mssqlserverversion,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` + Mysqlserverversion string `json:"mysqlserverversion,omitempty"` + Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` + Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Authnprofile string `json:"authnprofile,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Dtls string `json:"dtls,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Timeout int `json:"timeout,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Persistencebackup string `json:"persistencebackup,omitempty"` + Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` + Tcpprobeport int `json:"tcpprobeport,omitempty"` + Probeprotocol string `json:"probeprotocol,omitempty"` + Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + Probeport int `json:"probeport,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Redirectfromport int `json:"redirectfromport,omitempty"` + Dnsoverhttps string `json:"dnsoverhttps,omitempty"` + Httpsredirecturl string `json:"httpsredirecturl,omitempty"` + Apiprofile string `json:"apiprofile,omitempty"` + Domainname string `json:"domainname,omitempty"` + Ttl int `json:"ttl,omitempty"` + Backupip string `json:"backupip,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Newname string `json:"newname,omitempty"` + Ip string `json:"ip,omitempty"` + Value string `json:"value,omitempty"` + Ngname string `json:"ngname,omitempty"` + Type string `json:"type,omitempty"` + Curstate string `json:"curstate,omitempty"` + Status string `json:"status,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Redirect string `json:"redirect,omitempty"` + Homepage string `json:"homepage,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight string `json:"weight,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Url string `json:"url,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gt2gb string `json:"gt2gb,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Statechangetimemsec string `json:"statechangetimemsec,omitempty"` + Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Version string `json:"version,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Csvserveranalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Csvservercachepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvserverdomainbinding struct { + Domainname string `json:"domainname,omitempty"` + Ttl int `json:"ttl,omitempty"` + Backupip string `json:"backupip,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Name string `json:"name,omitempty"` +} + +type Csparameter struct { + Stateupdate string `json:"stateupdate,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cspolicybinding struct { + Policyname string `json:"policyname,omitempty"` +} + +type Csvserverauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverauthorizationpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvserverlbvserverbinding struct { + Lbvserver string `json:"lbvserver,omitempty"` + Hits int `json:"hits,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Csvserverspilloverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvservertmtrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Cspolicyvserverbinding struct { + Domain string `json:"domain,omitempty"` + Action string `json:"action,omitempty"` + Url string `json:"url,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Pihits uint32 `json:"pihits,omitempty"` + Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Csvservercmppolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvservernslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverrewritepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvservervpnvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` +} + +type Cspolicycspolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type Cspolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Cspolicylabeltype string `json:"cspolicylabeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cspolicylabelcspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvservervserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Csvserverappflowpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Csvserverappqoepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Csvserverbotpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Csvserverfeopolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverfilterpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvservertrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csaction struct { + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Targetvserverexpr string `json:"targetvserverexpr,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Csvserverprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Csvservertransformpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Cspolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Csvservercontentinspectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type Cspolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Csvserverauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Csvservercspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Hits int `json:"hits,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Rule string `json:"rule,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` + Name string `json:"name,omitempty"` +} + +type Csvservergslbvserverbinding struct { + Vserver string `json:"vserver,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` +} + +type Csvserverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` + Rule string `json:"rule,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/db.go b/nitrogo/models/db.go new file mode 100644 index 0000000..86941c6 --- /dev/null +++ b/nitrogo/models/db.go @@ -0,0 +1,23 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Dbdbprofile struct { + Name string `json:"name,omitempty"` + Interpretquery string `json:"interpretquery,omitempty"` + Stickiness string `json:"stickiness,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Conmultiplex string `json:"conmultiplex,omitempty"` + Enablecachingconmuxoff string `json:"enablecachingconmuxoff,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dbuser struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/dns.go b/nitrogo/models/dns.go new file mode 100644 index 0000000..b40c2d4 --- /dev/null +++ b/nitrogo/models/dns.go @@ -0,0 +1,558 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Dnsaddrec struct { + Hostname string `json:"hostname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Vservername string `json:"vservername,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnscnamerec struct { + Aliasname string `json:"aliasname,omitempty"` + Canonicalname string `json:"canonicalname,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Vservername string `json:"vservername,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsglobaldnspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Dnskey struct { + Keyname string `json:"keyname,omitempty"` + Publickey string `json:"publickey,omitempty"` + Privatekey string `json:"privatekey,omitempty"` + Expires int `json:"expires,omitempty"` + Units1 string `json:"units1,omitempty"` + Notificationperiod int `json:"notificationperiod,omitempty"` + Units2 string `json:"units2,omitempty"` + Ttl int `json:"ttl,omitempty"` + Password string `json:"password,omitempty"` + Autorollover string `json:"autorollover,omitempty"` + Rollovermethod string `json:"rollovermethod,omitempty"` + Revoke bool `json:"revoke,omitempty"` + Zonename string `json:"zonename,omitempty"` + Keytype string `json:"keytype,omitempty"` + Algorithm string `json:"algorithm,omitempty"` + Keysize int `json:"keysize,omitempty"` + Filenameprefix string `json:"filenameprefix,omitempty"` + Src string `json:"src,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Tag string `json:"tag,omitempty"` + Createtimestr string `json:"createtimestr,omitempty"` + Activationtimestr string `json:"activationtimestr,omitempty"` + Expirytimestr string `json:"expirytimestr,omitempty"` + Deletiontimestr string `json:"deletiontimestr,omitempty"` + Rolloverfailrc string `json:"rolloverfailrc,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicydnspolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Transform string `json:"transform,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsprofile struct { + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Recursiveresolution string `json:"recursiveresolution,omitempty"` + Dnsquerylogging string `json:"dnsquerylogging,omitempty"` + Dnsanswerseclogging string `json:"dnsanswerseclogging,omitempty"` + Dnsextendedlogging string `json:"dnsextendedlogging,omitempty"` + Dnserrorlogging string `json:"dnserrorlogging,omitempty"` + Cacherecords string `json:"cacherecords,omitempty"` + Cachenegativeresponses string `json:"cachenegativeresponses,omitempty"` + Dropmultiqueryrequest string `json:"dropmultiqueryrequest,omitempty"` + Cacheecsresponses string `json:"cacheecsresponses,omitempty"` + Insertecs string `json:"insertecs,omitempty"` + Replaceecs string `json:"replaceecs,omitempty"` + Maxcacheableecsprefixlength int `json:"maxcacheableecsprefixlength,omitempty"` + Maxcacheableecsprefixlength6 int `json:"maxcacheableecsprefixlength6,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsviewpolicybinding struct { + Dnspolicyname string `json:"dnspolicyname,omitempty"` + Viewname string `json:"viewname,omitempty"` +} + +type Dnsaction struct { + Actionname string `json:"actionname,omitempty"` + Actiontype string `json:"actiontype,omitempty"` + Ipaddress []string `json:"ipaddress,omitempty"` + Ttl int `json:"ttl,omitempty"` + Viewname string `json:"viewname,omitempty"` + Preferredloclist []string `json:"preferredloclist,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Drop string `json:"drop,omitempty"` + Cachebypass string `json:"cachebypass,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsaction64 struct { + Actionname string `json:"actionname,omitempty"` + Prefix string `json:"prefix,omitempty"` + Mappedrule string `json:"mappedrule,omitempty"` + Excluderule string `json:"excluderule,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsviewbinding struct { + Viewname string `json:"viewname,omitempty"` +} + +type Dnszonebinding struct { + Zonename string `json:"zonename,omitempty"` +} + +type Dnspolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Dnspolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Dnsptrrec struct { + Reversedomain string `json:"reversedomain,omitempty"` + Domain string `json:"domain,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnssubnetcache struct { + Ecssubnet string `json:"ecssubnet,omitempty"` + All bool `json:"all,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Hostname string `json:"hostname,omitempty"` + Nextrecs string `json:"nextrecs,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnstxtrec struct { + Domain string `json:"domain,omitempty"` + String []string `json:"String,omitempty"` + Ttl int `json:"ttl,omitempty"` + Recordid int `json:"recordid,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnszone struct { + Zonename string `json:"zonename,omitempty"` + Proxymode string `json:"proxymode,omitempty"` + Dnssecoffload string `json:"dnssecoffload,omitempty"` + Nsec string `json:"nsec,omitempty"` + Keyname []string `json:"keyname,omitempty"` + Type string `json:"type,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnszonedomainbinding struct { + Domain string `json:"domain,omitempty"` + Nextrecs []string `json:"nextrecs,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + +type Dnsnsrec struct { + Domain string `json:"domain,omitempty"` + Nameserver string `json:"nameserver,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsparameter struct { + Retries int `json:"retries,omitempty"` + Minttl int `json:"minttl"` + Maxttl int `json:"maxttl,omitempty"` + Cacherecords string `json:"cacherecords,omitempty"` + Namelookuppriority string `json:"namelookuppriority,omitempty"` + Recursion string `json:"recursion,omitempty"` + Resolutionorder string `json:"resolutionorder,omitempty"` + Dnssec string `json:"dnssec,omitempty"` + Maxpipeline int `json:"maxpipeline,omitempty"` + Dnsrootreferral string `json:"dnsrootreferral,omitempty"` + Dns64timeout int `json:"dns64timeout"` + Ecsmaxsubnets int `json:"ecsmaxsubnets"` + Maxnegcachettl int `json:"maxnegcachettl,omitempty"` + Cachehitbypass string `json:"cachehitbypass,omitempty"` + Maxcachesize int `json:"maxcachesize"` + Resolvermaxactiveresolutions int `json:"resolvermaxactiveresolutions,omitempty"` + Resolvermaxtcpconnections int `json:"resolvermaxtcpconnections,omitempty"` + Resolvermaxtcptimeout int `json:"resolvermaxtcptimeout,omitempty"` + Maxnegativecachesize int `json:"maxnegativecachesize"` + Cachenoexpire string `json:"cachenoexpire,omitempty"` + Splitpktqueryprocessing string `json:"splitpktqueryprocessing,omitempty"` + Cacheecszeroprefix string `json:"cacheecszeroprefix,omitempty"` + Maxudppacketsize int `json:"maxudppacketsize,omitempty"` + Zonetransfer string `json:"zonetransfer,omitempty"` + Autosavekeyops string `json:"autosavekeyops,omitempty"` + Nxdomainratelimitthreshold int `json:"nxdomainratelimitthreshold"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nxdomainthresholdcrossed string `json:"nxdomainthresholdcrossed,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Viewname string `json:"viewname,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Preferredloclist []string `json:"preferredloclist,omitempty"` + Drop string `json:"drop,omitempty"` + Cachebypass string `json:"cachebypass,omitempty"` + Actionname string `json:"actionname,omitempty"` + Logaction string `json:"logaction,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsnameserver struct { + Ip string `json:"ip,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Local bool `json:"local,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Servicename string `json:"servicename,omitempty"` + Port string `json:"port,omitempty"` + Nameserverstate string `json:"nameserverstate,omitempty"` + Clmonowner string `json:"clmonowner,omitempty"` + Clmonview string `json:"clmonview,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsnaptrrec struct { + Domain string `json:"domain,omitempty"` + Order int `json:"order,omitempty"` + Preference int `json:"preference,omitempty"` + Flags string `json:"flags,omitempty"` + Services string `json:"services,omitempty"` + Regexp string `json:"regexp,omitempty"` + Replacement string `json:"replacement,omitempty"` + Ttl int `json:"ttl,omitempty"` + Recordid int `json:"recordid,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Vservername string `json:"vservername,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsmxrec struct { + Domain string `json:"domain,omitempty"` + Mx string `json:"mx,omitempty"` + Pref int `json:"pref,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicy64vserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicydnsglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Dnszonekeybinding struct { + Keyname []string `json:"keyname,omitempty"` + Siginceptiontime []uint32 `json:"siginceptiontime,omitempty"` + Signed uint32 `json:"signed,omitempty"` + Expires uint32 `json:"expires,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + +type Dnscaarec struct { + Domain string `json:"domain,omitempty"` + Valuestring string `json:"valuestring,omitempty"` + Tag string `json:"tag,omitempty"` + Flag string `json:"flag,omitempty"` + Ttl int `json:"ttl,omitempty"` + Recordid int `json:"recordid,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsnegativecacherecords struct { + Nodeid int `json:"nodeid,omitempty"` + Hostname string `json:"hostname,omitempty"` + Negcachetype string `json:"negcachetype,omitempty"` + Rdclient string `json:"rdclient,omitempty"` + Querytype string `json:"querytype,omitempty"` + Ttl string `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicylabeldnspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Dnssuffix struct { + Dnssuffix string `json:"Dnssuffix,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsviewdnspolicybinding struct { + Dnspolicyname string `json:"dnspolicyname,omitempty"` + Viewname string `json:"viewname,omitempty"` +} + +type Dnszonednskeybinding struct { + Keyname []string `json:"keyname,omitempty"` + Siginceptiontime []int `json:"siginceptiontime,omitempty"` + Signed int `json:"signed,omitempty"` + Expires int `json:"expires,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + +type Dnsaaaarec struct { + Hostname string `json:"hostname,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Vservername string `json:"vservername,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsdsfile struct { + Keyname string `json:"keyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Dnsproxyrecords struct { + Type string `json:"type,omitempty"` + Negrectype string `json:"negrectype,omitempty"` +} + +type Dnssoarec struct { + Domain string `json:"domain,omitempty"` + Originserver string `json:"originserver,omitempty"` + Contact string `json:"contact,omitempty"` + Serial int `json:"serial,omitempty"` + Refresh int `json:"refresh,omitempty"` + Retry int `json:"retry,omitempty"` + Expire int `json:"expire,omitempty"` + Minimum int `json:"minimum,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnssrvrec struct { + Domain string `json:"domain,omitempty"` + Target string `json:"target,omitempty"` + Priority int `json:"priority,omitempty"` + Weight int `json:"weight,omitempty"` + Port int `json:"port,omitempty"` + Ttl int `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Authtype string `json:"authtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnsviewgslbservicebinding struct { + Gslbservicename string `json:"gslbservicename,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Viewname string `json:"viewname,omitempty"` +} + +type Dnsviewservicebinding struct { + Gslbservicename string `json:"gslbservicename,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Viewname string `json:"viewname,omitempty"` +} + +type Dnsglobalbinding struct { +} + +type Dnsnsecrec struct { + Hostname string `json:"hostname,omitempty"` + Type string `json:"type,omitempty"` + Nextnsec string `json:"nextnsec,omitempty"` + Nextrecs string `json:"nextrecs,omitempty"` + Ttl string `json:"ttl,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicy64 struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Hits string `json:"hits,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Dnspolicy64binding struct { + Name string `json:"name,omitempty"` +} + +type Dnspolicy64lbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Dnspolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Dnsview struct { + Viewname string `json:"viewname,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/dos.go b/nitrogo/models/dos.go new file mode 100644 index 0000000..ad42ba7 --- /dev/null +++ b/nitrogo/models/dos.go @@ -0,0 +1,11 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Dospolicy struct { + Name string `json:"name,omitempty"` + Qdepth int `json:"qdepth,omitempty"` + Cltdetectrate int `json:"cltdetectrate,omitempty"` +} diff --git a/nitrogo/models/endpoint.go b/nitrogo/models/endpoint.go new file mode 100644 index 0000000..de62b60 --- /dev/null +++ b/nitrogo/models/endpoint.go @@ -0,0 +1,13 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Endpointinfo struct { + Endpointkind string `json:"endpointkind,omitempty"` + Endpointname string `json:"endpointname,omitempty"` + Endpointmetadata string `json:"endpointmetadata,omitempty"` + Endpointlabelsjson string `json:"endpointlabelsjson,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/feo.go b/nitrogo/models/feo.go new file mode 100644 index 0000000..ddf38d1 --- /dev/null +++ b/nitrogo/models/feo.go @@ -0,0 +1,131 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Feoglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Feoparameter struct { + Jpegqualitypercent int `json:"jpegqualitypercent"` + Cssinlinethressize int `json:"cssinlinethressize,omitempty"` + Jsinlinethressize int `json:"jsinlinethressize,omitempty"` + Imginlinethressize int `json:"imginlinethressize,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Feopolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Feopolicyfeoglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feoglobalfeopolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Feopolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Feopolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feopolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feopolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feopolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feoaction struct { + Name string `json:"name,omitempty"` + Pageextendcache bool `json:"pageextendcache,omitempty"` + Cachemaxage int `json:"cachemaxage"` + Imgshrinktoattrib bool `json:"imgshrinktoattrib,omitempty"` + Imggiftopng bool `json:"imggiftopng,omitempty"` + Imgtowebp bool `json:"imgtowebp,omitempty"` + Imgtojpegxr bool `json:"imgtojpegxr,omitempty"` + Imginline bool `json:"imginline,omitempty"` + Cssimginline bool `json:"cssimginline,omitempty"` + Jpgoptimize bool `json:"jpgoptimize,omitempty"` + Imglazyload bool `json:"imglazyload,omitempty"` + Cssminify bool `json:"cssminify,omitempty"` + Cssinline bool `json:"cssinline,omitempty"` + Csscombine bool `json:"csscombine,omitempty"` + Convertimporttolink bool `json:"convertimporttolink,omitempty"` + Jsminify bool `json:"jsminify,omitempty"` + Jsinline bool `json:"jsinline,omitempty"` + Htmlminify bool `json:"htmlminify,omitempty"` + Cssmovetohead bool `json:"cssmovetohead,omitempty"` + Jsmovetoend bool `json:"jsmovetoend,omitempty"` + Domainsharding string `json:"domainsharding,omitempty"` + Dnsshards []string `json:"dnsshards,omitempty"` + Clientsidemeasurements bool `json:"clientsidemeasurements,omitempty"` + Imgadddimensions string `json:"imgadddimensions,omitempty"` + Imgshrinkformobile string `json:"imgshrinkformobile,omitempty"` + Imgweaken string `json:"imgweaken,omitempty"` + Jpgprogressive string `json:"jpgprogressive,omitempty"` + Cssflattenimports string `json:"cssflattenimports,omitempty"` + Jscombine string `json:"jscombine,omitempty"` + Htmlrmdefaultattribs string `json:"htmlrmdefaultattribs,omitempty"` + Htmlrmattribquotes string `json:"htmlrmattribquotes,omitempty"` + Htmltrimurls string `json:"htmltrimurls,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Feoglobalbinding struct { +} diff --git a/nitrogo/models/filter.go b/nitrogo/models/filter.go new file mode 100644 index 0000000..f5082bf --- /dev/null +++ b/nitrogo/models/filter.go @@ -0,0 +1,113 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Filterpolicyfilterglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Filterprebodyinjection struct { + Prebody string `json:"prebody,omitempty"` + Systemiid string `json:"systemiid,omitempty"` +} + +type Filterglobalbinding struct { +} + +type Filterglobalfilterpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` +} + +type Filterpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Resaction string `json:"resaction,omitempty"` + Hits string `json:"hits,omitempty"` +} + +type Filterpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Filterhtmlinjectionparameter struct { + Rate int `json:"rate,omitempty"` + Frequency int `json:"frequency,omitempty"` + Strict string `json:"strict,omitempty"` + Htmlsearchlen int `json:"htmlsearchlen,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` +} + +type Filterhtmlinjectionvariable struct { + Variable string `json:"variable,omitempty"` + Value string `json:"value,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Type string `json:"type,omitempty"` +} + +type Filteraction struct { + Name string `json:"name,omitempty"` + Qual string `json:"qual,omitempty"` + Servicename string `json:"servicename,omitempty"` + Value string `json:"value,omitempty"` + Respcode int `json:"respcode,omitempty"` + Page string `json:"page,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` +} + +type Filterpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Filterpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Filterpostbodyinjection struct { + Postbody string `json:"postbody,omitempty"` + Systemiid string `json:"systemiid,omitempty"` +} + +type Filterglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` +} + +type Filterpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Filterpolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Filterpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/gslb.go b/nitrogo/models/gslb.go new file mode 100644 index 0000000..809abe9 --- /dev/null +++ b/nitrogo/models/gslb.go @@ -0,0 +1,778 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Gslbservicegrouplbmonitorbinding struct { + Monitorname string `json:"monitor_name,omitempty"` + Monweight int `json:"monweight,omitempty"` + Monstate string `json:"monstate,omitempty"` + Weight int `json:"weight,omitempty"` + Passive bool `json:"passive,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Port int `json:"port,omitempty"` + State string `json:"state,omitempty"` + Hashid int `json:"hashid,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Order int `json:"order,omitempty"` +} + +type Gslbconfig struct { + Preview bool `json:"preview,omitempty"` + Debug bool `json:"debug,omitempty"` + Forcesync string `json:"forcesync,omitempty"` + Nowarn bool `json:"nowarn,omitempty"` + Saveconfig bool `json:"saveconfig,omitempty"` + Command string `json:"command,omitempty"` +} + +type Gslbdomain struct { + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbdomainservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Vservername string `json:"vservername,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + State string `json:"state,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Dynamicconfwt uint32 `json:"dynamicconfwt,omitempty"` + Cumulativeweight uint32 `json:"cumulativeweight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbservicelbmonitorbinding struct { + Monitorname string `json:"monitor_name,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monitorstate string `json:"monitor_state,omitempty"` + Weight int `json:"weight,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Responsetime int `json:"responsetime,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Gslbvservergslbservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Weight int `json:"weight,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Sitepersistcookie string `json:"sitepersistcookie,omitempty"` + Svcsitepersistence string `json:"svcsitepersistence,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomaingslbservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Vservername string `json:"vservername,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` + Dynamicconfwt int `json:"dynamicconfwt,omitempty"` + Cumulativeweight int `json:"cumulativeweight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Order int `json:"order,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomaingslbservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Weight int `json:"weight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Order int `json:"order,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbrunningconfig struct { + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbservicebinding struct { + Servicename string `json:"servicename,omitempty"` +} + +type Gslbsitegslbservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbvservergslbservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Order int `json:"order,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbvserverservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomaingslbvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Edr string `json:"edr,omitempty"` + Mir string `json:"mir,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Cip string `json:"cip,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Netmask string `json:"netmask,omitempty"` + V6netmasklen int `json:"v6netmasklen,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbldnsentry struct { + Ipaddress string `json:"ipaddress,omitempty"` +} + +type Gslbservice struct { + Servicename string `json:"servicename,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Ip string `json:"ip,omitempty"` + Servername string `json:"servername,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Port int `json:"port,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Sitename string `json:"sitename,omitempty"` + State string `json:"state,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Hashid int `json:"hashid,omitempty"` + Comment string `json:"comment,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Naptrreplacement string `json:"naptrreplacement,omitempty"` + Naptrorder int `json:"naptrorder,omitempty"` + Naptrservices string `json:"naptrservices,omitempty"` + Naptrdomainttl int `json:"naptrdomainttl,omitempty"` + Naptrpreference int `json:"naptrpreference,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Viewname string `json:"viewname,omitempty"` + Viewip string `json:"viewip,omitempty"` + Weight int `json:"weight,omitempty"` + Monitornamesvc string `json:"monitor_name_svc,omitempty"` + Newname string `json:"newname,omitempty"` + Gslb string `json:"gslb,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold string `json:"gslbthreshold,omitempty"` + Gslbsvcstats string `json:"gslbsvcstats,omitempty"` + Monstate string `json:"monstate,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Monitorstate string `json:"monitor_state,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` + Threshold string `json:"threshold,omitempty"` + Clmonowner string `json:"clmonowner,omitempty"` + Clmonview string `json:"clmonview,omitempty"` + Gslbsvchealth string `json:"gslbsvchealth,omitempty"` + Glsbsvchealthdescr string `json:"glsbsvchealthdescr,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Gslbvserverservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Thresholdvalue int32 `json:"thresholdvalue,omitempty"` + Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Sitepersistcookie string `json:"sitepersistcookie,omitempty"` + Svcsitepersistence string `json:"svcsitepersistence,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomainservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomainvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Edr string `json:"edr,omitempty"` + Mir string `json:"mir,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Cip string `json:"cip,omitempty"` + Persistenceid uint32 `json:"persistenceid,omitempty"` + Netmask string `json:"netmask,omitempty"` + V6netmasklen uint32 `json:"v6netmasklen,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + V6persistmasklen uint32 `json:"v6persistmasklen,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbservicemonitorbinding struct { + Monitorname string `json:"monitor_name,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monitorstate string `json:"monitor_state,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Totalfailedprobes uint32 `json:"totalfailedprobes,omitempty"` + Failedprobes uint32 `json:"failedprobes,omitempty"` + Monstatcode int32 `json:"monstatcode,omitempty"` + Monstatparam1 int32 `json:"monstatparam1,omitempty"` + Monstatparam2 int32 `json:"monstatparam2,omitempty"` + Monstatparam3 int32 `json:"monstatparam3,omitempty"` + Responsetime uint64 `json:"responsetime,omitempty"` + Monitortotalprobes uint32 `json:"monitortotalprobes,omitempty"` + Monitortotalfailedprobes uint32 `json:"monitortotalfailedprobes,omitempty"` + Monitorcurrentfailedprobes uint32 `json:"monitorcurrentfailedprobes,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Gslbservicegroup struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + State string `json:"state,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Comment string `json:"comment,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Autoscale string `json:"autoscale,omitempty"` + Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Servername string `json:"servername,omitempty"` + Port int `json:"port,omitempty"` + Weight int `json:"weight,omitempty"` + Hashid int `json:"hashid,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Order int `json:"order,omitempty"` + Monitornamesvc string `json:"monitor_name_svc,omitempty"` + Dupweight int `json:"dup_weight,omitempty"` + Delay int `json:"delay,omitempty"` + Graceful string `json:"graceful,omitempty"` + Includemembers bool `json:"includemembers,omitempty"` + Newname string `json:"newname,omitempty"` + Numofconnections string `json:"numofconnections,omitempty"` + Serviceconftype string `json:"serviceconftype,omitempty"` + Value string `json:"value,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Ip string `json:"ip,omitempty"` + Monstatcode string `json:"monstatcode,omitempty"` + Monstatparam1 string `json:"monstatparam1,omitempty"` + Monstatparam2 string `json:"monstatparam2,omitempty"` + Monstatparam3 string `json:"monstatparam3,omitempty"` + Statechangetimemsec string `json:"statechangetimemsec,omitempty"` + Stateupdatereason string `json:"stateupdatereason,omitempty"` + Clmonowner string `json:"clmonowner,omitempty"` + Clmonview string `json:"clmonview,omitempty"` + Groupcount string `json:"groupcount,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` + Gslb string `json:"gslb,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbservicegroupservicegroupmemberbinding struct { + Ip string `json:"ip,omitempty"` + Port int32 `json:"port,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Tickssincelaststatechange uint32 `json:"tickssincelaststatechange,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Servername string `json:"servername,omitempty"` + State string `json:"state,omitempty"` + Hashid uint32 `json:"hashid,omitempty"` + Graceful string `json:"graceful,omitempty"` + Delay uint64 `json:"delay,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int32 `json:"publicport,omitempty"` + Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Threshold string `json:"threshold,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Gslbsitebinding struct { + Sitename string `json:"sitename,omitempty"` +} + +type Gslbsiteservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Gslbdomainlbmonitorbinding struct { + Monitorname string `json:"monitorname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Vservername string `json:"vservername,omitempty"` + Monstate string `json:"monstate,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Respcode string `json:"respcode,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Responsetime int `json:"responsetime,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Grpchealthcheck string `json:"grpchealthcheck,omitempty"` + Grpcstatuscode int `json:"grpcstatuscode,omitempty"` + Grpcservicename string `json:"grpcservicename,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbldnsentries struct { + Nodeid int `json:"nodeid,omitempty"` + Sitename string `json:"sitename,omitempty"` + Numsites string `json:"numsites,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Ttl string `json:"ttl,omitempty"` + Name string `json:"name,omitempty"` + Rtt string `json:"rtt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbservicednsviewbinding struct { + Viewname string `json:"viewname,omitempty"` + Viewip string `json:"viewip,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Gslbserviceviewbinding struct { + Viewname string `json:"viewname,omitempty"` + Viewip string `json:"viewip,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Gslbsitegslbservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbsyncstatus struct { + Summary bool `json:"summary,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbvserverdomainbinding struct { + Domainname string `json:"domainname,omitempty"` + Ttl int `json:"ttl,omitempty"` + Backupip string `json:"backupip,omitempty"` + Cookiedomain string `json:"cookie_domain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Backupipflag bool `json:"backupipflag,omitempty"` + Cookiedomainflag bool `json:"cookie_domainflag,omitempty"` +} + +type Gslbvservergslbservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Weight int `json:"weight,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Dynamicconfwt int `json:"dynamicconfwt,omitempty"` + Cumulativeweight int `json:"cumulativeweight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Iscname string `json:"iscname,omitempty"` + Domainname string `json:"domainname,omitempty"` + Sitepersistcookie string `json:"sitepersistcookie,omitempty"` + Svcsitepersistence string `json:"svcsitepersistence,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomainbinding struct { + Name string `json:"name,omitempty"` +} + +type Gslbdomainservicegroupmemberbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbparameter struct { + Ldnsentrytimeout int `json:"ldnsentrytimeout,omitempty"` + Rtttolerance int `json:"rtttolerance,omitempty"` + Ldnsmask string `json:"ldnsmask,omitempty"` + V6ldnsmasklen int `json:"v6ldnsmasklen,omitempty"` + Ldnsprobeorder []string `json:"ldnsprobeorder,omitempty"` + Dropldnsreq string `json:"dropldnsreq,omitempty"` + Gslbsvcstatedelaytime int `json:"gslbsvcstatedelaytime,omitempty"` + Svcstatelearningtime int `json:"svcstatelearningtime,omitempty"` + Automaticconfigsync string `json:"automaticconfigsync,omitempty"` + Mepkeepalivetimeout int `json:"mepkeepalivetimeout,omitempty"` + Gslbsyncinterval int `json:"gslbsyncinterval,omitempty"` + Gslbsyncmode string `json:"gslbsyncmode,omitempty"` + Gslbsynclocfiles string `json:"gslbsynclocfiles,omitempty"` + Gslbconfigsyncmonitor string `json:"gslbconfigsyncmonitor,omitempty"` + Gslbsyncsaveconfigcommand string `json:"gslbsyncsaveconfigcommand,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Flags string `json:"flags,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Incarnation string `json:"incarnation,omitempty"` + Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbservicegroupgslbservicegroupmemberbinding struct { + Ip string `json:"ip,omitempty"` + Port int `json:"port,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Weight int `json:"weight,omitempty"` + Servername string `json:"servername,omitempty"` + State string `json:"state,omitempty"` + Hashid int `json:"hashid,omitempty"` + Graceful string `json:"graceful,omitempty"` + Delay int `json:"delay,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Threshold string `json:"threshold,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Trofsdelay int `json:"trofsdelay,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Gslbsite struct { + Sitename string `json:"sitename,omitempty"` + Sitetype string `json:"sitetype,omitempty"` + Siteipaddress string `json:"siteipaddress,omitempty"` + Publicip string `json:"publicip,omitempty"` + Metricexchange string `json:"metricexchange,omitempty"` + Nwmetricexchange string `json:"nwmetricexchange,omitempty"` + Sessionexchange string `json:"sessionexchange,omitempty"` + Triggermonitor string `json:"triggermonitor,omitempty"` + Parentsite string `json:"parentsite,omitempty"` + Clip string `json:"clip,omitempty"` + Publicclip string `json:"publicclip,omitempty"` + Naptrreplacementsuffix string `json:"naptrreplacementsuffix,omitempty"` + Backupparentlist []string `json:"backupparentlist,omitempty"` + Sitepassword string `json:"sitepassword,omitempty"` + Newname string `json:"newname,omitempty"` + Status string `json:"status,omitempty"` + Persistencemepstatus string `json:"persistencemepstatus,omitempty"` + Version string `json:"version,omitempty"` + Curbackupparentip string `json:"curbackupparentip,omitempty"` + Sitestate string `json:"sitestate,omitempty"` + Oldname string `json:"oldname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbsitegslbservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbvserver struct { + Name string `json:"name,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Iptype string `json:"iptype,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Backupsessiontimeout int `json:"backupsessiontimeout,omitempty"` + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Netmask string `json:"netmask,omitempty"` + V6netmasklen int `json:"v6netmasklen,omitempty"` + Rule string `json:"rule,omitempty"` + Tolerance int `json:"tolerance,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Timeout int `json:"timeout,omitempty"` + Edr string `json:"edr,omitempty"` + Ecs string `json:"ecs,omitempty"` + Ecsaddrvalidation string `json:"ecsaddrvalidation,omitempty"` + Mir string `json:"mir,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + State string `json:"state,omitempty"` + Considereffectivestate string `json:"considereffectivestate,omitempty"` + Comment string `json:"comment,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + Sobackupaction string `json:"sobackupaction,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Toggleorder string `json:"toggleorder,omitempty"` + Orderthreshold int `json:"orderthreshold,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight int `json:"weight,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Domainname string `json:"domainname,omitempty"` + Ttl int `json:"ttl,omitempty"` + Backupip string `json:"backupip,omitempty"` + Cookiedomain string `json:"cookie_domain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Order int `json:"order,omitempty"` + Newname string `json:"newname,omitempty"` + Curstate string `json:"curstate,omitempty"` + Status string `json:"status,omitempty"` + Lbrrreason string `json:"lbrrreason,omitempty"` + Iscname string `json:"iscname,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Totalservices string `json:"totalservices,omitempty"` + Activeservices string `json:"activeservices,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Statechangetimemsec string `json:"statechangetimemsec,omitempty"` + Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` + Health string `json:"health,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` + Vsvrbindsvcport string `json:"vsvrbindsvcport,omitempty"` + Servername string `json:"servername,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Currentactiveorder string `json:"currentactiveorder,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Gslbvserverlbpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Gslbservicegroupmonitorbinding struct { + Monitorname string `json:"monitor_name,omitempty"` + Monweight uint32 `json:"monweight,omitempty"` + Monstate string `json:"monstate,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Passive bool `json:"passive,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Port int32 `json:"port,omitempty"` + State string `json:"state,omitempty"` + Hashid uint32 `json:"hashid,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int32 `json:"publicport,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` +} + +type Gslbsiteservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbvserverservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Weight uint32 `json:"weight,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int32 `json:"port,omitempty"` + Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Dynamicconfwt uint32 `json:"dynamicconfwt,omitempty"` + Cumulativeweight uint32 `json:"cumulativeweight,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Thresholdvalue int32 `json:"thresholdvalue,omitempty"` + Iscname string `json:"iscname,omitempty"` + Domainname string `json:"domainname,omitempty"` + Sitepersistcookie string `json:"sitepersistcookie,omitempty"` + Svcsitepersistence string `json:"svcsitepersistence,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbvserverspilloverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Gslbdomaingslbservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Order int `json:"order,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbdomainmonitorbinding struct { + Monitorname string `json:"monitorname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Vservername string `json:"vservername,omitempty"` + Monstate string `json:"monstate,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Respcode string `json:"respcode,omitempty"` + Monitortotalprobes uint32 `json:"monitortotalprobes,omitempty"` + Monitortotalfailedprobes uint32 `json:"monitortotalfailedprobes,omitempty"` + Monitorcurrentfailedprobes uint32 `json:"monitorcurrentfailedprobes,omitempty"` + Responsetime uint64 `json:"responsetime,omitempty"` + Monstatcode int32 `json:"monstatcode,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Name string `json:"name,omitempty"` +} + +type Gslbservicegroupservicegroupentitymonbindingsbinding struct { + Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` + Monitorname string `json:"monitor_name,omitempty"` + Monitorstate string `json:"monitor_state,omitempty"` + Passive bool `json:"passive,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Port int `json:"port,omitempty"` + Weight int `json:"weight,omitempty"` + State string `json:"state,omitempty"` + Hashid int `json:"hashid,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + Order int `json:"order,omitempty"` +} + +type Gslbsiteservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` +} + +type Gslbvserverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/ha.go b/nitrogo/models/ha.go new file mode 100644 index 0000000..590a5bf --- /dev/null +++ b/nitrogo/models/ha.go @@ -0,0 +1,97 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Hafailover struct { + Force bool `json:"force,omitempty"` +} + +type Hanode struct { + Id int `json:"id"` + Ipaddress string `json:"ipaddress,omitempty"` + Inc string `json:"inc,omitempty"` + Rpcnodepassword string `json:"rpcnodepassword,omitempty"` + Hastatus string `json:"hastatus,omitempty"` + Hasync string `json:"hasync,omitempty"` + Haprop string `json:"haprop,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Deadinterval int `json:"deadinterval,omitempty"` + Failsafe string `json:"failsafe,omitempty"` + Maxflips int `json:"maxflips,omitempty"` + Maxfliptime int `json:"maxfliptime,omitempty"` + Syncvlan int `json:"syncvlan,omitempty"` + Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` + Name string `json:"name,omitempty"` + Flags string `json:"flags,omitempty"` + State string `json:"state,omitempty"` + Enaifaces string `json:"enaifaces,omitempty"` + Disifaces string `json:"disifaces,omitempty"` + Hamonifaces string `json:"hamonifaces,omitempty"` + Haheartbeatifaces string `json:"haheartbeatifaces,omitempty"` + Pfifaces string `json:"pfifaces,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Netmask string `json:"netmask,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Masterstatetime string `json:"masterstatetime,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` + Curflips string `json:"curflips,omitempty"` + Completedfliptime string `json:"completedfliptime,omitempty"` + Routemonitorstate string `json:"routemonitorstate,omitempty"` + Hasyncfailurereason string `json:"hasyncfailurereason,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Hanodepartialfailureinterfacesbinding struct { + Pfifaces string `json:"pfifaces,omitempty"` + Id int `json:"id,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` +} + +type Hanoderoutemonitor6binding struct { + Routemonitor string `json:"routemonitor,omitempty"` + Netmask string `json:"netmask,omitempty"` + Flags int `json:"flags,omitempty"` + Routemonitorstate string `json:"routemonitorstate,omitempty"` + Id int `json:"id"` +} + +type Hanoderoutemonitorbinding struct { + Routemonitor string `json:"routemonitor,omitempty"` + Netmask string `json:"netmask,omitempty"` + Flags int `json:"flags,omitempty"` + Routemonitorstate string `json:"routemonitorstate,omitempty"` + Id int `json:"id"` +} + +type Hasync struct { + Force bool `json:"force,omitempty"` + Save string `json:"save,omitempty"` +} + +type Hafiles struct { + Mode []string `json:"mode,omitempty"` +} + +type Hanodebinding struct { + Id int `json:"id,omitempty"` +} + +type Hanodecibinding struct { + Enaifaces string `json:"enaifaces,omitempty"` + Id int `json:"id,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` +} + +type Hanodefisbinding struct { + Name string `json:"name,omitempty"` + Enaifaces string `json:"enaifaces,omitempty"` + Id int `json:"id,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` +} + +type Hasyncfailures struct { + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/ica.go b/nitrogo/models/ica.go new file mode 100644 index 0000000..6487a7d --- /dev/null +++ b/nitrogo/models/ica.go @@ -0,0 +1,150 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Icapolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Icapolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Icapolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Icaaccessprofile struct { + Name string `json:"name,omitempty"` + Connectclientlptports string `json:"connectclientlptports,omitempty"` + Clientaudioredirection string `json:"clientaudioredirection,omitempty"` + Localremotedatasharing string `json:"localremotedatasharing,omitempty"` + Clientclipboardredirection string `json:"clientclipboardredirection,omitempty"` + Clientcomportredirection string `json:"clientcomportredirection,omitempty"` + Clientdriveredirection string `json:"clientdriveredirection,omitempty"` + Clientprinterredirection string `json:"clientprinterredirection,omitempty"` + Multistream string `json:"multistream,omitempty"` + Clientusbdriveredirection string `json:"clientusbdriveredirection,omitempty"` + Clienttwaindeviceredirection string `json:"clienttwaindeviceredirection,omitempty"` + Wiaredirection string `json:"wiaredirection,omitempty"` + Draganddrop string `json:"draganddrop,omitempty"` + Smartcardredirection string `json:"smartcardredirection,omitempty"` + Fido2redirection string `json:"fido2redirection,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Icaaction struct { + Name string `json:"name,omitempty"` + Accessprofilename string `json:"accessprofilename,omitempty"` + Latencyprofilename string `json:"latencyprofilename,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Icaglobalicapolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Icaglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Icaparameter struct { + Enablesronhafailover string `json:"enablesronhafailover,omitempty"` + Hdxinsightnonnsap string `json:"hdxinsightnonnsap,omitempty"` + Edtpmtuddf string `json:"edtpmtuddf,omitempty"` + Edtpmtuddftimeout int `json:"edtpmtuddftimeout,omitempty"` + L7latencyfrequency int `json:"l7latencyfrequency,omitempty"` + Edtlosstolerant string `json:"edtlosstolerant,omitempty"` + Edtpmtudrediscovery string `json:"edtpmtudrediscovery,omitempty"` + Dfpersistence string `json:"dfpersistence,omitempty"` + Builtin string `json:"builtin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Icapolicyicaglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Icaglobalbinding struct { +} + +type Icalatencyprofile struct { + Name string `json:"name,omitempty"` + L7latencymonitoring string `json:"l7latencymonitoring,omitempty"` + L7latencythresholdfactor int `json:"l7latencythresholdfactor,omitempty"` + L7latencywaittime int `json:"l7latencywaittime,omitempty"` + L7latencynotifyinterval int `json:"l7latencynotifyinterval,omitempty"` + L7latencymaxnotifycount int `json:"l7latencymaxnotifycount,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Icapolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Icapolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Icapolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/ipsec.go b/nitrogo/models/ipsec.go new file mode 100644 index 0000000..10dc69e --- /dev/null +++ b/nitrogo/models/ipsec.go @@ -0,0 +1,40 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Ipsecparameter struct { + Ikeversion string `json:"ikeversion,omitempty"` + Encalgo []string `json:"encalgo,omitempty"` + Hashalgo []string `json:"hashalgo,omitempty"` + Lifetime int `json:"lifetime,omitempty"` + Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` + Replaywindowsize int `json:"replaywindowsize,omitempty"` + Ikeretryinterval int `json:"ikeretryinterval,omitempty"` + Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` + Retransmissiontime int `json:"retransmissiontime,omitempty"` + Responderonly string `json:"responderonly,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ipsecprofile struct { + Name string `json:"name,omitempty"` + Ikeversion string `json:"ikeversion,omitempty"` + Encalgo []string `json:"encalgo,omitempty"` + Hashalgo []string `json:"hashalgo,omitempty"` + Lifetime int `json:"lifetime,omitempty"` + Psk string `json:"psk,omitempty"` + Publickey string `json:"publickey,omitempty"` + Privatekey string `json:"privatekey,omitempty"` + Peerpublickey string `json:"peerpublickey,omitempty"` + Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` + Replaywindowsize int `json:"replaywindowsize,omitempty"` + Ikeretryinterval int `json:"ikeretryinterval,omitempty"` + Retransmissiontime int `json:"retransmissiontime,omitempty"` + Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` + Responderonly string `json:"responderonly,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/ipsecalg.go b/nitrogo/models/ipsecalg.go new file mode 100644 index 0000000..da2ce1d --- /dev/null +++ b/nitrogo/models/ipsecalg.go @@ -0,0 +1,26 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Ipsecalgprofile struct { + Name string `json:"name,omitempty"` + Ikesessiontimeout int `json:"ikesessiontimeout,omitempty"` + Espsessiontimeout int `json:"espsessiontimeout,omitempty"` + Espgatetimeout int `json:"espgatetimeout,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ipsecalgsession struct { + Sourceipalg string `json:"sourceip_alg,omitempty"` + Natipalg string `json:"natip_alg,omitempty"` + Destipalg string `json:"destip_alg,omitempty"` + Sourceip string `json:"sourceip,omitempty"` + Natip string `json:"natip,omitempty"` + Destip string `json:"destip,omitempty"` + Spiin string `json:"spiin,omitempty"` + Spiout string `json:"spiout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/kafka.go b/nitrogo/models/kafka.go new file mode 100644 index 0000000..01eefbc --- /dev/null +++ b/nitrogo/models/kafka.go @@ -0,0 +1,23 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Kafkacluster struct { + Name string `json:"name,omitempty"` + Activesvc string `json:"activesvc,omitempty"` + Totalsvc string `json:"totalsvc,omitempty"` + Topicname string `json:"topicname,omitempty"` + Numtopics string `json:"numtopics,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Kafkaclusterbinding struct { + Name string `json:"name,omitempty"` +} + +type Kafkaclusterservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/lb.go b/nitrogo/models/lb.go new file mode 100644 index 0000000..9aebdd6 --- /dev/null +++ b/nitrogo/models/lb.go @@ -0,0 +1,1109 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Lbvserverfilterpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbpolicygslbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Weight int `json:"weight,omitempty"` + Dynamicweight int `json:"dynamicweight,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` + Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Name string `json:"name,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Lbvservertransformpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvservervideooptimizationpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbmetrictablebinding struct { + Metrictable string `json:"metrictable,omitempty"` +} + +type Lbmonbindingsgslbservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbmonitorservicegroupbinding struct { + Monitorname string `json:"monitorname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Dupstate string `json:"dup_state,omitempty"` + Dupweight int `json:"dup_weight,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Lbsipparameters struct { + Rnatsrcport int `json:"rnatsrcport,omitempty"` + Rnatdstport int `json:"rnatdstport,omitempty"` + Retrydur int `json:"retrydur,omitempty"` + Addrportvip string `json:"addrportvip,omitempty"` + Sip503ratethreshold int `json:"sip503ratethreshold,omitempty"` + Rnatsecuresrcport int `json:"rnatsecuresrcport,omitempty"` + Rnatsecuredstport int `json:"rnatsecuredstport,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbmonbindingsservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Monsvcstate string `json:"monsvcstate,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbvserverauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbmetrictable struct { + Metrictable string `json:"metrictable,omitempty"` + Metric string `json:"metric,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` + Metrictype string `json:"metrictype,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbparameter struct { + Httponlycookieflag string `json:"httponlycookieflag,omitempty"` + Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` + Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` + Cookiepassphrase string `json:"cookiepassphrase,omitempty"` + Consolidatedlconn string `json:"consolidatedlconn,omitempty"` + Useportforhashlb string `json:"useportforhashlb,omitempty"` + Preferdirectroute string `json:"preferdirectroute,omitempty"` + Startuprrfactor int `json:"startuprrfactor,omitempty"` + Monitorskipmaxclient string `json:"monitorskipmaxclient,omitempty"` + Monitorconnectionclose string `json:"monitorconnectionclose,omitempty"` + Vserverspecificmac string `json:"vserverspecificmac,omitempty"` + Allowboundsvcremoval string `json:"allowboundsvcremoval,omitempty"` + Retainservicestate string `json:"retainservicestate,omitempty"` + Dbsttl int `json:"dbsttl,omitempty"` + Maxpipelinenat int `json:"maxpipelinenat,omitempty"` + Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` + Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` + Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` + Dropmqttjumbomessage string `json:"dropmqttjumbomessage,omitempty"` + Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` + Lbhashfingers int `json:"lbhashfingers,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Proximityfromself string `json:"proximityfromself,omitempty"` + Sessionsthreshold string `json:"sessionsthreshold,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` + Lbhashalgowinsize string `json:"lbhashalgowinsize,omitempty"` + Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type LBVServer struct { + ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` + ActiveServices string `json:"activeservices,omitempty"` + APIProfile string `json:"apiprofile,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + AuthenticationHost string `json:"authenticationhost,omitempty"` + Authn401 string `json:"authn401,omitempty"` + AuthnProfile string `json:"authnprofile,omitempty"` + AuthnVSName string `json:"authnvsname,omitempty"` + BackupLBMethod string `json:"backuplbmethod,omitempty"` + BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BackupvServerStatus string `json:"backupvserverstatus,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + BypassAAAA string `json:"bypassaaaa,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CltTimeOut string `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + ConnFailOver string `json:"connfailover,omitempty"` + ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` + ConsolidatedLConngbl string `json:"consolidatedlconngbl,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CurrentactiveOrder string `json:"currentactiveorder,omitempty"` + CurState string `json:"curstate,omitempty"` + DataLength string `json:"datalength,omitempty"` + DataOffset string `json:"dataoffset,omitempty"` + DbProfileName string `json:"dbprofilename,omitempty"` + DbsLB string `json:"dbslb,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DNS64 string `json:"dns64,omitempty"` + DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + GroupName string `json:"groupname,omitempty"` + Gt2GB string `json:"gt2gb,omitempty"` + HashLength int `json:"hashlength,omitempty"` + Health string `json:"health,omitempty"` + HealthThreshold string `json:"healththreshold,omitempty"` + Homepage string `json:"homepage,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` + ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` + InsertVServerIPPort string `json:"insertvserveripport,omitempty"` + IPMapping string `json:"ipmapping,omitempty"` + IPMask string `json:"ipmask,omitempty"` + IPPattern string `json:"ippattern,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + IsGSLB bool `json:"isgslb,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LBMethod string `json:"lbmethod,omitempty"` + LBProfileName string `json:"lbprofilename,omitempty"` + LBRRReason int `json:"lbrrreason,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority string `json:"listenpriority,omitempty"` + M string `json:"m,omitempty"` + MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` + Map string `json:"map,omitempty"` + MaxAutoScaleMembers string `json:"maxautoscalemembers,omitempty"` + MinAutoScaleMembers string `json:"minautoscalemembers,omitempty"` + MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` + MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` + MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` + MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` + MySQLServerVersion string `json:"mysqlserverversion,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NewServiceRequest int `json:"newservicerequest,omitempty"` + NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` + NewserviceRequestUnit string `json:"newservicerequestunit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NGName string `json:"ngname,omitempty"` + NodeFaultBindings string `json:"nodefaultbindings,omitempty"` + OracleServerVersion string `json:"oracleserverversion,omitempty"` + Order int `json:"order,omitempty"` + OrderThreshold string `json:"orderthreshold,omitempty"` + PersistAVPNO []int `json:"persistavpno,omitempty"` + PersistenceBackup string `json:"persistencebackup,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + ProbePort int `json:"probeport,omitempty"` + ProbeProtocol string `json:"probeprotocol,omitempty"` + ProbeSuccessResponsecode string `json:"probesuccessresponsecode,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + Push string `json:"push,omitempty"` + PushLabel string `json:"pushlabel,omitempty"` + PushMultiClients string `json:"pushmulticlients,omitempty"` + PushVServer string `json:"pushvserver,omitempty"` + QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` + Range string `json:"range,omitempty"` + RecursionAvailable string `json:"recursionavailable,omitempty"` + Redirect string `json:"redirect,omitempty"` + RedirectFromPort int `json:"redirectfromport,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + RedirURL string `json:"redirurl,omitempty"` + RedirURLFlags bool `json:"redirurlflags,omitempty"` + Resrule string `json:"resrule,omitempty"` + RetainConnectionsonCluster string `json:"retainconnectionsoncluster,omitempty"` + RHIState string `json:"rhistate,omitempty"` + RTSPNAT string `json:"rtspnat,omitempty"` + Rule string `json:"rule,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + Sessionless string `json:"sessionless,omitempty"` + SkipPersistency string `json:"skippersistency,omitempty"` + SoBackupAction string `json:"sobackupaction,omitempty"` + SoMethod string `json:"somethod,omitempty"` + SoPersistence string `json:"sopersistence,omitempty"` + SoPersistenceTimeout string `json:"sopersistencetimeout,omitempty"` + SoThreshold string `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + StateChangeTimeMsec string `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + StateChangeTimeSeconds string `json:"statechangetimeseconds,omitempty"` + Status int `json:"status,omitempty"` + TCPProbePort int `json:"tcpprobeport,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + Td string `json:"td,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` + TicksSinceLastStateChange string `json:"tickssincelaststatechange,omitempty"` + Timeout int `json:"timeout,omitempty"` + ToggleOrder string `json:"toggleorder,omitempty"` + TOSID int `json:"tosid,omitempty"` + TotalServices string `json:"totalservices,omitempty"` + TROFSPersistence string `json:"trofspersistence,omitempty"` + Type string `json:"type,omitempty"` + V6NetMaskLen int `json:"v6netmasklen,omitempty"` + V6PersistMaskLen string `json:"v6persistmasklen,omitempty"` + Value string `json:"value,omitempty"` + Version int `json:"version,omitempty"` + VIPHeader string `json:"vipheader,omitempty"` + VSvrDynConnsoThreshold string `json:"vsvrdynconnsothreshold,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Lbvserverauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Logaction string `json:"logaction,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Feature string `json:"feature,omitempty"` + Builtin string `json:"builtin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbgroupbinding struct { + Name string `json:"name,omitempty"` +} + +type Lbpolicylabellbpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbvserverappqoepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverdnspolicy64binding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverscpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbvserversyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbmonitorcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Ca bool `json:"ca,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Lbwlmbinding struct { + Wlmname string `json:"wlmname,omitempty"` +} + +type Lbvservercachepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbmonitorservicebinding struct { + Monitorname string `json:"monitorname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Dupstate string `json:"dup_state,omitempty"` + Dupweight int `json:"dup_weight,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Lbpolicylbglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbprofile struct { + Lbprofilename string `json:"lbprofilename,omitempty"` + Dbslb string `json:"dbslb,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Httponlycookieflag string `json:"httponlycookieflag,omitempty"` + Cookiepassphrase string `json:"cookiepassphrase,omitempty"` + Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` + Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` + Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` + Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` + Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` + Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` + Lbhashfingers int `json:"lbhashfingers,omitempty"` + Proximityfromself string `json:"proximityfromself,omitempty"` + Vsvrcount string `json:"vsvrcount,omitempty"` + Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` + Lbhashalgowinsize string `json:"lbhashalgowinsize,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbvserveranalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvservercsvserverbinding struct { + Cachevserver string `json:"cachevserver,omitempty"` + Policyname string `json:"policyname,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Priority int `json:"priority,omitempty"` + Hits int `json:"hits,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Policysubtype int `json:"policysubtype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverdetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverdospolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverspilloverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbwlm struct { + Wlmname string `json:"wlmname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Lbuid string `json:"lbuid,omitempty"` + Katimeout int `json:"katimeout,omitempty"` + Secure string `json:"secure,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbgloballbpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Lbmetrictablemetricbinding struct { + Metric string `json:"metric,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` + Metrictype string `json:"metrictype,omitempty"` + Metrictable string `json:"metrictable,omitempty"` +} + +type Lbmonitormetricbinding struct { + Metric string `json:"metric,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Metricunit string `json:"metric_unit,omitempty"` + Metricweight int `json:"metricweight,omitempty"` + Metricthreshold int `json:"metricthreshold,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbpersistentsessions struct { + Vserver string `json:"vserver,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Persistenceparameter string `json:"persistenceparameter,omitempty"` + Type string `json:"type,omitempty"` + Typestring string `json:"typestring,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcipv6 string `json:"srcipv6,omitempty"` + Destip string `json:"destip,omitempty"` + Destipv6 string `json:"destipv6,omitempty"` + Flags string `json:"flags,omitempty"` + Destport string `json:"destport,omitempty"` + Vservername string `json:"vservername,omitempty"` + Timeout string `json:"timeout,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Persistenceparam string `json:"persistenceparam,omitempty"` + Cnamepersparam string `json:"cnamepersparam,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbroute6 struct { + Network string `json:"network,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Td int `json:"td,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbvserverpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverresponderpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbgroup struct { + Name string `json:"name,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistencebackup string `json:"persistencebackup,omitempty"` + Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Timeout int `json:"timeout,omitempty"` + Rule string `json:"rule,omitempty"` + Mastervserver string `json:"mastervserver,omitempty"` + Usevserverpersistency string `json:"usevserverpersistency,omitempty"` + Newname string `json:"newname,omitempty"` + Td string `json:"td,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbvserverservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Order int `json:"order,omitempty"` + Name string `json:"name,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Lbvservertrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbvservervideooptimizationdetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbwlmlbvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Wlmname string `json:"wlmname,omitempty"` +} + +type Lbwlmvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Wlmname string `json:"wlmname,omitempty"` +} + +type Lbvservercmppolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverpolicy64binding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbvserverappflowpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverauthorizationpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvservernslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Sc string `json:"sc,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbvservertmtrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvservervserverbinding struct { + Cachevserver string `json:"cachevserver,omitempty"` + Policyname string `json:"policyname,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Hits uint32 `json:"hits,omitempty"` + Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` + Policysubtype uint32 `json:"policysubtype,omitempty"` + Name string `json:"name,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Value []int `json:"value,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Feature string `json:"feature,omitempty"` + Builtin string `json:"builtin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbglobalbinding struct { +} + +type Lbgroupvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbmonitor struct { + Monitorname string `json:"monitorname,omitempty"` + Type string `json:"type,omitempty"` + Action string `json:"action,omitempty"` + Respcode []string `json:"respcode,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Rtsprequest string `json:"rtsprequest,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Maxforwards int `json:"maxforwards,omitempty"` + Sipmethod string `json:"sipmethod,omitempty"` + Sipuri string `json:"sipuri,omitempty"` + Sipreguri string `json:"sipreguri,omitempty"` + Send string `json:"send,omitempty"` + Recv string `json:"recv,omitempty"` + Query string `json:"query,omitempty"` + Querytype string `json:"querytype,omitempty"` + Scriptname string `json:"scriptname,omitempty"` + Scriptargs string `json:"scriptargs,omitempty"` + Secureargs string `json:"secureargs,omitempty"` + Dispatcherip string `json:"dispatcherip,omitempty"` + Dispatcherport int `json:"dispatcherport,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Secondarypassword string `json:"secondarypassword,omitempty"` + Logonpointname string `json:"logonpointname,omitempty"` + Lasversion string `json:"lasversion,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Radaccounttype int `json:"radaccounttype,omitempty"` + Radframedip string `json:"radframedip,omitempty"` + Radapn string `json:"radapn,omitempty"` + Radmsisdn string `json:"radmsisdn,omitempty"` + Radaccountsession string `json:"radaccountsession,omitempty"` + Lrtm string `json:"lrtm,omitempty"` + Deviation int `json:"deviation"` + Units1 string `json:"units1,omitempty"` + Interval int `json:"interval,omitempty"` + Units3 string `json:"units3,omitempty"` + Resptimeout int `json:"resptimeout,omitempty"` + Units4 string `json:"units4,omitempty"` + Resptimeoutthresh int `json:"resptimeoutthresh,omitempty"` + Retries int `json:"retries,omitempty"` + Failureretries int `json:"failureretries,omitempty"` + Alertretries int `json:"alertretries,omitempty"` + Successretries int `json:"successretries,omitempty"` + Downtime int `json:"downtime,omitempty"` + Units2 string `json:"units2,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + State string `json:"state,omitempty"` + Reverse string `json:"reverse,omitempty"` + Transparent string `json:"transparent,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Tos string `json:"tos,omitempty"` + Tosid int `json:"tosid,omitempty"` + Secure string `json:"secure,omitempty"` + Validatecred string `json:"validatecred,omitempty"` + Domain string `json:"domain,omitempty"` + Ipaddress []string `json:"ipaddress,omitempty"` + Group string `json:"group,omitempty"` + Filename string `json:"filename,omitempty"` + Basedn string `json:"basedn,omitempty"` + Binddn string `json:"binddn,omitempty"` + Filter string `json:"filter,omitempty"` + Attribute string `json:"attribute,omitempty"` + Database string `json:"database,omitempty"` + Oraclesid string `json:"oraclesid,omitempty"` + Sqlquery string `json:"sqlquery,omitempty"` + Evalrule string `json:"evalrule,omitempty"` + Mssqlprotocolversion string `json:"mssqlprotocolversion,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` + Snmpcommunity string `json:"snmpcommunity,omitempty"` + Snmpthreshold string `json:"snmpthreshold,omitempty"` + Snmpversion string `json:"snmpversion,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Application string `json:"application,omitempty"` + Sitepath string `json:"sitepath,omitempty"` + Storename string `json:"storename,omitempty"` + Storefrontacctservice string `json:"storefrontacctservice,omitempty"` + Hostname string `json:"hostname,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Originhost string `json:"originhost,omitempty"` + Originrealm string `json:"originrealm,omitempty"` + Hostipaddress string `json:"hostipaddress,omitempty"` + Vendorid int `json:"vendorid,omitempty"` + Productname string `json:"productname,omitempty"` + Firmwarerevision int `json:"firmwarerevision,omitempty"` + Authapplicationid []int `json:"authapplicationid,omitempty"` + Acctapplicationid []int `json:"acctapplicationid,omitempty"` + Inbandsecurityid string `json:"inbandsecurityid,omitempty"` + Supportedvendorids []int `json:"supportedvendorids,omitempty"` + Vendorspecificvendorid int `json:"vendorspecificvendorid,omitempty"` + Vendorspecificauthapplicationids []int `json:"vendorspecificauthapplicationids,omitempty"` + Vendorspecificacctapplicationids []int `json:"vendorspecificacctapplicationids,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Storedb string `json:"storedb,omitempty"` + Storefrontcheckbackendservices string `json:"storefrontcheckbackendservices,omitempty"` + Trofscode int `json:"trofscode,omitempty"` + Trofsstring string `json:"trofsstring,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Mqttclientidentifier string `json:"mqttclientidentifier,omitempty"` + Mqttversion int `json:"mqttversion,omitempty"` + Grpchealthcheck string `json:"grpchealthcheck,omitempty"` + Grpcstatuscode []int `json:"grpcstatuscode,omitempty"` + Grpcservicename string `json:"grpcservicename,omitempty"` + Metric string `json:"metric,omitempty"` + Metricthreshold int `json:"metricthreshold,omitempty"` + Metricweight int `json:"metricweight,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Lrtmconf string `json:"lrtmconf,omitempty"` + Lrtmconfstr string `json:"lrtmconfstr,omitempty"` + Dynamicresponsetimeout string `json:"dynamicresponsetimeout,omitempty"` + Dynamicinterval string `json:"dynamicinterval,omitempty"` + Multimetrictable string `json:"multimetrictable,omitempty"` + Dupstate string `json:"dup_state,omitempty"` + Dupweight string `json:"dup_weight,omitempty"` + Weight string `json:"weight,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbmonitorbinding struct { + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbmonitorsslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Ca bool `json:"ca,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Lbvserverappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbpolicylbpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbvserverlbpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverrewritepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type LBVServerServiceGroupMemberBinding struct { + CookieIPPort string `json:"cookieipport,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CurState string `json:"curstate,omitempty"` + DynamicWeight string `json:"dynamicweight,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Name string `json:"name,omitempty"` + Order string `json:"order,omitempty"` + OrderStr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + VServerid string `json:"vserverid,omitempty"` + Weight string `json:"weight,omitempty"` +} + +type Lbmonbindingsbinding struct { + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbmonbindingsservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type Lbroute struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Td int `json:"td,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Lbvserverpqpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Lbgrouplbvserverbinding struct { + Vservername string `json:"vservername,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbmonbindings struct { + Monitorname string `json:"monitorname,omitempty"` + Type string `json:"type,omitempty"` + State string `json:"state,omitempty"` + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Lbpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lbvserverbotpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvservercontentinspectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` +} + +type Lbvserverfeopolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Order int `json:"order,omitempty"` +} diff --git a/nitrogo/models/lbmodels.go b/nitrogo/models/lbmodels.go deleted file mode 100644 index 32903b6..0000000 --- a/nitrogo/models/lbmodels.go +++ /dev/null @@ -1,170 +0,0 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2025 - -package models - -type LBVServer struct { - ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` - APIProfile string `json:"apiprofile,omitempty"` - AppFlowLog string `json:"appflowlog,omitempty"` - Authentication string `json:"authentication,omitempty"` - AuthenticationHost string `json:"authenticationhost,omitempty"` - Authn401 string `json:"authn401,omitempty"` - AuthnProfile string `json:"authnprofile,omitempty"` - AuthnVSName string `json:"authnvsname,omitempty"` - BackupLBMethod string `json:"backuplbmethod,omitempty"` - BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` - BackupVServer string `json:"backupvserver,omitempty"` - BypassAAAA string `json:"bypassaaaa,omitempty"` - Cacheable string `json:"cacheable,omitempty"` - CltTimeOut string `json:"clttimeout,omitempty"` - Comment string `json:"comment,omitempty"` - ConnFailOver string `json:"connfailover,omitempty"` - CookieName string `json:"cookiename,omitempty"` - DataLength string `json:"datalength,omitempty"` - DataOffset string `json:"dataoffset,omitempty"` - DbProfileName string `json:"dbprofilename,omitempty"` - DbsLB string `json:"dbslb,omitempty"` - DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` - DNS64 string `json:"dns64,omitempty"` - DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` - DNSProfileName string `json:"dnsprofilename,omitempty"` - DownStateFlush string `json:"downstateflush,omitempty"` - HashLength int `json:"hashlength,omitempty"` - HealthThreshold string `json:"healththreshold,omitempty"` - HTTPProfileName string `json:"httpprofilename,omitempty"` - HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` - ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` - InsertVServerIPPort string `json:"insertvserveripport,omitempty"` - IPMask string `json:"ipmask,omitempty"` - IPPattern string `json:"ippattern,omitempty"` - IPSet string `json:"ipset,omitempty"` - IPv46 string `json:"ipv46,omitempty"` - L2Conn string `json:"l2conn,omitempty"` - LBMethod string `json:"lbmethod,omitempty"` - LBProfileName string `json:"lbprofilename,omitempty"` - ListenPolicy string `json:"listenpolicy,omitempty"` - ListenPriority string `json:"listenpriority,omitempty"` - M string `json:"m,omitempty"` - MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` - MaxAutoScaleMembers string `json:"maxautoscalemembers,omitempty"` - MinAutoScaleMembers string `json:"minautoscalemembers,omitempty"` - MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` - MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` - MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` - MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` - MySQLServerVersion string `json:"mysqlserverversion,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NetProfile string `json:"netprofile,omitempty"` - NewName string `json:"newname,omitempty"` - NewServiceRequest int `json:"newservicerequest,omitempty"` - NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` - NewserviceRequestUnit string `json:"newservicerequestunit,omitempty"` - OracleServerVersion string `json:"oracleserverversion,omitempty"` - Order int `json:"order,omitempty"` - OrderThreshold string `json:"orderthreshold,omitempty"` - PersistAVPNO []int `json:"persistavpno,omitempty"` - PersistenceBackup string `json:"persistencebackup,omitempty"` - PersistenceType string `json:"persistencetype,omitempty"` - PersistMask string `json:"persistmask,omitempty"` - Port int `json:"port,omitempty"` - ProbePort int `json:"probeport,omitempty"` - ProbeProtocol string `json:"probeprotocol,omitempty"` - ProbeSuccessResponsecode string `json:"probesuccessresponsecode,omitempty"` - ProcessLocal string `json:"processlocal,omitempty"` - Push string `json:"push,omitempty"` - PushLabel string `json:"pushlabel,omitempty"` - PushMultiClients string `json:"pushmulticlients,omitempty"` - PushVServer string `json:"pushvserver,omitempty"` - QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` - QUICProfileName string `json:"quicprofilename,omitempty"` - Range string `json:"range,omitempty"` - RecursionAvailable string `json:"recursionavailable,omitempty"` - RedirectFromPort int `json:"redirectfromport,omitempty"` - RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` - RedirURL string `json:"redirurl,omitempty"` - RedirURLFlags bool `json:"redirurlflags,omitempty"` - Resrule string `json:"resrule,omitempty"` - RetainConnectionsonCluster string `json:"retainconnectionsoncluster,omitempty"` - RHIState string `json:"rhistate,omitempty"` - RTSPNAT string `json:"rtspnat,omitempty"` - Rule string `json:"rule,omitempty"` - ServiceName string `json:"servicename,omitempty"` - ServiceType string `json:"servicetype,omitempty"` - Sessionless string `json:"sessionless,omitempty"` - SkipPersistency string `json:"skippersistency,omitempty"` - SoBackupAction string `json:"sobackupaction,omitempty"` - SoMethod string `json:"somethod,omitempty"` - SoPersistence string `json:"sopersistence,omitempty"` - SoPersistenceTimeout string `json:"sopersistencetimeout,omitempty"` - SoThreshold string `json:"sothreshold,omitempty"` - State string `json:"state,omitempty"` - TCPProbePort int `json:"tcpprobeport,omitempty"` - TCPProfileName string `json:"tcpprofilename,omitempty"` - Td string `json:"td,omitempty"` - Timeout int `json:"timeout,omitempty"` - ToggleOrder string `json:"toggleorder,omitempty"` - TOSID int `json:"tosid,omitempty"` - TROFSPersistence string `json:"trofspersistence,omitempty"` - V6NetMaskLen int `json:"v6netmasklen,omitempty"` - V6PersistMaskLen string `json:"v6persistmasklen,omitempty"` - VIPHeader string `json:"vipheader,omitempty"` - Weight int `json:"weight,omitempty"` - - ActiveServices string `json:"activeservices,omitempty"` - BackupvServerStatus string `json:"backupvserverstatus,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - CacheVServer string `json:"cachevserver,omitempty"` - ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` - ConsolidatedLConngbl string `json:"consolidatedlconngbl,omitempty"` - CookieDomain string `json:"cookiedomain,omitempty"` - CurrentactiveOrder string `json:"currentactiveorder,omitempty"` - CurState string `json:"curstate,omitempty"` - DNSVServerName string `json:"dnsvservername,omitempty"` - Domain string `json:"domain,omitempty"` - EffectiveState string `json:"effectivestate,omitempty"` - GroupName string `json:"groupname,omitempty"` - Gt2GB string `json:"gt2gb,omitempty"` - Health string `json:"health,omitempty"` - Homepage string `json:"homepage,omitempty"` - IPMapping string `json:"ipmapping,omitempty"` - IsGSLB bool `json:"isgslb,omitempty"` - LBRRReason int `json:"lbrrreason,omitempty"` - Map string `json:"map,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NGName string `json:"ngname,omitempty"` - NodeFaultBindings string `json:"nodefaultbindings,omitempty"` - Precedence string `json:"precedence,omitempty"` - Redirect string `json:"redirect,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - StateChangeTimeMsec string `json:"statechangetimemsec,omitempty"` - StateChangeTimeSec string `json:"statechangetimesec,omitempty"` - StateChangeTimeSeconds string `json:"statechangetimeseconds,omitempty"` - Status int `json:"status,omitempty"` - ThresholdValue int `json:"thresholdvalue,omitempty"` - TicksSinceLastStateChange string `json:"tickssincelaststatechange,omitempty"` - TotalServices string `json:"totalservices,omitempty"` - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` - Version int `json:"version,omitempty"` - VSvrDynConnsoThreshold string `json:"vsvrdynconnsothreshold,omitempty"` -} - -type LBVServerServiceGroupMemberBinding struct { - CookieIPPort string `json:"cookieipport,omitempty"` - CookieName string `json:"cookiename,omitempty"` - CurState string `json:"curstate,omitempty"` - DynamicWeight string `json:"dynamicweight,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Name string `json:"name,omitempty"` - Order string `json:"order,omitempty"` - OrderStr string `json:"orderstr,omitempty"` - PreferredLocation string `json:"preferredlocation,omitempty"` - Port int `json:"port,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` - ServiceType string `json:"servicetype,omitempty"` - VServerid string `json:"vserverid,omitempty"` - Weight string `json:"weight,omitempty"` -} diff --git a/nitrogo/models/lldp.go b/nitrogo/models/lldp.go new file mode 100644 index 0000000..1471052 --- /dev/null +++ b/nitrogo/models/lldp.go @@ -0,0 +1,48 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Lldpneighbors struct { + Ifnum string `json:"ifnum,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Chassisidsubtype string `json:"chassisidsubtype,omitempty"` + Chassisid string `json:"chassisid,omitempty"` + Portidsubtype string `json:"portidsubtype,omitempty"` + Portid string `json:"portid,omitempty"` + Ttl string `json:"ttl,omitempty"` + Portdescription string `json:"portdescription,omitempty"` + Sys string `json:"sys,omitempty"` + Sysdesc string `json:"sysdesc,omitempty"` + Mgmtaddresssubtype string `json:"mgmtaddresssubtype,omitempty"` + Mgmtaddress string `json:"mgmtaddress,omitempty"` + Iftype string `json:"iftype,omitempty"` + Ifnumber string `json:"ifnumber,omitempty"` + Vlan string `json:"vlan,omitempty"` + Vlanid string `json:"vlanid,omitempty"` + Portprotosupported string `json:"portprotosupported,omitempty"` + Portprotoenabled string `json:"portprotoenabled,omitempty"` + Portprotoid string `json:"portprotoid,omitempty"` + Portvlanid string `json:"portvlanid,omitempty"` + Protocolid string `json:"protocolid,omitempty"` + Linkaggrcapable string `json:"linkaggrcapable,omitempty"` + Linkaggrenabled string `json:"linkaggrenabled,omitempty"` + Linkaggrid string `json:"linkaggrid,omitempty"` + Flag string `json:"flag,omitempty"` + Syscapabilities string `json:"syscapabilities,omitempty"` + Syscapenabled string `json:"syscapenabled,omitempty"` + Autonegsupport string `json:"autonegsupport,omitempty"` + Autonegenabled string `json:"autonegenabled,omitempty"` + Autonegadvertised string `json:"autonegadvertised,omitempty"` + Autonegmautype string `json:"autonegmautype,omitempty"` + Mtu string `json:"mtu,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lldpparam struct { + Holdtimetxmult int `json:"holdtimetxmult,omitempty"` + Timer int `json:"timer,omitempty"` + Mode string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/lsn.go b/nitrogo/models/lsn.go new file mode 100644 index 0000000..00403c4 --- /dev/null +++ b/nitrogo/models/lsn.go @@ -0,0 +1,419 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Lsnsipalgcall struct { + Callid string `json:"callid,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Callflags string `json:"callflags,omitempty"` + Xlatip string `json:"xlatip,omitempty"` + Callrefcount string `json:"callrefcount,omitempty"` + Calltimer string `json:"calltimer,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnsipalgcallbinding struct { + Callid string `json:"callid,omitempty"` +} + +type Lsngroupbinding struct { + Groupname string `json:"groupname,omitempty"` +} + +type Lsngroupipsecalgprofilebinding struct { + Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouplogprofilebinding struct { + Logprofilename string `json:"logprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouplsnrtspalgprofilebinding struct { + Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouplsnsipalgprofilebinding struct { + Sipalgprofilename string `json:"sipalgprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngroupprofilebinding struct { + Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnlogprofile struct { + Logprofilename string `json:"logprofilename,omitempty"` + Logsubscrinfo string `json:"logsubscrinfo,omitempty"` + Logcompact string `json:"logcompact,omitempty"` + Logipfix string `json:"logipfix,omitempty"` + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Logsessdeletion string `json:"logsessdeletion,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnsipalgcallcontrolchannelbinding struct { + Channelip string `json:"channelip,omitempty"` + Channelnatip string `json:"channelnatip,omitempty"` + Channelport int `json:"channelport,omitempty"` + Channelnatport int `json:"channelnatport,omitempty"` + Channelprotocol string `json:"channelprotocol,omitempty"` + Channelflags int `json:"channelflags,omitempty"` + Channeltimeout int `json:"channeltimeout,omitempty"` + Callid string `json:"callid,omitempty"` +} + +type Lsnclientnsacl6binding struct { + Acl6name string `json:"acl6name,omitempty"` + Td int `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} + +type Lsnclientbinding struct { + Clientname string `json:"clientname,omitempty"` +} + +type Lsngrouppoolbinding struct { + Poolname string `json:"poolname,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngroupserverbinding struct { + Pcpserver string `json:"pcpserver,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnrtspalgsessionbinding struct { + Sessionid string `json:"sessionid,omitempty"` +} + +type Lsnstatic struct { + Name string `json:"name,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Subscrport int `json:"subscrport,omitempty"` + Network6 string `json:"network6,omitempty"` + Td int `json:"td"` + Natip string `json:"natip,omitempty"` + Natport int `json:"natport,omitempty"` + Destip string `json:"destip,omitempty"` + Dsttd int `json:"dsttd,omitempty"` + Nattype string `json:"nattype,omitempty"` + Status string `json:"status,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsntransportprofile struct { + Transportprofilename string `json:"transportprofilename,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Finrsttimeout int `json:"finrsttimeout,omitempty"` + Stuntimeout int `json:"stuntimeout,omitempty"` + Synidletimeout int `json:"synidletimeout,omitempty"` + Portquota int `json:"portquota"` + Sessionquota int `json:"sessionquota"` + Groupsessionlimit int `json:"groupsessionlimit"` + Portpreserveparity string `json:"portpreserveparity,omitempty"` + Portpreserverange string `json:"portpreserverange,omitempty"` + Syncheck string `json:"syncheck,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnappsprofilebinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` +} + +type Lsnclientnetworkbinding struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Td int `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} + +type Lsngrouphttphdrlogprofilebinding struct { + Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouppcpserverbinding struct { + Pcpserver string `json:"pcpserver,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouprtspalgprofilebinding struct { + Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnpoollsnipbinding struct { + Lsnip string `json:"lsnip,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Poolname string `json:"poolname,omitempty"` +} + +type Lsnsipalgprofile struct { + Sipalgprofilename string `json:"sipalgprofilename,omitempty"` + Datasessionidletimeout int `json:"datasessionidletimeout,omitempty"` + Sipsessiontimeout int `json:"sipsessiontimeout,omitempty"` + Registrationtimeout int `json:"registrationtimeout,omitempty"` + Sipsrcportrange string `json:"sipsrcportrange,omitempty"` + Sipdstportrange string `json:"sipdstportrange,omitempty"` + Openregisterpinhole string `json:"openregisterpinhole,omitempty"` + Opencontactpinhole string `json:"opencontactpinhole,omitempty"` + Openviapinhole string `json:"openviapinhole,omitempty"` + Openrecordroutepinhole string `json:"openrecordroutepinhole,omitempty"` + Siptransportprotocol string `json:"siptransportprotocol,omitempty"` + Openroutepinhole string `json:"openroutepinhole,omitempty"` + Rport string `json:"rport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsngrouplsnappsprofilebinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngroup struct { + Groupname string `json:"groupname,omitempty"` + Clientname string `json:"clientname,omitempty"` + Nattype string `json:"nattype,omitempty"` + Allocpolicy string `json:"allocpolicy,omitempty"` + Portblocksize int `json:"portblocksize"` + Logging string `json:"logging,omitempty"` + Sessionlogging string `json:"sessionlogging,omitempty"` + Sessionsync string `json:"sessionsync,omitempty"` + Snmptraplimit int `json:"snmptraplimit"` + Ftp string `json:"ftp,omitempty"` + Pptp string `json:"pptp,omitempty"` + Sipalg string `json:"sipalg,omitempty"` + Rtspalg string `json:"rtspalg,omitempty"` + Ip6profile string `json:"ip6profile,omitempty"` + Ftpcm string `json:"ftpcm,omitempty"` + Groupid string `json:"groupid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsngroupappsprofilebinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngroupsipalgprofilebinding struct { + Sipalgprofilename string `json:"sipalgprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnrtspalgsession struct { + Sessionid string `json:"sessionid,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Callflags string `json:"callflags,omitempty"` + Xlatip string `json:"xlatip,omitempty"` + Callrefcount string `json:"callrefcount,omitempty"` + Calltimer string `json:"calltimer,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnappsprofile struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` + Ippooling string `json:"ippooling,omitempty"` + Mapping string `json:"mapping,omitempty"` + Filtering string `json:"filtering,omitempty"` + Tcpproxy string `json:"tcpproxy,omitempty"` + Td int `json:"td,omitempty"` + L2info string `json:"l2info,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsngrouplsnhttphdrlogprofilebinding struct { + Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouptransportprofilebinding struct { + Transportprofilename string `json:"transportprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnrtspalgprofile struct { + Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` + Rtspidletimeout int `json:"rtspidletimeout,omitempty"` + Rtspportrange string `json:"rtspportrange,omitempty"` + Rtsptransportprotocol string `json:"rtsptransportprotocol,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnsipalgcalldatachannelbinding struct { + Channelip string `json:"channelip,omitempty"` + Channelnatip string `json:"channelnatip,omitempty"` + Channelport int `json:"channelport,omitempty"` + Channelnatport int `json:"channelnatport,omitempty"` + Channelprotocol string `json:"channelprotocol,omitempty"` + Channelflags int `json:"channelflags,omitempty"` + Channeltimeout int `json:"channeltimeout,omitempty"` + Callid string `json:"callid,omitempty"` +} + +type Lsnappsprofileappsattributesbinding struct { + Appsattributesname string `json:"appsattributesname,omitempty"` + Appsprofilename string `json:"appsprofilename,omitempty"` +} + +type Lsnappsprofilelsnappsattributesbinding struct { + Appsattributesname string `json:"appsattributesname,omitempty"` + Appsprofilename string `json:"appsprofilename,omitempty"` +} + +type Lsndeterministicnat struct { + Clientname string `json:"clientname,omitempty"` + Network6 string `json:"network6,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Td int `json:"td,omitempty"` + Natip string `json:"natip,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Subscrip2 string `json:"subscrip2,omitempty"` + Natip2 string `json:"natip2,omitempty"` + Firstport string `json:"firstport,omitempty"` + Lastport string `json:"lastport,omitempty"` + Srctd string `json:"srctd,omitempty"` + Nattype string `json:"nattype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsngrouplsnlogprofilebinding struct { + Logprofilename string `json:"logprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnpool struct { + Poolname string `json:"poolname,omitempty"` + Nattype string `json:"nattype,omitempty"` + Portblockallocation string `json:"portblockallocation,omitempty"` + Portrealloctimeout int `json:"portrealloctimeout"` + Maxportrealloctmq int `json:"maxportrealloctmq"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnpoolbinding struct { + Poolname string `json:"poolname,omitempty"` +} + +type Lsnclient struct { + Clientname string `json:"clientname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsngrouplsnpoolbinding struct { + Poolname string `json:"poolname,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsngrouplsntransportprofilebinding struct { + Transportprofilename string `json:"transportprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` +} + +type Lsnhttphdrlogprofile struct { + Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` + Logurl string `json:"logurl,omitempty"` + Logmethod string `json:"logmethod,omitempty"` + Logversion string `json:"logversion,omitempty"` + Loghost string `json:"loghost,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnip6profile struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Network6 string `json:"network6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnparameter struct { + Memlimit int `json:"memlimit,omitempty"` + Sessionsync string `json:"sessionsync,omitempty"` + Subscrsessionremoval string `json:"subscrsessionremoval,omitempty"` + Memlimitactive string `json:"memlimitactive,omitempty"` + Maxmemlimit string `json:"maxmemlimit,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnrtspalgsessiondatachannelbinding struct { + Channelip string `json:"channelip,omitempty"` + Channelnatip string `json:"channelnatip,omitempty"` + Channelport int `json:"channelport,omitempty"` + Channelnatport int `json:"channelnatport,omitempty"` + Channelprotocol string `json:"channelprotocol,omitempty"` + Channelflags int `json:"channelflags,omitempty"` + Channeltimeout int `json:"channeltimeout,omitempty"` + Sessionid string `json:"sessionid,omitempty"` +} + +type Lsnsession struct { + Nattype string `json:"nattype,omitempty"` + Clientname string `json:"clientname,omitempty"` + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network6 string `json:"network6,omitempty"` + Td int `json:"td,omitempty"` + Natip string `json:"natip,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Natport2 int `json:"natport2,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Subscrport string `json:"subscrport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Natport string `json:"natport,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` + Sessionestdir string `json:"sessionestdir,omitempty"` + Dsttd string `json:"dsttd,omitempty"` + Srctd string `json:"srctd,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnclientnsaclbinding struct { + Aclname string `json:"aclname,omitempty"` + Td int `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} + +type Lsnappsattributes struct { + Name string `json:"name,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` + Port string `json:"port,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lsnappsprofileportbinding struct { + Lsnport string `json:"lsnport,omitempty"` + Appsprofilename string `json:"appsprofilename,omitempty"` +} + +type Lsnclientacl6binding struct { + Acl6name string `json:"acl6name,omitempty"` + Td uint32 `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} + +type Lsnclientaclbinding struct { + Aclname string `json:"aclname,omitempty"` + Td uint32 `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} + +type Lsnclientnetwork6binding struct { + Network6 string `json:"network6,omitempty"` + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Td int `json:"td,omitempty"` + Clientname string `json:"clientname,omitempty"` +} diff --git a/nitrogo/models/metrics.go b/nitrogo/models/metrics.go new file mode 100644 index 0000000..d5f626f --- /dev/null +++ b/nitrogo/models/metrics.go @@ -0,0 +1,77 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Metricsprofileuservserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofile struct { + Name string `json:"name,omitempty"` + Collector string `json:"collector,omitempty"` + Outputmode string `json:"outputmode,omitempty"` + Metrics string `json:"metrics,omitempty"` + Servemode string `json:"servemode,omitempty"` + Schemafile string `json:"schemafile,omitempty"` + Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` + Metricsauthtoken string `json:"metricsauthtoken,omitempty"` + Metricsendpointurl string `json:"metricsendpointurl,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Metricsprofilecrvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofilecsvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofilegslbvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofilevpnvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofileauthenticationvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Metricsprofilelbvserverbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofileservicebinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofileservicegroupbinding struct { + Entityname string `json:"entityname,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/network.go b/nitrogo/models/network.go new file mode 100644 index 0000000..637624e --- /dev/null +++ b/nitrogo/models/network.go @@ -0,0 +1,1294 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Inatparam struct { + Nat46v6prefix string `json:"nat46v6prefix,omitempty"` + Td int `json:"td"` + Nat46ignoretos string `json:"nat46ignoretos,omitempty"` + Nat46zerochecksum string `json:"nat46zerochecksum,omitempty"` + Nat46v6mtu int `json:"nat46v6mtu,omitempty"` + Nat46fragheader string `json:"nat46fragheader,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ipsetnsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` +} + +type Mapbmr struct { + Name string `json:"name,omitempty"` + Ruleipv6prefix string `json:"ruleipv6prefix,omitempty"` + Psidoffset int `json:"psidoffset,omitempty"` + Eabitlength int `json:"eabitlength,omitempty"` + Psidlength int `json:"psidlength,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netprofile struct { + Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Overridelsn string `json:"overridelsn,omitempty"` + Mbf string `json:"mbf,omitempty"` + Proxyprotocol string `json:"proxyprotocol,omitempty"` + Proxyprotocoltxversion string `json:"proxyprotocoltxversion,omitempty"` + Proxyprotocolaftertlshandshake string `json:"proxyprotocolaftertlshandshake,omitempty"` + Proxyprotocoltlvoptions string `json:"proxyprotocoltlvoptions,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Rnat6 struct { + Name string `json:"name,omitempty"` + Network string `json:"network,omitempty"` + Acl6name string `json:"acl6name,omitempty"` + Redirectport int `json:"redirectport,omitempty"` + Td int `json:"td,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnatnsipbinding struct { + Natip string `json:"natip,omitempty"` + Td int `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rnatglobalsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + All bool `json:"all,omitempty"` +} + +type Ci struct { + Ifaces string `json:"ifaces,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Route6 struct { + Network string `json:"network,omitempty"` + Gateway string `json:"gateway,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Weight int `json:"weight,omitempty"` + Distance int `json:"distance,omitempty"` + Cost int `json:"cost,omitempty"` + Advertise string `json:"advertise,omitempty"` + Msr string `json:"msr,omitempty"` + Monitor string `json:"monitor,omitempty"` + Td int `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Mgmt bool `json:"mgmt,omitempty"` + Routetype string `json:"routetype,omitempty"` + Detail bool `json:"detail,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Type string `json:"type,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Data string `json:"data,omitempty"` + Flags string `json:"flags,omitempty"` + State string `json:"state,omitempty"` + Totalprobes string `json:"totalprobes,omitempty"` + Totalfailedprobes string `json:"totalfailedprobes,omitempty"` + Failedprobes string `json:"failedprobes,omitempty"` + Monstatcode string `json:"monstatcode,omitempty"` + Monstatparam1 string `json:"monstatparam1,omitempty"` + Monstatparam2 string `json:"monstatparam2,omitempty"` + Monstatparam3 string `json:"monstatparam3,omitempty"` + Data1 string `json:"data1,omitempty"` + Routeowners string `json:"routeowners,omitempty"` + Retain string `json:"retain,omitempty"` + Static string `json:"Static,omitempty"` + Permanent string `json:"permanent,omitempty"` + Connected string `json:"connected,omitempty"` + Ospfv3 string `json:"ospfv3,omitempty"` + Isis string `json:"isis,omitempty"` + Active string `json:"active,omitempty"` + Bgp string `json:"bgp,omitempty"` + Rip string `json:"rip,omitempty"` + Raroute string `json:"raroute,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vxlan struct { + Id int `json:"id,omitempty"` + Vlan int `json:"vlan,omitempty"` + Port int `json:"port,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Type string `json:"type,omitempty"` + Protocol string `json:"protocol,omitempty"` + Innervlantagging string `json:"innervlantagging,omitempty"` + Td string `json:"td,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Interfacepair struct { + Id int `json:"id,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nd6 struct { + Neighbor string `json:"neighbor,omitempty"` + Mac string `json:"mac,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Vtep string `json:"vtep,omitempty"` + Td int `json:"td"` + Nodeid int `json:"nodeid"` + State string `json:"state,omitempty"` + Timeout string `json:"timeout,omitempty"` + Flags string `json:"flags,omitempty"` + Controlplane string `json:"controlplane,omitempty"` + Channel string `json:"channel,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netbridgeipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vridinterfacebinding struct { + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vridnsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Bridgegroupnsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td int `json:"td,omitempty"` + Netmask string `json:"netmask,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id int `json:"id,omitempty"` +} + +type L2param struct { + Mbfpeermacupdate int `json:"mbfpeermacupdate"` + Maxbridgecollision int `json:"maxbridgecollision"` + Bdggrpproxyarp string `json:"bdggrpproxyarp,omitempty"` + Bdgsetting string `json:"bdgsetting,omitempty"` + Garponvridintf string `json:"garponvridintf,omitempty"` + Macmodefwdmypkt string `json:"macmodefwdmypkt,omitempty"` + Usemymac string `json:"usemymac,omitempty"` + Proxyarp string `json:"proxyarp,omitempty"` + Garpreply string `json:"garpreply,omitempty"` + Mbfinstlearning string `json:"mbfinstlearning,omitempty"` + Rstintfonhafo string `json:"rstintfonhafo,omitempty"` + Skipproxyingbsdtraffic string `json:"skipproxyingbsdtraffic,omitempty"` + Returntoethernetsender string `json:"returntoethernetsender,omitempty"` + Stopmacmoveupdate string `json:"stopmacmoveupdate,omitempty"` + Bridgeagetimeout int `json:"bridgeagetimeout,omitempty"` + Usenetprofilebsdtraffic string `json:"usenetprofilebsdtraffic,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type L4param struct { + L2connmethod string `json:"l2connmethod,omitempty"` + L4switch string `json:"l4switch,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ipsetip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` +} + +type Mapbmrbinding struct { + Name string `json:"name,omitempty"` +} + +type Nd6ravariables struct { + Vlan int `json:"vlan,omitempty"` + Ceaserouteradv string `json:"ceaserouteradv,omitempty"` + Sendrouteradv string `json:"sendrouteradv,omitempty"` + Srclinklayeraddroption string `json:"srclinklayeraddroption,omitempty"` + Onlyunicastrtadvresponse string `json:"onlyunicastrtadvresponse,omitempty"` + Managedaddrconfig string `json:"managedaddrconfig,omitempty"` + Otheraddrconfig string `json:"otheraddrconfig,omitempty"` + Currhoplimit int `json:"currhoplimit,omitempty"` + Maxrtadvinterval int `json:"maxrtadvinterval,omitempty"` + Minrtadvinterval int `json:"minrtadvinterval,omitempty"` + Linkmtu int `json:"linkmtu,omitempty"` + Reachabletime int `json:"reachabletime,omitempty"` + Retranstime int `json:"retranstime,omitempty"` + Defaultlifetime int `json:"defaultlifetime,omitempty"` + Lastrtadvtime string `json:"lastrtadvtime,omitempty"` + Nextrtadvdelay string `json:"nextrtadvdelay,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ip6tunnelparam struct { + Srcip string `json:"srcip,omitempty"` + Dropfrag string `json:"dropfrag,omitempty"` + Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` + Srciproundrobin string `json:"srciproundrobin,omitempty"` + Useclientsourceipv6 string `json:"useclientsourceipv6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netprofilenatrulebinding struct { + Natrule string `json:"natrule,omitempty"` + Netmask string `json:"netmask,omitempty"` + Rewriteip string `json:"rewriteip,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vlannsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Td int `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vrid6ip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags uint32 `json:"flags,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type L3param struct { + Srcnat string `json:"srcnat,omitempty"` + Icmpgenratethreshold int `json:"icmpgenratethreshold,omitempty"` + Overridernat string `json:"overridernat,omitempty"` + Dropdfflag string `json:"dropdfflag,omitempty"` + Miproundrobin string `json:"miproundrobin,omitempty"` + Externalloopback string `json:"externalloopback,omitempty"` + Tnlpmtuwoconn string `json:"tnlpmtuwoconn,omitempty"` + Usipserverstraypkt string `json:"usipserverstraypkt,omitempty"` + Forwardicmpfragments string `json:"forwardicmpfragments,omitempty"` + Dropipfragments string `json:"dropipfragments,omitempty"` + Acllogtime int `json:"acllogtime,omitempty"` + Implicitaclallow string `json:"implicitaclallow,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Allowclasseipv4 string `json:"allowclasseipv4,omitempty"` + Implicitpbr string `json:"implicitpbr,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netbridge struct { + Name string `json:"name,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vlanlinksetbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Tagged bool `json:"tagged,omitempty"` + Id int `json:"id,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` +} + +type Vrid6channelbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Ipsetnsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` +} + +type Linkset struct { + Id string `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Linksetchannelbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Id string `json:"id,omitempty"` +} + +type Fischannelbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Name string `json:"name,omitempty"` +} + +type Inat struct { + Name string `json:"name,omitempty"` + Publicip string `json:"publicip,omitempty"` + Privateip string `json:"privateip,omitempty"` + Mode string `json:"mode,omitempty"` + Tcpproxy string `json:"tcpproxy,omitempty"` + Ftp string `json:"ftp,omitempty"` + Tftp string `json:"tftp,omitempty"` + Usip string `json:"usip,omitempty"` + Usnip string `json:"usnip,omitempty"` + Proxyip string `json:"proxyip,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` + Td int `json:"td,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netbridgevlanbinding struct { + Vlan int `json:"vlan,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vrid6 struct { + Id int `json:"id,omitempty"` + Priority int `json:"priority,omitempty"` + Preemption string `json:"preemption,omitempty"` + Sharing string `json:"sharing,omitempty"` + Tracking string `json:"tracking,omitempty"` + Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + All bool `json:"all,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Type string `json:"type,omitempty"` + State string `json:"state,omitempty"` + Flags string `json:"flags,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Effectivepriority string `json:"effectivepriority,omitempty"` + Operationalownernode string `json:"operationalownernode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnat6binding struct { + Name string `json:"name,omitempty"` +} + +type Vlanbinding struct { + Id int `json:"id,omitempty"` +} + +type Mapdomainmapbmrbinding struct { + Mapbmrname string `json:"mapbmrname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Netbridgebinding struct { + Name string `json:"name,omitempty"` +} + +type Netbridgeiptunnelbinding struct { + Tunnel string `json:"tunnel,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vxlanip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Id uint32 `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Vxlanvlanmapbinding struct { + Name string `json:"name,omitempty"` +} + +type Fis struct { + Name string `json:"name,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vlannsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td int `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id int `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Vrid6interfacebinding struct { + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vrid6nsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Channel struct { + Id string `json:"id,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + State string `json:"state,omitempty"` + Mode string `json:"mode,omitempty"` + Conndistr string `json:"conndistr,omitempty"` + Macdistr string `json:"macdistr,omitempty"` + Lamac string `json:"lamac,omitempty"` + Speed string `json:"speed,omitempty"` + Flowctl string `json:"flowctl,omitempty"` + Hamonitor string `json:"hamonitor,omitempty"` + Haheartbeat string `json:"haheartbeat,omitempty"` + Tagall string `json:"tagall,omitempty"` + Trunk string `json:"trunk,omitempty"` + Ifalias string `json:"ifalias,omitempty"` + Throughput int `json:"throughput,omitempty"` + Bandwidthhigh int `json:"bandwidthhigh,omitempty"` + Bandwidthnormal int `json:"bandwidthnormal,omitempty"` + Mtu int `json:"mtu,omitempty"` + Lrminthroughput int `json:"lrminthroughput,omitempty"` + Linkredundancy string `json:"linkredundancy,omitempty"` + Devicename string `json:"devicename,omitempty"` + Unit string `json:"unit,omitempty"` + Description string `json:"description,omitempty"` + Flags string `json:"flags,omitempty"` + Actualmtu string `json:"actualmtu,omitempty"` + Vlan string `json:"vlan,omitempty"` + Mac string `json:"mac,omitempty"` + Uptime string `json:"uptime,omitempty"` + Downtime string `json:"downtime,omitempty"` + Reqmedia string `json:"reqmedia,omitempty"` + Reqspeed string `json:"reqspeed,omitempty"` + Reqduplex string `json:"reqduplex,omitempty"` + Reqflowcontrol string `json:"reqflowcontrol,omitempty"` + Media string `json:"media,omitempty"` + Actspeed string `json:"actspeed,omitempty"` + Duplex string `json:"duplex,omitempty"` + Actflowctl string `json:"actflowctl,omitempty"` + Lamode string `json:"lamode,omitempty"` + Autoneg string `json:"autoneg,omitempty"` + Autonegresult string `json:"autonegresult,omitempty"` + Tagged string `json:"tagged,omitempty"` + Taggedany string `json:"taggedany,omitempty"` + Taggedautolearn string `json:"taggedautolearn,omitempty"` + Hangdetect string `json:"hangdetect,omitempty"` + Hangreset string `json:"hangreset,omitempty"` + Linkstate string `json:"linkstate,omitempty"` + Intfstate string `json:"intfstate,omitempty"` + Rxpackets string `json:"rxpackets,omitempty"` + Rxbytes string `json:"rxbytes,omitempty"` + Rxerrors string `json:"rxerrors,omitempty"` + Rxdrops string `json:"rxdrops,omitempty"` + Txpackets string `json:"txpackets,omitempty"` + Txbytes string `json:"txbytes,omitempty"` + Txerrors string `json:"txerrors,omitempty"` + Txdrops string `json:"txdrops,omitempty"` + Indisc string `json:"indisc,omitempty"` + Outdisc string `json:"outdisc,omitempty"` + Fctls string `json:"fctls,omitempty"` + Hangs string `json:"hangs,omitempty"` + Stsstalls string `json:"stsstalls,omitempty"` + Txstalls string `json:"txstalls,omitempty"` + Rxstalls string `json:"rxstalls,omitempty"` + Bdgmuted string `json:"bdgmuted,omitempty"` + Vmac string `json:"vmac,omitempty"` + Vmac6 string `json:"vmac6,omitempty"` + Reqthroughput string `json:"reqthroughput,omitempty"` + Actthroughput string `json:"actthroughput,omitempty"` + Backplane string `json:"backplane,omitempty"` + Cleartime string `json:"cleartime,omitempty"` + Lacpmode string `json:"lacpmode,omitempty"` + Lacptimeout string `json:"lacptimeout,omitempty"` + Lacpactorpriority string `json:"lacpactorpriority,omitempty"` + Lacpactorportno string `json:"lacpactorportno,omitempty"` + Lacppartnerstate string `json:"lacppartnerstate,omitempty"` + Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` + Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` + Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` + Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` + Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` + Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` + Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` + Lacppartnerpriority string `json:"lacppartnerpriority,omitempty"` + Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` + Lacppartnersystempriority string `json:"lacppartnersystempriority,omitempty"` + Lacppartnerportno string `json:"lacppartnerportno,omitempty"` + Lacppartnerkey string `json:"lacppartnerkey,omitempty"` + Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` + Lacpactorinsync string `json:"lacpactorinsync,omitempty"` + Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` + Lacpactordistributing string `json:"lacpactordistributing,omitempty"` + Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` + Lacpportrxstat string `json:"lacpportrxstat,omitempty"` + Lacpportselectstate string `json:"lacpportselectstate,omitempty"` + Lldpmode string `json:"lldpmode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Fisinterfacebinding struct { + Ifnum string `json:"ifnum,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Name string `json:"name,omitempty"` +} + +type Nd6ravariablesbinding struct { + Vlan int `json:"vlan,omitempty"` +} + +type Netbridgensipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vrid6ipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags uint32 `json:"flags,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Vridip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags uint32 `json:"flags,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Bridgetable struct { + Mac string `json:"mac,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Vtep string `json:"vtep,omitempty"` + Vni int `json:"vni,omitempty"` + Devicevlan int `json:"devicevlan,omitempty"` + Bridgeage int `json:"bridgeage,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Vlan int `json:"vlan,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Flags string `json:"flags,omitempty"` + Type string `json:"type,omitempty"` + Channel string `json:"channel,omitempty"` + Controlplane string `json:"controlplane,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Channelbinding struct { + Id string `json:"id,omitempty"` +} + +type Ipset struct { + Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Mapbmrbmrv4networkbinding struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vlan struct { + Id int `json:"id,omitempty"` + Aliasname string `json:"aliasname,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Mtu int `json:"mtu,omitempty"` + Sharing string `json:"sharing,omitempty"` + Linklocalipv6addr string `json:"linklocalipv6addr,omitempty"` + Rnat string `json:"rnat,omitempty"` + Portbitmap string `json:"portbitmap,omitempty"` + Lsbitmap string `json:"lsbitmap,omitempty"` + Tagbitmap string `json:"tagbitmap,omitempty"` + Lstagbitmap string `json:"lstagbitmap,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Tagifaces string `json:"tagifaces,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Tagged string `json:"tagged,omitempty"` + Vlantd string `json:"vlantd,omitempty"` + Sdxvlan string `json:"sdxvlan,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Vxlan string `json:"vxlan,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vxlanbinding struct { + Id int `json:"id,omitempty"` +} + +type Bridgegroupbinding struct { + Id int `json:"id,omitempty"` +} + +type Linksetinterfacebinding struct { + Ifnum string `json:"ifnum,omitempty"` + Id string `json:"id,omitempty"` +} + +type Mapdomainbinding struct { + Name string `json:"name,omitempty"` +} + +type Linksetbinding struct { + Id string `json:"id,omitempty"` +} + +type Nat64 struct { + Name string `json:"name,omitempty"` + Acl6name string `json:"acl6name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nat64param struct { + Td int `json:"td"` + Nat64ignoretos string `json:"nat64ignoretos,omitempty"` + Nat64zerochecksum string `json:"nat64zerochecksum,omitempty"` + Nat64v6mtu int `json:"nat64v6mtu,omitempty"` + Nat64fragheader string `json:"nat64fragheader,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnat6nsip6binding struct { + Natip6 string `json:"natip6,omitempty"` + Td int `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rnatretainsourceportsetbinding struct { + Retainsourceportrange string `json:"retainsourceportrange,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vrid struct { + Id int `json:"id,omitempty"` + Priority int `json:"priority,omitempty"` + Preemption string `json:"preemption,omitempty"` + Sharing string `json:"sharing,omitempty"` + Tracking string `json:"tracking,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + All bool `json:"all,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Type string `json:"type,omitempty"` + Effectivepriority string `json:"effectivepriority,omitempty"` + Flags string `json:"flags,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + State string `json:"state,omitempty"` + Operationalownernode string `json:"operationalownernode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Forwardingsession struct { + Name string `json:"name,omitempty"` + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Acl6name string `json:"acl6name,omitempty"` + Aclname string `json:"aclname,omitempty"` + Td int `json:"td,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Sourceroutecache string `json:"sourceroutecache,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Route struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Gateway string `json:"gateway,omitempty"` + Vlan int `json:"vlan,omitempty"` + Cost int `json:"cost,omitempty"` + Td int `json:"td,omitempty"` + Distance int `json:"distance,omitempty"` + Cost1 int `json:"cost1,omitempty"` + Weight int `json:"weight,omitempty"` + Advertise string `json:"advertise,omitempty"` + Protocol []string `json:"protocol,omitempty"` + Msr string `json:"msr,omitempty"` + Monitor string `json:"monitor,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Mgmt bool `json:"mgmt,omitempty"` + Routetype string `json:"routetype,omitempty"` + Detail bool `json:"detail,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Type string `json:"type,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Static string `json:"Static,omitempty"` + Permanent string `json:"permanent,omitempty"` + Direct string `json:"direct,omitempty"` + Nat string `json:"nat,omitempty"` + Lbroute string `json:"lbroute,omitempty"` + Adv string `json:"adv,omitempty"` + Tunnel string `json:"tunnel,omitempty"` + Data string `json:"data,omitempty"` + Data0 string `json:"data0,omitempty"` + Flags string `json:"flags,omitempty"` + Routeowners string `json:"routeowners,omitempty"` + Retain string `json:"retain,omitempty"` + Ospf string `json:"ospf,omitempty"` + Isis string `json:"isis,omitempty"` + Rip string `json:"rip,omitempty"` + Bgp string `json:"bgp,omitempty"` + Dhcp string `json:"dhcp,omitempty"` + Advospf string `json:"advospf,omitempty"` + Advisis string `json:"advisis,omitempty"` + Advrip string `json:"advrip,omitempty"` + Advbgp string `json:"advbgp,omitempty"` + State string `json:"state,omitempty"` + Totalprobes string `json:"totalprobes,omitempty"` + Totalfailedprobes string `json:"totalfailedprobes,omitempty"` + Failedprobes string `json:"failedprobes,omitempty"` + Monstatcode string `json:"monstatcode,omitempty"` + Monstatparam1 string `json:"monstatparam1,omitempty"` + Monstatparam2 string `json:"monstatparam2,omitempty"` + Monstatparam3 string `json:"monstatparam3,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Arpparam struct { + Timeout int `json:"timeout,omitempty"` + Spoofvalidation string `json:"spoofvalidation,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vridipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags uint32 `json:"flags,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Ipsetbinding struct { + Name string `json:"name,omitempty"` +} + +type Interface struct { + Id string `json:"id,omitempty"` + Speed string `json:"speed,omitempty"` + Duplex string `json:"duplex,omitempty"` + Flowctl string `json:"flowctl,omitempty"` + Autoneg string `json:"autoneg,omitempty"` + Hamonitor string `json:"hamonitor,omitempty"` + Haheartbeat string `json:"haheartbeat,omitempty"` + Mtu int `json:"mtu,omitempty"` + Ringsize int `json:"ringsize,omitempty"` + Ringtype string `json:"ringtype,omitempty"` + Tagall string `json:"tagall,omitempty"` + Trunk string `json:"trunk,omitempty"` + Trunkmode string `json:"trunkmode,omitempty"` + Trunkallowedvlan []string `json:"trunkallowedvlan,omitempty"` + Lacpmode string `json:"lacpmode,omitempty"` + Lacpkey int `json:"lacpkey,omitempty"` + Lagtype string `json:"lagtype,omitempty"` + Lacppriority int `json:"lacppriority,omitempty"` + Lacptimeout string `json:"lacptimeout,omitempty"` + Ifalias string `json:"ifalias,omitempty"` + Throughput int `json:"throughput,omitempty"` + Linkredundancy string `json:"linkredundancy,omitempty"` + Bandwidthhigh int `json:"bandwidthhigh,omitempty"` + Bandwidthnormal int `json:"bandwidthnormal,omitempty"` + Lldpmode string `json:"lldpmode,omitempty"` + Lrsetpriority int `json:"lrsetpriority,omitempty"` + Devicename string `json:"devicename,omitempty"` + Unit string `json:"unit,omitempty"` + Description string `json:"description,omitempty"` + Flags string `json:"flags,omitempty"` + Actualmtu string `json:"actualmtu,omitempty"` + Vlan string `json:"vlan,omitempty"` + Mac string `json:"mac,omitempty"` + Uptime string `json:"uptime,omitempty"` + Downtime string `json:"downtime,omitempty"` + Actualringsize string `json:"actualringsize,omitempty"` + Reqmedia string `json:"reqmedia,omitempty"` + Reqspeed string `json:"reqspeed,omitempty"` + Reqduplex string `json:"reqduplex,omitempty"` + Reqflowcontrol string `json:"reqflowcontrol,omitempty"` + Actmedia string `json:"actmedia,omitempty"` + Actspeed string `json:"actspeed,omitempty"` + Actduplex string `json:"actduplex,omitempty"` + Actflowctl string `json:"actflowctl,omitempty"` + Mode string `json:"mode,omitempty"` + State string `json:"state,omitempty"` + Autonegresult string `json:"autonegresult,omitempty"` + Tagged string `json:"tagged,omitempty"` + Taggedany string `json:"taggedany,omitempty"` + Taggedautolearn string `json:"taggedautolearn,omitempty"` + Hangdetect string `json:"hangdetect,omitempty"` + Hangreset string `json:"hangreset,omitempty"` + Linkstate string `json:"linkstate,omitempty"` + Intfstate string `json:"intfstate,omitempty"` + Rxpackets string `json:"rxpackets,omitempty"` + Rxbytes string `json:"rxbytes,omitempty"` + Rxerrors string `json:"rxerrors,omitempty"` + Rxdrops string `json:"rxdrops,omitempty"` + Txpackets string `json:"txpackets,omitempty"` + Txbytes string `json:"txbytes,omitempty"` + Txerrors string `json:"txerrors,omitempty"` + Txdrops string `json:"txdrops,omitempty"` + Indisc string `json:"indisc,omitempty"` + Outdisc string `json:"outdisc,omitempty"` + Fctls string `json:"fctls,omitempty"` + Hangs string `json:"hangs,omitempty"` + Stsstalls string `json:"stsstalls,omitempty"` + Txstalls string `json:"txstalls,omitempty"` + Rxstalls string `json:"rxstalls,omitempty"` + Bdgmacmoved string `json:"bdgmacmoved,omitempty"` + Bdgmuted string `json:"bdgmuted,omitempty"` + Vmac string `json:"vmac,omitempty"` + Vmac6 string `json:"vmac6,omitempty"` + Reqthroughput string `json:"reqthroughput,omitempty"` + Actthroughput string `json:"actthroughput,omitempty"` + Backplane string `json:"backplane,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Cleartime string `json:"cleartime,omitempty"` + Slavestate string `json:"slavestate,omitempty"` + Slavemedia string `json:"slavemedia,omitempty"` + Slavespeed string `json:"slavespeed,omitempty"` + Slaveduplex string `json:"slaveduplex,omitempty"` + Slaveflowctl string `json:"slaveflowctl,omitempty"` + Slavetime string `json:"slavetime,omitempty"` + Intftype string `json:"intftype,omitempty"` + Svmcmd string `json:"svmcmd,omitempty"` + Lacpactormode string `json:"lacpactormode,omitempty"` + Lacpactortimeout string `json:"lacpactortimeout,omitempty"` + Lacpactorpriority string `json:"lacpactorpriority,omitempty"` + Lacpactorportno string `json:"lacpactorportno,omitempty"` + Lacppartnerstate string `json:"lacppartnerstate,omitempty"` + Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` + Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` + Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` + Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` + Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` + Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` + Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` + Lacppartnerpriority string `json:"lacppartnerpriority,omitempty"` + Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` + Lacppartnersystempriority string `json:"lacppartnersystempriority,omitempty"` + Lacppartnerportno string `json:"lacppartnerportno,omitempty"` + Lacppartnerkey string `json:"lacppartnerkey,omitempty"` + Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` + Lacpactorinsync string `json:"lacpactorinsync,omitempty"` + Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` + Lacpactordistributing string `json:"lacpactordistributing,omitempty"` + Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` + Lacpportrxstat string `json:"lacpportrxstat,omitempty"` + Lacpportselectstate string `json:"lacpportselectstate,omitempty"` + Lractiveintf string `json:"lractiveintf,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnat6ip6binding struct { + Natip6 string `json:"natip6,omitempty"` + Td uint32 `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vrid6binding struct { + Id int `json:"id,omitempty"` +} + +type Vxlanipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Vxlansrcipbinding struct { + Srcip string `json:"srcip,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vxlanvlanmap struct { + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ip6tunnel struct { + Name string `json:"name,omitempty"` + Remote string `json:"remote,omitempty"` + Local string `json:"local,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Remoteip string `json:"remoteip,omitempty"` + Type string `json:"type,omitempty"` + Encapip string `json:"encapip,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rsskeytype struct { + Rsstype string `json:"rsstype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Bridgegroupip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td uint32 `json:"td,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id uint32 `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Vridparam struct { + Sendtomaster string `json:"sendtomaster,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Deadinterval int `json:"deadinterval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nd6ravariablesonlinkipv6prefixbinding struct { + Ipv6prefix string `json:"ipv6prefix,omitempty"` + Vlan int `json:"vlan,omitempty"` +} + +type Bridgegroupvlanbinding struct { + Vlan int `json:"vlan,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Id int `json:"id,omitempty"` +} + +type Rnatglobalauditsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + All bool `json:"all,omitempty"` +} + +type Vlanipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Td uint32 `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Iptunnelparam struct { + Srcip string `json:"srcip,omitempty"` + Dropfrag string `json:"dropfrag,omitempty"` + Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` + Srciproundrobin string `json:"srciproundrobin,omitempty"` + Enablestrictrx string `json:"enablestrictrx,omitempty"` + Enablestricttx string `json:"enablestricttx,omitempty"` + Mac string `json:"mac,omitempty"` + Useclientsourceip string `json:"useclientsourceip,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Mapdmr struct { + Name string `json:"name,omitempty"` + Bripv6prefix string `json:"bripv6prefix,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netbridgeip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vrid6trackinterfacebinding struct { + Trackifnum string `json:"trackifnum,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Mapdomain struct { + Name string `json:"name,omitempty"` + Mapdmrname string `json:"mapdmrname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Arp struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td int `json:"td"` + Mac string `json:"mac,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Vtep string `json:"vtep,omitempty"` + Vlan int `json:"vlan,omitempty"` + Ownernode int `json:"ownernode"` + All bool `json:"all,omitempty"` + Nodeid int `json:"nodeid"` + Timeout string `json:"timeout,omitempty"` + State string `json:"state,omitempty"` + Flags string `json:"flags,omitempty"` + Type string `json:"type,omitempty"` + Channel string `json:"channel,omitempty"` + Controlplane string `json:"controlplane,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Lacp struct { + Syspriority int `json:"syspriority,omitempty"` + Ownernode int `json:"ownernode"` + Devicename string `json:"devicename,omitempty"` + Mac string `json:"mac,omitempty"` + Flags string `json:"flags,omitempty"` + Lacpkey string `json:"lacpkey,omitempty"` + Clustersyspriority string `json:"clustersyspriority,omitempty"` + Clustermac string `json:"clustermac,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Onlinkipv6prefix struct { + Ipv6prefix string `json:"ipv6prefix,omitempty"` + Onlinkprefix string `json:"onlinkprefix,omitempty"` + Autonomusprefix string `json:"autonomusprefix,omitempty"` + Depricateprefix string `json:"depricateprefix,omitempty"` + Decrementprefixlifetimes string `json:"decrementprefixlifetimes,omitempty"` + Prefixvalidelifetime int `json:"prefixvalidelifetime,omitempty"` + Prefixpreferredlifetime int `json:"prefixpreferredlifetime,omitempty"` + Prefixcurrvalidelft string `json:"prefixcurrvalidelft,omitempty"` + Prefixcurrpreferredlft string `json:"prefixcurrpreferredlft,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vlanchannelbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Tagged bool `json:"tagged,omitempty"` + Id int `json:"id,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` +} + +type Fisbinding struct { + Name string `json:"name,omitempty"` +} + +type Ipsetipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` +} + +type Ipv6 struct { + Ralearning string `json:"ralearning,omitempty"` + Routerredirection string `json:"routerredirection,omitempty"` + Ndbasereachtime int `json:"ndbasereachtime,omitempty"` + Ndretransmissiontime int `json:"ndretransmissiontime,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Td int `json:"td"` + Dodad string `json:"dodad,omitempty"` + Usipnatprefix string `json:"usipnatprefix,omitempty"` + Basereachtime string `json:"basereachtime,omitempty"` + Reachtime string `json:"reachtime,omitempty"` + Ndreachtime string `json:"ndreachtime,omitempty"` + Retransmissiontime string `json:"retransmissiontime,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnatbinding struct { + Name string `json:"name,omitempty"` +} + +type Vxlaniptunnelbinding struct { + Id int `json:"id,omitempty"` + Tunnel string `json:"tunnel,omitempty"` +} + +type Rnatglobalbinding struct { +} + +type Vlanip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td uint32 `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id uint32 `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Bridgegroupipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td uint32 `json:"td,omitempty"` + Netmask string `json:"netmask,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id uint32 `json:"id,omitempty"` +} + +type Iptunnel struct { + Name string `json:"name,omitempty"` + Remote string `json:"remote,omitempty"` + Remotesubnetmask string `json:"remotesubnetmask,omitempty"` + Local string `json:"local,omitempty"` + Protocol string `json:"protocol,omitempty"` + Vnid int `json:"vnid,omitempty"` + Vlantagging string `json:"vlantagging,omitempty"` + Destport int `json:"destport,omitempty"` + Tosinherit string `json:"tosinherit,omitempty"` + Grepayload string `json:"grepayload,omitempty"` + Ipsecprofilename string `json:"ipsecprofilename,omitempty"` + Vlan int `json:"vlan,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Sysname string `json:"sysname,omitempty"` + Type string `json:"type,omitempty"` + Encapip string `json:"encapip,omitempty"` + Channel string `json:"channel,omitempty"` + Tunneltype string `json:"tunneltype,omitempty"` + Ipsectunnelstatus string `json:"ipsectunnelstatus,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Netbridgensip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Name string `json:"name,omitempty"` +} + +type Portallocation struct { + Srcip string `json:"srcip,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Protocol int `json:"protocol,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Freeports string `json:"freeports,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnat struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Aclname string `json:"aclname,omitempty"` + Td int `json:"td"` + Ownergroup string `json:"ownergroup,omitempty"` + Name string `json:"name,omitempty"` + Redirectport int `json:"redirectport,omitempty"` + Natip string `json:"natip,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Bridgegroup struct { + Id int `json:"id,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Flags string `json:"flags,omitempty"` + Portbitmap string `json:"portbitmap,omitempty"` + Tagbitmap string `json:"tagbitmap,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Tagifaces string `json:"tagifaces,omitempty"` + Rnat string `json:"rnat,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vxlanvlanmapvxlanbinding struct { + Vxlan int `json:"vxlan,omitempty"` + Vlan []string `json:"vlan,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rnatsession struct { + Network string `json:"network,omitempty"` + Netmask string `json:"netmask,omitempty"` + Natip string `json:"natip,omitempty"` + Aclname string `json:"aclname,omitempty"` +} + +type Vlaninterfacebinding struct { + Ifnum string `json:"ifnum,omitempty"` + Tagged bool `json:"tagged,omitempty"` + Id int `json:"id,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` +} + +type Vrid6nsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vridbinding struct { + Id int `json:"id,omitempty"` +} + +type Vxlannsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Id int `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Bridgegroupnsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Td int `json:"td,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Id int `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Vridchannelbinding struct { + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Vxlannsipbinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Id int `json:"id,omitempty"` +} + +type Channelinterfacebinding struct { + Ifnum []string `json:"ifnum,omitempty"` + Lamode string `json:"lamode,omitempty"` + Slavestate int `json:"slavestate,omitempty"` + Slavemedia int `json:"slavemedia,omitempty"` + Slavespeed int `json:"slavespeed,omitempty"` + Slaveduplex int `json:"slaveduplex,omitempty"` + Slaveflowctl int `json:"slaveflowctl,omitempty"` + Slavetime int `json:"slavetime,omitempty"` + Lractiveintf int `json:"lractiveintf,omitempty"` + Svmcmd int `json:"svmcmd,omitempty"` + Id string `json:"id,omitempty"` +} + +type Netprofilesrcportsetbinding struct { + Srcportrange string `json:"srcportrange,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rnatparam struct { + Tcpproxy string `json:"tcpproxy,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vridnsip6binding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} + +type Appalgparam struct { + Pptpgreidletimeout int `json:"pptpgreidletimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ptp struct { + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rnatipbinding struct { + Natip string `json:"natip,omitempty"` + Td uint32 `json:"td,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vridtrackinterfacebinding struct { + Trackifnum string `json:"trackifnum,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` +} diff --git a/nitrogo/models/ns.go b/nitrogo/models/ns.go new file mode 100644 index 0000000..4c91d6b --- /dev/null +++ b/nitrogo/models/ns.go @@ -0,0 +1,1790 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Nshmackey struct { + Name string `json:"name,omitempty"` + Digest string `json:"digest,omitempty"` + Keyvalue string `json:"keyvalue,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsconsoleloginprompt struct { + Promptstring string `json:"promptstring,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nscqaparam struct { + Harqretxdelay int `json:"harqretxdelay,omitempty"` + Net1label string `json:"net1label,omitempty"` + Minrttnet1 int `json:"minrttnet1,omitempty"` + Lr1coeflist string `json:"lr1coeflist,omitempty"` + Lr1probthresh float64 `json:"lr1probthresh,omitempty"` + Net1cclscale string `json:"net1cclscale,omitempty"` + Net1csqscale string `json:"net1csqscale,omitempty"` + Net1logcoef string `json:"net1logcoef,omitempty"` + Net2label string `json:"net2label,omitempty"` + Minrttnet2 int `json:"minrttnet2,omitempty"` + Lr2coeflist string `json:"lr2coeflist,omitempty"` + Lr2probthresh float64 `json:"lr2probthresh,omitempty"` + Net2cclscale string `json:"net2cclscale,omitempty"` + Net2csqscale string `json:"net2csqscale,omitempty"` + Net2logcoef string `json:"net2logcoef,omitempty"` + Net3label string `json:"net3label,omitempty"` + Minrttnet3 int `json:"minrttnet3,omitempty"` + Net3cclscale string `json:"net3cclscale,omitempty"` + Net3csqscale string `json:"net3csqscale,omitempty"` + Net3logcoef string `json:"net3logcoef,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsicapprofile struct { + Name string `json:"name,omitempty"` + Preview string `json:"preview,omitempty"` + Previewlength int `json:"previewlength,omitempty"` + Uri string `json:"uri,omitempty"` + Hostheader string `json:"hostheader,omitempty"` + Useragent string `json:"useragent,omitempty"` + Mode string `json:"mode,omitempty"` + Queryparams string `json:"queryparams,omitempty"` + Connectionkeepalive string `json:"connectionkeepalive,omitempty"` + Allow204 string `json:"allow204,omitempty"` + Inserticapheaders string `json:"inserticapheaders,omitempty"` + Inserthttprequest string `json:"inserthttprequest,omitempty"` + Reqtimeout int `json:"reqtimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Logaction string `json:"logaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nspbrs struct { +} + +type Nssimpleacl struct { + Aclname string `json:"aclname,omitempty"` + Aclaction string `json:"aclaction,omitempty"` + Td int `json:"td,omitempty"` + Srcip string `json:"srcip,omitempty"` + Destport int `json:"destport,omitempty"` + Protocol string `json:"protocol,omitempty"` + Ttl int `json:"ttl,omitempty"` + Estsessions bool `json:"estsessions,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsweblogparam struct { + Buffersizemb int `json:"buffersizemb,omitempty"` + Customreqhdrs []string `json:"customreqhdrs,omitempty"` + Customrsphdrs []string `json:"customrsphdrs,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsdiameter struct { + Identity string `json:"identity,omitempty"` + Realm string `json:"realm,omitempty"` + Serverclosepropagation string `json:"serverclosepropagation,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsextensionbinding struct { + Name string `json:"name,omitempty"` +} + +type Nslicenseserver struct { + Licenseserverip string `json:"licenseserverip,omitempty"` + Servername string `json:"servername,omitempty"` + Port int `json:"port,omitempty"` + Forceupdateip bool `json:"forceupdateip,omitempty"` + Licensemode string `json:"licensemode,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Deviceprofilename string `json:"deviceprofilename,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Status string `json:"status,omitempty"` + Grace string `json:"grace,omitempty"` + Gptimeleft string `json:"gptimeleft,omitempty"` + Type string `json:"type,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitidentifiernslimitsessionsbinding struct { + Limitidentifier string `json:"limitidentifier,omitempty"` +} + +type Nsrpcnode struct { + Ipaddress string `json:"ipaddress,omitempty"` + Password string `json:"password,omitempty"` + Srcip string `json:"srcip,omitempty"` + Secure string `json:"secure,omitempty"` + Validatecert string `json:"validatecert,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsspparams struct { + Basethreshold int `json:"basethreshold,omitempty"` + Throttle string `json:"throttle,omitempty"` + Table0 string `json:"table0,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsvariablevalues struct { + Name string `json:"name,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Variablekey string `json:"variablekey,omitempty"` + Variablevalue string `json:"variablevalue,omitempty"` + Variabledata string `json:"variabledata,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsappflowparam struct { + Templaterefresh int `json:"templaterefresh,omitempty"` + Udppmtu int `json:"udppmtu,omitempty"` + Httpurl string `json:"httpurl,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httpreferer string `json:"httpreferer,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httphost string `json:"httphost,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Clienttrafficonly string `json:"clienttrafficonly,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsassignment struct { + Name string `json:"name,omitempty"` + Variable string `json:"variable,omitempty"` + Set string `json:"set,omitempty"` + Add string `json:"Add,omitempty"` + Sub string `json:"sub,omitempty"` + Append string `json:"append,omitempty"` + Clear bool `json:"clear,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nshttpparam struct { + Dropinvalreqs string `json:"dropinvalreqs,omitempty"` + Markhttp09inval string `json:"markhttp09inval,omitempty"` + Markconnreqinval string `json:"markconnreqinval,omitempty"` + Insnssrvrhdr string `json:"insnssrvrhdr,omitempty"` + Nssrvrhdr string `json:"nssrvrhdr,omitempty"` + Logerrresp string `json:"logerrresp,omitempty"` + Conmultiplex string `json:"conmultiplex,omitempty"` + Maxreusepool int `json:"maxreusepool"` + Http2serverside string `json:"http2serverside,omitempty"` + Ignoreconnectcodingscheme string `json:"ignoreconnectcodingscheme,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimerautoscalepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Vserver string `json:"vserver,omitempty"` + Samplesize int `json:"samplesize,omitempty"` + Threshold int `json:"threshold,omitempty"` + Name string `json:"name,omitempty"` +} + +type Nstrafficdomainvlanbinding struct { + Vlan int `json:"vlan,omitempty"` + Td int `json:"td,omitempty"` +} + +type Nslicenseproxyserver struct { + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Port int `json:"port,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsratecontrol struct { + Tcpthreshold int `json:"tcpthreshold"` + Udpthreshold int `json:"udpthreshold"` + Icmpthreshold int `json:"icmpthreshold"` + Tcprstthreshold int `json:"tcprstthreshold"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsservicefunction struct { + Servicefunctionname string `json:"servicefunctionname,omitempty"` + Ingressvlan int `json:"ingressvlan,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimer struct { + Name string `json:"name,omitempty"` + Interval int `json:"interval,omitempty"` + Unit string `json:"unit,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsversion struct { + Installedversion bool `json:"installedversion,omitempty"` + Version string `json:"version,omitempty"` + Mode string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nscapacity struct { + Bandwidth int `json:"bandwidth,omitempty"` + Platform string `json:"platform,omitempty"` + Vcpu bool `json:"vcpu,omitempty"` + Edition string `json:"edition,omitempty"` + Unit string `json:"unit,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Actualbandwidth string `json:"actualbandwidth,omitempty"` + Vcpucount string `json:"vcpucount,omitempty"` + Maxvcpucount string `json:"maxvcpucount,omitempty"` + Maxbandwidth string `json:"maxbandwidth,omitempty"` + Minbandwidth string `json:"minbandwidth,omitempty"` + Instancecount string `json:"instancecount,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitidentifierbinding struct { + Limitidentifier string `json:"limitidentifier,omitempty"` +} + +type Nsmode struct { + Mode []string `json:"mode,omitempty"` + Fr string `json:"fr,omitempty"` + L2 string `json:"l2,omitempty"` + Usip string `json:"usip,omitempty"` + Cka string `json:"cka,omitempty"` + Tcpb string `json:"tcpb,omitempty"` + Mbf string `json:"mbf,omitempty"` + Edge string `json:"edge,omitempty"` + Usnip string `json:"usnip,omitempty"` + L3 string `json:"l3,omitempty"` + Pmtud string `json:"pmtud,omitempty"` + Mediaclassification string `json:"mediaclassification,omitempty"` + Sradv string `json:"sradv,omitempty"` + Dradv string `json:"dradv,omitempty"` + Iradv string `json:"iradv,omitempty"` + Sradv6 string `json:"sradv6,omitempty"` + Dradv6 string `json:"dradv6,omitempty"` + Bridgebpdus string `json:"bridgebpdus,omitempty"` + Singleip string `json:"single_ip,omitempty"` + Ulfd string `json:"ulfd,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nspartitionbridgegroupbinding struct { + Bridgegroup int `json:"bridgegroup,omitempty"` + Partitionname string `json:"partitionname,omitempty"` +} + +type Nspartitionvlanbinding struct { + Vlan int `json:"vlan,omitempty"` + Partitionname string `json:"partitionname,omitempty"` +} + +type Nspartitionmac struct { + Partitionmac string `json:"partitionmac,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsservicepathnsservicefunctionbinding struct { + Servicefunction string `json:"servicefunction,omitempty"` + Index int `json:"index,omitempty"` + Servicepathname string `json:"servicepathname,omitempty"` +} + +type Nsconfig struct { + Force bool `json:"force,omitempty"` + Level string `json:"level,omitempty"` + Rbaconfig string `json:"rbaconfig,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nsvlan int `json:"nsvlan,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Tagged string `json:"tagged,omitempty"` + Httpport []int `json:"httpport,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cookieversion string `json:"cookieversion,omitempty"` + Securecookie string `json:"securecookie,omitempty"` + Pmtumin int `json:"pmtumin,omitempty"` + Pmtutimeout int `json:"pmtutimeout,omitempty"` + Ftpportrange string `json:"ftpportrange,omitempty"` + Crportrange string `json:"crportrange,omitempty"` + Timezone string `json:"timezone,omitempty"` + Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` + Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` + Grantquotaspillover int `json:"grantquotaspillover,omitempty"` + Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` + Securemanagementtraffic string `json:"securemanagementtraffic,omitempty"` + Securemanagementtd int `json:"securemanagementtd,omitempty"` + All bool `json:"all,omitempty"` + Config1 string `json:"config1,omitempty"` + Config2 string `json:"config2,omitempty"` + Outtype string `json:"outtype,omitempty"` + Template bool `json:"template,omitempty"` + Ignoredevicespecific bool `json:"ignoredevicespecific,omitempty"` + Weakpassword bool `json:"weakpassword,omitempty"` + Changedpassword bool `json:"changedpassword,omitempty"` + Config string `json:"config,omitempty"` + Configfile string `json:"configfile,omitempty"` + Responsefile string `json:"responsefile,omitempty"` + Async bool `json:"Async,omitempty"` + Message string `json:"message,omitempty"` + Mappedip string `json:"mappedip,omitempty"` + Range string `json:"range,omitempty"` + Svmcmd string `json:"svmcmd,omitempty"` + Systemtype string `json:"systemtype,omitempty"` + Primaryip string `json:"primaryip,omitempty"` + Primaryip6 string `json:"primaryip6,omitempty"` + Flags string `json:"flags,omitempty"` + Lastconfigchangedtime string `json:"lastconfigchangedtime,omitempty"` + Lastconfigsavetime string `json:"lastconfigsavetime,omitempty"` + Currentsytemtime string `json:"currentsytemtime,omitempty"` + Systemtime string `json:"systemtime,omitempty"` + Configchanged string `json:"configchanged,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` + Id string `json:"id,omitempty"` +} + +type Nsencryptionparams struct { + Method string `json:"method,omitempty"` + Keyvalue string `json:"keyvalue,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsfeature struct { + Feature []string `json:"feature,omitempty"` + Wl string `json:"wl,omitempty"` + Sp string `json:"sp,omitempty"` + Lb string `json:"lb,omitempty"` + Cs string `json:"cs,omitempty"` + Cr string `json:"cr,omitempty"` + Cmp string `json:"cmp,omitempty"` + Ssl string `json:"ssl,omitempty"` + Gslb string `json:"gslb,omitempty"` + Cf string `json:"cf,omitempty"` + Ic string `json:"ic,omitempty"` + Sslvpn string `json:"sslvpn,omitempty"` + Aaa string `json:"aaa,omitempty"` + Ospf string `json:"ospf,omitempty"` + Rip string `json:"rip,omitempty"` + Bgp string `json:"bgp,omitempty"` + Rewrite string `json:"rewrite,omitempty"` + Ipv6pt string `json:"ipv6pt,omitempty"` + Appfw string `json:"appfw,omitempty"` + Responder string `json:"responder,omitempty"` + Push string `json:"push,omitempty"` + Appflow string `json:"appflow,omitempty"` + Cloudbridge string `json:"cloudbridge,omitempty"` + Isis string `json:"isis,omitempty"` + Ch string `json:"ch,omitempty"` + Appqoe string `json:"appqoe,omitempty"` + Contentaccelerator string `json:"contentaccelerator,omitempty"` + Feo string `json:"feo,omitempty"` + Lsn string `json:"lsn,omitempty"` + Rdpproxy string `json:"rdpproxy,omitempty"` + Rep string `json:"rep,omitempty"` + Videooptimization string `json:"videooptimization,omitempty"` + Forwardproxy string `json:"forwardproxy,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Adaptivetcp string `json:"adaptivetcp,omitempty"` + Cqa string `json:"cqa,omitempty"` + Ci string `json:"ci,omitempty"` + Bot string `json:"bot,omitempty"` + Apigateway string `json:"apigateway,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsip struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Type string `json:"type,omitempty"` + Arp string `json:"arp,omitempty"` + Icmp string `json:"icmp,omitempty"` + Vserver string `json:"vserver,omitempty"` + Telnet string `json:"telnet,omitempty"` + Ftp string `json:"ftp,omitempty"` + Gui string `json:"gui,omitempty"` + Ssh string `json:"ssh,omitempty"` + Snmp string `json:"snmp,omitempty"` + Mgmtaccess string `json:"mgmtaccess,omitempty"` + Restrictaccess string `json:"restrictaccess,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Decrementttl string `json:"decrementttl,omitempty"` + Ospf string `json:"ospf,omitempty"` + Bgp string `json:"bgp,omitempty"` + Rip string `json:"rip,omitempty"` + Hostroute string `json:"hostroute,omitempty"` + Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` + Networkroute string `json:"networkroute,omitempty"` + Tag int `json:"tag,omitempty"` + Hostrtgw string `json:"hostrtgw,omitempty"` + Metric int `json:"metric,omitempty"` + Vserverrhilevel string `json:"vserverrhilevel,omitempty"` + Ospflsatype string `json:"ospflsatype,omitempty"` + Ospfarea int `json:"ospfarea,omitempty"` + State string `json:"state,omitempty"` + Vrid int `json:"vrid,omitempty"` + Icmpresponse string `json:"icmpresponse,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Arpresponse string `json:"arpresponse,omitempty"` + Ownerdownresponse string `json:"ownerdownresponse,omitempty"` + Td int `json:"td,omitempty"` + Arpowner int `json:"arpowner,omitempty"` + Mptcpadvertise string `json:"mptcpadvertise,omitempty"` + Flags string `json:"flags,omitempty"` + Hostrtgwact string `json:"hostrtgwact,omitempty"` + Ospfareaval string `json:"ospfareaval,omitempty"` + Viprtadv2bsd string `json:"viprtadv2bsd,omitempty"` + Vipvsercount string `json:"vipvsercount,omitempty"` + Vipvserdowncount string `json:"vipvserdowncount,omitempty"` + Vipvsrvrrhiactivecount string `json:"vipvsrvrrhiactivecount,omitempty"` + Vipvsrvrrhiactiveupcount string `json:"vipvsrvrrhiactiveupcount,omitempty"` + Freeports string `json:"freeports,omitempty"` + Iptype string `json:"iptype,omitempty"` + Operationalarpowner string `json:"operationalarpowner,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitselector struct { + Selectorname string `json:"selectorname,omitempty"` + Rule []string `json:"rule,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimeout struct { + Zombie int `json:"zombie,omitempty"` + Client int `json:"client"` + Server int `json:"server"` + Httpclient int `json:"httpclient"` + Httpserver int `json:"httpserver"` + Tcpclient int `json:"tcpclient"` + Tcpserver int `json:"tcpserver"` + Anyclient int `json:"anyclient"` + Anyserver int `json:"anyserver"` + Anytcpclient int `json:"anytcpclient"` + Anytcpserver int `json:"anytcpserver"` + Halfclose int `json:"halfclose,omitempty"` + Nontcpzombie int `json:"nontcpzombie,omitempty"` + Reducedfintimeout int `json:"reducedfintimeout,omitempty"` + Reducedrsttimeout int `json:"reducedrsttimeout"` + Newconnidletimeout int `json:"newconnidletimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimerbinding struct { + Name string `json:"name,omitempty"` +} + +type Nsaptlicense struct { + Serialno string `json:"serialno,omitempty"` + Useproxy string `json:"useproxy,omitempty"` + Id string `json:"id,omitempty"` + Sessionid string `json:"sessionid,omitempty"` + Bindtype string `json:"bindtype,omitempty"` + Countavailable string `json:"countavailable,omitempty"` + Licensedir string `json:"licensedir,omitempty"` + Response string `json:"response,omitempty"` + Counttotal string `json:"counttotal,omitempty"` + Name string `json:"name,omitempty"` + Relevance string `json:"relevance,omitempty"` + Datepurchased string `json:"datepurchased,omitempty"` + Datesa string `json:"datesa,omitempty"` + Dateexp string `json:"dateexp,omitempty"` + Features string `json:"features,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nschannelparam struct { + Vfautorecover string `json:"vfautorecover,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsip6 struct { + Ipv6address string `json:"ipv6address,omitempty"` + Scope string `json:"scope,omitempty"` + Type string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Nd string `json:"nd,omitempty"` + Icmp string `json:"icmp,omitempty"` + Vserver string `json:"vserver,omitempty"` + Telnet string `json:"telnet,omitempty"` + Ftp string `json:"ftp,omitempty"` + Gui string `json:"gui,omitempty"` + Ssh string `json:"ssh,omitempty"` + Snmp string `json:"snmp,omitempty"` + Mgmtaccess string `json:"mgmtaccess,omitempty"` + Restrictaccess string `json:"restrictaccess,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Decrementhoplimit string `json:"decrementhoplimit,omitempty"` + Hostroute string `json:"hostroute,omitempty"` + Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` + Networkroute string `json:"networkroute,omitempty"` + Tag int `json:"tag,omitempty"` + Ip6hostrtgw string `json:"ip6hostrtgw,omitempty"` + Metric int `json:"metric,omitempty"` + Vserverrhilevel string `json:"vserverrhilevel,omitempty"` + Ospf6lsatype string `json:"ospf6lsatype,omitempty"` + Ospfarea int `json:"ospfarea,omitempty"` + State string `json:"state,omitempty"` + Map string `json:"map,omitempty"` + Vrid6 int `json:"vrid6,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Ownerdownresponse string `json:"ownerdownresponse,omitempty"` + Td int `json:"td,omitempty"` + Ndowner int `json:"ndowner,omitempty"` + Mptcpadvertise string `json:"mptcpadvertise,omitempty"` + Icmpresponse string `json:"icmpresponse,omitempty"` + Iptype string `json:"iptype,omitempty"` + Curstate string `json:"curstate,omitempty"` + Viprtadv2bsd string `json:"viprtadv2bsd,omitempty"` + Vipvsercount string `json:"vipvsercount,omitempty"` + Vipvserdowncount string `json:"vipvserdowncount,omitempty"` + Systemtype string `json:"systemtype,omitempty"` + Operationalndowner string `json:"operationalndowner,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsjob struct { + Id int `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Status string `json:"status,omitempty"` + Progress string `json:"progress,omitempty"` + Timeelapsed string `json:"timeelapsed,omitempty"` + Errorcode string `json:"errorcode,omitempty"` + Message string `json:"message,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslicense struct { + Wl string `json:"wl,omitempty"` + Sp string `json:"sp,omitempty"` + Lb string `json:"lb,omitempty"` + Cs string `json:"cs,omitempty"` + Cr string `json:"cr,omitempty"` + Cmp string `json:"cmp,omitempty"` + Delta string `json:"delta,omitempty"` + Ssl string `json:"ssl,omitempty"` + Gslb string `json:"gslb,omitempty"` + Gslbp string `json:"gslbp,omitempty"` + Routing string `json:"routing,omitempty"` + Cf string `json:"cf,omitempty"` + Contentaccelerator string `json:"contentaccelerator,omitempty"` + Ic string `json:"ic,omitempty"` + Sslvpn string `json:"sslvpn,omitempty"` + Fsslvpnusers string `json:"f_sslvpn_users,omitempty"` + Ficausers string `json:"f_ica_users,omitempty"` + Aaa string `json:"aaa,omitempty"` + Ospf string `json:"ospf,omitempty"` + Rip string `json:"rip,omitempty"` + Bgp string `json:"bgp,omitempty"` + Rewrite string `json:"rewrite,omitempty"` + Ipv6pt string `json:"ipv6pt,omitempty"` + Appfw string `json:"appfw,omitempty"` + Responder string `json:"responder,omitempty"` + Agee string `json:"agee,omitempty"` + Nsxn string `json:"nsxn,omitempty"` + Modelid string `json:"modelid,omitempty"` + Push string `json:"push,omitempty"` + Appflow string `json:"appflow,omitempty"` + Cloudbridge string `json:"cloudbridge,omitempty"` + Cloudbridgeappliance string `json:"cloudbridgeappliance,omitempty"` + Cloudextenderappliance string `json:"cloudextenderappliance,omitempty"` + Isis string `json:"isis,omitempty"` + Cluster string `json:"cluster,omitempty"` + Ch string `json:"ch,omitempty"` + Appqoe string `json:"appqoe,omitempty"` + Appflowica string `json:"appflowica,omitempty"` + Isstandardlic string `json:"isstandardlic,omitempty"` + Isenterpriselic string `json:"isenterpriselic,omitempty"` + Isplatinumlic string `json:"isplatinumlic,omitempty"` + Issgwylic string `json:"issgwylic,omitempty"` + Isswglic string `json:"isswglic,omitempty"` + Feo string `json:"feo,omitempty"` + Lsn string `json:"lsn,omitempty"` + Licensingmode string `json:"licensingmode,omitempty"` + Cloudsubscriptionimage string `json:"cloudsubscriptionimage,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Daystolasenforcement string `json:"daystolasenforcement,omitempty"` + Rdpproxy string `json:"rdpproxy,omitempty"` + Rep string `json:"rep,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Videooptimization string `json:"videooptimization,omitempty"` + Forwardproxy string `json:"forwardproxy,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Remotecontentinspection string `json:"remotecontentinspection,omitempty"` + Adaptivetcp string `json:"adaptivetcp,omitempty"` + Cqa string `json:"cqa,omitempty"` + Bot string `json:"bot,omitempty"` + Apigateway string `json:"apigateway,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslicenseactivationdata struct { + Filename string `json:"filename,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsmigration struct { + Dumpsession string `json:"dumpsession,omitempty"` + Migrationstatus string `json:"migrationstatus,omitempty"` + Migrationstarttime string `json:"migrationstarttime,omitempty"` + Migrationendtime string `json:"migrationendtime,omitempty"` + Migrationrollbackstarttime string `json:"migrationrollbackstarttime,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport string `json:"srcport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Timeout string `json:"timeout,omitempty"` + Migdfdsessionsallocated string `json:"migdfdsessionsallocated,omitempty"` + Migdfdsessionsactive string `json:"migdfdsessionsactive,omitempty"` + Migl4sessionsallocated string `json:"migl4sessionsallocated,omitempty"` + Migl4sessionsactive string `json:"migl4sessionsactive,omitempty"` + Migdfdsessionsallocatedrollback string `json:"migdfdsessionsallocatedrollback,omitempty"` + Migdfdsessionsactiverollback string `json:"migdfdsessionsactiverollback,omitempty"` + Migl4sessionsallocatedrollback string `json:"migl4sessionsallocatedrollback,omitempty"` + Migl4sessionsactiverollback string `json:"migl4sessionsactiverollback,omitempty"` + Mighastateflag string `json:"mighastateflag,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsservicepath struct { + Servicepathname string `json:"servicepathname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsacl6 struct { + Acl6name string `json:"acl6name,omitempty"` + Acl6action string `json:"acl6action,omitempty"` + Td int `json:"td,omitempty"` + Srcipv6 bool `json:"srcipv6,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipv6val string `json:"srcipv6val,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + Destipv6 bool `json:"destipv6,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipv6val string `json:"destipv6val,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Ttl int `json:"ttl,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Interface string `json:"Interface,omitempty"` + Established bool `json:"established,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Dfdhash string `json:"dfdhash,omitempty"` + Dfdprefix int `json:"dfdprefix,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Stateful string `json:"stateful,omitempty"` + Logstate string `json:"logstate,omitempty"` + Ratelimit int `json:"ratelimit,omitempty"` + Aclaction string `json:"aclaction,omitempty"` + Newname string `json:"newname,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Hits string `json:"hits,omitempty"` + Aclassociate string `json:"aclassociate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsappflowcollector struct { + Name string `json:"name,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsconfigview struct { + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslaslicense struct { + Filename string `json:"filename,omitempty"` + Filelocation string `json:"filelocation,omitempty"` + Fixedbandwidth bool `json:"fixedbandwidth,omitempty"` + Status string `json:"status,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Renewalprev string `json:"renewalprev,omitempty"` + Renewalnext string `json:"renewalnext,omitempty"` + Renewalprevdate string `json:"renewalprevdate,omitempty"` + Renewalnextdate string `json:"renewalnextdate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslicenseserverpool struct { + Getalllicenses bool `json:"getalllicenses,omitempty"` + Instancetotal string `json:"instancetotal,omitempty"` + Instanceavailable string `json:"instanceavailable,omitempty"` + Standardbandwidthtotal string `json:"standardbandwidthtotal,omitempty"` + Standardbandwidthavailable string `json:"standardbandwidthavailable,omitempty"` + Enterprisebandwidthtotal string `json:"enterprisebandwidthtotal,omitempty"` + Enterprisebandwidthavailable string `json:"enterprisebandwidthavailable,omitempty"` + Platinumbandwidthtotal string `json:"platinumbandwidthtotal,omitempty"` + Platinumbandwidthavailable string `json:"platinumbandwidthavailable,omitempty"` + Standardcputotal string `json:"standardcputotal,omitempty"` + Standardcpuavailable string `json:"standardcpuavailable,omitempty"` + Enterprisecputotal string `json:"enterprisecputotal,omitempty"` + Enterprisecpuavailable string `json:"enterprisecpuavailable,omitempty"` + Platinumcputotal string `json:"platinumcputotal,omitempty"` + Platinumcpuavailable string `json:"platinumcpuavailable,omitempty"` + Cpxinstancetotal string `json:"cpxinstancetotal,omitempty"` + Cpxinstanceavailable string `json:"cpxinstanceavailable,omitempty"` + Vpx1stotal string `json:"vpx1stotal,omitempty"` + Vpx1savailable string `json:"vpx1savailable,omitempty"` + Vpx1ptotal string `json:"vpx1ptotal,omitempty"` + Vpx1pavailable string `json:"vpx1pavailable,omitempty"` + Vpx5stotal string `json:"vpx5stotal,omitempty"` + Vpx5savailable string `json:"vpx5savailable,omitempty"` + Vpx5ptotal string `json:"vpx5ptotal,omitempty"` + Vpx5pavailable string `json:"vpx5pavailable,omitempty"` + Vpx10stotal string `json:"vpx10stotal,omitempty"` + Vpx10savailable string `json:"vpx10savailable,omitempty"` + Vpx10etotal string `json:"vpx10etotal,omitempty"` + Vpx10eavailable string `json:"vpx10eavailable,omitempty"` + Vpx10ptotal string `json:"vpx10ptotal,omitempty"` + Vpx10pavailable string `json:"vpx10pavailable,omitempty"` + Vpx25stotal string `json:"vpx25stotal,omitempty"` + Vpx25savailable string `json:"vpx25savailable,omitempty"` + Vpx25etotal string `json:"vpx25etotal,omitempty"` + Vpx25eavailable string `json:"vpx25eavailable,omitempty"` + Vpx25ptotal string `json:"vpx25ptotal,omitempty"` + Vpx25pavailable string `json:"vpx25pavailable,omitempty"` + Vpx50stotal string `json:"vpx50stotal,omitempty"` + Vpx50savailable string `json:"vpx50savailable,omitempty"` + Vpx50etotal string `json:"vpx50etotal,omitempty"` + Vpx50eavailable string `json:"vpx50eavailable,omitempty"` + Vpx50ptotal string `json:"vpx50ptotal,omitempty"` + Vpx50pavailable string `json:"vpx50pavailable,omitempty"` + Vpx100stotal string `json:"vpx100stotal,omitempty"` + Vpx100savailable string `json:"vpx100savailable,omitempty"` + Vpx100etotal string `json:"vpx100etotal,omitempty"` + Vpx100eavailable string `json:"vpx100eavailable,omitempty"` + Vpx100ptotal string `json:"vpx100ptotal,omitempty"` + Vpx100pavailable string `json:"vpx100pavailable,omitempty"` + Vpx200stotal string `json:"vpx200stotal,omitempty"` + Vpx200savailable string `json:"vpx200savailable,omitempty"` + Vpx200etotal string `json:"vpx200etotal,omitempty"` + Vpx200eavailable string `json:"vpx200eavailable,omitempty"` + Vpx200ptotal string `json:"vpx200ptotal,omitempty"` + Vpx200pavailable string `json:"vpx200pavailable,omitempty"` + Vpx500stotal string `json:"vpx500stotal,omitempty"` + Vpx500savailable string `json:"vpx500savailable,omitempty"` + Vpx500etotal string `json:"vpx500etotal,omitempty"` + Vpx500eavailable string `json:"vpx500eavailable,omitempty"` + Vpx500ptotal string `json:"vpx500ptotal,omitempty"` + Vpx500pavailable string `json:"vpx500pavailable,omitempty"` + Vpx1000stotal string `json:"vpx1000stotal,omitempty"` + Vpx1000savailable string `json:"vpx1000savailable,omitempty"` + Vpx1000etotal string `json:"vpx1000etotal,omitempty"` + Vpx1000eavailable string `json:"vpx1000eavailable,omitempty"` + Vpx1000ptotal string `json:"vpx1000ptotal,omitempty"` + Vpx1000pavailable string `json:"vpx1000pavailable,omitempty"` + Vpx2000ptotal string `json:"vpx2000ptotal,omitempty"` + Vpx2000pavailable string `json:"vpx2000pavailable,omitempty"` + Vpx3000stotal string `json:"vpx3000stotal,omitempty"` + Vpx3000savailable string `json:"vpx3000savailable,omitempty"` + Vpx3000etotal string `json:"vpx3000etotal,omitempty"` + Vpx3000eavailable string `json:"vpx3000eavailable,omitempty"` + Vpx3000ptotal string `json:"vpx3000ptotal,omitempty"` + Vpx3000pavailable string `json:"vpx3000pavailable,omitempty"` + Vpx4000ptotal string `json:"vpx4000ptotal,omitempty"` + Vpx4000pavailable string `json:"vpx4000pavailable,omitempty"` + Vpx5000stotal string `json:"vpx5000stotal,omitempty"` + Vpx5000savailable string `json:"vpx5000savailable,omitempty"` + Vpx5000etotal string `json:"vpx5000etotal,omitempty"` + Vpx5000eavailable string `json:"vpx5000eavailable,omitempty"` + Vpx5000ptotal string `json:"vpx5000ptotal,omitempty"` + Vpx5000pavailable string `json:"vpx5000pavailable,omitempty"` + Vpx8000stotal string `json:"vpx8000stotal,omitempty"` + Vpx8000savailable string `json:"vpx8000savailable,omitempty"` + Vpx8000etotal string `json:"vpx8000etotal,omitempty"` + Vpx8000eavailable string `json:"vpx8000eavailable,omitempty"` + Vpx8000ptotal string `json:"vpx8000ptotal,omitempty"` + Vpx8000pavailable string `json:"vpx8000pavailable,omitempty"` + Vpx10000stotal string `json:"vpx10000stotal,omitempty"` + Vpx10000savailable string `json:"vpx10000savailable,omitempty"` + Vpx10000etotal string `json:"vpx10000etotal,omitempty"` + Vpx10000eavailable string `json:"vpx10000eavailable,omitempty"` + Vpx10000ptotal string `json:"vpx10000ptotal,omitempty"` + Vpx10000pavailable string `json:"vpx10000pavailable,omitempty"` + Vpx15000stotal string `json:"vpx15000stotal,omitempty"` + Vpx15000savailable string `json:"vpx15000savailable,omitempty"` + Vpx15000etotal string `json:"vpx15000etotal,omitempty"` + Vpx15000eavailable string `json:"vpx15000eavailable,omitempty"` + Vpx15000ptotal string `json:"vpx15000ptotal,omitempty"` + Vpx15000pavailable string `json:"vpx15000pavailable,omitempty"` + Vpx25000stotal string `json:"vpx25000stotal,omitempty"` + Vpx25000savailable string `json:"vpx25000savailable,omitempty"` + Vpx25000etotal string `json:"vpx25000etotal,omitempty"` + Vpx25000eavailable string `json:"vpx25000eavailable,omitempty"` + Vpx25000ptotal string `json:"vpx25000ptotal,omitempty"` + Vpx25000pavailable string `json:"vpx25000pavailable,omitempty"` + Vpx40000stotal string `json:"vpx40000stotal,omitempty"` + Vpx40000savailable string `json:"vpx40000savailable,omitempty"` + Vpx40000etotal string `json:"vpx40000etotal,omitempty"` + Vpx40000eavailable string `json:"vpx40000eavailable,omitempty"` + Vpx40000ptotal string `json:"vpx40000ptotal,omitempty"` + Vpx40000pavailable string `json:"vpx40000pavailable,omitempty"` + Vpx100000stotal string `json:"vpx100000stotal,omitempty"` + Vpx100000savailable string `json:"vpx100000savailable,omitempty"` + Vpx100000etotal string `json:"vpx100000etotal,omitempty"` + Vpx100000eavailable string `json:"vpx100000eavailable,omitempty"` + Vpx100000ptotal string `json:"vpx100000ptotal,omitempty"` + Vpx100000pavailable string `json:"vpx100000pavailable,omitempty"` + Licensemode string `json:"licensemode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitidentifierlimitsessionsbinding struct { + Limitidentifier string `json:"limitidentifier,omitempty"` +} + +type Nspartition struct { + Partitionname string `json:"partitionname,omitempty"` + Maxbandwidth int `json:"maxbandwidth"` + Minbandwidth int `json:"minbandwidth"` + Maxconn int `json:"maxconn"` + Maxmemlimit int `json:"maxmemlimit"` + Partitionmac string `json:"partitionmac,omitempty"` + Force bool `json:"force,omitempty"` + Save bool `json:"save,omitempty"` + Partitionid string `json:"partitionid,omitempty"` + Partitiontype string `json:"partitiontype,omitempty"` + Pmacinternal string `json:"pmacinternal,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsrunningconfig struct { + Withdefaults bool `json:"withdefaults,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nshardware struct { + Hwdescription string `json:"hwdescription,omitempty"` + Sysid string `json:"sysid,omitempty"` + Manufactureday string `json:"manufactureday,omitempty"` + Manufacturemonth string `json:"manufacturemonth,omitempty"` + Manufactureyear string `json:"manufactureyear,omitempty"` + Cpufrequncy string `json:"cpufrequncy,omitempty"` + Hostid string `json:"hostid,omitempty"` + Host string `json:"host,omitempty"` + Serialno string `json:"serialno,omitempty"` + Encodedserialno string `json:"encodedserialno,omitempty"` + Netscaleruuid string `json:"netscaleruuid,omitempty"` + Bmcrevision string `json:"bmcrevision,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nshttpprofile struct { + Name string `json:"name,omitempty"` + Dropinvalreqs string `json:"dropinvalreqs,omitempty"` + Markhttp09inval string `json:"markhttp09inval,omitempty"` + Markconnreqinval string `json:"markconnreqinval,omitempty"` + Marktracereqinval string `json:"marktracereqinval,omitempty"` + Markrfc7230noncompliantinval string `json:"markrfc7230noncompliantinval,omitempty"` + Markhttpheaderextrawserror string `json:"markhttpheaderextrawserror,omitempty"` + Cmponpush string `json:"cmponpush,omitempty"` + Conmultiplex string `json:"conmultiplex,omitempty"` + Maxreusepool int `json:"maxreusepool,omitempty"` + Dropextracrlf string `json:"dropextracrlf,omitempty"` + Incomphdrdelay int `json:"incomphdrdelay,omitempty"` + Websocket string `json:"websocket,omitempty"` + Rtsptunnel string `json:"rtsptunnel,omitempty"` + Reqtimeout int `json:"reqtimeout,omitempty"` + Adpttimeout string `json:"adpttimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Dropextradata string `json:"dropextradata,omitempty"` + Weblog string `json:"weblog,omitempty"` + Clientiphdrexpr string `json:"clientiphdrexpr,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Persistentetag string `json:"persistentetag,omitempty"` + Http2 string `json:"http2,omitempty"` + Http2direct string `json:"http2direct,omitempty"` + Http2strictcipher string `json:"http2strictcipher,omitempty"` + Http2altsvcframe string `json:"http2altsvcframe,omitempty"` + Altsvc string `json:"altsvc,omitempty"` + Altsvcvalue string `json:"altsvcvalue,omitempty"` + Reusepooltimeout int `json:"reusepooltimeout,omitempty"` + Maxheaderlen int `json:"maxheaderlen,omitempty"` + Maxheaderfieldlen int `json:"maxheaderfieldlen,omitempty"` + Minreusepool int `json:"minreusepool,omitempty"` + Http2maxheaderlistsize int `json:"http2maxheaderlistsize,omitempty"` + Http2maxframesize int `json:"http2maxframesize,omitempty"` + Http2maxconcurrentstreams int `json:"http2maxconcurrentstreams,omitempty"` + Http2initialconnwindowsize int `json:"http2initialconnwindowsize,omitempty"` + Http2initialwindowsize int `json:"http2initialwindowsize,omitempty"` + Http2headertablesize int `json:"http2headertablesize,omitempty"` + Http2minseverconn int `json:"http2minseverconn,omitempty"` + Http2maxpingframespermin int `json:"http2maxpingframespermin,omitempty"` + Http2maxsettingsframespermin int `json:"http2maxsettingsframespermin,omitempty"` + Http2maxresetframespermin int `json:"http2maxresetframespermin,omitempty"` + Http2maxemptyframespermin int `json:"http2maxemptyframespermin,omitempty"` + Http2maxrxresetframespermin int `json:"http2maxrxresetframespermin,omitempty"` + Grpcholdlimit int `json:"grpcholdlimit,omitempty"` + Grpcholdtimeout int `json:"grpcholdtimeout,omitempty"` + Grpclengthdelimitation string `json:"grpclengthdelimitation,omitempty"` + Apdexcltresptimethreshold int `json:"apdexcltresptimethreshold,omitempty"` + Http3 string `json:"http3,omitempty"` + Http3maxheaderfieldsectionsize int `json:"http3maxheaderfieldsectionsize,omitempty"` + Http3maxheadertablesize int `json:"http3maxheadertablesize,omitempty"` + Http3maxheaderblockedstreams int `json:"http3maxheaderblockedstreams,omitempty"` + Http3webtransport string `json:"http3webtransport,omitempty"` + Http3minseverconn int `json:"http3minseverconn,omitempty"` + Httppipelinebuffsize int `json:"httppipelinebuffsize,omitempty"` + Allowonlywordcharactersandhyphen string `json:"allowonlywordcharactersandhyphen,omitempty"` + Hostheadervalidation string `json:"hostheadervalidation,omitempty"` + Maxduplicateheaderfields int `json:"maxduplicateheaderfields,omitempty"` + Passprotocolupgrade string `json:"passprotocolupgrade,omitempty"` + Http2extendedconnect string `json:"http2extendedconnect,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Builtin string `json:"builtin,omitempty"` + Apdexsvrresptimethreshold string `json:"apdexsvrresptimethreshold,omitempty"` + Dropinvalreqswarning string `json:"dropinvalreqswarning,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitidentifier struct { + Limitidentifier string `json:"limitidentifier,omitempty"` + Threshold int `json:"threshold,omitempty"` + Timeslice int `json:"timeslice,omitempty"` + Mode string `json:"mode,omitempty"` + Limittype string `json:"limittype,omitempty"` + Selectorname string `json:"selectorname,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Trapsintimeslice int `json:"trapsintimeslice,omitempty"` + Ngname string `json:"ngname,omitempty"` + Hits string `json:"hits,omitempty"` + Drop string `json:"drop,omitempty"` + Rule string `json:"rule,omitempty"` + Time string `json:"time,omitempty"` + Total string `json:"total,omitempty"` + Trapscomputedintimeslice string `json:"trapscomputedintimeslice,omitempty"` + Computedtraptimeslice string `json:"computedtraptimeslice,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nspbr6 struct { + Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` + Action string `json:"action,omitempty"` + Srcipv6 bool `json:"srcipv6,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipv6val string `json:"srcipv6val,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + Destipv6 bool `json:"destipv6,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipv6val string `json:"destipv6val,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Interface string `json:"Interface,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Msr string `json:"msr,omitempty"` + Monitor string `json:"monitor,omitempty"` + Nexthop bool `json:"nexthop,omitempty"` + Nexthopval string `json:"nexthopval,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + Nexthopvlan int `json:"nexthopvlan,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Detail bool `json:"detail,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Hits string `json:"hits,omitempty"` + Curstate string `json:"curstate,omitempty"` + Totalprobes string `json:"totalprobes,omitempty"` + Totalfailedprobes string `json:"totalfailedprobes,omitempty"` + Failedprobes string `json:"failedprobes,omitempty"` + Monstatcode string `json:"monstatcode,omitempty"` + Monstatparam1 string `json:"monstatparam1,omitempty"` + Monstatparam2 string `json:"monstatparam2,omitempty"` + Monstatparam3 string `json:"monstatparam3,omitempty"` + Data string `json:"data,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nssimpleacl6 struct { + Aclname string `json:"aclname,omitempty"` + Td int `json:"td,omitempty"` + Aclaction string `json:"aclaction,omitempty"` + Srcipv6 string `json:"srcipv6,omitempty"` + Destport int `json:"destport,omitempty"` + Protocol string `json:"protocol,omitempty"` + Ttl int `json:"ttl,omitempty"` + Estsessions bool `json:"estsessions,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nssourceroutecachetable struct { + Sourceip string `json:"sourceip,omitempty"` + Sourcemac string `json:"sourcemac,omitempty"` + Vlan string `json:"vlan,omitempty"` + Interface string `json:"Interface,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimezone struct { + Value string `json:"value,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsconnectiontable struct { + Filterexpression string `json:"filterexpression,omitempty"` + Link bool `json:"link,omitempty"` + Filtername bool `json:"filtername,omitempty"` + Detail []string `json:"detail,omitempty"` + Listen bool `json:"listen,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Sourceip string `json:"sourceip,omitempty"` + Sourceport string `json:"sourceport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Svctype string `json:"svctype,omitempty"` + Idletime string `json:"idletime,omitempty"` + State string `json:"state,omitempty"` + Linksourceip string `json:"linksourceip,omitempty"` + Linksourceport string `json:"linksourceport,omitempty"` + Linkdestip string `json:"linkdestip,omitempty"` + Linkdestport string `json:"linkdestport,omitempty"` + Linkservicetype string `json:"linkservicetype,omitempty"` + Linkidletime string `json:"linkidletime,omitempty"` + Linkstate string `json:"linkstate,omitempty"` + Entityname string `json:"entityname,omitempty"` + Linkentityname string `json:"linkentityname,omitempty"` + Connid string `json:"connid,omitempty"` + Linkconnid string `json:"linkconnid,omitempty"` + Connproperties string `json:"connproperties,omitempty"` + Optionflags string `json:"optionflags,omitempty"` + Nswsvalue string `json:"nswsvalue,omitempty"` + Peerwsvalue string `json:"peerwsvalue,omitempty"` + Mss string `json:"mss,omitempty"` + Retxretrycnt string `json:"retxretrycnt,omitempty"` + Rcvwnd string `json:"rcvwnd,omitempty"` + Advwnd string `json:"advwnd,omitempty"` + Sndcwnd string `json:"sndcwnd,omitempty"` + Iss string `json:"iss,omitempty"` + Irs string `json:"irs,omitempty"` + Rcvnxt string `json:"rcvnxt,omitempty"` + Maxack string `json:"maxack,omitempty"` + Sndnxt string `json:"sndnxt,omitempty"` + Sndunack string `json:"sndunack,omitempty"` + Httpendseq string `json:"httpendseq,omitempty"` + Httpstate string `json:"httpstate,omitempty"` + Trcount string `json:"trcount,omitempty"` + Priority string `json:"priority,omitempty"` + Httpreqver string `json:"httpreqver,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Httprspcode string `json:"httprspcode,omitempty"` + Rttsmoothed string `json:"rttsmoothed,omitempty"` + Rttvariance string `json:"rttvariance,omitempty"` + Outoforderpkts string `json:"outoforderpkts,omitempty"` + Linkoptionflag string `json:"linkoptionflag,omitempty"` + Linknswsvalue string `json:"linknswsvalue,omitempty"` + Linkpeerwsvalue string `json:"linkpeerwsvalue,omitempty"` + Targetnodeidnnm string `json:"targetnodeidnnm,omitempty"` + Sourcenodeidnnm string `json:"sourcenodeidnnm,omitempty"` + Channelidnnm string `json:"channelidnnm,omitempty"` + Msgversionnnm string `json:"msgversionnnm,omitempty"` + Td string `json:"td,omitempty"` + Maxrcvbuf string `json:"maxrcvbuf,omitempty"` + Linkmaxrcvbuf string `json:"linkmaxrcvbuf,omitempty"` + Rxqsize string `json:"rxqsize,omitempty"` + Linkrxqsize string `json:"linkrxqsize,omitempty"` + Maxsndbuf string `json:"maxsndbuf,omitempty"` + Linkmaxsndbuf string `json:"linkmaxsndbuf,omitempty"` + Txqsize string `json:"txqsize,omitempty"` + Linktxqsize string `json:"linktxqsize,omitempty"` + Flavor string `json:"flavor,omitempty"` + Linkflavor string `json:"linkflavor,omitempty"` + Bwestimate string `json:"bwestimate,omitempty"` + Linkbwestimate string `json:"linkbwestimate,omitempty"` + Rttmin string `json:"rttmin,omitempty"` + Linkrttmin string `json:"linkrttmin,omitempty"` + Name string `json:"name,omitempty"` + Linkname string `json:"linkname,omitempty"` + Tcpmode string `json:"tcpmode,omitempty"` + Linktcpmode string `json:"linktcpmode,omitempty"` + Realtimertt string `json:"realtimertt,omitempty"` + Linkrealtimertt string `json:"linkrealtimertt,omitempty"` + Sndbuf string `json:"sndbuf,omitempty"` + Linksndbuf string `json:"linksndbuf,omitempty"` + Nsbtcpwaitq string `json:"nsbtcpwaitq,omitempty"` + Linknsbtcpwaitq string `json:"linknsbtcpwaitq,omitempty"` + Nsbretxq string `json:"nsbretxq,omitempty"` + Linknsbretxq string `json:"linknsbretxq,omitempty"` + Sackblocks string `json:"sackblocks,omitempty"` + Linksackblocks string `json:"linksackblocks,omitempty"` + Congstate string `json:"congstate,omitempty"` + Linkcongstate string `json:"linkcongstate,omitempty"` + Sndrecoverle string `json:"sndrecoverle,omitempty"` + Linksndrecoverle string `json:"linksndrecoverle,omitempty"` + Creditsinbytes string `json:"creditsinbytes,omitempty"` + Linkcredits string `json:"linkcredits,omitempty"` + Rateinbytes string `json:"rateinbytes,omitempty"` + Linkrateinbytes string `json:"linkrateinbytes,omitempty"` + Rateschedulerqueue string `json:"rateschedulerqueue,omitempty"` + Linkrateschedulerqueue string `json:"linkrateschedulerqueue,omitempty"` + Burstratecontrol string `json:"burstratecontrol,omitempty"` + Linkburstratecontrol string `json:"linkburstratecontrol,omitempty"` + Cqabifavg string `json:"cqabifavg,omitempty"` + Cqathruputavg string `json:"cqathruputavg,omitempty"` + Cqarcvwndavg string `json:"cqarcvwndavg,omitempty"` + Cqaiai1mspct string `json:"cqaiai1mspct,omitempty"` + Cqaiai2mspct string `json:"cqaiai2mspct,omitempty"` + Cqasamples string `json:"cqasamples,omitempty"` + Cqaiaisamples string `json:"cqaiaisamples,omitempty"` + Cqanetclass string `json:"cqanetclass,omitempty"` + Cqaccl string `json:"cqaccl,omitempty"` + Cqacsq string `json:"cqacsq,omitempty"` + Cqaiaiavg string `json:"cqaiaiavg,omitempty"` + Cqaisiavg string `json:"cqaisiavg,omitempty"` + Cqarcvwndmin string `json:"cqarcvwndmin,omitempty"` + Cqaretxcorr string `json:"cqaretxcorr,omitempty"` + Cqaretxcong string `json:"cqaretxcong,omitempty"` + Cqaretxpackets string `json:"cqaretxpackets,omitempty"` + Cqaloaddelayavg string `json:"cqaloaddelayavg,omitempty"` + Cqanoisedelayavg string `json:"cqanoisedelayavg,omitempty"` + Cqarttmax string `json:"cqarttmax,omitempty"` + Cqarttmin string `json:"cqarttmin,omitempty"` + Cqarttavg string `json:"cqarttavg,omitempty"` + Adaptivetcpprofname string `json:"adaptivetcpprofname,omitempty"` + Outoforderblocks string `json:"outoforderblocks,omitempty"` + Outoforderflushedcount string `json:"outoforderflushedcount,omitempty"` + Outoforderbytes string `json:"outoforderbytes,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsevents struct { + Eventno int `json:"eventno,omitempty"` + Time string `json:"time,omitempty"` + Eventcode string `json:"eventcode,omitempty"` + Devid string `json:"devid,omitempty"` + Devname string `json:"devname,omitempty"` + Text string `json:"text,omitempty"` + Data0 string `json:"data0,omitempty"` + Data1 string `json:"data1,omitempty"` + Data2 string `json:"data2,omitempty"` + Data3 string `json:"data3,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nshostname struct { + Hostname string `json:"hostname,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nslimitsessions struct { + Limitidentifier string `json:"limitidentifier,omitempty"` + Detail bool `json:"detail,omitempty"` + Timeout string `json:"timeout,omitempty"` + Hits string `json:"hits,omitempty"` + Drop string `json:"drop,omitempty"` + Number string `json:"number,omitempty"` + Name string `json:"name,omitempty"` + Unit string `json:"unit,omitempty"` + Flags string `json:"flags,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Maxbandwidth string `json:"maxbandwidth,omitempty"` + Selectoripv61 string `json:"selectoripv61,omitempty"` + Selectoripv62 string `json:"selectoripv62,omitempty"` + Flag string `json:"flag,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsmgmtparam struct { + Mgmthttpport int `json:"mgmthttpport,omitempty"` + Mgmthttpsport int `json:"mgmthttpsport,omitempty"` + Httpdmaxclients int `json:"httpdmaxclients,omitempty"` + Httpdmaxreqworkers int `json:"httpdmaxreqworkers,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nssurgeq struct { + Name string `json:"name,omitempty"` + Servername string `json:"servername,omitempty"` + Port int `json:"port,omitempty"` +} + +type Nstcpbufparam struct { + Size int `json:"size,omitempty"` + Memlimit int `json:"memlimit"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsxmlnamespace struct { + Prefix string `json:"prefix,omitempty"` + Namespace string `json:"Namespace,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nssavedconfig struct { + Textblob string `json:"textblob,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Shutdown struct { +} + +type Nsacls6 struct { + Type string `json:"type,omitempty"` +} + +type Nsdhcpparams struct { + Dhcpclient string `json:"dhcpclient,omitempty"` + Saveroute string `json:"saveroute,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Hostrtgw string `json:"hostrtgw,omitempty"` + Running string `json:"running,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsextensionextensionfunctionbinding struct { + Extensionfunctionname string `json:"extensionfunctionname,omitempty"` + Extensionfunctionlinenumber int `json:"extensionfunctionlinenumber,omitempty"` + Extensionfunctionclasstype string `json:"extensionfunctionclasstype,omitempty"` + Extensionfunctionreturntype string `json:"extensionfunctionreturntype,omitempty"` + Activeextensionfunction int `json:"activeextensionfunction,omitempty"` + Extensionfunctionargtype []string `json:"extensionfunctionargtype,omitempty"` + Extensionfuncdescription string `json:"extensionfuncdescription,omitempty"` + Extensionfunctionargcount int `json:"extensionfunctionargcount,omitempty"` + Extensionfunctionclasses []string `json:"extensionfunctionclasses,omitempty"` + Extensionfunctionclassescount int `json:"extensionfunctionclassescount,omitempty"` + Extensionfunctionallparams []string `json:"extensionfunctionallparams,omitempty"` + Extensionfunctionallparamscount int `json:"extensionfunctionallparamscount,omitempty"` + Name string `json:"name,omitempty"` +} + +type Nsnextgenapi struct { + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsparam struct { + Httpport []int `json:"httpport,omitempty"` + Maxconn int `json:"maxconn"` + Maxreq int `json:"maxreq"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cookieversion string `json:"cookieversion"` + Securecookie string `json:"securecookie,omitempty"` + Pmtumin int `json:"pmtumin,omitempty"` + Pmtutimeout int `json:"pmtutimeout,omitempty"` + Ftpportrange string `json:"ftpportrange,omitempty"` + Crportrange string `json:"crportrange,omitempty"` + Timezone string `json:"timezone,omitempty"` + Grantquotamaxclient int `json:"grantquotamaxclient"` + Exclusivequotamaxclient int `json:"exclusivequotamaxclient"` + Grantquotaspillover int `json:"grantquotaspillover,omitempty"` + Exclusivequotaspillover int `json:"exclusivequotaspillover"` + Useproxyport string `json:"useproxyport,omitempty"` + Internaluserlogin string `json:"internaluserlogin,omitempty"` + Aftpallowrandomsourceport string `json:"aftpallowrandomsourceport,omitempty"` + Icaports []int `json:"icaports,omitempty"` + Tcpcip string `json:"tcpcip,omitempty"` + Servicepathingressvlan int `json:"servicepathingressvlan,omitempty"` + Secureicaports []int `json:"secureicaports,omitempty"` + Mgmthttpport int `json:"mgmthttpport,omitempty"` + Mgmthttpsport int `json:"mgmthttpsport,omitempty"` + Proxyprotocol string `json:"proxyprotocol,omitempty"` + Advancedanalyticsstats string `json:"advancedanalyticsstats,omitempty"` + Ipttl int `json:"ipttl,omitempty"` + Autoscaleoption string `json:"autoscaleoption,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nspartitionbinding struct { + Partitionname string `json:"partitionname,omitempty"` +} + +type Nspartitionvxlanbinding struct { + Vxlan int `json:"vxlan,omitempty"` + Partitionname string `json:"partitionname,omitempty"` +} + +type Nspbr struct { + Name string `json:"name,omitempty"` + Action string `json:"action,omitempty"` + Td int `json:"td,omitempty"` + Srcip bool `json:"srcip,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipval string `json:"srcipval,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + Destip bool `json:"destip,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipval string `json:"destipval,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Nexthop bool `json:"nexthop,omitempty"` + Nexthopval string `json:"nexthopval,omitempty"` + Iptunnel bool `json:"iptunnel,omitempty"` + Iptunnelname string `json:"iptunnelname,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + Targettd int `json:"targettd,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Interface string `json:"Interface,omitempty"` + Priority int `json:"priority,omitempty"` + Msr string `json:"msr,omitempty"` + Monitor string `json:"monitor,omitempty"` + State string `json:"state,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Detail bool `json:"detail,omitempty"` + Hits string `json:"hits,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Curstate string `json:"curstate,omitempty"` + Totalprobes string `json:"totalprobes,omitempty"` + Totalfailedprobes string `json:"totalfailedprobes,omitempty"` + Failedprobes string `json:"failedprobes,omitempty"` + Monstatcode string `json:"monstatcode,omitempty"` + Monstatparam1 string `json:"monstatparam1,omitempty"` + Monstatparam2 string `json:"monstatparam2,omitempty"` + Monstatparam3 string `json:"monstatparam3,omitempty"` + Data string `json:"data,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsacl struct { + Aclname string `json:"aclname,omitempty"` + Aclaction string `json:"aclaction,omitempty"` + Td int `json:"td,omitempty"` + Srcip bool `json:"srcip,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipval string `json:"srcipval,omitempty"` + Srcipdataset string `json:"srcipdataset,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + Srcportdataset string `json:"srcportdataset,omitempty"` + Destip bool `json:"destip,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipval string `json:"destipval,omitempty"` + Destipdataset string `json:"destipdataset,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Destportdataset string `json:"destportdataset,omitempty"` + Ttl int `json:"ttl,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Interface string `json:"Interface,omitempty"` + Established bool `json:"established,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Logstate string `json:"logstate,omitempty"` + Ratelimit int `json:"ratelimit,omitempty"` + Type string `json:"type,omitempty"` + Dfdhash string `json:"dfdhash,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Stateful string `json:"stateful,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Aclassociate string `json:"aclassociate,omitempty"` + Aclchildcount string `json:"aclchildcount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsacls struct { + Type string `json:"type,omitempty"` +} + +type Nscentralmanagementserver struct { + Type string `json:"type,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Activationcode string `json:"activationcode,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Servername string `json:"servername,omitempty"` + Validatecert string `json:"validatecert,omitempty"` + Deviceprofilename string `json:"deviceprofilename,omitempty"` + Adcusername string `json:"adcusername,omitempty"` + Adcpassword string `json:"adcpassword,omitempty"` + Instanceid string `json:"instanceid,omitempty"` + Customerid string `json:"customerid,omitempty"` + Admserviceenvironment string `json:"admserviceenvironment,omitempty"` + Admserviceconnectionstatus string `json:"admserviceconnectionstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsdhcpip struct { +} + +type Nsrollbackcmd struct { + Filename string `json:"filename,omitempty"` + Outtype string `json:"outtype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsservicepathbinding struct { + Servicepathname string `json:"servicepathname,omitempty"` +} + +type Nstcpparam struct { + Ws string `json:"ws,omitempty"` + Wsval int `json:"wsval"` + Sack string `json:"sack,omitempty"` + Learnvsvrmss string `json:"learnvsvrmss,omitempty"` + Maxburst int `json:"maxburst,omitempty"` + Initialcwnd int `json:"initialcwnd,omitempty"` + Recvbuffsize int `json:"recvbuffsize,omitempty"` + Delayedack int `json:"delayedack,omitempty"` + Downstaterst string `json:"downstaterst,omitempty"` + Nagle string `json:"nagle,omitempty"` + Limitedpersist string `json:"limitedpersist,omitempty"` + Oooqsize int `json:"oooqsize"` + Ackonpush string `json:"ackonpush,omitempty"` + Maxpktpermss int `json:"maxpktpermss"` + Pktperretx int `json:"pktperretx,omitempty"` + Minrto int `json:"minrto,omitempty"` + Slowstartincr int `json:"slowstartincr,omitempty"` + Maxdynserverprobes int `json:"maxdynserverprobes,omitempty"` + Synholdfastgiveup int `json:"synholdfastgiveup,omitempty"` + Maxsynholdperprobe int `json:"maxsynholdperprobe,omitempty"` + Maxsynhold int `json:"maxsynhold,omitempty"` + Msslearninterval int `json:"msslearninterval,omitempty"` + Msslearndelay int `json:"msslearndelay,omitempty"` + Maxtimewaitconn int `json:"maxtimewaitconn,omitempty"` + Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` + Maxsynackretx int `json:"maxsynackretx,omitempty"` + Synattackdetection string `json:"synattackdetection,omitempty"` + Connflushifnomem string `json:"connflushifnomem,omitempty"` + Connflushthres int `json:"connflushthres,omitempty"` + Mptcpconcloseonpassivesf string `json:"mptcpconcloseonpassivesf,omitempty"` + Mptcpchecksum string `json:"mptcpchecksum,omitempty"` + Mptcpsftimeout int `json:""` + Mptcpsfreplacetimeout int `json:"mptcpsfreplacetimeout"` + Mptcpmaxsf int `json:"mptcpmaxsf,omitempty"` + Mptcpmaxpendingsf int `json:"mptcpmaxpendingsf"` + Mptcppendingjointhreshold int `json:"mptcppendingjointhreshold"` + Mptcprtostoswitchsf int `json:"mptcprtostoswitchsf,omitempty"` + Mptcpusebackupondss string `json:"mptcpusebackupondss,omitempty"` + Tcpmaxretries int `json:"tcpmaxretries,omitempty"` + Mptcpimmediatesfcloseonfin string `json:"mptcpimmediatesfcloseonfin,omitempty"` + Mptcpclosemptcpsessiononlastsfclose string `json:"mptcpclosemptcpsessiononlastsfclose,omitempty"` + Mptcpsendsfresetoption string `json:"mptcpsendsfresetoption,omitempty"` + Mptcpfastcloseoption string `json:"mptcpfastcloseoption,omitempty"` + Mptcpreliableaddaddr string `json:"mptcpreliableaddaddr,omitempty"` + Tcpfastopencookietimeout int `json:"tcpfastopencookietimeout"` + Autosyncookietimeout int `json:"autosyncookietimeout,omitempty"` + Tcpfintimeout int `json:"tcpfintimeout,omitempty"` + Compacttcpoptionnoop string `json:"compacttcpoptionnoop,omitempty"` + Delinkclientserveronrst string `json:"delinkclientserveronrst,omitempty"` + Rfc5961chlgacklimit int `json:"rfc5961chlgacklimit,omitempty"` + Enhancedisngeneration string `json:"enhancedisngeneration,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsvpxparam struct { + Masterclockcpu1 string `json:"masterclockcpu1,omitempty"` + Cpuyield string `json:"cpuyield,omitempty"` + Ownernode int `json:"ownernode"` + Kvmvirtiomultiqueue string `json:"kvmvirtiomultiqueue,omitempty"` + Vpxenvironment string `json:"vpxenvironment,omitempty"` + Memorystatus string `json:"memorystatus,omitempty"` + Cloudproductcode string `json:"cloudproductcode,omitempty"` + Vpxoemcode string `json:"vpxoemcode,omitempty"` + Technicalsupportpin string `json:"technicalsupportpin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstcpprofile struct { + Name string `json:"name,omitempty"` + Ws string `json:"ws,omitempty"` + Sack string `json:"sack,omitempty"` + Wsval int `json:"wsval,omitempty"` + Nagle string `json:"nagle,omitempty"` + Ackonpush string `json:"ackonpush,omitempty"` + Mss int `json:"mss,omitempty"` + Maxburst int `json:"maxburst,omitempty"` + Initialcwnd int `json:"initialcwnd,omitempty"` + Delayedack int `json:"delayedack,omitempty"` + Oooqsize int `json:"oooqsize,omitempty"` + Maxpktpermss int `json:"maxpktpermss,omitempty"` + Pktperretx int `json:"pktperretx,omitempty"` + Minrto int `json:"minrto,omitempty"` + Slowstartincr int `json:"slowstartincr,omitempty"` + Buffersize int `json:"buffersize,omitempty"` + Syncookie string `json:"syncookie,omitempty"` + Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` + Flavor string `json:"flavor,omitempty"` + Dynamicreceivebuffering string `json:"dynamicreceivebuffering,omitempty"` + Ka string `json:"ka,omitempty"` + Kaconnidletime int `json:"kaconnidletime,omitempty"` + Kamaxprobes int `json:"kamaxprobes,omitempty"` + Kaprobeinterval int `json:"kaprobeinterval,omitempty"` + Sendbuffsize int `json:"sendbuffsize,omitempty"` + Mptcp string `json:"mptcp,omitempty"` + Establishclientconn string `json:"establishclientconn,omitempty"` + Tcpsegoffload string `json:"tcpsegoffload,omitempty"` + Rfc5961compliance string `json:"rfc5961compliance,omitempty"` + Rstwindowattenuate string `json:"rstwindowattenuate,omitempty"` + Rstmaxack string `json:"rstmaxack,omitempty"` + Spoofsyndrop string `json:"spoofsyndrop,omitempty"` + Ecn string `json:"ecn,omitempty"` + Mptcpdropdataonpreestsf string `json:"mptcpdropdataonpreestsf,omitempty"` + Mptcpfastopen string `json:"mptcpfastopen,omitempty"` + Mptcpsessiontimeout int `json:"mptcpsessiontimeout,omitempty"` + Timestamp string `json:"timestamp,omitempty"` + Dsack string `json:"dsack,omitempty"` + Ackaggregation string `json:"ackaggregation,omitempty"` + Frto string `json:"frto,omitempty"` + Maxcwnd int `json:"maxcwnd,omitempty"` + Fack string `json:"fack,omitempty"` + Tcpmode string `json:"tcpmode,omitempty"` + Tcpfastopen string `json:"tcpfastopen,omitempty"` + Hystart string `json:"hystart,omitempty"` + Dupackthresh int `json:"dupackthresh,omitempty"` + Burstratecontrol string `json:"burstratecontrol,omitempty"` + Tcprate int `json:"tcprate,omitempty"` + Rateqmax int `json:"rateqmax,omitempty"` + Drophalfclosedconnontimeout string `json:"drophalfclosedconnontimeout,omitempty"` + Dropestconnontimeout string `json:"dropestconnontimeout,omitempty"` + Applyadaptivetcp string `json:"applyadaptivetcp,omitempty"` + Tcpfastopencookiesize int `json:"tcpfastopencookiesize,omitempty"` + Taillossprobe string `json:"taillossprobe,omitempty"` + Clientiptcpoption string `json:"clientiptcpoption,omitempty"` + Clientiptcpoptionnumber int `json:"clientiptcpoptionnumber,omitempty"` + Mpcapablecbit string `json:"mpcapablecbit,omitempty"` + Sendclientportintcpoption string `json:"sendclientportintcpoption,omitempty"` + Slowstartthreshold int `json:"slowstartthreshold,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstimerpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Vserver string `json:"vserver,omitempty"` + Samplesize uint32 `json:"samplesize,omitempty"` + Threshold uint32 `json:"threshold,omitempty"` + Name string `json:"name,omitempty"` +} + +type Nstrafficdomainbridgegroupbinding struct { + Bridgegroup int `json:"bridgegroup,omitempty"` + Td int `json:"td,omitempty"` +} + +type Nsvariable struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Scope string `json:"scope,omitempty"` + Iffull string `json:"iffull,omitempty"` + Ifvaluetoobig string `json:"ifvaluetoobig,omitempty"` + Ifnovalue string `json:"ifnovalue,omitempty"` + Init string `json:"init,omitempty"` + Expires int `json:"expires,omitempty"` + Comment string `json:"comment,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Reboot struct { + Warm bool `json:"warm,omitempty"` +} + +type Nsencryptionkey struct { + Name string `json:"name,omitempty"` + Method string `json:"method,omitempty"` + Keyvalue string `json:"keyvalue,omitempty"` + Padding string `json:"padding,omitempty"` + Iv string `json:"iv,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsextension struct { + Src string `json:"src,omitempty"` + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Trace string `json:"trace,omitempty"` + Tracefunctions string `json:"tracefunctions,omitempty"` + Tracevariables string `json:"tracevariables,omitempty"` + Detail string `json:"detail,omitempty"` + Type string `json:"type,omitempty"` + Functionhits string `json:"functionhits,omitempty"` + Functionundefhits string `json:"functionundefhits,omitempty"` + Functionhaltcount string `json:"functionhaltcount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nskeymanagerproxy struct { + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Port int `json:"port,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Status string `json:"status,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsservicepathservicefunctionbinding struct { + Servicefunction string `json:"servicefunction,omitempty"` + Index uint32 `json:"index,omitempty"` + Servicepathname string `json:"servicepathname,omitempty"` +} + +type Nstestlicense struct { + Wl string `json:"wl,omitempty"` + Sp string `json:"sp,omitempty"` + Lb string `json:"lb,omitempty"` + Cs string `json:"cs,omitempty"` + Cr string `json:"cr,omitempty"` + Cmp string `json:"cmp,omitempty"` + Delta string `json:"delta,omitempty"` + Ssl string `json:"ssl,omitempty"` + Gslb string `json:"gslb,omitempty"` + Gslbp string `json:"gslbp,omitempty"` + Routing string `json:"routing,omitempty"` + Cf string `json:"cf,omitempty"` + Contentaccelerator string `json:"contentaccelerator,omitempty"` + Ic string `json:"ic,omitempty"` + Sslvpn string `json:"sslvpn,omitempty"` + Fsslvpnusers string `json:"f_sslvpn_users,omitempty"` + Ficausers string `json:"f_ica_users,omitempty"` + Aaa string `json:"aaa,omitempty"` + Ospf string `json:"ospf,omitempty"` + Rip string `json:"rip,omitempty"` + Bgp string `json:"bgp,omitempty"` + Rewrite string `json:"rewrite,omitempty"` + Ipv6pt string `json:"ipv6pt,omitempty"` + Appfw string `json:"appfw,omitempty"` + Responder string `json:"responder,omitempty"` + Agee string `json:"agee,omitempty"` + Nsxn string `json:"nsxn,omitempty"` + Modelid string `json:"modelid,omitempty"` + Push string `json:"push,omitempty"` + Appflow string `json:"appflow,omitempty"` + Cloudbridge string `json:"cloudbridge,omitempty"` + Cloudbridgeappliance string `json:"cloudbridgeappliance,omitempty"` + Cloudextenderappliance string `json:"cloudextenderappliance,omitempty"` + Isis string `json:"isis,omitempty"` + Cluster string `json:"cluster,omitempty"` + Ch string `json:"ch,omitempty"` + Appqoe string `json:"appqoe,omitempty"` + Appflowica string `json:"appflowica,omitempty"` + Isstandardlic string `json:"isstandardlic,omitempty"` + Isenterpriselic string `json:"isenterpriselic,omitempty"` + Isplatinumlic string `json:"isplatinumlic,omitempty"` + Issgwylic string `json:"issgwylic,omitempty"` + Isswglic string `json:"isswglic,omitempty"` + Feo string `json:"feo,omitempty"` + Lsn string `json:"lsn,omitempty"` + Licensingmode string `json:"licensingmode,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Rdpproxy string `json:"rdpproxy,omitempty"` + Rep string `json:"rep,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Videooptimization string `json:"videooptimization,omitempty"` + Forwardproxy string `json:"forwardproxy,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Remotecontentinspection string `json:"remotecontentinspection,omitempty"` + Adaptivetcp string `json:"adaptivetcp,omitempty"` + Cqa string `json:"cqa,omitempty"` + Bot string `json:"bot,omitempty"` + Apigateway string `json:"apigateway,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstrafficdomainbinding struct { + Td int `json:"td,omitempty"` +} + +type Nslicenseparameters struct { + Alert1gracetimeout int `json:"alert1gracetimeout"` + Alert2gracetimeout int `json:"alert2gracetimeout,omitempty"` + Licenseexpiryalerttime int `json:"licenseexpiryalerttime,omitempty"` + Heartbeatinterval int `json:"heartbeatinterval,omitempty"` + Inventoryrefreshinterval int `json:"inventoryrefreshinterval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsmemrecovery struct { + Percentage int `json:"percentage,omitempty"` +} + +type Nsstats struct { + Cleanuplevel string `json:"cleanuplevel,omitempty"` +} + +type Nstrafficdomain struct { + Td int `json:"td,omitempty"` + Aliasname string `json:"aliasname,omitempty"` + Vmac string `json:"vmac,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nstrafficdomainvxlanbinding struct { + Vxlan int `json:"vxlan,omitempty"` + Td int `json:"td,omitempty"` +} diff --git a/nitrogo/models/ntp.go b/nitrogo/models/ntp.go new file mode 100644 index 0000000..6b7786d --- /dev/null +++ b/nitrogo/models/ntp.go @@ -0,0 +1,34 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Ntpparam struct { + Authentication string `json:"authentication,omitempty"` + Trustedkey []int `json:"trustedkey,omitempty"` + Autokeylogsec int `json:"autokeylogsec"` + Revokelogsec int `json:"revokelogsec"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ntpserver struct { + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Minpoll int `json:"minpoll,omitempty"` + Maxpoll int `json:"maxpoll,omitempty"` + Autokey bool `json:"autokey,omitempty"` + Key int `json:"key,omitempty"` + Preferredntpserver string `json:"preferredntpserver,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ntpstatus struct { + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ntpsync struct { + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/pcp.go b/nitrogo/models/pcp.go new file mode 100644 index 0000000..1f052e6 --- /dev/null +++ b/nitrogo/models/pcp.go @@ -0,0 +1,41 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Pcpprofile struct { + Name string `json:"name,omitempty"` + Mapping string `json:"mapping,omitempty"` + Peer string `json:"peer,omitempty"` + Minmaplife int `json:"minmaplife,omitempty"` + Maxmaplife int `json:"maxmaplife,omitempty"` + Announcemulticount int `json:"announcemulticount"` + Thirdparty string `json:"thirdparty,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Pcpserver struct { + Name string `json:"name,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Pcpprofile string `json:"pcpprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Pcpmap struct { + Nattype string `json:"nattype,omitempty"` + Pcpsrcip string `json:"pcpsrcip,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Pcpsrcport string `json:"pcpsrcport,omitempty"` + Pcpdstip string `json:"pcpdstip,omitempty"` + Pcpdstport string `json:"pcpdstport,omitempty"` + Pcpnatip string `json:"pcpnatip,omitempty"` + Pcpnatport string `json:"pcpnatport,omitempty"` + Pcpprotocol string `json:"pcpprotocol,omitempty"` + Pcpaddr string `json:"pcpaddr,omitempty"` + Pcpnounce string `json:"pcpnounce,omitempty"` + Pcprefcnt string `json:"pcprefcnt,omitempty"` + Pcplifetime string `json:"pcplifetime,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/policy.go b/nitrogo/models/policy.go new file mode 100644 index 0000000..01172fb --- /dev/null +++ b/nitrogo/models/policy.go @@ -0,0 +1,214 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Policydataset struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Comment string `json:"comment,omitempty"` + Patsetfile string `json:"patsetfile,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Dynamiconly bool `json:"dynamiconly,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policyhttpcallout struct { + Name string `json:"name,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Vserver string `json:"vserver,omitempty"` + Returntype string `json:"returntype,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Hostexpr string `json:"hostexpr,omitempty"` + Urlstemexpr string `json:"urlstemexpr,omitempty"` + Headers []string `json:"headers,omitempty"` + Parameters []string `json:"parameters,omitempty"` + Bodyexpr string `json:"bodyexpr,omitempty"` + Fullreqexpr string `json:"fullreqexpr,omitempty"` + Scheme string `json:"scheme,omitempty"` + Resultexpr string `json:"resultexpr,omitempty"` + Cacheforsecs int `json:"cacheforsecs,omitempty"` + Comment string `json:"comment,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Undefreason string `json:"undefreason,omitempty"` + Recursivecallout string `json:"recursivecallout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policypatsetpatternbinding struct { + String string `json:"String,omitempty"` + Index int `json:"index,omitempty"` + Charset string `json:"charset,omitempty"` + Comment string `json:"comment,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` +} + +type Policypatsetfile struct { + Src string `json:"src,omitempty"` + Name string `json:"name,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Delimiter string `json:"delimiter,omitempty"` + Charset string `json:"charset,omitempty"` + Comment string `json:"comment,omitempty"` + Imported bool `json:"imported,omitempty"` + Totalpatterns string `json:"totalpatterns,omitempty"` + Boundpatterns string `json:"boundpatterns,omitempty"` + Patsetname string `json:"patsetname,omitempty"` + Bindstatuscode string `json:"bindstatuscode,omitempty"` + Bindstatus string `json:"bindstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policystringmappatternbinding struct { + Key string `json:"key,omitempty"` + Value string `json:"value,omitempty"` + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Policydatasetbinding struct { + Name string `json:"name,omitempty"` +} + +type Policyevaluation struct { + Expression string `json:"expression,omitempty"` + Action string `json:"action,omitempty"` + Type string `json:"type,omitempty"` + Input string `json:"input,omitempty"` + Pitmodifiedinputdata string `json:"pitmodifiedinputdata,omitempty"` + Pitboolresult string `json:"pitboolresult,omitempty"` + Pitnumresult string `json:"pitnumresult,omitempty"` + Pitdoubleresult string `json:"pitdoubleresult,omitempty"` + Pitulongresult string `json:"pitulongresult,omitempty"` + Pitrefresult string `json:"pitrefresult,omitempty"` + Pitoffsetresult string `json:"pitoffsetresult,omitempty"` + Pitoffsetresultlen string `json:"pitoffsetresultlen,omitempty"` + Istruncatedrefresult string `json:"istruncatedrefresult,omitempty"` + Pitboolevaltime string `json:"pitboolevaltime,omitempty"` + Pitnumevaltime string `json:"pitnumevaltime,omitempty"` + Pitdoubleevaltime string `json:"pitdoubleevaltime,omitempty"` + Pitulongevaltime string `json:"pitulongevaltime,omitempty"` + Pitrefevaltime string `json:"pitrefevaltime,omitempty"` + Pitoffsetevaltime string `json:"pitoffsetevaltime,omitempty"` + Pitactionevaltime string `json:"pitactionevaltime,omitempty"` + Pitoperationperformerarray string `json:"pitoperationperformerarray,omitempty"` + Pitoldoffsetarray string `json:"pitoldoffsetarray,omitempty"` + Pitnewoffsetarray string `json:"pitnewoffsetarray,omitempty"` + Pitoffsetlengtharray string `json:"pitoffsetlengtharray,omitempty"` + Pitoffsetnewlengtharray string `json:"pitoffsetnewlengtharray,omitempty"` + Pitboolerrorresult string `json:"pitboolerrorresult,omitempty"` + Pitnumerrorresult string `json:"pitnumerrorresult,omitempty"` + Pitdoubleerrorresult string `json:"pitdoubleerrorresult,omitempty"` + Pitulongerrorresult string `json:"pitulongerrorresult,omitempty"` + Pitreferrorresult string `json:"pitreferrorresult,omitempty"` + Pitoffseterrorresult string `json:"pitoffseterrorresult,omitempty"` + Pitactionerrorresult string `json:"pitactionerrorresult,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policyexpression struct { + Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` + Comment string `json:"comment,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Type string `json:"type,omitempty"` + Hits string `json:"hits,omitempty"` + Pihits string `json:"pihits,omitempty"` + Type1 string `json:"type1,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policyparam struct { + Timeout int `json:"timeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policypatset struct { + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Patsetfile string `json:"patsetfile,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Dynamiconly bool `json:"dynamiconly,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policymap struct { + Mappolicyname string `json:"mappolicyname,omitempty"` + Sd string `json:"sd,omitempty"` + Su string `json:"su,omitempty"` + Td string `json:"td,omitempty"` + Tu string `json:"tu,omitempty"` + Targetname string `json:"targetname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policypatsetbinding struct { + Name string `json:"name,omitempty"` +} + +type Policystringmap struct { + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policytracing struct { + Filterexpr string `json:"filterexpr,omitempty"` + Protocoltype string `json:"protocoltype,omitempty"` + Capturesslhandshakepolicies string `json:"capturesslhandshakepolicies,omitempty"` + Transactionid string `json:"transactionid,omitempty"` + Detail string `json:"detail,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Packetengineid string `json:"packetengineid,omitempty"` + Clientip string `json:"clientip,omitempty"` + Destip string `json:"destip,omitempty"` + Srcport string `json:"srcport,omitempty"` + Destport string `json:"destport,omitempty"` + Transactiontime string `json:"transactiontime,omitempty"` + Policytracingmodule string `json:"policytracingmodule,omitempty"` + Url string `json:"url,omitempty"` + Policynames string `json:"policynames,omitempty"` + Isresponse string `json:"isresponse,omitempty"` + Isundefpolicy string `json:"isundefpolicy,omitempty"` + Policytracingrecordcount string `json:"policytracingrecordcount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policyurlset struct { + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Imported bool `json:"imported,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Delimiter string `json:"delimiter,omitempty"` + Rowseparator string `json:"rowseparator,omitempty"` + Url string `json:"url,omitempty"` + Interval int `json:"interval,omitempty"` + Privateset bool `json:"privateset,omitempty"` + Subdomainexactmatch bool `json:"subdomainexactmatch,omitempty"` + Matchedid int `json:"matchedid,omitempty"` + Canaryurl string `json:"canaryurl,omitempty"` + Patterncount string `json:"patterncount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Policydatasetvaluebinding struct { + Value string `json:"value,omitempty"` + Index int `json:"index,omitempty"` + Comment string `json:"comment,omitempty"` + Endrange string `json:"endrange,omitempty"` + Name string `json:"name,omitempty"` +} + +type Policystringmapbinding struct { + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/pq.go b/nitrogo/models/pq.go new file mode 100644 index 0000000..818fa91 --- /dev/null +++ b/nitrogo/models/pq.go @@ -0,0 +1,26 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Pqbinding struct { + Vservername string `json:"vservername,omitempty"` + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Priority string `json:"priority,omitempty"` + Weight string `json:"weight,omitempty"` + Qdepth string `json:"qdepth,omitempty"` + Polqdepth string `json:"polqdepth,omitempty"` + Hits string `json:"hits,omitempty"` +} + +type Pqpolicy struct { + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Priority int `json:"priority,omitempty"` + Weight int `json:"weight,omitempty"` + Qdepth int `json:"qdepth,omitempty"` + Polqdepth int `json:"polqdepth,omitempty"` + Hits string `json:"hits,omitempty"` +} diff --git a/nitrogo/models/protocol.go b/nitrogo/models/protocol.go new file mode 100644 index 0000000..bf8dccb --- /dev/null +++ b/nitrogo/models/protocol.go @@ -0,0 +1,24 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Protocolhttpband struct { + Reqbandsize int `json:"reqbandsize,omitempty"` + Respbandsize int `json:"respbandsize,omitempty"` + Type string `json:"type,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Bandrange string `json:"bandrange,omitempty"` + Numberofbands string `json:"numberofbands,omitempty"` + Totalbandsize string `json:"totalbandsize,omitempty"` + Avgbandsize string `json:"avgbandsize,omitempty"` + Avgbandsizenew string `json:"avgbandsizenew,omitempty"` + Banddata string `json:"banddata,omitempty"` + Banddatanew string `json:"banddatanew,omitempty"` + Accesscount string `json:"accesscount,omitempty"` + Accessratio string `json:"accessratio,omitempty"` + Accessrationew string `json:"accessrationew,omitempty"` + Totals string `json:"totals,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/quic.go b/nitrogo/models/quic.go new file mode 100644 index 0000000..66a755c --- /dev/null +++ b/nitrogo/models/quic.go @@ -0,0 +1,35 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Quicprofile struct { + Name string `json:"name,omitempty"` + Ackdelayexponent int `json:"ackdelayexponent,omitempty"` + Activeconnectionidlimit int `json:"activeconnectionidlimit,omitempty"` + Activeconnectionmigration string `json:"activeconnectionmigration,omitempty"` + Congestionctrlalgorithm string `json:"congestionctrlalgorithm,omitempty"` + Initialmaxdata int `json:"initialmaxdata,omitempty"` + Initialmaxstreamdatabidilocal int `json:"initialmaxstreamdatabidilocal,omitempty"` + Initialmaxstreamdatabidiremote int `json:"initialmaxstreamdatabidiremote,omitempty"` + Initialmaxstreamdatauni int `json:"initialmaxstreamdatauni,omitempty"` + Initialmaxstreamsbidi int `json:"initialmaxstreamsbidi,omitempty"` + Initialmaxstreamsuni int `json:"initialmaxstreamsuni,omitempty"` + Maxackdelay int `json:"maxackdelay,omitempty"` + Maxidletimeout int `json:"maxidletimeout,omitempty"` + Maxudpdatagramsperburst int `json:"maxudpdatagramsperburst,omitempty"` + Maxudppayloadsize int `json:"maxudppayloadsize,omitempty"` + Newtokenvalidityperiod int `json:"newtokenvalidityperiod,omitempty"` + Retrytokenvalidityperiod int `json:"retrytokenvalidityperiod,omitempty"` + Statelessaddressvalidation string `json:"statelessaddressvalidation,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Quicparam struct { + Quicsecrettimeout int `json:"quicsecrettimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/quicbridge.go b/nitrogo/models/quicbridge.go new file mode 100644 index 0000000..9faf6e1 --- /dev/null +++ b/nitrogo/models/quicbridge.go @@ -0,0 +1,13 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Quicbridgeprofile struct { + Name string `json:"name,omitempty"` + Routingalgorithm string `json:"routingalgorithm,omitempty"` + Serveridlength int `json:"serveridlength,omitempty"` + Refcnt string `json:"refcnt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/rdp.go b/nitrogo/models/rdp.go new file mode 100644 index 0000000..5c6849d --- /dev/null +++ b/nitrogo/models/rdp.go @@ -0,0 +1,54 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Rdpclientprofile struct { + Name string `json:"name,omitempty"` + Rdpurloverride string `json:"rdpurloverride,omitempty"` + Redirectclipboard string `json:"redirectclipboard,omitempty"` + Redirectdrives string `json:"redirectdrives,omitempty"` + Redirectprinters string `json:"redirectprinters,omitempty"` + Redirectcomports string `json:"redirectcomports,omitempty"` + Redirectpnpdevices string `json:"redirectpnpdevices,omitempty"` + Keyboardhook string `json:"keyboardhook,omitempty"` + Audiocapturemode string `json:"audiocapturemode,omitempty"` + Videoplaybackmode string `json:"videoplaybackmode,omitempty"` + Multimonitorsupport string `json:"multimonitorsupport,omitempty"` + Rdpcookievalidity int `json:"rdpcookievalidity,omitempty"` + Addusernameinrdpfile string `json:"addusernameinrdpfile,omitempty"` + Rdpfilename string `json:"rdpfilename,omitempty"` + Rdphost string `json:"rdphost,omitempty"` + Rdplistener string `json:"rdplistener,omitempty"` + Rdpcustomparams string `json:"rdpcustomparams,omitempty"` + Psk string `json:"psk,omitempty"` + Randomizerdpfilename string `json:"randomizerdpfilename,omitempty"` + Rdplinkattribute string `json:"rdplinkattribute,omitempty"` + Rdpvalidateclientip string `json:"rdpvalidateclientip,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rdpconnections struct { + Username string `json:"username,omitempty"` + All bool `json:"all,omitempty"` + Endpointip string `json:"endpointip,omitempty"` + Endpointport string `json:"endpointport,omitempty"` + Targetip string `json:"targetip,omitempty"` + Targetport string `json:"targetport,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rdpserverprofile struct { + Name string `json:"name,omitempty"` + Rdpip string `json:"rdpip,omitempty"` + Rdpport int `json:"rdpport,omitempty"` + Psk string `json:"psk,omitempty"` + Rdpredirection string `json:"rdpredirection,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/reputation.go b/nitrogo/models/reputation.go new file mode 100644 index 0000000..af62c13 --- /dev/null +++ b/nitrogo/models/reputation.go @@ -0,0 +1,13 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Reputationsettings struct { + Proxyserver string `json:"proxyserver,omitempty"` + Proxyport int `json:"proxyport,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/responder.go b/nitrogo/models/responder.go new file mode 100644 index 0000000..b77460c --- /dev/null +++ b/nitrogo/models/responder.go @@ -0,0 +1,227 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Responderglobalbinding struct { +} + +type Responderglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Responderglobalresponderpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Responderpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicyresponderglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicylabelresponderpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Responderaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Target string `json:"target,omitempty"` + Htmlpage string `json:"htmlpage,omitempty"` + Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` + Comment string `json:"comment,omitempty"` + Responsestatuscode int `json:"responsestatuscode,omitempty"` + Reasonphrase string `json:"reasonphrase,omitempty"` + Headers []string `json:"headers,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Responderpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Appflowaction string `json:"appflowaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Responderpolicycrvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Responderhtmlpage struct { + Src string `json:"src,omitempty"` + Name string `json:"name,omitempty"` + Comment string `json:"comment,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Cacertfile string `json:"cacertfile,omitempty"` + Response string `json:"response,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Responderpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Responderpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Responderpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Responderparam struct { + Undefaction string `json:"undefaction,omitempty"` + Timeout int `json:"timeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Responderpolicyresponderpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Responderpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/rewrite.go b/nitrogo/models/rewrite.go new file mode 100644 index 0000000..a9dc357 --- /dev/null +++ b/nitrogo/models/rewrite.go @@ -0,0 +1,213 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Rewritepolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicyrewriteglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewriteparam struct { + Undefaction string `json:"undefaction,omitempty"` + Timeout int `json:"timeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rewritepolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rewritepolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Rewritepolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Rewritepolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Rewritepolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Rewritepolicyrewritepolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Transform string `json:"transform,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rewritepolicylabelrewritepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Rewriteaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Target string `json:"target,omitempty"` + Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` + Search string `json:"search,omitempty"` + Refinesearch string `json:"refinesearch,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Description string `json:"description,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Rewriteglobalbinding struct { +} + +type Rewriteglobalrewritepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Rewritepolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewritepolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Rewriteglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} diff --git a/nitrogo/models/router.go b/nitrogo/models/router.go new file mode 100644 index 0000000..a7b1943 --- /dev/null +++ b/nitrogo/models/router.go @@ -0,0 +1,12 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Routerdynamicrouting struct { + Commandstring string `json:"commandstring,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Output string `json:"output,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/sc.go b/nitrogo/models/sc.go new file mode 100644 index 0000000..41d6ab0 --- /dev/null +++ b/nitrogo/models/sc.go @@ -0,0 +1,23 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Scpolicy struct { + Name string `json:"name,omitempty"` + Url string `json:"url,omitempty"` + Rule string `json:"rule,omitempty"` + Delay int `json:"delay,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Action string `json:"action,omitempty"` + Altcontentsvcname string `json:"altcontentsvcname,omitempty"` + Altcontentpath string `json:"altcontentpath,omitempty"` +} + +type Scparameter struct { + Sessionlife int `json:"sessionlife,omitempty"` + Vsr string `json:"vsr,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` +} diff --git a/nitrogo/models/smpp.go b/nitrogo/models/smpp.go new file mode 100644 index 0000000..9caf4ab --- /dev/null +++ b/nitrogo/models/smpp.go @@ -0,0 +1,21 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Smppparam struct { + Clientmode string `json:"clientmode,omitempty"` + Msgqueue string `json:"msgqueue,omitempty"` + Msgqueuesize int `json:"msgqueuesize,omitempty"` + Addrton int `json:"addrton"` + Addrnpi int `json:"addrnpi"` + Addrrange string `json:"addrrange,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Smppuser struct { + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/snmp.go b/nitrogo/models/snmp.go new file mode 100644 index 0000000..39cec76 --- /dev/null +++ b/nitrogo/models/snmp.go @@ -0,0 +1,137 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Snmpview struct { + Name string `json:"name,omitempty"` + Subtree string `json:"subtree,omitempty"` + Type string `json:"type,omitempty"` + Storagetype string `json:"storagetype,omitempty"` + Status string `json:"status,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpengineid struct { + Engineid string `json:"engineid,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Defaultengineid string `json:"defaultengineid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpgroup struct { + Name string `json:"name,omitempty"` + Securitylevel string `json:"securitylevel,omitempty"` + Readviewname string `json:"readviewname,omitempty"` + Storagetype string `json:"storagetype,omitempty"` + Status string `json:"status,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpmanager struct { + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Ip string `json:"ip,omitempty"` + Domain string `json:"domain,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpoid struct { + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpoption struct { + Snmpset string `json:"snmpset,omitempty"` + Snmptraplogging string `json:"snmptraplogging,omitempty"` + Partitionnameintrap string `json:"partitionnameintrap,omitempty"` + Snmptraplogginglevel string `json:"snmptraplogginglevel,omitempty"` + Severityinfointrap string `json:"severityinfointrap,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmptrap struct { + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Version string `json:"version,omitempty"` + Td int `json:"td,omitempty"` + Destport int `json:"destport,omitempty"` + Communityname string `json:"communityname,omitempty"` + Srcip string `json:"srcip,omitempty"` + Severity string `json:"severity,omitempty"` + Allpartitions string `json:"allpartitions,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmptrapbinding struct { + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Version string `json:"version,omitempty"` + Td int `json:"td,omitempty"` +} + +type Snmpuser struct { + Name string `json:"name,omitempty"` + Group string `json:"group,omitempty"` + Authtype string `json:"authtype,omitempty"` + Authpasswd string `json:"authpasswd,omitempty"` + Privtype string `json:"privtype,omitempty"` + Privpasswd string `json:"privpasswd,omitempty"` + Engineid string `json:"engineid,omitempty"` + Storagetype string `json:"storagetype,omitempty"` + Status string `json:"status,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpalarm struct { + Trapname string `json:"trapname,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Normalvalue int `json:"normalvalue,omitempty"` + Time int `json:"time,omitempty"` + State string `json:"state,omitempty"` + Severity string `json:"severity,omitempty"` + Logging string `json:"logging,omitempty"` + Timeout string `json:"timeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpcommunity struct { + Communityname string `json:"communityname,omitempty"` + Permissions string `json:"permissions,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmpmib struct { + Contact string `json:"contact,omitempty"` + Name string `json:"name,omitempty"` + Location string `json:"location,omitempty"` + Customid string `json:"customid,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Sysdesc string `json:"sysdesc,omitempty"` + Sysuptime string `json:"sysuptime,omitempty"` + Sysservices string `json:"sysservices,omitempty"` + Sysoid string `json:"sysoid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Snmptrapsnmpuserbinding struct { + Username string `json:"username,omitempty"` + Securitylevel string `json:"securitylevel,omitempty"` + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Td int `json:"td,omitempty"` + Version string `json:"version,omitempty"` +} + +type Snmptrapuserbinding struct { + Username string `json:"username,omitempty"` + Securitylevel string `json:"securitylevel,omitempty"` + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Td uint32 `json:"td,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/nitrogo/models/spillover.go b/nitrogo/models/spillover.go new file mode 100644 index 0000000..97cec69 --- /dev/null +++ b/nitrogo/models/spillover.go @@ -0,0 +1,71 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Spilloverpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Spilloveraction struct { + Name string `json:"name,omitempty"` + Action string `json:"action,omitempty"` + Newname string `json:"newname,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Spilloverpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Spilloverpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Spilloverpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Spilloverpolicygslbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Spilloverpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/ssl.go b/nitrogo/models/ssl.go new file mode 100644 index 0000000..dbe80c8 --- /dev/null +++ b/nitrogo/models/ssl.go @@ -0,0 +1,1445 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Sslcacertbundle struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Bundlefile string `json:"bundlefile,omitempty"` + Servername string `json:"servername,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcertificatechain struct { + Certkeyname string `json:"certkeyname,omitempty"` + Chainlinked string `json:"chainlinked,omitempty"` + Chainpossiblelinks string `json:"chainpossiblelinks,omitempty"` + Chainissuer string `json:"chainissuer,omitempty"` + Chaincomplete string `json:"chaincomplete,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcertkeyocspresponderbinding struct { + Ocspresponder string `json:"ocspresponder,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslcipher struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Ciphgrpalias string `json:"ciphgrpalias,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslpolicyservicebinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslcertkeysslprofilebinding struct { + Sslprofile string `json:"sslprofile,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslechconfig struct { + Echconfigname string `json:"echconfigname,omitempty"` + Echcipher string `json:"echcipher,omitempty"` + Hpkekeyname string `json:"hpkekeyname,omitempty"` + Echpublicname string `json:"echpublicname,omitempty"` + Echconfigid int `json:"echconfigid,omitempty"` + Version int `json:"version,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslocspresponder struct { + Name string `json:"name,omitempty"` + Url string `json:"url,omitempty"` + Cache string `json:"cache,omitempty"` + Cachetimeout int `json:"cachetimeout,omitempty"` + Batchingdepth int `json:"batchingdepth,omitempty"` + Batchingdelay int `json:"batchingdelay,omitempty"` + Resptimeout int `json:"resptimeout,omitempty"` + Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` + Respondercert string `json:"respondercert,omitempty"` + Trustresponder bool `json:"trustresponder,omitempty"` + Producedattimeskew int `json:"producedattimeskew,omitempty"` + Signingcert string `json:"signingcert,omitempty"` + Usenonce string `json:"usenonce,omitempty"` + Insertclientcert string `json:"insertclientcert,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Ocspaiarefcount string `json:"ocspaiarefcount,omitempty"` + Ocspipaddrstr string `json:"ocspipaddrstr,omitempty"` + Port string `json:"port,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofilesslcertkeybinding struct { + Sslicacertkey string `json:"sslicacertkey,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslprofilevserverbinding struct { + Servicename string `json:"servicename,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` +} + +type Sslrsakey struct { + Keyfile string `json:"keyfile,omitempty"` + Bits int `json:"bits,omitempty"` + Exponent string `json:"exponent,omitempty"` + Keyform string `json:"keyform,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Aes256 bool `json:"aes256,omitempty"` + Password string `json:"password,omitempty"` + Pkcs8 bool `json:"pkcs8,omitempty"` +} + +type Sslservice struct { + Servicename string `json:"servicename,omitempty"` + Dh string `json:"dh,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Dtls1 string `json:"dtls1,omitempty"` + Dtls12 string `json:"dtls12,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Commonname string `json:"commonname,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Dtlsprofilename string `json:"dtlsprofilename,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Service string `json:"service,omitempty"` + Skipcaname string `json:"skipcaname,omitempty"` + Dtlsflag string `json:"dtlsflag,omitempty"` + Quicflag string `json:"quicflag,omitempty"` + Skipcacertbundle string `json:"skipcacertbundle,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslciphersslciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` +} + +type Ssldhfile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Ssldhparam struct { + Dhfile string `json:"dhfile,omitempty"` + Bits int `json:"bits,omitempty"` + Gen string `json:"gen,omitempty"` +} + +type Sslpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Type string `json:"type,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke string `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Flowtype string `json:"flowtype,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofilecertkeybinding struct { + Sslicacertkey string `json:"sslicacertkey,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` +} + +type Sslvserversslcipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Vservername string `json:"vservername,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslcrlbinding struct { + Crlname string `json:"crlname,omitempty"` +} + +type Sslfipssimtarget struct { + Keyvector string `json:"keyvector,omitempty"` + Sourcesecret string `json:"sourcesecret,omitempty"` + Certfile string `json:"certfile,omitempty"` + Targetsecret string `json:"targetsecret,omitempty"` +} + +type Sslglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Sslpkcs12 struct { + Outfile string `json:"outfile,omitempty"` + Import bool `json:"Import,omitempty"` + Pkcs12file string `json:"pkcs12file,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Aes256 bool `json:"aes256,omitempty"` + Export bool `json:"export,omitempty"` + Certfile string `json:"certfile,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Password string `json:"password,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` +} + +type Sslcertkeysslocspresponderbinding struct { + Ocspresponder string `json:"ocspresponder,omitempty"` + Priority int `json:"priority,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslcertkeybundlesslvserverbinding struct { + Servername string `json:"servername,omitempty"` + Certkeybundlename string `json:"certkeybundlename,omitempty"` +} + +type Sslprofileecccurvebinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslvserverhashicorpbinding struct { + Vault string `json:"vault,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcert struct { + Certfile string `json:"certfile,omitempty"` + Reqfile string `json:"reqfile,omitempty"` + Certtype string `json:"certtype,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` + Days int `json:"days,omitempty"` + Subjectaltname string `json:"subjectaltname,omitempty"` + Certform string `json:"certform,omitempty"` + Cacert string `json:"cacert,omitempty"` + Cacertform string `json:"cacertform,omitempty"` + Cakey string `json:"cakey,omitempty"` + Cakeyform string `json:"cakeyform,omitempty"` + Caserial string `json:"caserial,omitempty"` +} + +type Sslcertkeysslvserverbinding struct { + Servername string `json:"servername,omitempty"` + Data int `json:"data,omitempty"` + Version int `json:"version,omitempty"` + Certkey string `json:"certkey,omitempty"` + Vservername string `json:"vservername,omitempty"` + Vserver bool `json:"vserver,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslcipherservicebinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Service bool `json:"service,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicegroup bool `json:"servicegroup,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Ssldtlsprofile struct { + Name string `json:"name,omitempty"` + Pmtudiscovery string `json:"pmtudiscovery,omitempty"` + Maxrecordsize int `json:"maxrecordsize,omitempty"` + Maxretrytime int `json:"maxretrytime,omitempty"` + Helloverifyrequest string `json:"helloverifyrequest,omitempty"` + Terminatesession string `json:"terminatesession,omitempty"` + Maxpacketsize int `json:"maxpacketsize,omitempty"` + Maxholdqlen int `json:"maxholdqlen,omitempty"` + Maxbadmacignorecount int `json:"maxbadmacignorecount,omitempty"` + Initialretrytimeout int `json:"initialretrytimeout,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslfipssimsource struct { + Targetsecret string `json:"targetsecret,omitempty"` + Sourcesecret string `json:"sourcesecret,omitempty"` + Certfile string `json:"certfile,omitempty"` +} + +type Sslhpkekey struct { + Hpkekeyname string `json:"hpkekeyname,omitempty"` + File string `json:"file,omitempty"` + Dhkem string `json:"dhkem,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Sslvservercertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Cleartextport int32 `json:"cleartextport,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcertchainsslcertkeybinding struct { + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Islinked bool `json:"islinked,omitempty"` + Isca bool `json:"isca,omitempty"` + Addsubject bool `json:"addsubject,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` +} + +type Sslcacertbundlebinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` +} + +type Sslcrl struct { + Crlname string `json:"crlname,omitempty"` + Crlpath string `json:"crlpath,omitempty"` + Inform string `json:"inform,omitempty"` + Refresh string `json:"refresh,omitempty"` + Cacert string `json:"cacert,omitempty"` + Method string `json:"method,omitempty"` + Server string `json:"server,omitempty"` + Url string `json:"url,omitempty"` + Port int `json:"port,omitempty"` + Basedn string `json:"basedn,omitempty"` + Scope string `json:"scope,omitempty"` + Interval string `json:"interval,omitempty"` + Day int `json:"day,omitempty"` + Time string `json:"time,omitempty"` + Binddn string `json:"binddn,omitempty"` + Password string `json:"password,omitempty"` + Binary string `json:"binary,omitempty"` + Cacertfile string `json:"cacertfile,omitempty"` + Cakeyfile string `json:"cakeyfile,omitempty"` + Indexfile string `json:"indexfile,omitempty"` + Revoke string `json:"revoke,omitempty"` + Gencrl string `json:"gencrl,omitempty"` + Flags string `json:"flags,omitempty"` + Lastupdatetime string `json:"lastupdatetime,omitempty"` + Version string `json:"version,omitempty"` + Signaturealgo string `json:"signaturealgo,omitempty"` + Issuer string `json:"issuer,omitempty"` + Lastupdate string `json:"lastupdate,omitempty"` + Nextupdate string `json:"nextupdate,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslvserversslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcertfile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofilesslechconfigbinding struct { + Echconfigname string `json:"echconfigname,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslserviceecccurvebinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslcertkeyprofilebinding struct { + Sslprofile string `json:"sslprofile,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslcertchaincertkeybinding struct { + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Islinked bool `json:"islinked,omitempty"` + Isca bool `json:"isca,omitempty"` + Addsubject bool `json:"addsubject,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` +} + +type Sslcertkeycrldistributionbinding struct { + Issuer string `json:"issuer,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslhsmkey struct { + Hsmkeyname string `json:"hsmkeyname,omitempty"` + Hsmtype string `json:"hsmtype,omitempty"` + Key string `json:"key,omitempty"` + Serialnum string `json:"serialnum,omitempty"` + Password string `json:"password,omitempty"` + Keystore string `json:"keystore,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslpolicysslservicebinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslservicegroup struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Commonname string `json:"commonname,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Dh string `json:"dh,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhcount string `json:"dhcount,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount string `json:"ersacount,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Cleartextport string `json:"cleartextport,omitempty"` + Servicename string `json:"servicename,omitempty"` + Ca string `json:"ca,omitempty"` + Snicert string `json:"snicert,omitempty"` + Quicflag string `json:"quicflag,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcipherbinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` +} + +type Sslpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Sslpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslservicecertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Cleartextport int32 `json:"cleartextport,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslservicesslpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Polinherit int `json:"polinherit,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslservicegroupsslcacertbundlebinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslcacertgroup struct { + Cacertgroupname string `json:"cacertgroupname,omitempty"` + Cacertgroupreferences string `json:"cacertgroupreferences,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofileciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslservicegroupecccurvebinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslcertchain struct { + Certkeyname string `json:"certkeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslparameter struct { + Quantumsize string `json:"quantumsize,omitempty"` + Crlmemorysizemb int `json:"crlmemorysizemb,omitempty"` + Strictcachecks string `json:"strictcachecks,omitempty"` + Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` + Denysslreneg string `json:"denysslreneg,omitempty"` + Insertionencoding string `json:"insertionencoding,omitempty"` + Ocspcachesize int `json:"ocspcachesize,omitempty"` + Pushflag int `json:"pushflag,omitempty"` + Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` + Snihttphostmatch string `json:"snihttphostmatch,omitempty"` + Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` + Cryptodevdisablelimit int `json:"cryptodevdisablelimit,omitempty"` + Undefactioncontrol string `json:"undefactioncontrol,omitempty"` + Undefactiondata string `json:"undefactiondata,omitempty"` + Defaultprofile string `json:"defaultprofile,omitempty"` + Softwarecryptothreshold int `json:"softwarecryptothreshold,omitempty"` + Hybridfipsmode string `json:"hybridfipsmode,omitempty"` + Sigdigesttype []string `json:"sigdigesttype,omitempty"` + Sslierrorcache string `json:"sslierrorcache,omitempty"` + Sslimaxerrorcachemem int `json:"sslimaxerrorcachemem,omitempty"` + Insertcertspace string `json:"insertcertspace,omitempty"` + Ndcppcompliancecertcheck string `json:"ndcppcompliancecertcheck,omitempty"` + Heterogeneoussslhw string `json:"heterogeneoussslhw,omitempty"` + Operationqueuelimit int `json:"operationqueuelimit,omitempty"` + Svctls1112disable string `json:"svctls1112disable,omitempty"` + Montls1112disable string `json:"montls1112disable,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslvserverbinding struct { + Vservername string `json:"vservername,omitempty"` +} + +type Sslfipskey struct { + Fipskeyname string `json:"fipskeyname,omitempty"` + Keytype string `json:"keytype,omitempty"` + Exponent string `json:"exponent,omitempty"` + Modulus int `json:"modulus,omitempty"` + Curve string `json:"curve,omitempty"` + Key string `json:"key,omitempty"` + Inform string `json:"inform,omitempty"` + Wrapkeyname string `json:"wrapkeyname,omitempty"` + Iv string `json:"iv,omitempty"` + Size string `json:"size,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcertchainbinding struct { + Certkeyname string `json:"certkeyname,omitempty"` +} + +type Sslcertkeybinding struct { + Certkey string `json:"certkey,omitempty"` +} + +type Sslpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslvserversslcacertbundlebinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslciphersslprofilebinding struct { + Sslprofile string `json:"sslprofile,omitempty"` + Description string `json:"description,omitempty"` + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslprofilecipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslcertreq struct { + Reqfile string `json:"reqfile,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Subjectaltname string `json:"subjectaltname,omitempty"` + Fipskeyname string `json:"fipskeyname,omitempty"` + Keyform string `json:"keyform,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` + Countryname string `json:"countryname,omitempty"` + Statename string `json:"statename,omitempty"` + Organizationname string `json:"organizationname,omitempty"` + Organizationunitname string `json:"organizationunitname,omitempty"` + Localityname string `json:"localityname,omitempty"` + Commonname string `json:"commonname,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Challengepassword string `json:"challengepassword,omitempty"` + Companyname string `json:"companyname,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` +} + +type Sslpolicysslvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslcertlink struct { + Certkeyname string `json:"certkeyname,omitempty"` + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcipherprofilebinding struct { + Sslprofile string `json:"sslprofile,omitempty"` + Description string `json:"description,omitempty"` + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` +} + +type Sslcertkeybundleintermediatecertlinksbinding struct { + Subject string `json:"subject,omitempty"` + Serial string `json:"serial,omitempty"` + Issuer string `json:"issuer,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize int `json:"publickeysize,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Status string `json:"status,omitempty"` + Certkeybundlename string `json:"certkeybundlename,omitempty"` +} + +type Sslcipherindividualcipherbinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` +} + +type Sslglobalsslpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Ssllogprofile struct { + Name string `json:"name,omitempty"` + Ssllogclauth string `json:"ssllogclauth,omitempty"` + Ssllogclauthfailures string `json:"ssllogclauthfailures,omitempty"` + Sslloghs string `json:"sslloghs,omitempty"` + Sslloghsfailures string `json:"sslloghsfailures,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslservicesslcacertbundlebinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslservicegroupcipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslciphersuite struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Sslservicegroupsslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslcacertgroupcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Cacertgroupname string `json:"cacertgroupname,omitempty"` +} + +type Sslcacertgroupsslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Cacertgroupname string `json:"cacertgroupname,omitempty"` +} + +type Sslcertkeybundle struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` + Bundlefile string `json:"bundlefile,omitempty"` + Passplain string `json:"passplain,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslservicesslciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Cipherdefaulton int `json:"cipherdefaulton,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslvserverecccurvebinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslvserversslpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Type string `json:"type,omitempty"` + Polinherit int `json:"polinherit,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcertkeyvserverbinding struct { + Servername string `json:"servername,omitempty"` + Data uint32 `json:"data,omitempty"` + Version int32 `json:"version,omitempty"` + Certkey string `json:"certkey,omitempty"` + Vservername string `json:"vservername,omitempty"` + Vserver bool `json:"vserver,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslpolicysslpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslcipherciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Description string `json:"description,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` +} + +type Ssldefaultprofile struct { +} + +type Sslservicegroupsslcipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslvserversslciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcrlfile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslservicegroupbinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslpolicylabelsslpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Invoke bool `json:"invoke,omitempty"` +} + +type Sslprofilesslciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslservicesslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslvserversslcertkeybundlebinding struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` + Snicertkeybundle bool `json:"snicertkeybundle,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslwrapkey struct { + Wrapkeyname string `json:"wrapkeyname,omitempty"` + Password string `json:"password,omitempty"` + Salt string `json:"salt,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcertkeybundlebinding struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` +} + +type Sslpkcs8 struct { + Pkcs8file string `json:"pkcs8file,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Password string `json:"password,omitempty"` +} + +type Sslpolicysslglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslserviceciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslcacertbundleintermediatecacertlistbinding struct { + Subject string `json:"subject,omitempty"` + Serial string `json:"serial,omitempty"` + Issuer string `json:"issuer,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize int `json:"publickeysize,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Status string `json:"status,omitempty"` + Cacertbundlename string `json:"cacertbundlename,omitempty"` +} + +type Sslcipherservicegroupbinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Service bool `json:"service,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicegroup bool `json:"servicegroup,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslvserver struct { + Vservername string `json:"vservername,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Dh string `json:"dh,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Dtls1 string `json:"dtls1,omitempty"` + Dtls12 string `json:"dtls12,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Dtlsprofilename string `json:"dtlsprofilename,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Hsts string `json:"hsts,omitempty"` + Maxage int `json:"maxage,omitempty"` + Includesubdomains string `json:"includesubdomains,omitempty"` + Preload string `json:"preload,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Zerorttearlydata string `json:"zerorttearlydata,omitempty"` + Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` + Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` + Defaultsni string `json:"defaultsni,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Service string `json:"service,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ca string `json:"ca,omitempty"` + Snicert string `json:"snicert,omitempty"` + Skipcaname string `json:"skipcaname,omitempty"` + Dtlsflag string `json:"dtlsflag,omitempty"` + Quicflag string `json:"quicflag,omitempty"` + Skipcacertbundle string `json:"skipcacertbundle,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslvservercipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Vservername string `json:"vservername,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslcertkeyservicebinding struct { + Servicename string `json:"servicename,omitempty"` + Data int `json:"data,omitempty"` + Version int `json:"version,omitempty"` + Certkey string `json:"certkey,omitempty"` + Service bool `json:"service,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Ca bool `json:"ca,omitempty"` +} + +type Sslecdsakey struct { + Keyfile string `json:"keyfile,omitempty"` + Curve string `json:"curve,omitempty"` + Keyform string `json:"keyform,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Aes256 bool `json:"aes256,omitempty"` + Password string `json:"password,omitempty"` + Pkcs8 bool `json:"pkcs8,omitempty"` +} + +type Sslkeyfile struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Password string `json:"password,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslservicecipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Servicename string `json:"servicename,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslaction struct { + Name string `json:"name,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcertverification string `json:"clientcertverification,omitempty"` + Ssllogprofile string `json:"ssllogprofile,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Certheader string `json:"certheader,omitempty"` + Clientcertserialnumber string `json:"clientcertserialnumber,omitempty"` + Certserialheader string `json:"certserialheader,omitempty"` + Clientcertsubject string `json:"clientcertsubject,omitempty"` + Certsubjectheader string `json:"certsubjectheader,omitempty"` + Clientcerthash string `json:"clientcerthash,omitempty"` + Certhashheader string `json:"certhashheader,omitempty"` + Clientcertfingerprint string `json:"clientcertfingerprint,omitempty"` + Certfingerprintheader string `json:"certfingerprintheader,omitempty"` + Certfingerprintdigest string `json:"certfingerprintdigest,omitempty"` + Clientcertissuer string `json:"clientcertissuer,omitempty"` + Certissuerheader string `json:"certissuerheader,omitempty"` + Sessionid string `json:"sessionid,omitempty"` + Sessionidheader string `json:"sessionidheader,omitempty"` + Cipher string `json:"cipher,omitempty"` + Cipherheader string `json:"cipherheader,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Certnotbeforeheader string `json:"certnotbeforeheader,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Certnotafterheader string `json:"certnotafterheader,omitempty"` + Owasupport string `json:"owasupport,omitempty"` + Forward string `json:"forward,omitempty"` + Cacertgrpname string `json:"cacertgrpname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslglobalbinding struct { +} + +type Sslservicegroupcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ca bool `json:"ca,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Invoke bool `json:"invoke,omitempty"` +} + +type Sslservicesslcipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Description string `json:"description,omitempty"` + Cipherdefaulton int `json:"cipherdefaulton,omitempty"` + Servicename string `json:"servicename,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslservicegroupsslciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Sslvserverciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslcrlserialnumberbinding struct { + Number string `json:"number,omitempty"` + Date string `json:"date,omitempty"` + Crlname string `json:"crlname,omitempty"` +} + +type Sslpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Sslprofilesslcipherbinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Ciphername string `json:"ciphername,omitempty"` +} + +type Sslcacertgroupbinding struct { + Cacertgroupname string `json:"cacertgroupname,omitempty"` +} + +type Sslciphersslvserverbinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Vservername string `json:"vservername,omitempty"` + Vserver bool `json:"vserver,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslprofile struct { + Name string `json:"name,omitempty"` + Sslprofiletype string `json:"sslprofiletype,omitempty"` + Ssllogprofile string `json:"ssllogprofile,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dh string `json:"dh,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Snienable string `json:"snienable,omitempty"` + Allowunknownsni string `json:"allowunknownsni,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Commonname string `json:"commonname,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Insertionencoding string `json:"insertionencoding,omitempty"` + Denysslreneg string `json:"denysslreneg,omitempty"` + Maxrenegrate int `json:"maxrenegrate,omitempty"` + Quantumsize string `json:"quantumsize,omitempty"` + Strictcachecks string `json:"strictcachecks,omitempty"` + Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` + Pushflag int `json:"pushflag,omitempty"` + Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` + Snihttphostmatch string `json:"snihttphostmatch,omitempty"` + Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` + Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` + Clientauthuseboundcachain string `json:"clientauthuseboundcachain,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Sslireneg string `json:"sslireneg,omitempty"` + Ssliocspcheck string `json:"ssliocspcheck,omitempty"` + Sslimaxsessperserver int `json:"sslimaxsessperserver,omitempty"` + Sessionticket string `json:"sessionticket,omitempty"` + Sessionticketlifetime int `json:"sessionticketlifetime,omitempty"` + Sessionticketkeyrefresh string `json:"sessionticketkeyrefresh,omitempty"` + Sessionticketkeydata string `json:"sessionticketkeydata,omitempty"` + Sessionkeylifetime int `json:"sessionkeylifetime,omitempty"` + Prevsessionkeylifetime int `json:"prevsessionkeylifetime,omitempty"` + Hsts string `json:"hsts,omitempty"` + Maxage int `json:"maxage,omitempty"` + Includesubdomains string `json:"includesubdomains,omitempty"` + Preload string `json:"preload,omitempty"` + Skipclientcertpolicycheck string `json:"skipclientcertpolicycheck,omitempty"` + Zerorttearlydata string `json:"zerorttearlydata,omitempty"` + Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` + Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` + Allowextendedmastersecret string `json:"allowextendedmastersecret,omitempty"` + Alpnprotocol string `json:"alpnprotocol,omitempty"` + Encryptedclienthello string `json:"encryptedclienthello,omitempty"` + Defaultsni string `json:"defaultsni,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Snicert string `json:"snicert,omitempty"` + Skipcaname string `json:"skipcaname,omitempty"` + Invoke string `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Service string `json:"service,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Sslpfobjecttype string `json:"sslpfobjecttype,omitempty"` + Ssliverifyservercertforreuse string `json:"ssliverifyservercertforreuse,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslprofilesslvserverbinding struct { + Servicename string `json:"servicename,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` +} + +type Sslservicebinding struct { + Servicename string `json:"servicename,omitempty"` +} + +type Sslvserverpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Type string `json:"type,omitempty"` + Polinherit uint32 `json:"polinherit,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Sslfips struct { + Inithsm string `json:"inithsm,omitempty"` + Sopassword string `json:"sopassword,omitempty"` + Oldsopassword string `json:"oldsopassword,omitempty"` + Userpassword string `json:"userpassword,omitempty"` + Hsmlabel string `json:"hsmlabel,omitempty"` + Fipsfw string `json:"fipsfw,omitempty"` + Erasedata string `json:"erasedata,omitempty"` + Serial string `json:"serial,omitempty"` + Majorversion string `json:"majorversion,omitempty"` + Minorversion string `json:"minorversion,omitempty"` + Fipshwmajorversion string `json:"fipshwmajorversion,omitempty"` + Fipshwminorversion string `json:"fipshwminorversion,omitempty"` + Fipshwversionstring string `json:"fipshwversionstring,omitempty"` + Flashmemorytotal string `json:"flashmemorytotal,omitempty"` + Flashmemoryfree string `json:"flashmemoryfree,omitempty"` + Sramtotal string `json:"sramtotal,omitempty"` + Sramfree string `json:"sramfree,omitempty"` + Status string `json:"status,omitempty"` + Flag string `json:"flag,omitempty"` + Serialno string `json:"serialno,omitempty"` + Model string `json:"model,omitempty"` + State string `json:"state,omitempty"` + Firmwarereleasedate string `json:"firmwarereleasedate,omitempty"` + Coresmax string `json:"coresmax,omitempty"` + Coresenabled string `json:"coresenabled,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslservicepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Polinherit uint32 `json:"polinherit,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Servicename string `json:"servicename,omitempty"` +} + +type Sslcertbundle struct { + Name string `json:"name,omitempty"` + Src string `json:"src,omitempty"` + Inuse string `json:"inuse,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslcertkey struct { + Certkey string `json:"certkey,omitempty"` + Cert string `json:"cert,omitempty"` + Key string `json:"key,omitempty"` + Password bool `json:"password,omitempty"` + Fipskey string `json:"fipskey,omitempty"` + Hsmkey string `json:"hsmkey,omitempty"` + Inform string `json:"inform,omitempty"` + Passplain string `json:"passplain,omitempty"` + Expirymonitor string `json:"expirymonitor,omitempty"` + Notificationperiod int `json:"notificationperiod,omitempty"` + Bundle string `json:"bundle,omitempty"` + Deletecertkeyfilesonremoval string `json:"deletecertkeyfilesonremoval,omitempty"` + Deletefromdevice bool `json:"deletefromdevice,omitempty"` + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Nodomaincheck bool `json:"nodomaincheck,omitempty"` + Ocspstaplingcache bool `json:"ocspstaplingcache,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Certificatetype string `json:"certificatetype,omitempty"` + Serial string `json:"serial,omitempty"` + Issuer string `json:"issuer,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Daystoexpiration string `json:"daystoexpiration,omitempty"` + Subject string `json:"subject,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize string `json:"publickeysize,omitempty"` + Version string `json:"version,omitempty"` + Priority string `json:"priority,omitempty"` + Status string `json:"status,omitempty"` + Passcrypt string `json:"passcrypt,omitempty"` + Data string `json:"data,omitempty"` + Servicename string `json:"servicename,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Ocspresponsestatus string `json:"ocspresponsestatus,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Certkeydigest string `json:"certkeydigest,omitempty"` + Certificatesource string `json:"certificatesource,omitempty"` + Certkeystatus string `json:"certkeystatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Sslciphervserverbinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Vservername string `json:"vservername,omitempty"` + Vserver bool `json:"vserver,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Cipherpriority uint32 `json:"cipherpriority,omitempty"` +} + +type Sslservicegroupciphersuitebinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} diff --git a/nitrogo/models/stream.go b/nitrogo/models/stream.go new file mode 100644 index 0000000..2401ddc --- /dev/null +++ b/nitrogo/models/stream.go @@ -0,0 +1,54 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Streamidentifiersessionbinding struct { + Name string `json:"name,omitempty"` +} + +type Streamidentifierstreamsessionbinding struct { + Name string `json:"name,omitempty"` + Analyticsprofile string `json:"analyticsprofile,omitempty"` +} + +type Streamselector struct { + Name string `json:"name,omitempty"` + Rule []string `json:"rule,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Streamsession struct { + Name string `json:"name,omitempty"` +} + +type Streamidentifier struct { + Name string `json:"name,omitempty"` + Selectorname string `json:"selectorname,omitempty"` + Interval int `json:"interval,omitempty"` + Samplecount int `json:"samplecount,omitempty"` + Sort string `json:"sort,omitempty"` + Snmptrap string `json:"snmptrap,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Trackackonlypackets string `json:"trackackonlypackets,omitempty"` + Tracktransactions string `json:"tracktransactions,omitempty"` + Maxtransactionthreshold int `json:"maxtransactionthreshold,omitempty"` + Mintransactionthreshold int `json:"mintransactionthreshold,omitempty"` + Acceptancethreshold string `json:"acceptancethreshold,omitempty"` + Breachthreshold int `json:"breachthreshold,omitempty"` + Log string `json:"log,omitempty"` + Loginterval int `json:"loginterval,omitempty"` + Loglimit int `json:"loglimit,omitempty"` + Rule string `json:"rule,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Streamidentifieranalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Streamidentifierbinding struct { + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/subscriber.go b/nitrogo/models/subscriber.go new file mode 100644 index 0000000..d8674c7 --- /dev/null +++ b/nitrogo/models/subscriber.go @@ -0,0 +1,92 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Subscribergxinterface struct { + Vserver string `json:"vserver,omitempty"` + Service string `json:"service,omitempty"` + Pcrfrealm string `json:"pcrfrealm,omitempty"` + Holdonsubscriberabsence string `json:"holdonsubscriberabsence,omitempty"` + Requesttimeout int `json:"requesttimeout,omitempty"` + Requestretryattempts int `json:"requestretryattempts,omitempty"` + Idlettl int `json:"idlettl,omitempty"` + Revalidationtimeout int `json:"revalidationtimeout,omitempty"` + Healthcheck string `json:"healthcheck,omitempty"` + Healthcheckttl int `json:"healthcheckttl,omitempty"` + Cerrequesttimeout int `json:"cerrequesttimeout,omitempty"` + Negativettl int `json:"negativettl,omitempty"` + Negativettllimitedsuccess string `json:"negativettllimitedsuccess,omitempty"` + Purgesdbongxfailure string `json:"purgesdbongxfailure,omitempty"` + Servicepathavp []int `json:"servicepathavp,omitempty"` + Servicepathvendorid int `json:"servicepathvendorid,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Identity string `json:"identity,omitempty"` + Realm string `json:"realm,omitempty"` + Status string `json:"status,omitempty"` + Servicepathinfomode string `json:"servicepathinfomode,omitempty"` + Gxreportingavp1 string `json:"gxreportingavp1,omitempty"` + Gxreportingavp1vendorid string `json:"gxreportingavp1vendorid,omitempty"` + Gxreportingavp1type string `json:"gxreportingavp1type,omitempty"` + Gxreportingavp2 string `json:"gxreportingavp2,omitempty"` + Gxreportingavp2vendorid string `json:"gxreportingavp2vendorid,omitempty"` + Gxreportingavp2type string `json:"gxreportingavp2type,omitempty"` + Gxreportingavp3 string `json:"gxreportingavp3,omitempty"` + Gxreportingavp3vendorid string `json:"gxreportingavp3vendorid,omitempty"` + Gxreportingavp3type string `json:"gxreportingavp3type,omitempty"` + Gxreportingavp4 string `json:"gxreportingavp4,omitempty"` + Gxreportingavp4vendorid string `json:"gxreportingavp4vendorid,omitempty"` + Gxreportingavp4type string `json:"gxreportingavp4type,omitempty"` + Gxreportingavp5 string `json:"gxreportingavp5,omitempty"` + Gxreportingavp5vendorid string `json:"gxreportingavp5vendorid,omitempty"` + Gxreportingavp5type string `json:"gxreportingavp5type,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Subscriberparam struct { + Keytype string `json:"keytype,omitempty"` + Interfacetype string `json:"interfacetype,omitempty"` + Idlettl int `json:"idlettl,omitempty"` + Idleaction string `json:"idleaction,omitempty"` + Ipv6prefixlookuplist []int `json:"ipv6prefixlookuplist,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Subscriberprofile struct { + Ip string `json:"ip,omitempty"` + Vlan int `json:"vlan"` + Subscriberrules []string `json:"subscriberrules,omitempty"` + Subscriptionidtype string `json:"subscriptionidtype,omitempty"` + Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` + Servicepath string `json:"servicepath,omitempty"` + Flags string `json:"flags,omitempty"` + Ttl string `json:"ttl,omitempty"` + Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Subscriberradiusinterface struct { + Listeningservice string `json:"listeningservice,omitempty"` + Radiusinterimasstart string `json:"radiusinterimasstart,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Subscribersessions struct { + Ip string `json:"ip,omitempty"` + Vlan int `json:"vlan,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Subscriptionidtype string `json:"subscriptionidtype,omitempty"` + Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` + Subscriberrules string `json:"subscriberrules,omitempty"` + Flags string `json:"flags,omitempty"` + Ttl string `json:"ttl,omitempty"` + Idlettl string `json:"idlettl,omitempty"` + Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` + Servicepath string `json:"servicepath,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/tm.go b/nitrogo/models/tm.go new file mode 100644 index 0000000..5df2c71 --- /dev/null +++ b/nitrogo/models/tm.go @@ -0,0 +1,338 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Tmsessionpolicyauthenticationvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmsessionpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Tmtrafficpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmglobalauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmglobalnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmglobaltrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` + Type string `json:"type,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsessionaction struct { + Name string `json:"name,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Ssodomain string `json:"ssodomain,omitempty"` + Httponlycookie string `json:"httponlycookie,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Persistentcookie string `json:"persistentcookie,omitempty"` + Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` + Homepage string `json:"homepage,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmtrafficaction struct { + Name string `json:"name,omitempty"` + Apptimeout int `json:"apptimeout,omitempty"` + Sso string `json:"sso,omitempty"` + Formssoaction string `json:"formssoaction,omitempty"` + Persistentcookie string `json:"persistentcookie,omitempty"` + Initiatelogout string `json:"initiatelogout,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Forcedtimeout string `json:"forcedtimeout,omitempty"` + Forcedtimeoutval int `json:"forcedtimeoutval,omitempty"` + Userexpression string `json:"userexpression,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmtrafficpolicytmglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmformssoaction struct { + Name string `json:"name,omitempty"` + Actionurl string `json:"actionurl,omitempty"` + Userfield string `json:"userfield,omitempty"` + Passwdfield string `json:"passwdfield,omitempty"` + Ssosuccessrule string `json:"ssosuccessrule,omitempty"` + Namevaluepair string `json:"namevaluepair,omitempty"` + Responsesize int `json:"responsesize,omitempty"` + Nvtype string `json:"nvtype,omitempty"` + Submitmethod string `json:"submitmethod,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmglobalsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsessionpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmsessionpolicytmglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmsessionpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits string `json:"hits,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmsessionpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmsessionpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmtrafficpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmglobalauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsessionparameter struct { + Sesstimeout int `json:"sesstimeout,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Ssodomain string `json:"ssodomain,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Httponlycookie string `json:"httponlycookie,omitempty"` + Persistentcookie string `json:"persistentcookie,omitempty"` + Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` + Homepage string `json:"homepage,omitempty"` + Name string `json:"name,omitempty"` + Tmsessionpolicybindtype string `json:"tmsessionpolicybindtype,omitempty"` + Tmsessionpolicycount string `json:"tmsessionpolicycount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmtrafficpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Tmtrafficpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmglobaltmsessionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsamlssoprofile struct { + Name string `json:"name,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Audience string `json:"audience,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tmsessionpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmglobalbinding struct { +} + +type Tmglobalsessionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsessionpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmtrafficpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmglobaltmtrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Type string `json:"type,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Tmsessionpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tmtrafficpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/transform.go b/nitrogo/models/transform.go new file mode 100644 index 0000000..42afe28 --- /dev/null +++ b/nitrogo/models/transform.go @@ -0,0 +1,234 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Transformglobalbinding struct { +} + +type Transformpolicytransformglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicylabelpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Transformpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Transformpolicylabeltransformpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Transformglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Flowtype uint32 `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Transformglobaltransformpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Numpol int `json:"numpol,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Transformpolicycsvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicypolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicytransformpolicylabelbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Transformprofileactionbinding struct { + Actionname string `json:"actionname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Profilename string `json:"profilename,omitempty"` + Requrlfrom string `json:"requrlfrom,omitempty"` + Requrlinto string `json:"requrlinto,omitempty"` + Resurlfrom string `json:"resurlfrom,omitempty"` + Resurlinto string `json:"resurlinto,omitempty"` + Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` + Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + Actioncomment string `json:"actioncomment,omitempty"` + Name string `json:"name,omitempty"` +} + +type Transformaction struct { + Name string `json:"name,omitempty"` + Profilename string `json:"profilename,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Requrlfrom string `json:"requrlfrom,omitempty"` + Requrlinto string `json:"requrlinto,omitempty"` + Resurlfrom string `json:"resurlfrom,omitempty"` + Resurlinto string `json:"resurlinto,omitempty"` + Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` + Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + Comment string `json:"comment,omitempty"` + Continuematching string `json:"continuematching,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Transformpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Profilename string `json:"profilename,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Transformpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Transformpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Transformprofile struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Onlytransformabsurlinbody string `json:"onlytransformabsurlinbody,omitempty"` + Comment string `json:"comment,omitempty"` + Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` + Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` + Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` + Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` + Additionalreqheaderslist string `json:"additionalreqheaderslist,omitempty"` + Additionalrespheaderslist string `json:"additionalrespheaderslist,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Transformprofilebinding struct { + Name string `json:"name,omitempty"` +} + +type Transformprofiletransformactionbinding struct { + Actionname string `json:"actionname,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Profilename string `json:"profilename,omitempty"` + Requrlfrom string `json:"requrlfrom,omitempty"` + Requrlinto string `json:"requrlinto,omitempty"` + Resurlfrom string `json:"resurlfrom,omitempty"` + Resurlinto string `json:"resurlinto,omitempty"` + Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` + Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + Actioncomment string `json:"actioncomment,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/tunnel.go b/nitrogo/models/tunnel.go new file mode 100644 index 0000000..a452fc3 --- /dev/null +++ b/nitrogo/models/tunnel.go @@ -0,0 +1,76 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Tunnelglobaltrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Type string `json:"type,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policytype string `json:"policytype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Tunnelglobaltunneltrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Type string `json:"type,omitempty"` + Numpol int `json:"numpol,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policytype string `json:"policytype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` +} + +type Tunneltrafficpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Txbytes string `json:"txbytes,omitempty"` + Rxbytes string `json:"rxbytes,omitempty"` + Clientttlb string `json:"clientttlb,omitempty"` + Clienttransactions string `json:"clienttransactions,omitempty"` + Serverttlb string `json:"serverttlb,omitempty"` + Servertransactions string `json:"servertransactions,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Tunneltrafficpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Tunneltrafficpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tunneltrafficpolicytunnelglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` +} + +type Tunnelglobalbinding struct { +} diff --git a/nitrogo/models/ulfd.go b/nitrogo/models/ulfd.go new file mode 100644 index 0000000..0764f3c --- /dev/null +++ b/nitrogo/models/ulfd.go @@ -0,0 +1,11 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Ulfdserver struct { + Loggerip string `json:"loggerip,omitempty"` + State string `json:"state,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/urlfiltering.go b/nitrogo/models/urlfiltering.go new file mode 100644 index 0000000..47058fa --- /dev/null +++ b/nitrogo/models/urlfiltering.go @@ -0,0 +1,36 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Urlfilteringparameter struct { + Hoursbetweendbupdates int `json:"hoursbetweendbupdates,omitempty"` + Timeofdaytoupdatedb string `json:"timeofdaytoupdatedb,omitempty"` + Localdatabasethreads int `json:"localdatabasethreads,omitempty"` + Cloudhost string `json:"cloudhost,omitempty"` + Seeddbpath string `json:"seeddbpath,omitempty"` + Maxnumberofcloudthreads string `json:"maxnumberofcloudthreads,omitempty"` + Cloudkeepalivetimeout string `json:"cloudkeepalivetimeout,omitempty"` + Cloudserverconnecttimeout string `json:"cloudserverconnecttimeout,omitempty"` + Clouddblookuptimeout string `json:"clouddblookuptimeout,omitempty"` + Proxyhostip string `json:"proxyhostip,omitempty"` + Proxyport string `json:"proxyport,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Seeddbsizelevel string `json:"seeddbsizelevel,omitempty"` +} + +type Urlfilteringcategories struct { + Group string `json:"group,omitempty"` + Categories string `json:"categories,omitempty"` +} + +type Urlfilteringcategorization struct { + Url string `json:"url,omitempty"` + Categorization string `json:"categorization,omitempty"` +} + +type Urlfilteringcategorygroups struct { + Categorygroups string `json:"categorygroups,omitempty"` +} diff --git a/nitrogo/models/user.go b/nitrogo/models/user.go new file mode 100644 index 0000000..0433738 --- /dev/null +++ b/nitrogo/models/user.go @@ -0,0 +1,31 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Userprotocol struct { + Name string `json:"name,omitempty"` + Transport string `json:"transport,omitempty"` + Extension string `json:"extension,omitempty"` + Comment string `json:"comment,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Uservserver struct { + Name string `json:"name,omitempty"` + Userprotocol string `json:"userprotocol,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Defaultlb string `json:"defaultlb,omitempty"` + Params string `json:"Params,omitempty"` + Comment string `json:"comment,omitempty"` + State string `json:"state,omitempty"` + Curstate string `json:"curstate,omitempty"` + Value string `json:"value,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Statechangetimemsec string `json:"statechangetimemsec,omitempty"` + Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} diff --git a/nitrogo/models/utility.go b/nitrogo/models/utility.go new file mode 100644 index 0000000..90bdfd9 --- /dev/null +++ b/nitrogo/models/utility.go @@ -0,0 +1,142 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Ping6 struct { + B int `json:"b,omitempty"` + C int `json:"c,omitempty"` + I int `json:"i,omitempty"` + I_ string `json:"I,omitempty"` + M bool `json:"m,omitempty"` + N bool `json:"n,omitempty"` + P string `json:"p,omitempty"` + Q bool `json:"q,omitempty"` + S int `json:"s,omitempty"` + V int `json:"V,omitempty"` + S_ string `json:"S,omitempty"` + T int `json:"T,omitempty"` + T_ int `json:"t,omitempty"` + HostName string `json:"hostName,omitempty"` + Response string `json:"response,omitempty"` +} + +type Raid struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Techsupport struct { + Scope string `json:"scope,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Upload bool `json:"upload,omitempty"` + Proxy string `json:"proxy,omitempty"` + Casenumber string `json:"casenumber,omitempty"` + File string `json:"file,omitempty"` + Description string `json:"description,omitempty"` + Authtoken string `json:"authtoken,omitempty"` + Time string `json:"time,omitempty"` + Adss bool `json:"adss,omitempty"` + Nodes []int `json:"nodes,omitempty"` + Response string `json:"response,omitempty"` + Servername string `json:"servername,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Traceroute struct { + S bool `json:"S,omitempty"` + N bool `json:"n,omitempty"` + R bool `json:"r,omitempty"` + V bool `json:"v,omitempty"` + M int `json:"M,omitempty"` + M_ int `json:"m,omitempty"` + P string `json:"P,omitempty"` + P_ int `json:"p,omitempty"` + Q int `json:"q,omitempty"` + S_ string `json:"s,omitempty"` + T int `json:"T,omitempty"` + T_ int `json:"t,omitempty"` + W int `json:"w,omitempty"` + Host string `json:"host,omitempty"` + Packetlen int `json:"packetlen,omitempty"` + Response string `json:"response,omitempty"` +} + +type Traceroute6 struct { + N bool `json:"n,omitempty"` + I bool `json:"I,omitempty"` + R bool `json:"r,omitempty"` + V bool `json:"v,omitempty"` + M int `json:"m,omitempty"` + P int `json:"p,omitempty"` + Q int `json:"q,omitempty"` + S string `json:"s,omitempty"` + T int `json:"T,omitempty"` + W int `json:"w,omitempty"` + Host string `json:"host,omitempty"` + Packetlen int `json:"packetlen,omitempty"` + Response string `json:"response,omitempty"` +} + +type Callhome struct { + Nodeid int `json:"nodeid,omitempty"` + Mode string `json:"mode,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Hbcustominterval int `json:"hbcustominterval,omitempty"` + Proxymode string `json:"proxymode,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Proxyauthservice string `json:"proxyauthservice,omitempty"` + Port int `json:"port,omitempty"` + Sslcardfirstfailure string `json:"sslcardfirstfailure,omitempty"` + Sslcardlatestfailure string `json:"sslcardlatestfailure,omitempty"` + Powfirstfail string `json:"powfirstfail,omitempty"` + Powlatestfailure string `json:"powlatestfailure,omitempty"` + Hddfirstfail string `json:"hddfirstfail,omitempty"` + Hddlatestfailure string `json:"hddlatestfailure,omitempty"` + Flashfirstfail string `json:"flashfirstfail,omitempty"` + Flashlatestfailure string `json:"flashlatestfailure,omitempty"` + Rlfirsthighdrop string `json:"rlfirsthighdrop,omitempty"` + Rllatesthighdrop string `json:"rllatesthighdrop,omitempty"` + Restartlatestfail string `json:"restartlatestfail,omitempty"` + Memthrefirstanomaly string `json:"memthrefirstanomaly,omitempty"` + Memthrelatestanomaly string `json:"memthrelatestanomaly,omitempty"` + Callhomestatus string `json:"callhomestatus,omitempty"` + Anomalydetection string `json:"anomalydetection,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Filesystemencryption struct { + Ntimes0flash int `json:"ntimes0flash,omitempty"` + Ntimes0var int `json:"ntimes0var,omitempty"` + Passphrase string `json:"passphrase,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Supportedstate string `json:"supportedstate,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Install struct { + Url string `json:"url,omitempty"` + Y bool `json:"y,omitempty"` + L bool `json:"l,omitempty"` + A bool `json:"a,omitempty"` + Enhancedupgrade bool `json:"enhancedupgrade,omitempty"` + Resizeswapvar bool `json:"resizeswapvar,omitempty"` + Async bool `json:"Async,omitempty"` + Id string `json:"id,omitempty"` +} + +type Ping struct { + C int `json:"c,omitempty"` + I int `json:"i,omitempty"` + I_ string `json:"I,omitempty"` + N bool `json:"n,omitempty"` + P string `json:"p,omitempty"` + Q bool `json:"q,omitempty"` + S int `json:"s,omitempty"` + S_ string `json:"S,omitempty"` + T int `json:"T,omitempty"` + T_ int `json:"t,omitempty"` + HostName string `json:"hostName,omitempty"` + Response string `json:"response,omitempty"` +} diff --git a/nitrogo/models/videooptimization.go b/nitrogo/models/videooptimization.go new file mode 100644 index 0000000..a3c82fc --- /dev/null +++ b/nitrogo/models/videooptimization.go @@ -0,0 +1,305 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Videooptimizationglobaldetectionbinding struct { +} + +type Videooptimizationpacingpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationpacingpolicyvideooptimizationglobalpacingbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationglobaldetectiondetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationglobalpacingbinding struct { +} + +type Videooptimizationglobalpacingpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol uint32 `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationdetectionpolicyglobaldetectionbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationpacingpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationdetectionpolicylabelbinding struct { + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationpacingpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationdetectionpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationpacingpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Videooptimizationpacingpolicyglobalpacingbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationdetectionpolicylabelpolicybindingbinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationglobaldetectionvideooptimizationdetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationpacingpolicylbvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationparameter struct { + Randomsamplingpercentage float64 `json:"randomsamplingpercentage,omitempty"` + Quicpacingrate int `json:"quicpacingrate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationdetectionpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationdetectionpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationdetectionpolicylabeldetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationglobalpacingvideooptimizationpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Type string `json:"type,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol int `json:"numpol,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationpacingpolicylabelpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationpacingpolicylabelvideooptimizationpacingpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationdetectionaction struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationdetectionpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Videooptimizationdetectionpolicylabelvideooptimizationdetectionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Videooptimizationpacingaction struct { + Name string `json:"name,omitempty"` + Rate int `json:"rate,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Referencecount string `json:"referencecount,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationpacingpolicylabel struct { + Labelname string `json:"labelname,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Comment string `json:"comment,omitempty"` + Newname string `json:"newname,omitempty"` + Numpol string `json:"numpol,omitempty"` + Hits string `json:"hits,omitempty"` + Priority string `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Invokelabelname string `json:"invoke_labelname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationpacingpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} + +type Videooptimizationdetectionpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Videooptimizationdetectionpolicyvideooptimizationglobaldetectionbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/nitrogo/models/vpn.go b/nitrogo/models/vpn.go new file mode 100644 index 0000000..4ef141f --- /dev/null +++ b/nitrogo/models/vpn.go @@ -0,0 +1,1819 @@ +// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) +// Originally licensed under the Apache License, Version 2.0 +// Modifications by Adam Crawford, 2026 + +package models + +type Vpnglobalauthenticationtacacspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobaleulabinding struct { + Eula string `json:"eula,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalstaserverbinding struct { + Staserver string `json:"staserver,omitempty"` + Staauthid string `json:"staauthid,omitempty"` + Stastate string `json:"stastate,omitempty"` + Staaddresstype string `json:"staaddresstype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalurlpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnglobaltrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnportaltheme struct { + Name string `json:"name,omitempty"` + Basetheme string `json:"basetheme,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnsessionpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Vpnvserversamlidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpnepaprofilebinding struct { + Epaprofile string `json:"epaprofile,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` +} + +type Vpnvservervpnurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalappfwpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnglobalnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalsamlpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalsessionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnsessionpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverauthenticationcertpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpngloballocalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnsessionpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpntrafficpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpntrafficpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverintranetipbinding struct { + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Map string `json:"map,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverldappolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpnintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalintranetip6binding struct { + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvservercertpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpnnexthopserverbinding struct { + Nexthopserver string `json:"nexthopserver,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnclientlessaccesspolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Vpnglobalauthenticationpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnpcoipconnection struct { + Username string `json:"username,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + All bool `json:"all,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport string `json:"srcport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnurlpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverappfwpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnurlpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserver struct { + Name string `json:"name,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Range int `json:"range,omitempty"` + Port int `json:"port,omitempty"` + Ipset string `json:"ipset,omitempty"` + State string `json:"state,omitempty"` + Authentication string `json:"authentication,omitempty"` + Doublehop string `json:"doublehop,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Icaonly string `json:"icaonly,omitempty"` + Icaproxysessionmigration string `json:"icaproxysessionmigration,omitempty"` + Dtls string `json:"dtls,omitempty"` + Loginonce string `json:"loginonce,omitempty"` + Advancedepa string `json:"advancedepa,omitempty"` + Devicecert string `json:"devicecert,omitempty"` + Certkeynames string `json:"certkeynames,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Comment string `json:"comment,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Cginfrahomepageredirect string `json:"cginfrahomepageredirect,omitempty"` + Secureprivateaccess string `json:"secureprivateaccess,omitempty"` + Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Deploymenttype string `json:"deploymenttype,omitempty"` + Rdpserverprofilename string `json:"rdpserverprofilename,omitempty"` + Windowsepapluginupgrade string `json:"windowsepapluginupgrade,omitempty"` + Linuxepapluginupgrade string `json:"linuxepapluginupgrade,omitempty"` + Macepapluginupgrade string `json:"macepapluginupgrade,omitempty"` + Logoutonsmartcardremoval string `json:"logoutonsmartcardremoval,omitempty"` + Userdomains string `json:"userdomains,omitempty"` + Authnprofile string `json:"authnprofile,omitempty"` + Vserverfqdn string `json:"vserverfqdn,omitempty"` + Pcoipvserverprofilename string `json:"pcoipvserverprofilename,omitempty"` + Samesite string `json:"samesite,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Newname string `json:"newname,omitempty"` + Ip string `json:"ip,omitempty"` + Value string `json:"value,omitempty"` + Type string `json:"type,omitempty"` + Curstate string `json:"curstate,omitempty"` + Status string `json:"status,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Redirect string `json:"redirect,omitempty"` + Precedence string `json:"precedence,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Curaaausers string `json:"curaaausers,omitempty"` + Curtotalusers string `json:"curtotalusers,omitempty"` + Domain string `json:"domain,omitempty"` + Rule string `json:"rule,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight string `json:"weight,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Clttimeout string `json:"clttimeout,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sothreshold string `json:"sothreshold,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout string `json:"sopersistencetimeout,omitempty"` + Usemip string `json:"usemip,omitempty"` + Map string `json:"map,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Secondary string `json:"secondary,omitempty"` + Groupextraction string `json:"groupextraction,omitempty"` + Epaprofileoptional string `json:"epaprofileoptional,omitempty"` + Ngname string `json:"ngname,omitempty"` + Csvserver string `json:"csvserver,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` +} + +type Vpnvserverauthenticationdfapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnclientlessaccesspolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalintranetipbinding struct { + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvserverauditsyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpnportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnclientlessaccessprofile struct { + Profilename string `json:"profilename,omitempty"` + Urlrewritepolicylabel string `json:"urlrewritepolicylabel,omitempty"` + Javascriptrewritepolicylabel string `json:"javascriptrewritepolicylabel,omitempty"` + Reqhdrrewritepolicylabel string `json:"reqhdrrewritepolicylabel,omitempty"` + Reshdrrewritepolicylabel string `json:"reshdrrewritepolicylabel,omitempty"` + Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` + Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` + Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` + Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` + Regexforfindingcustomurls string `json:"regexforfindingcustomurls,omitempty"` + Clientconsumedcookies string `json:"clientconsumedcookies,omitempty"` + Requirepersistentcookie string `json:"requirepersistentcookie,omitempty"` + Cssrewritepolicylabel string `json:"cssrewritepolicylabel,omitempty"` + Xmlrewritepolicylabel string `json:"xmlrewritepolicylabel,omitempty"` + Xcomponentrewritepolicylabel string `json:"xcomponentrewritepolicylabel,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Description string `json:"description,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpngloballdappolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvserverauthenticationwebauthpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverbinding struct { + Name string `json:"name,omitempty"` +} + +type Vpnvserverloginschemapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalvpnportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnalwaysonprofile struct { + Name string `json:"name,omitempty"` + Networkaccessonvpnfailure string `json:"networkaccessonvpnfailure,omitempty"` + Clientcontrol string `json:"clientcontrol,omitempty"` + Locationbasedvpn string `json:"locationbasedvpn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnglobalclientlessaccesspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnglobalvpnsessionpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnurlaction struct { + Name string `json:"name,omitempty"` + Linkname string `json:"linkname,omitempty"` + Actualurl string `json:"actualurl,omitempty"` + Vservername string `json:"vservername,omitempty"` + Clientlessaccess string `json:"clientlessaccess,omitempty"` + Comment string `json:"comment,omitempty"` + Iconurl string `json:"iconurl,omitempty"` + Ssotype string `json:"ssotype,omitempty"` + Applicationtype string `json:"applicationtype,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvserverrewritepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnglobalauthenticationlocalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalbinding struct { +} + +type Vpnintranetapplication struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Protocol string `json:"protocol,omitempty"` + Destip string `json:"destip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Iprange string `json:"iprange,omitempty"` + Hostname string `json:"hostname,omitempty"` + Clientapplication []string `json:"clientapplication,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Destport string `json:"destport,omitempty"` + Interception string `json:"interception,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnparameter struct { + Httpport []int `json:"httpport,omitempty"` + Winsip string `json:"winsip,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Splitdns string `json:"splitdns,omitempty"` + Icauseraccounting string `json:"icauseraccounting,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Clientsecurity string `json:"clientsecurity,omitempty"` + Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Clientsecuritylog string `json:"clientsecuritylog,omitempty"` + Smartgroup string `json:"smartgroup,omitempty"` + Splittunnel string `json:"splittunnel,omitempty"` + Locallanaccess string `json:"locallanaccess,omitempty"` + Rfc1918 string `json:"rfc1918,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Killconnections string `json:"killconnections,omitempty"` + Transparentinterception string `json:"transparentinterception,omitempty"` + Windowsclienttype string `json:"windowsclienttype,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Authorizationgroup string `json:"authorizationgroup,omitempty"` + Clientidletimeout int `json:"clientidletimeout,omitempty"` + Proxy string `json:"proxy,omitempty"` + Allprotocolproxy string `json:"allprotocolproxy,omitempty"` + Httpproxy string `json:"httpproxy,omitempty"` + Ftpproxy string `json:"ftpproxy,omitempty"` + Socksproxy string `json:"socksproxy,omitempty"` + Gopherproxy string `json:"gopherproxy,omitempty"` + Sslproxy string `json:"sslproxy,omitempty"` + Proxyexception string `json:"proxyexception,omitempty"` + Proxylocalbypass string `json:"proxylocalbypass,omitempty"` + Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` + Forcecleanup []string `json:"forcecleanup,omitempty"` + Clientoptions []string `json:"clientoptions,omitempty"` + Clientconfiguration []string `json:"clientconfiguration,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Windowsautologon string `json:"windowsautologon,omitempty"` + Usemip string `json:"usemip,omitempty"` + Useiip string `json:"useiip,omitempty"` + Clientdebug string `json:"clientdebug,omitempty"` + Loginscript string `json:"loginscript,omitempty"` + Logoutscript string `json:"logoutscript,omitempty"` + Homepage string `json:"homepage,omitempty"` + Icaproxy string `json:"icaproxy,omitempty"` + Wihome string `json:"wihome,omitempty"` + Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` + Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` + Wiportalmode string `json:"wiportalmode,omitempty"` + Clientchoices string `json:"clientchoices,omitempty"` + Epaclienttype string `json:"epaclienttype,omitempty"` + Iipdnssuffix string `json:"iipdnssuffix,omitempty"` + Forcedtimeout int `json:"forcedtimeout,omitempty"` + Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` + Ntdomain string `json:"ntdomain,omitempty"` + Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` + Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` + Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` + Emailhome string `json:"emailhome,omitempty"` + Allowedlogingroups string `json:"allowedlogingroups,omitempty"` + Encryptcsecexp string `json:"encryptcsecexp,omitempty"` + Apptokentimeout int `json:"apptokentimeout,omitempty"` + Mdxtokentimeout int `json:"mdxtokentimeout,omitempty"` + Uitheme string `json:"uitheme,omitempty"` + Securebrowse string `json:"securebrowse,omitempty"` + Storefronturl string `json:"storefronturl,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Clientversions string `json:"clientversions,omitempty"` + Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` + Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` + Macpluginupgrade string `json:"macpluginupgrade,omitempty"` + Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` + Iconwithreceiver string `json:"iconwithreceiver,omitempty"` + Userdomains string `json:"userdomains,omitempty"` + Icasessiontimeout string `json:"icasessiontimeout,omitempty"` + Httptrackconnproxy string `json:"httptrackconnproxy,omitempty"` + Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` + Autoproxyurl string `json:"autoproxyurl,omitempty"` + Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` + Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + Backendserversni string `json:"backendserversni,omitempty"` + Backendcertvalidation string `json:"backendcertvalidation,omitempty"` + Secureprivateaccess string `json:"secureprivateaccess,omitempty"` + Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` + Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Samesite string `json:"samesite,omitempty"` + Maxiipperuser int `json:"maxiipperuser,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Backenddtls12 string `json:"backenddtls12,omitempty"` + Name string `json:"name,omitempty"` + Clientidletimeoutwarning string `json:"clientidletimeoutwarning,omitempty"` + Vpnsessionpolicybindtype string `json:"vpnsessionpolicybindtype,omitempty"` + Vpnsessionpolicycount string `json:"vpnsessionpolicycount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvserverauthenticationnegotiatepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverauthenticationradiuspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverclientlessaccesspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvservernslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnclientlessaccesspolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnformssoaction struct { + Name string `json:"name,omitempty"` + Actionurl string `json:"actionurl,omitempty"` + Userfield string `json:"userfield,omitempty"` + Passwdfield string `json:"passwdfield,omitempty"` + Ssosuccessrule string `json:"ssosuccessrule,omitempty"` + Namevaluepair string `json:"namevaluepair,omitempty"` + Responsesize int `json:"responsesize,omitempty"` + Nvtype string `json:"nvtype,omitempty"` + Submitmethod string `json:"submitmethod,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnnexthopserver struct { + Name string `json:"name,omitempty"` + Nexthopip string `json:"nexthopip,omitempty"` + Nexthopfqdn string `json:"nexthopfqdn,omitempty"` + Resaddresstype string `json:"resaddresstype,omitempty"` + Nexthopport int `json:"nexthopport,omitempty"` + Secure string `json:"secure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpntrafficpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpntrafficpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnurlpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverappflowpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvservericapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalsslcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` + Cacert string `json:"cacert,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvserverlocalpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpneulabinding struct { + Eula string `json:"eula,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnpcoipvserverprofile struct { + Name string `json:"name,omitempty"` + Logindomain string `json:"logindomain,omitempty"` + Udpport int `json:"udpport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvservernexthopserverbinding struct { + Nexthopserver string `json:"nexthopserver,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverstaserverbinding struct { + Staserver string `json:"staserver,omitempty"` + Staauthid string `json:"staauthid,omitempty"` + Stastate string `json:"stastate,omitempty"` + Acttype int `json:"acttype,omitempty"` + Staaddresstype string `json:"staaddresstype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserversyslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverintranetip6binding struct { + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvservernegotiatepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverwebauthpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnsessionpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpntrafficpolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpntrafficpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverauditnslogpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservercachepolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvserversharefileserverbinding struct { + Sharefile string `json:"sharefile,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnurlpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Builtin string `json:"builtin,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnurlpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Vpnvserverappcontrollerbinding struct { + Appcontroller string `json:"appcontroller,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalcertkeybinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` + Cacert string `json:"cacert,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalvpntrafficpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpntrafficaction struct { + Name string `json:"name,omitempty"` + Qual string `json:"qual,omitempty"` + Apptimeout int `json:"apptimeout,omitempty"` + Sso string `json:"sso,omitempty"` + Hdx string `json:"hdx,omitempty"` + Formssoaction string `json:"formssoaction,omitempty"` + Fta string `json:"fta,omitempty"` + Wanscaler string `json:"wanscaler,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Proxy string `json:"proxy,omitempty"` + Userexpression string `json:"userexpression,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpntrafficpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnicaconnection struct { + Username string `json:"username,omitempty"` + Transproto string `json:"transproto,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + All bool `json:"all,omitempty"` + Domain string `json:"domain,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport string `json:"srcport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvserverauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvservertrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalauthenticationradiuspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpntrafficpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverauthenticationloginschemapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverportalthemebinding struct { + Portaltheme string `json:"portaltheme,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalcertpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvserverauthenticationlocalpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalvpnintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnclientlessaccesspolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Profilename string `json:"profilename,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Hits string `json:"hits,omitempty"` + Undefhits string `json:"undefhits,omitempty"` + Description string `json:"description,omitempty"` + Isdefault string `json:"isdefault,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnclientlessaccesspolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnurlpolicygroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnurlpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverepaprofilebinding struct { + Epaprofile string `json:"epaprofile,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` +} + +type Vpnvservertacacspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnicadtlsconnection struct { + Username string `json:"username,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Domain string `json:"domain,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport string `json:"srcport,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Channelnumber string `json:"channelnumber,omitempty"` + Peid string `json:"peid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvserveraaapreauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverdfapolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverpreauthenticationpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservervpnclientlessaccesspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvservervpntrafficpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnclientlessaccesspolicyglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy int32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobaldomainbinding struct { + Intranetdomain string `json:"intranetdomain,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalvpnnexthopserverbinding struct { + Nexthopserver string `json:"nexthopserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnsessionaction struct { + Name string `json:"name,omitempty"` + Useraccounting string `json:"useraccounting,omitempty"` + Httpport []int `json:"httpport,omitempty"` + Winsip string `json:"winsip,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Splitdns string `json:"splitdns,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Clientsecurity string `json:"clientsecurity,omitempty"` + Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Clientsecuritylog string `json:"clientsecuritylog,omitempty"` + Splittunnel string `json:"splittunnel,omitempty"` + Locallanaccess string `json:"locallanaccess,omitempty"` + Rfc1918 string `json:"rfc1918,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Killconnections string `json:"killconnections,omitempty"` + Transparentinterception string `json:"transparentinterception,omitempty"` + Windowsclienttype string `json:"windowsclienttype,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Authorizationgroup string `json:"authorizationgroup,omitempty"` + Smartgroup string `json:"smartgroup,omitempty"` + Clientidletimeout int `json:"clientidletimeout,omitempty"` + Proxy string `json:"proxy,omitempty"` + Allprotocolproxy string `json:"allprotocolproxy,omitempty"` + Httpproxy string `json:"httpproxy,omitempty"` + Ftpproxy string `json:"ftpproxy,omitempty"` + Socksproxy string `json:"socksproxy,omitempty"` + Gopherproxy string `json:"gopherproxy,omitempty"` + Sslproxy string `json:"sslproxy,omitempty"` + Proxyexception string `json:"proxyexception,omitempty"` + Proxylocalbypass string `json:"proxylocalbypass,omitempty"` + Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` + Forcecleanup []string `json:"forcecleanup,omitempty"` + Clientoptions string `json:"clientoptions,omitempty"` + Clientconfiguration []string `json:"clientconfiguration,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Windowsautologon string `json:"windowsautologon,omitempty"` + Usemip string `json:"usemip,omitempty"` + Useiip string `json:"useiip,omitempty"` + Clientdebug string `json:"clientdebug,omitempty"` + Loginscript string `json:"loginscript,omitempty"` + Logoutscript string `json:"logoutscript,omitempty"` + Homepage string `json:"homepage,omitempty"` + Icaproxy string `json:"icaproxy,omitempty"` + Wihome string `json:"wihome,omitempty"` + Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` + Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` + Wiportalmode string `json:"wiportalmode,omitempty"` + Clientchoices string `json:"clientchoices,omitempty"` + Epaclienttype string `json:"epaclienttype,omitempty"` + Iipdnssuffix string `json:"iipdnssuffix,omitempty"` + Forcedtimeout int `json:"forcedtimeout,omitempty"` + Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` + Ntdomain string `json:"ntdomain,omitempty"` + Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` + Emailhome string `json:"emailhome,omitempty"` + Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` + Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` + Allowedlogingroups string `json:"allowedlogingroups,omitempty"` + Securebrowse string `json:"securebrowse,omitempty"` + Storefronturl string `json:"storefronturl,omitempty"` + Sfgatewayauthtype string `json:"sfgatewayauthtype,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` + Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` + Macpluginupgrade string `json:"macpluginupgrade,omitempty"` + Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` + Iconwithreceiver string `json:"iconwithreceiver,omitempty"` + Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` + Autoproxyurl string `json:"autoproxyurl,omitempty"` + Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` + Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Clientidletimeoutwarning string `json:"clientidletimeoutwarning,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnsessionpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnsessionpolicyuserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnurlpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverauthenticationtacacspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalauthenticationnegotiatepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalauthenticationsamlpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalradiuspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnvservervpnsessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalauthenticationcertpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnsfconfig struct { + Vserver []string `json:"vserver,omitempty"` + Filename string `json:"filename,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnurlpolicyaaagroupbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserversecureprivateaccessurlbinding struct { + Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnpcoipprofile struct { + Name string `json:"name,omitempty"` + Conserverurl string `json:"conserverurl,omitempty"` + Icvverification string `json:"icvverification,omitempty"` + Sessionidletimeout int `json:"sessionidletimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnsamlssoprofile struct { + Name string `json:"name,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Audience string `json:"audience,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnurl struct { + Urlname string `json:"urlname,omitempty"` + Linkname string `json:"linkname,omitempty"` + Actualurl string `json:"actualurl,omitempty"` + Vservername string `json:"vservername,omitempty"` + Clientlessaccess string `json:"clientlessaccess,omitempty"` + Comment string `json:"comment,omitempty"` + Iconurl string `json:"iconurl,omitempty"` + Ssotype string `json:"ssotype,omitempty"` + Applicationtype string `json:"applicationtype,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Appjson string `json:"appjson,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnsessionpolicyvpnvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpntrafficpolicyvserverbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Activepolicy uint32 `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserverfeopolicybinding struct { + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvserversessionpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalappcontrollerbinding struct { + Appcontroller string `json:"appcontroller,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalsecureprivateaccessurlbinding struct { + Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalvpnurlpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnsessionpolicy struct { + Name string `json:"name,omitempty"` + Rule string `json:"rule,omitempty"` + Action string `json:"action,omitempty"` + Builtin string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits string `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnsessionpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserveroauthidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverradiuspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserversamlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnglobalauditnslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalintranetapplicationbinding struct { + Intranetapplication string `json:"intranetapplication,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnstoreinfo struct { + Url string `json:"url,omitempty"` + Storeserverstatus string `json:"storeserverstatus,omitempty"` + Storeserverissf string `json:"storeserverissf,omitempty"` + Storeapisupport string `json:"storeapisupport,omitempty"` + Storelist string `json:"storelist,omitempty"` + Storestatus string `json:"storestatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnvserverresponderpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnvservervpnurlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnepaprofile struct { + Name string `json:"name,omitempty"` + Filename string `json:"filename,omitempty"` + Data string `json:"data,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnglobalnegotiatepolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalnexthopserverbinding struct { + Nexthopserver string `json:"nexthopserver,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobaltacacspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority uint32 `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalvpneulabinding struct { + Eula string `json:"eula,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnsessionpolicyaaauserbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvservercspolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvservereulabinding struct { + Eula string `json:"eula,omitempty"` + Acttype uint32 `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnglobalsharefileserverbinding struct { + Sharefile string `json:"sharefile,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalvpnclientlessaccesspolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Type string `json:"type,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` +} + +type Vpnglobalvpnurlbinding struct { + Urlname string `json:"urlname,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpntrafficpolicybinding struct { + Name string `json:"name,omitempty"` +} + +type Vpnvserverauthenticationldappolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverauthenticationoauthidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverauthenticationsamlidppolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnvserverauthenticationsamlpolicybinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Acttype int `json:"acttype,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Name string `json:"name,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` +} + +type Vpnurlpolicyvpnglobalbinding struct { + Boundto string `json:"boundto,omitempty"` + Priority int `json:"priority,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpnvserveranalyticsprofilebinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` +} + +type Vpneula struct { + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Vpnglobalauditsyslogpolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Vpnglobalauthenticationldappolicybinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} From 888fc33fa015c8cc1e027671e703dc575ec122c5 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sun, 15 Feb 2026 14:41:28 -0600 Subject: [PATCH 05/10] new structs. --- nitrogo/models/aaa.go | 830 +++---- nitrogo/models/adm.go | 5 +- nitrogo/models/analytics.go | 79 +- nitrogo/models/api.go | 65 +- nitrogo/models/app.go | 7 +- nitrogo/models/appflow.go | 393 ++-- nitrogo/models/appfw.go | 2091 +++++++++-------- nitrogo/models/appqoe.go | 93 +- nitrogo/models/audit.go | 566 +++-- nitrogo/models/authentication.go | 2496 ++++++++++----------- nitrogo/models/authorization.go | 140 +- nitrogo/models/autoscale.go | 78 +- nitrogo/models/azure.go | 35 +- nitrogo/models/basic.go | 569 ++++- nitrogo/models/bfd.go | 50 +- nitrogo/models/bot.go | 501 ++--- nitrogo/models/cache.go | 528 ++--- nitrogo/models/cloud.go | 118 +- nitrogo/models/cloudtunnel.go | 42 +- nitrogo/models/cluster.go | 359 ++- nitrogo/models/cmp.go | 282 +-- nitrogo/models/contentinspection.go | 309 ++- nitrogo/models/cr.go | 486 ++-- nitrogo/models/cs.go | 793 +++---- nitrogo/models/db.go | 35 +- nitrogo/models/dns.go | 901 ++++---- nitrogo/models/dps.go | 11 + nitrogo/models/endpoint.go | 16 +- nitrogo/models/feo.go | 174 +- nitrogo/models/gslb.go | 1168 ++++------ nitrogo/models/ha.go | 141 +- nitrogo/models/ica.go | 210 +- nitrogo/models/ipsec.go | 38 +- nitrogo/models/ipsecalg.go | 41 +- nitrogo/models/kafka.go | 27 +- nitrogo/models/lb.go | 1687 +++++++------- nitrogo/models/lldp.go | 80 +- nitrogo/models/lsn.go | 620 +++--- nitrogo/models/metrics.go | 69 +- nitrogo/models/network.go | 2057 +++++++++-------- nitrogo/models/ns.go | 3211 ++++++++++++++------------- nitrogo/models/ntp.go | 44 +- nitrogo/models/pcp.go | 68 +- nitrogo/models/policy.go | 368 +-- nitrogo/models/protocol.go | 37 +- nitrogo/models/quic.go | 58 +- nitrogo/models/quicbridge.go | 16 +- nitrogo/models/rdp.go | 92 +- nitrogo/models/reputation.go | 11 +- nitrogo/models/responder.go | 270 +-- nitrogo/models/rewrite.go | 273 +-- nitrogo/models/router.go | 14 +- nitrogo/models/smpp.go | 18 +- nitrogo/models/snmp.go | 210 +- nitrogo/models/spillover.go | 86 +- nitrogo/models/ssl.go | 2225 +++++++++---------- nitrogo/models/stream.go | 73 +- nitrogo/models/subscriber.go | 147 +- nitrogo/models/system.go | 319 ++- nitrogo/models/tm.go | 482 ++-- nitrogo/models/transform.go | 297 +-- nitrogo/models/tunnel.go | 101 +- nitrogo/models/ulfd.go | 12 +- nitrogo/models/user.go | 51 +- nitrogo/models/utility.go | 207 +- nitrogo/models/videooptimization.go | 381 ++-- nitrogo/models/vpn.go | 2610 ++++++++++------------ nitrogo/models/wasm.go | 10 + 68 files changed, 14256 insertions(+), 15625 deletions(-) create mode 100644 nitrogo/models/dps.go create mode 100644 nitrogo/models/wasm.go diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go index c46b9a6..8c11baf 100644 --- a/nitrogo/models/aaa.go +++ b/nitrogo/models/aaa.go @@ -1,620 +1,498 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Aaaglobalauthenticationnegotiateactionbinding struct { - Windowsprofile string `json:"windowsprofile,omitempty"` -} - -type Aaagroupintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` +// aaa configuration structs +type AaagroupVpnurlpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaaldapparams struct { - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Ldapbase string `json:"ldapbase,omitempty"` - Ldapbinddn string `json:"ldapbinddn,omitempty"` - Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` - Ldaploginname string `json:"ldaploginname,omitempty"` - Searchfilter string `json:"searchfilter,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Subattributename string `json:"subattributename,omitempty"` - Sectype string `json:"sectype,omitempty"` - Svrtype string `json:"svrtype,omitempty"` - Ssonameattribute string `json:"ssonameattribute,omitempty"` - Passwdchange string `json:"passwdchange,omitempty"` - Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` - Maxnestinglevel int `json:"maxnestinglevel,omitempty"` - Groupnameidentifier string `json:"groupnameidentifier,omitempty"` - Groupsearchattribute string `json:"groupsearchattribute,omitempty"` - Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` - Groupsearchfilter string `json:"groupsearchfilter,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Groupauthname string `json:"groupauthname,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaaotpparameter struct { - Encryption string `json:"encryption,omitempty"` - Maxotpdevices int `json:"maxotpdevices,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaasession struct { - Username string `json:"username,omitempty"` - Groupname string `json:"groupname,omitempty"` - Iip string `json:"iip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Sessionkey string `json:"sessionkey,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - All bool `json:"all,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport string `json:"publicport,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port string `json:"port,omitempty"` - Privateip string `json:"privateip,omitempty"` - Privateport string `json:"privateport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Intranetip string `json:"intranetip,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaauserauditsyslogpolicybinding struct { + Groupname string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaagroupauthorizationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AaagroupVpnsessionpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Type string `json:"type,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupname string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaagroupsessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` +type AaagroupVpnurlBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` + Urlname string `json:"urlname,omitempty"` } -type Aaaparameter struct { - Enablestaticpagecaching string `json:"enablestaticpagecaching,omitempty"` - Enableenhancedauthfeedback string `json:"enableenhancedauthfeedback,omitempty"` - Defaultauthtype string `json:"defaultauthtype,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` - Aaadnatip string `json:"aaadnatip,omitempty"` - Enablesessionstickiness string `json:"enablesessionstickiness,omitempty"` - Aaasessionloglevel string `json:"aaasessionloglevel,omitempty"` - Aaadloglevel string `json:"aaadloglevel,omitempty"` - Dynaddr string `json:"dynaddr,omitempty"` - Ftmode string `json:"ftmode,omitempty"` - Maxsamldeflatesize int `json:"maxsamldeflatesize,omitempty"` - Persistentloginattempts string `json:"persistentloginattempts,omitempty"` - Pwdexpirynotificationdays int `json:"pwdexpirynotificationdays,omitempty"` - Maxkbquestions int `json:"maxkbquestions,omitempty"` - Loginencryption string `json:"loginencryption,omitempty"` - Samesite string `json:"samesite,omitempty"` - Apitokencache string `json:"apitokencache,omitempty"` - Tokenintrospectioninterval int `json:"tokenintrospectioninterval,omitempty"` - Defaultcspheader string `json:"defaultcspheader,omitempty"` - Httponlycookie string `json:"httponlycookie,omitempty"` - Enhancedepa string `json:"enhancedepa,omitempty"` - Wafprotection []string `json:"wafprotection,omitempty"` - Securityinsights string `json:"securityinsights,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Aaakcdaccount struct { + Cacert string `json:"cacert,omitempty"` + Count float64 `json:"__count,omitempty"` + Delegateduser string `json:"delegateduser,omitempty"` + Enterpriserealm string `json:"enterpriserealm,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Kcdpassword string `json:"kcdpassword,omitempty"` + Kcdspn string `json:"kcdspn,omitempty"` + Keytab string `json:"keytab,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Principle string `json:"principle,omitempty"` + Realmstr string `json:"realmstr,omitempty"` + Saltexpression string `json:"saltexpression,omitempty"` + Servicespn string `json:"servicespn,omitempty"` + Usercert string `json:"usercert,omitempty"` + Userrealm string `json:"userrealm,omitempty"` +} + +type AaagroupAuditnslogpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaauserbinding struct { - Username string `json:"username,omitempty"` +type AaaglobalBinding struct { + AaaglobalAaapreauthenticationpolicyBinding []interface{} `json:"aaaglobal_aaapreauthenticationpolicy_binding,omitempty"` + AaaglobalAuthenticationnegotiateactionBinding []interface{} `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` } -type Aaausersyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` +type AaagroupVpnintranetapplicationBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Intranetapplication string `json:"intranetapplication,omitempty"` } -type Aaausertrafficpolicybinding struct { +type AaauserVpntrafficpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Aaauservpnurlbinding struct { - Urlname string `json:"urlname,omitempty"` +type AaauserAuditsyslogpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaagroupuserbinding struct { + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Groupname string `json:"groupname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Aaapreauthenticationpolicyaaaglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Aaassoprofile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` } -type Aaaglobalbinding struct { +type Aaapreauthenticationparameter struct { + Builtin []string `json:"builtin,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Feature string `json:"feature,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preauthenticationaction string `json:"preauthenticationaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Aaagroupintranetip6binding struct { - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AaauserAuthorizationpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } -type Aaagrouppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Type string `json:"type,omitempty"` +type AaauserIntranetipBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Username string `json:"username,omitempty"` } -type Aaagroupsyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` +type AaagroupIntranetipBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` } -type Aaagroupvpnurlbinding struct { - Urlname string `json:"urlname,omitempty"` +type AaagroupVpntrafficpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaagroupvpnurlpolicybinding struct { + Groupname string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaakcdaccount struct { - Kcdaccount string `json:"kcdaccount,omitempty"` - Keytab string `json:"keytab,omitempty"` - Realmstr string `json:"realmstr,omitempty"` - Delegateduser string `json:"delegateduser,omitempty"` - Kcdpassword string `json:"kcdpassword,omitempty"` - Usercert string `json:"usercert,omitempty"` - Cacert string `json:"cacert,omitempty"` - Userrealm string `json:"userrealm,omitempty"` - Enterpriserealm string `json:"enterpriserealm,omitempty"` - Servicespn string `json:"servicespn,omitempty"` - Principle string `json:"principle,omitempty"` - Kcdspn string `json:"kcdspn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaatacacsparams struct { - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Tacacssecret string `json:"tacacssecret,omitempty"` - Authorization string `json:"authorization,omitempty"` - Accounting string `json:"accounting,omitempty"` - Auditfailedcmds string `json:"auditfailedcmds,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AaagroupVpnsecureprivateaccessprofileBinding struct { + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` } -type Aaauservpntrafficpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AaagroupAuditsyslogpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaacertparams struct { - Usernamefield string `json:"usernamefield,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Twofactor string `json:"twofactor,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaaglobalaaapreauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Builtin []string `json:"builtin,omitempty"` -} - -type Aaagroupauditsyslogpolicybinding struct { + Groupname string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaauservpnintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` +type AaauserVpnurlpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaauservpnsessionpolicybinding struct { Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` } -type Aaagroup struct { - Groupname string `json:"groupname,omitempty"` - Weight int `json:"weight,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaauserpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Type string `json:"type,omitempty"` +type AaauserVpnurlBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Urlname string `json:"urlname,omitempty"` Username string `json:"username,omitempty"` } -type Aaauservpnurlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` +type AaagroupIntranetip6Binding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaaglobalnegotiateactionbinding struct { - Windowsprofile string `json:"windowsprofile,omitempty"` -} - -type Aaagroupaaauserbinding struct { - Username string `json:"username,omitempty"` Groupname string `json:"groupname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaapreauthenticationparameter struct { - Preauthenticationaction string `json:"preauthenticationaction,omitempty"` - Rule string `json:"rule,omitempty"` - Killprocess string `json:"killprocess,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaassoprofile struct { - Name string `json:"name,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaauser struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaauserintranetip6binding struct { Intranetip6 string `json:"intranetip6,omitempty"` Numaddr int `json:"numaddr,omitempty"` - Username string `json:"username,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Aaagrouptmsessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` +type AaagroupAaauserBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` -} - -type Aaauserintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` Username string `json:"username,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaauserurlbinding struct { - Urlname string `json:"urlname,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Aaagroupauditnslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AaapreauthenticationpolicyBinding struct { + AaapreauthenticationpolicyAaaglobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` + AaapreauthenticationpolicyVpnvserverBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Aaapreauthenticationaction struct { - Name string `json:"name,omitempty"` - Preauthenticationaction string `json:"preauthenticationaction,omitempty"` - Killprocess string `json:"killprocess,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` - Defaultepagroup string `json:"defaultepagroup,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Aaaradiusparams struct { - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radnasip string `json:"radnasip,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radvendorid int `json:"radvendorid,omitempty"` - Radattributetype int `json:"radattributetype,omitempty"` - Radgroupsprefix string `json:"radgroupsprefix,omitempty"` - Radgroupseparator string `json:"radgroupseparator,omitempty"` - Passencoding string `json:"passencoding,omitempty"` - Ipvendorid int `json:"ipvendorid,omitempty"` - Ipattributetype int `json:"ipattributetype,omitempty"` - Accounting string `json:"accounting,omitempty"` - Pwdvendorid int `json:"pwdvendorid,omitempty"` - Pwdattributetype int `json:"pwdattributetype,omitempty"` +type Aaacertparams struct { Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Callingstationid string `json:"callingstationid,omitempty"` - Authservretry int `json:"authservretry,omitempty"` - Authentication string `json:"authentication,omitempty"` - Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` - Messageauthenticator string `json:"messageauthenticator,omitempty"` - Groupauthname string `json:"groupauthname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Twofactor string `json:"twofactor,omitempty"` + Usernamefield string `json:"usernamefield,omitempty"` } -type Aaaglobalpreauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` - Builtin []string `json:"builtin,omitempty"` -} - -type Aaagroupbinding struct { - Groupname string `json:"groupname,omitempty"` -} - -type Aaagroupurlbinding struct { - Urlname string `json:"urlname,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AaauserVpnsessionpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaagroupurlpolicybinding struct { Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } -type Aaapreauthenticationpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Hits string `json:"hits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` +type Aaaotpparameter struct { + Encryption string `json:"encryption,omitempty"` + Maxotpdevices int `json:"maxotpdevices,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Aaauseraaagroupbinding struct { - Groupname string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Aaaradiusparams struct { + Accounting string `json:"accounting,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authservretry int `json:"authservretry,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Callingstationid string `json:"callingstationid,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Feature string `json:"feature,omitempty"` + Groupauthname string `json:"groupauthname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Ipattributetype int `json:"ipattributetype,omitempty"` + Ipvendorid int `json:"ipvendorid,omitempty"` + Messageauthenticator string `json:"messageauthenticator,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passencoding string `json:"passencoding,omitempty"` + Pwdattributetype int `json:"pwdattributetype,omitempty"` + Pwdvendorid int `json:"pwdvendorid,omitempty"` + Radattributetype int `json:"radattributetype,omitempty"` + Radgroupseparator string `json:"radgroupseparator,omitempty"` + Radgroupsprefix string `json:"radgroupsprefix,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Radvendorid int `json:"radvendorid,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` +} + +type AaapreauthenticationpolicyAaaglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Aaagrouptrafficpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AaaglobalAuthenticationnegotiateactionBinding struct { + Windowsprofile string `json:"windowsprofile,omitempty"` } -type Aaapreauthenticationpolicybinding struct { - Name string `json:"name,omitempty"` +type AaaglobalAaapreauthenticationpolicyBinding struct { + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` } -type Aaagroupnslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` +type AaagroupAuthorizationpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Aaagroupvpntrafficpolicybinding struct { + Groupname string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AaauserVpnintranetapplicationBinding struct { Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Intranetapplication string `json:"intranetapplication,omitempty"` + Username string `json:"username,omitempty"` } -type Aaapreauthenticationpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Aaaparameter struct { + Aaadloglevel string `json:"aaadloglevel,omitempty"` + Aaadnatip string `json:"aaadnatip,omitempty"` + Aaasessionloglevel string `json:"aaasessionloglevel,omitempty"` + Apitokencache string `json:"apitokencache,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Classicendpoints string `json:"classicendpoints,omitempty"` + Defaultauthtype string `json:"defaultauthtype,omitempty"` + Defaultcspheader string `json:"defaultcspheader,omitempty"` + Dynaddr string `json:"dynaddr,omitempty"` + Enableenhancedauthfeedback string `json:"enableenhancedauthfeedback,omitempty"` + Enablesessionstickiness string `json:"enablesessionstickiness,omitempty"` + Enablestaticpagecaching string `json:"enablestaticpagecaching,omitempty"` + Enhancedepa string `json:"enhancedepa,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + Feature string `json:"feature,omitempty"` + Ftmode string `json:"ftmode,omitempty"` + Httponlycookie string `json:"httponlycookie,omitempty"` + Loginencryption string `json:"loginencryption,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Maxkbquestions int `json:"maxkbquestions,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Maxsamldeflatesize int `json:"maxsamldeflatesize,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Persistentloginattempts string `json:"persistentloginattempts,omitempty"` + Pwdexpirynotificationdays int `json:"pwdexpirynotificationdays,omitempty"` + Samesite string `json:"samesite,omitempty"` + Securityinsights string `json:"securityinsights,omitempty"` + Tokenintrospectioninterval int `json:"tokenintrospectioninterval,omitempty"` + Wafprotection []string `json:"wafprotection,omitempty"` + Webviewendpoints string `json:"webviewendpoints,omitempty"` } -type Aaauserauthorizationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Username string `json:"username,omitempty"` +type AaauserVpnsecureprivateaccessprofileBinding struct { + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` + Username string `json:"username,omitempty"` } -type Aaausersessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` +type AaauserAuditnslogpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` } -type Aaagroupvpnsessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AaauserBinding struct { + AaauserAaagroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` + AaauserAuditnslogpolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` + AaauserAuditsyslogpolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` + AaauserAuthorizationpolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` + AaauserIntranetip6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` + AaauserIntranetipBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` + AaauserTmsessionpolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` + AaauserVpnintranetapplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` + AaauserVpnsecureprivateaccessprofileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` + AaauserVpnsessionpolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` + AaauserVpntrafficpolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` + AaauserVpnurlBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` + AaauserVpnurlpolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` + Username string `json:"username,omitempty"` +} + +type AaagroupTmsessionpolicyBinding struct { Acttype int `json:"acttype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupname string `json:"groupname,omitempty"` - Type string `json:"type,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Aaapreauthenticationpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Aaapreauthenticationpolicy struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Aaapreauthenticationpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Aaatacacsparams struct { + Accounting string `json:"accounting,omitempty"` + Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + Authorization string `json:"authorization,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Feature string `json:"feature,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Tacacssecret string `json:"tacacssecret,omitempty"` +} + +type Aaagroup struct { + Count float64 `json:"__count,omitempty"` + Groupname string `json:"groupname,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Weight int `json:"weight,omitempty"` } -type Aaauserauditnslogpolicybinding struct { +type AaauserTmsessionpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` + TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Aaausernslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AaagroupBinding struct { + AaagroupAaauserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` + AaagroupAuditnslogpolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` + AaagroupAuditsyslogpolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` + AaagroupAuthorizationpolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` + AaagroupIntranetip6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` + AaagroupIntranetipBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` + AaagroupTmsessionpolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` + AaagroupVpnintranetapplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` + AaagroupVpnsecureprivateaccessprofileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` + AaagroupVpnsessionpolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` + AaagroupVpntrafficpolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` + AaagroupVpnurlBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` + AaagroupVpnurlpolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` + Groupname string `json:"groupname,omitempty"` } -type Aaausertmsessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` +type Aaasession struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Groupname string `json:"groupname,omitempty"` + Iip string `json:"iip,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + Intranetip6 string `json:"intranetip6,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Peid int `json:"peid,omitempty"` + Port int `json:"port,omitempty"` + Privateip string `json:"privateip,omitempty"` + Privateport int `json:"privateport,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Sessionkey string `json:"sessionkey,omitempty"` + Username string `json:"username,omitempty"` } -type Aaauserurlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Username string `json:"username,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Aaapreauthenticationaction struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultepagroup string `json:"defaultepagroup,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Feature string `json:"feature,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preauthenticationaction string `json:"preauthenticationaction,omitempty"` } -type Aaauserintranetipbinding struct { - Intranetip string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Username string `json:"username,omitempty"` +type AaauserAaagroupBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupname string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` } -type Aaagroupintranetipbinding struct { - Intranetip string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Groupname string `json:"groupname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Aaaldapparams struct { + Authtimeout int `json:"authtimeout,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Feature string `json:"feature,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Groupauthname string `json:"groupauthname,omitempty"` + Groupnameidentifier string `json:"groupnameidentifier,omitempty"` + Groupsearchattribute string `json:"groupsearchattribute,omitempty"` + Groupsearchfilter string `json:"groupsearchfilter,omitempty"` + Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` + Ldapbase string `json:"ldapbase,omitempty"` + Ldapbinddn string `json:"ldapbinddn,omitempty"` + Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` + Ldaploginname string `json:"ldaploginname,omitempty"` + Maxnestinglevel int `json:"maxnestinglevel,omitempty"` + Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passwdchange string `json:"passwdchange,omitempty"` + Searchfilter string `json:"searchfilter,omitempty"` + Sectype string `json:"sectype,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Ssonameattribute string `json:"ssonameattribute,omitempty"` + Subattributename string `json:"subattributename,omitempty"` + Svrtype string `json:"svrtype,omitempty"` } -type Aaagroupvpnintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Acttype int `json:"acttype,omitempty"` - Groupname string `json:"groupname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Aaauser struct { + Count float64 `json:"__count,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` } -type Aaausergroupbinding struct { - Groupname string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` +type AaauserIntranetip6Binding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` + Username string `json:"username,omitempty"` +} + +type AaapreauthenticationpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/adm.go b/nitrogo/models/adm.go index 998c91a..74d3c73 100644 --- a/nitrogo/models/adm.go +++ b/nitrogo/models/adm.go @@ -1,9 +1,6 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// adm configuration structs type Admparameter struct { Admserviceconnect string `json:"admserviceconnect,omitempty"` Lowtouchonboard string `json:"lowtouchonboard,omitempty"` diff --git a/nitrogo/models/analytics.go b/nitrogo/models/analytics.go index 9e4a698..f44fc6d 100644 --- a/nitrogo/models/analytics.go +++ b/nitrogo/models/analytics.go @@ -1,62 +1,57 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Analyticsglobalbinding struct { +// analytics configuration structs +type AnalyticsglobalAnalyticsprofileBinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` } -type Analyticsglobalprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type AnalyticsglobalBinding struct { + AnalyticsglobalAnalyticsprofileBinding []interface{} `json:"analyticsglobal_analyticsprofile_binding,omitempty"` } type Analyticsprofile struct { - Name string `json:"name,omitempty"` + Allhttpheaders string `json:"allhttpheaders,omitempty"` + Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` + Analyticsendpointcontenttype string `json:"analyticsendpointcontenttype,omitempty"` + Analyticsendpointmetadata string `json:"analyticsendpointmetadata,omitempty"` + Analyticsendpointurl string `json:"analyticsendpointurl,omitempty"` + Auditlogs string `json:"auditlogs,omitempty"` Collectors string `json:"collectors,omitempty"` - Type string `json:"type,omitempty"` + Count float64 `json:"__count,omitempty"` + Cqareporting string `json:"cqareporting,omitempty"` + Dataformatfile string `json:"dataformatfile,omitempty"` + Events string `json:"events,omitempty"` + Grpcstatus string `json:"grpcstatus,omitempty"` + Httpauthentication string `json:"httpauthentication,omitempty"` Httpclientsidemeasurements string `json:"httpclientsidemeasurements,omitempty"` - Httppagetracking string `json:"httppagetracking,omitempty"` - Httpurl string `json:"httpurl,omitempty"` + Httpcontenttype string `json:"httpcontenttype,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httpcustomheaders []string `json:"httpcustomheaders,omitempty"` + Httpdomainname string `json:"httpdomainname,omitempty"` Httphost string `json:"httphost,omitempty"` + Httplocation string `json:"httplocation,omitempty"` Httpmethod string `json:"httpmethod,omitempty"` + Httppagetracking string `json:"httppagetracking,omitempty"` Httpreferer string `json:"httpreferer,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httplocation string `json:"httplocation,omitempty"` - Urlcategory string `json:"urlcategory,omitempty"` - Allhttpheaders string `json:"allhttpheaders,omitempty"` - Httpcontenttype string `json:"httpcontenttype,omitempty"` - Httpauthentication string `json:"httpauthentication,omitempty"` - Httpvia string `json:"httpvia,omitempty"` - Httpxforwardedforheader string `json:"httpxforwardedforheader,omitempty"` Httpsetcookie string `json:"httpsetcookie,omitempty"` Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` - Httpdomainname string `json:"httpdomainname,omitempty"` + Httpurl string `json:"httpurl,omitempty"` Httpurlquery string `json:"httpurlquery,omitempty"` - Tcpburstreporting string `json:"tcpburstreporting,omitempty"` - Cqareporting string `json:"cqareporting,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Httpvia string `json:"httpvia,omitempty"` + Httpxforwardedforheader string `json:"httpxforwardedforheader,omitempty"` Integratedcache string `json:"integratedcache,omitempty"` - Grpcstatus string `json:"grpcstatus,omitempty"` - Outputmode string `json:"outputmode,omitempty"` + Managementlog []string `json:"managementlog,omitempty"` Metrics string `json:"metrics,omitempty"` - Events string `json:"events,omitempty"` - Auditlogs string `json:"auditlogs,omitempty"` - Servemode string `json:"servemode,omitempty"` - Schemafile string `json:"schemafile,omitempty"` Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` - Analyticsendpointmetadata string `json:"analyticsendpointmetadata,omitempty"` - Dataformatfile string `json:"dataformatfile,omitempty"` - Topn string `json:"topn,omitempty"` - Httpcustomheaders []string `json:"httpcustomheaders,omitempty"` - Managementlog []string `json:"managementlog,omitempty"` - Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` - Analyticsendpointurl string `json:"analyticsendpointurl,omitempty"` - Analyticsendpointcontenttype string `json:"analyticsendpointcontenttype,omitempty"` - Refcnt string `json:"refcnt,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Analyticsglobalanalyticsprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` + Outputmode string `json:"outputmode,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Schemafile string `json:"schemafile,omitempty"` + Servemode string `json:"servemode,omitempty"` + Tcpburstreporting string `json:"tcpburstreporting,omitempty"` + Topn string `json:"topn,omitempty"` + TypeField string `json:"type,omitempty"` + Urlcategory string `json:"urlcategory,omitempty"` } diff --git a/nitrogo/models/api.go b/nitrogo/models/api.go index 783cb3c..e80f145 100644 --- a/nitrogo/models/api.go +++ b/nitrogo/models/api.go @@ -1,34 +1,33 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Apiprofileapispecbinding struct { - Apispec string `json:"apispec,omitempty"` - Name string `json:"name,omitempty"` +// api configuration structs +type Apispecfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Src string `json:"src,omitempty"` } -type Apiprofilebinding struct { - Name string `json:"name,omitempty"` +type ApiprofileApispecBinding struct { + Apispec string `json:"apispec,omitempty"` + Name string `json:"name,omitempty"` } type Apispec struct { - Name string `json:"name,omitempty"` - File string `json:"file,omitempty"` - Type string `json:"type,omitempty"` - Skipvalidation string `json:"skipvalidation,omitempty"` - Encrypted bool `json:"encrypted,omitempty"` - Builtin string `json:"builtin,omitempty"` - Ready string `json:"ready,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Encrypted bool `json:"encrypted,omitempty"` + File string `json:"file,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nsappversion string `json:"nsappversion,omitempty"` + Ready string `json:"ready,omitempty"` + Skipvalidation string `json:"skipvalidation,omitempty"` + TypeField string `json:"type,omitempty"` } -type Apispecbinding struct { - Name string `json:"name,omitempty"` -} - -type Apispecspecendpointbinding struct { +type ApispecSpecendpointBinding struct { Apiname string `json:"apiname,omitempty"` Apiservice string `json:"apiservice,omitempty"` Httpmethod string `json:"httpmethod,omitempty"` @@ -36,15 +35,19 @@ type Apispecspecendpointbinding struct { Name string `json:"name,omitempty"` } -type Apispecfile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Apiprofile struct { + Apivisibility string `json:"apivisibility,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Apiprofile struct { - Name string `json:"name,omitempty"` - Apivisibility string `json:"apivisibility,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ApiprofileBinding struct { + ApiprofileApispecBinding []interface{} `json:"apiprofile_apispec_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type ApispecBinding struct { + ApispecSpecendpointBinding []interface{} `json:"apispec_specendpoint_binding,omitempty"` + Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/app.go b/nitrogo/models/app.go index fedbc85..6ea6a8a 100644 --- a/nitrogo/models/app.go +++ b/nitrogo/models/app.go @@ -1,11 +1,8 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// app configuration structs type Application struct { - Apptemplatefilename string `json:"apptemplatefilename,omitempty"` Appname string `json:"appname,omitempty"` + Apptemplatefilename string `json:"apptemplatefilename,omitempty"` Deploymentfilename string `json:"deploymentfilename,omitempty"` } diff --git a/nitrogo/models/appflow.go b/nitrogo/models/appflow.go index ed8dabe..8cc2fcb 100644 --- a/nitrogo/models/appflow.go +++ b/nitrogo/models/appflow.go @@ -1,278 +1,229 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Appflowcollector struct { - Name string `json:"name,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Transport string `json:"transport,omitempty"` - Newname string `json:"newname,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appflowglobalbinding struct { -} - -type Appflowpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appflowpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Appflowpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +// appflow configuration structs +type Appflowparam struct { + Aaausername string `json:"aaausername,omitempty"` + Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` + Appnamerefresh int `json:"appnamerefresh,omitempty"` + Auditlogs string `json:"auditlogs,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cacheinsight string `json:"cacheinsight,omitempty"` + Clienttrafficonly string `json:"clienttrafficonly,omitempty"` + Connectionchaining string `json:"connectionchaining,omitempty"` + Cqareporting string `json:"cqareporting,omitempty"` + Distributedtracing string `json:"distributedtracing,omitempty"` + Disttracingsamplingrate int `json:"disttracingsamplingrate,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Events string `json:"events,omitempty"` + Feature string `json:"feature,omitempty"` + Flowrecordinterval int `json:"flowrecordinterval,omitempty"` + Gxsessionreporting string `json:"gxsessionreporting,omitempty"` + Httpauthorization string `json:"httpauthorization,omitempty"` + Httpcontenttype string `json:"httpcontenttype,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httpdomain string `json:"httpdomain,omitempty"` + Httphost string `json:"httphost,omitempty"` + Httplocation string `json:"httplocation,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httpquerywithurl string `json:"httpquerywithurl,omitempty"` + Httpreferer string `json:"httpreferer,omitempty"` + Httpsetcookie string `json:"httpsetcookie,omitempty"` + Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` + Httpurl string `json:"httpurl,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Httpvia string `json:"httpvia,omitempty"` + Httpxforwardedfor string `json:"httpxforwardedfor,omitempty"` + Identifiername string `json:"identifiername,omitempty"` + Identifiersessionname string `json:"identifiersessionname,omitempty"` + Logstreamovernsip string `json:"logstreamovernsip,omitempty"` + Lsnlogging string `json:"lsnlogging,omitempty"` + Metrics string `json:"metrics,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Observationdomainid int `json:"observationdomainid,omitempty"` + Observationdomainname string `json:"observationdomainname,omitempty"` + Observationpointid int `json:"observationpointid,omitempty"` + Securityinsightrecordinterval int `json:"securityinsightrecordinterval,omitempty"` + Securityinsighttraffic string `json:"securityinsighttraffic,omitempty"` + Skipcacheredirectionhttptransaction string `json:"skipcacheredirectionhttptransaction,omitempty"` + Subscriberawareness string `json:"subscriberawareness,omitempty"` + Subscriberidobfuscation string `json:"subscriberidobfuscation,omitempty"` + Subscriberidobfuscationalgo string `json:"subscriberidobfuscationalgo,omitempty"` + Tcpattackcounterinterval int `json:"tcpattackcounterinterval,omitempty"` + Tcpburstreporting string `json:"tcpburstreporting,omitempty"` + Tcpburstreportingthreshold int `json:"tcpburstreportingthreshold,omitempty"` + Templaterefresh int `json:"templaterefresh,omitempty"` + Timeseriesovernsip string `json:"timeseriesovernsip,omitempty"` + Udppmtu int `json:"udppmtu,omitempty"` + Urlcategory string `json:"urlcategory,omitempty"` + Usagerecordinterval int `json:"usagerecordinterval,omitempty"` + Videoinsight string `json:"videoinsight,omitempty"` + Websaasappusagereporting string `json:"websaasappusagereporting,omitempty"` +} + +type AppflowglobalBinding struct { + AppflowglobalAppflowpolicyBinding []interface{} `json:"appflowglobal_appflowpolicy_binding,omitempty"` +} + +type AppflowpolicyAppflowglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appflowpolicyappflowglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Appflowpolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppflowpolicylabelBinding struct { + AppflowpolicylabelAppflowpolicyBinding []interface{} `json:"appflowpolicylabel_appflowpolicy_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type AppflowpolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appflowpolicyappflowpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` +type AppflowglobalAppflowpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Appflowpolicypolicylabelbinding struct { +type AppflowpolicyAppflowpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appflowpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appflowactionbinding struct { - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appflowparam struct { - Templaterefresh int `json:"templaterefresh,omitempty"` - Appnamerefresh int `json:"appnamerefresh,omitempty"` - Flowrecordinterval int `json:"flowrecordinterval,omitempty"` - Securityinsightrecordinterval int `json:"securityinsightrecordinterval,omitempty"` - Udppmtu int `json:"udppmtu,omitempty"` - Httpurl string `json:"httpurl,omitempty"` - Aaausername string `json:"aaausername,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httpreferer string `json:"httpreferer,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httphost string `json:"httphost,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Clienttrafficonly string `json:"clienttrafficonly,omitempty"` - Httpcontenttype string `json:"httpcontenttype,omitempty"` - Httpauthorization string `json:"httpauthorization,omitempty"` - Httpvia string `json:"httpvia,omitempty"` - Httpxforwardedfor string `json:"httpxforwardedfor,omitempty"` - Httplocation string `json:"httplocation,omitempty"` - Httpsetcookie string `json:"httpsetcookie,omitempty"` - Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` - Connectionchaining string `json:"connectionchaining,omitempty"` - Httpdomain string `json:"httpdomain,omitempty"` - Skipcacheredirectionhttptransaction string `json:"skipcacheredirectionhttptransaction,omitempty"` - Identifiername string `json:"identifiername,omitempty"` - Identifiersessionname string `json:"identifiersessionname,omitempty"` - Observationdomainid int `json:"observationdomainid,omitempty"` - Observationdomainname string `json:"observationdomainname,omitempty"` - Subscriberawareness string `json:"subscriberawareness,omitempty"` - Subscriberidobfuscation string `json:"subscriberidobfuscation,omitempty"` - Subscriberidobfuscationalgo string `json:"subscriberidobfuscationalgo,omitempty"` - Gxsessionreporting string `json:"gxsessionreporting,omitempty"` - Securityinsighttraffic string `json:"securityinsighttraffic,omitempty"` - Cacheinsight string `json:"cacheinsight,omitempty"` - Videoinsight string `json:"videoinsight,omitempty"` - Httpquerywithurl string `json:"httpquerywithurl,omitempty"` - Urlcategory string `json:"urlcategory,omitempty"` - Lsnlogging string `json:"lsnlogging,omitempty"` - Cqareporting string `json:"cqareporting,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Usagerecordinterval int `json:"usagerecordinterval,omitempty"` - Websaasappusagereporting string `json:"websaasappusagereporting,omitempty"` - Metrics string `json:"metrics,omitempty"` - Events string `json:"events,omitempty"` - Auditlogs string `json:"auditlogs,omitempty"` - Observationpointid int `json:"observationpointid,omitempty"` - Distributedtracing string `json:"distributedtracing,omitempty"` - Disttracingsamplingrate int `json:"disttracingsamplingrate,omitempty"` - Tcpattackcounterinterval int `json:"tcpattackcounterinterval,omitempty"` - Logstreamovernsip string `json:"logstreamovernsip,omitempty"` - Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` - Timeseriesovernsip string `json:"timeseriesovernsip,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Tcpburstreporting string `json:"tcpburstreporting,omitempty"` - Tcpburstreportingthreshold string `json:"tcpburstreportingthreshold,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppflowactionBinding struct { + AppflowactionAnalyticsprofileBinding []interface{} `json:"appflowaction_analyticsprofile_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Appflowpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type AppflowpolicylabelAppflowpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appflowpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type AppflowpolicyBinding struct { + AppflowpolicyAppflowglobalBinding []interface{} `json:"appflowpolicy_appflowglobal_binding,omitempty"` + AppflowpolicyAppflowpolicylabelBinding []interface{} `json:"appflowpolicy_appflowpolicylabel_binding,omitempty"` + AppflowpolicyCsvserverBinding []interface{} `json:"appflowpolicy_csvserver_binding,omitempty"` + AppflowpolicyLbvserverBinding []interface{} `json:"appflowpolicy_lbvserver_binding,omitempty"` + AppflowpolicyVpnvserverBinding []interface{} `json:"appflowpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Appflowpolicyvserverbinding struct { +type AppflowpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` -} - -type Appflowpolicylabelappflowpolicybinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Appflowpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` } type Appflowaction struct { - Name string `json:"name,omitempty"` - Collectors []string `json:"collectors,omitempty"` - Clientsidemeasurements string `json:"clientsidemeasurements,omitempty"` - Pagetracking string `json:"pagetracking,omitempty"` - Webinsight string `json:"webinsight,omitempty"` - Securityinsight string `json:"securityinsight,omitempty"` Botinsight string `json:"botinsight,omitempty"` Ciinsight string `json:"ciinsight,omitempty"` - Videoanalytics string `json:"videoanalytics,omitempty"` + Clientsidemeasurements string `json:"clientsidemeasurements,omitempty"` + Collectors []string `json:"collectors,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` Distributionalgorithm string `json:"distributionalgorithm,omitempty"` + Hits int `json:"hits,omitempty"` Metricslog bool `json:"metricslog,omitempty"` - Transactionlog string `json:"transactionlog,omitempty"` - Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Description string `json:"description,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pagetracking string `json:"pagetracking,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Securityinsight string `json:"securityinsight,omitempty"` + Transactionlog string `json:"transactionlog,omitempty"` + Videoanalytics string `json:"videoanalytics,omitempty"` + Webinsight string `json:"webinsight,omitempty"` } -type Appflowactionanalyticsprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appflowglobalappflowpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Appflowglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Appflowpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Appflowpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type AppflowpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appflowpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appflowactionprofilebinding struct { +type Appflowcollector struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + State string `json:"state,omitempty"` + Transport string `json:"transport,omitempty"` +} + +type AppflowactionAnalyticsprofileBinding struct { Analyticsprofile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/appfw.go b/nitrogo/models/appfw.go index 73df16a..5193a80 100644 --- a/nitrogo/models/appfw.go +++ b/nitrogo/models/appfw.go @@ -1,1190 +1,1167 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Appfwlearningdata struct { - Profilename string `json:"profilename,omitempty"` - Starturl string `json:"starturl,omitempty"` - Cookieconsistency string `json:"cookieconsistency,omitempty"` - Fieldconsistency string `json:"fieldconsistency,omitempty"` - Formactionurlffc string `json:"formactionurl_ffc,omitempty"` - Contenttype string `json:"contenttype,omitempty"` - Crosssitescripting string `json:"crosssitescripting,omitempty"` - Formactionurlxss string `json:"formactionurl_xss,omitempty"` - Asscanlocationxss string `json:"as_scan_location_xss,omitempty"` - Asvaluetypexss string `json:"as_value_type_xss,omitempty"` - Asvalueexprxss string `json:"as_value_expr_xss,omitempty"` - Sqlinjection string `json:"sqlinjection,omitempty"` - Formactionurlsql string `json:"formactionurl_sql,omitempty"` - Asscanlocationsql string `json:"as_scan_location_sql,omitempty"` - Asvaluetypesql string `json:"as_value_type_sql,omitempty"` - Asvalueexprsql string `json:"as_value_expr_sql,omitempty"` - Fieldformat string `json:"fieldformat,omitempty"` - Formactionurlff string `json:"formactionurl_ff,omitempty"` - Csrftag string `json:"csrftag,omitempty"` - Csrfformoriginurl string `json:"csrfformoriginurl,omitempty"` - Creditcardnumber string `json:"creditcardnumber,omitempty"` - Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` - Xmldoscheck string `json:"xmldoscheck,omitempty"` - Xmlwsicheck string `json:"xmlwsicheck,omitempty"` - Xmlattachmentcheck string `json:"xmlattachmentcheck,omitempty"` - Totalxmlrequests bool `json:"totalxmlrequests,omitempty"` - Securitycheck string `json:"securitycheck,omitempty"` - Target string `json:"target,omitempty"` - Url string `json:"url,omitempty"` - Name string `json:"name,omitempty"` - Fieldtype string `json:"fieldtype,omitempty"` - Fieldformatminlength string `json:"fieldformatminlength,omitempty"` - Fieldformatmaxlength string `json:"fieldformatmaxlength,omitempty"` - Fieldformatcharmappcre string `json:"fieldformatcharmappcre,omitempty"` - Valuetype string `json:"value_type,omitempty"` - Value string `json:"value,omitempty"` - Hits string `json:"hits,omitempty"` - Data string `json:"data,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwprofilefileuploadtypebinding struct { - Fileuploadtype string `json:"fileuploadtype,omitempty"` - Asfileuploadtypesurl string `json:"as_fileuploadtypes_url,omitempty"` - Isnameregex string `json:"isnameregex,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Filetype []string `json:"filetype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Isregexfileuploadtypesurl string `json:"isregex_fileuploadtypes_url,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilerestvalidationbinding struct { - Restvalidation string `json:"restvalidation,omitempty"` - Restvalidationaction string `json:"rest_validation_action,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +// appfw configuration structs +type Appfwxmlerrorpage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Appfwxmlcontenttype struct { - Xmlcontenttypevalue string `json:"xmlcontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwxmlschema struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` +type Appfwgrpcwebtextcontenttype struct { + Count float64 `json:"__count,omitempty"` + Grpcwebtextcontenttypevalue string `json:"grpcwebtextcontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwprofilecontenttypebinding struct { - Contenttype string `json:"contenttype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` +type AppfwglobalAppfwpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Policytype string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AppfwprofileCookieconsistencyBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Cookieconsistency string `json:"cookieconsistency,omitempty"` Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` + Isregex string `json:"isregex,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwprofiledenyurlbinding struct { - Denyurl string `json:"denyurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` +type AppfwprofileXmldosurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Xmlblockdtd string `json:"xmlblockdtd,omitempty"` + Xmlblockexternalentities string `json:"xmlblockexternalentities,omitempty"` + Xmlblockpi string `json:"xmlblockpi,omitempty"` + Xmldosurl string `json:"xmldosurl,omitempty"` + Xmlmaxattributenamelength int `json:"xmlmaxattributenamelength,omitempty"` + Xmlmaxattributenamelengthcheck string `json:"xmlmaxattributenamelengthcheck,omitempty"` + Xmlmaxattributes int `json:"xmlmaxattributes,omitempty"` + Xmlmaxattributescheck string `json:"xmlmaxattributescheck,omitempty"` + Xmlmaxattributevaluelength int `json:"xmlmaxattributevaluelength,omitempty"` + Xmlmaxattributevaluelengthcheck string `json:"xmlmaxattributevaluelengthcheck,omitempty"` + Xmlmaxchardatalength int `json:"xmlmaxchardatalength,omitempty"` + Xmlmaxchardatalengthcheck string `json:"xmlmaxchardatalengthcheck,omitempty"` + Xmlmaxelementchildren int `json:"xmlmaxelementchildren,omitempty"` + Xmlmaxelementchildrencheck string `json:"xmlmaxelementchildrencheck,omitempty"` + Xmlmaxelementdepth int `json:"xmlmaxelementdepth,omitempty"` + Xmlmaxelementdepthcheck string `json:"xmlmaxelementdepthcheck,omitempty"` + Xmlmaxelementnamelength int `json:"xmlmaxelementnamelength,omitempty"` + Xmlmaxelementnamelengthcheck string `json:"xmlmaxelementnamelengthcheck,omitempty"` + Xmlmaxelements int `json:"xmlmaxelements,omitempty"` + Xmlmaxelementscheck string `json:"xmlmaxelementscheck,omitempty"` + Xmlmaxentityexpansiondepth int `json:"xmlmaxentityexpansiondepth,omitempty"` + Xmlmaxentityexpansiondepthcheck string `json:"xmlmaxentityexpansiondepthcheck,omitempty"` + Xmlmaxentityexpansions int `json:"xmlmaxentityexpansions,omitempty"` + Xmlmaxentityexpansionscheck string `json:"xmlmaxentityexpansionscheck,omitempty"` + Xmlmaxfilesize int `json:"xmlmaxfilesize,omitempty"` + Xmlmaxfilesizecheck string `json:"xmlmaxfilesizecheck,omitempty"` + Xmlmaxnamespaces int `json:"xmlmaxnamespaces,omitempty"` + Xmlmaxnamespacescheck string `json:"xmlmaxnamespacescheck,omitempty"` + Xmlmaxnamespaceurilength int `json:"xmlmaxnamespaceurilength,omitempty"` + Xmlmaxnamespaceurilengthcheck string `json:"xmlmaxnamespaceurilengthcheck,omitempty"` + Xmlmaxnodes int `json:"xmlmaxnodes,omitempty"` + Xmlmaxnodescheck string `json:"xmlmaxnodescheck,omitempty"` + Xmlmaxsoaparrayrank int `json:"xmlmaxsoaparrayrank,omitempty"` + Xmlmaxsoaparraysize int `json:"xmlmaxsoaparraysize,omitempty"` + Xmlminfilesize int `json:"xmlminfilesize,omitempty"` + Xmlminfilesizecheck string `json:"xmlminfilesizecheck,omitempty"` + Xmlsoaparraycheck string `json:"xmlsoaparraycheck,omitempty"` +} + +type AppfwprofileDenyurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Denyurl string `json:"denyurl,omitempty"` Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwmultipartformcontenttype struct { - Multipartformcontenttypevalue string `json:"multipartformcontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Appfwsignatures struct { + Action []string `json:"action,omitempty"` + Autoenablenewsignatures string `json:"autoenablenewsignatures,omitempty"` + Category string `json:"category,omitempty"` + Comment string `json:"comment,omitempty"` + Enabled string `json:"enabled,omitempty"` + Encryptedversion int `json:"encryptedversion,omitempty"` + Merge bool `json:"merge,omitempty"` + Mergedefault bool `json:"mergedefault,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Preservedefactions bool `json:"preservedefactions,omitempty"` + Response string `json:"response,omitempty"` + Ruleid []interface{} `json:"ruleid,omitempty"` + Sha1 string `json:"sha1,omitempty"` + Src string `json:"src,omitempty"` + Vendortype string `json:"vendortype,omitempty"` + Xslt string `json:"xslt,omitempty"` +} + +type AppfwprofileFieldformatBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Fieldformat string `json:"fieldformat,omitempty"` + Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` + Fieldformatminlength int `json:"fieldformatminlength,omitempty"` + Fieldtype string `json:"fieldtype,omitempty"` + FormactionurlFf string `json:"formactionurl_ff,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexFf string `json:"isregex_ff,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type AppfwprofileLogexpressionBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsLogexpression string `json:"as_logexpression,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Logexpression string `json:"logexpression,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwcustomsettings struct { - Name string `json:"name,omitempty"` - Target string `json:"target,omitempty"` +type Appfwjsonerrorpage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Appfwgrpcwebtextcontenttype struct { - Grpcwebtextcontenttypevalue string `json:"grpcwebtextcontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwprofileJsondosurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Jsondosurl string `json:"jsondosurl,omitempty"` + Jsonmaxarraylength int `json:"jsonmaxarraylength,omitempty"` + Jsonmaxarraylengthcheck string `json:"jsonmaxarraylengthcheck,omitempty"` + Jsonmaxcontainerdepth int `json:"jsonmaxcontainerdepth,omitempty"` + Jsonmaxcontainerdepthcheck string `json:"jsonmaxcontainerdepthcheck,omitempty"` + Jsonmaxdocumentlength int `json:"jsonmaxdocumentlength,omitempty"` + Jsonmaxdocumentlengthcheck string `json:"jsonmaxdocumentlengthcheck,omitempty"` + Jsonmaxobjectkeycount int `json:"jsonmaxobjectkeycount,omitempty"` + Jsonmaxobjectkeycountcheck string `json:"jsonmaxobjectkeycountcheck,omitempty"` + Jsonmaxobjectkeylength int `json:"jsonmaxobjectkeylength,omitempty"` + Jsonmaxobjectkeylengthcheck string `json:"jsonmaxobjectkeylengthcheck,omitempty"` + Jsonmaxstringlength int `json:"jsonmaxstringlength,omitempty"` + Jsonmaxstringlengthcheck string `json:"jsonmaxstringlengthcheck,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Appfwpolicy struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policytype string `json:"policytype,omitempty"` + Profilename string `json:"profilename,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type AppfwprofileFakeaccountBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Fakeaccount string `json:"fakeaccount,omitempty"` + Formexpression string `json:"formexpression,omitempty"` + FormurlFad string `json:"formurl_fad,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Isfieldnameregex string `json:"isfieldnameregex,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Tag string `json:"tag,omitempty"` } -type Appfwprofile struct { - Name string `json:"name,omitempty"` - Defaults string `json:"defaults,omitempty"` - Starturlaction []string `json:"starturlaction,omitempty"` - Infercontenttypexmlpayloadaction []string `json:"infercontenttypexmlpayloadaction,omitempty"` - Contenttypeaction []string `json:"contenttypeaction,omitempty"` - Inspectcontenttypes []string `json:"inspectcontenttypes,omitempty"` - Starturlclosure string `json:"starturlclosure,omitempty"` - Denyurlaction []string `json:"denyurlaction,omitempty"` - Refererheadercheck string `json:"refererheadercheck,omitempty"` - Cookieconsistencyaction []string `json:"cookieconsistencyaction,omitempty"` - Cookiehijackingaction []string `json:"cookiehijackingaction,omitempty"` - Cookietransforms string `json:"cookietransforms,omitempty"` - Cookieencryption string `json:"cookieencryption,omitempty"` - Cookieproxying string `json:"cookieproxying,omitempty"` - Addcookieflags string `json:"addcookieflags,omitempty"` - Fieldconsistencyaction []string `json:"fieldconsistencyaction,omitempty"` - Csrftagaction []string `json:"csrftagaction,omitempty"` - Crosssitescriptingaction []string `json:"crosssitescriptingaction,omitempty"` - Crosssitescriptingtransformunsafehtml string `json:"crosssitescriptingtransformunsafehtml,omitempty"` - Crosssitescriptingcheckcompleteurls string `json:"crosssitescriptingcheckcompleteurls,omitempty"` - Sqlinjectionaction []string `json:"sqlinjectionaction,omitempty"` - Cmdinjectionaction []string `json:"cmdinjectionaction,omitempty"` - Cmdinjectiontype string `json:"cmdinjectiontype,omitempty"` - Sqlinjectiongrammar string `json:"sqlinjectiongrammar,omitempty"` - Cmdinjectiongrammar string `json:"cmdinjectiongrammar,omitempty"` - Fieldscan string `json:"fieldscan,omitempty"` - Fieldscanlimit int `json:"fieldscanlimit,omitempty"` - Jsonfieldscan string `json:"jsonfieldscan,omitempty"` - Jsonfieldscanlimit int `json:"jsonfieldscanlimit,omitempty"` - Messagescan string `json:"messagescan,omitempty"` - Messagescanlimit int `json:"messagescanlimit,omitempty"` - Jsonmessagescan string `json:"jsonmessagescan,omitempty"` - Jsonmessagescanlimit int `json:"jsonmessagescanlimit,omitempty"` - Messagescanlimitcontenttypes []string `json:"messagescanlimitcontenttypes,omitempty"` - Sqlinjectiontransformspecialchars string `json:"sqlinjectiontransformspecialchars,omitempty"` - Sqlinjectiononlycheckfieldswithsqlchars string `json:"sqlinjectiononlycheckfieldswithsqlchars,omitempty"` - Sqlinjectiontype string `json:"sqlinjectiontype,omitempty"` - Sqlinjectionchecksqlwildchars string `json:"sqlinjectionchecksqlwildchars,omitempty"` - Fieldformataction []string `json:"fieldformataction,omitempty"` - Defaultfieldformattype string `json:"defaultfieldformattype,omitempty"` - Defaultfieldformatminlength int `json:"defaultfieldformatminlength,omitempty"` - Defaultfieldformatmaxlength int `json:"defaultfieldformatmaxlength,omitempty"` - Defaultfieldformatmaxoccurrences int `json:"defaultfieldformatmaxoccurrences,omitempty"` - Bufferoverflowaction []string `json:"bufferoverflowaction,omitempty"` - Grpcaction []string `json:"grpcaction,omitempty"` - Restaction []string `json:"restaction,omitempty"` - Bufferoverflowmaxurllength int `json:"bufferoverflowmaxurllength,omitempty"` - Bufferoverflowmaxheaderlength int `json:"bufferoverflowmaxheaderlength,omitempty"` - Bufferoverflowmaxcookielength int `json:"bufferoverflowmaxcookielength,omitempty"` - Bufferoverflowmaxquerylength int `json:"bufferoverflowmaxquerylength,omitempty"` - Bufferoverflowmaxtotalheaderlength int `json:"bufferoverflowmaxtotalheaderlength,omitempty"` - Creditcardaction []string `json:"creditcardaction,omitempty"` - Creditcard []string `json:"creditcard,omitempty"` - Creditcardmaxallowed int `json:"creditcardmaxallowed,omitempty"` - Creditcardxout string `json:"creditcardxout,omitempty"` - Dosecurecreditcardlogging string `json:"dosecurecreditcardlogging,omitempty"` - Streaming string `json:"streaming,omitempty"` - Trace string `json:"trace,omitempty"` - Requestcontenttype string `json:"requestcontenttype,omitempty"` - Responsecontenttype string `json:"responsecontenttype,omitempty"` - Jsonerrorobject string `json:"jsonerrorobject,omitempty"` - Apispec string `json:"apispec,omitempty"` - Protofileobject string `json:"protofileobject,omitempty"` - Jsonerrorstatuscode int `json:"jsonerrorstatuscode,omitempty"` - Jsonerrorstatusmessage string `json:"jsonerrorstatusmessage,omitempty"` - Jsondosaction []string `json:"jsondosaction,omitempty"` - Jsonsqlinjectionaction []string `json:"jsonsqlinjectionaction,omitempty"` - Jsonsqlinjectiontype string `json:"jsonsqlinjectiontype,omitempty"` - Jsonsqlinjectiongrammar string `json:"jsonsqlinjectiongrammar,omitempty"` - Jsoncmdinjectionaction []string `json:"jsoncmdinjectionaction,omitempty"` - Jsoncmdinjectiontype string `json:"jsoncmdinjectiontype,omitempty"` - Jsoncmdinjectiongrammar string `json:"jsoncmdinjectiongrammar,omitempty"` - Jsonxssaction []string `json:"jsonxssaction,omitempty"` - Xmldosaction []string `json:"xmldosaction,omitempty"` - Xmlformataction []string `json:"xmlformataction,omitempty"` - Xmlsqlinjectionaction []string `json:"xmlsqlinjectionaction,omitempty"` - Xmlsqlinjectiononlycheckfieldswithsqlchars string `json:"xmlsqlinjectiononlycheckfieldswithsqlchars,omitempty"` - Xmlsqlinjectiontype string `json:"xmlsqlinjectiontype,omitempty"` - Xmlsqlinjectionchecksqlwildchars string `json:"xmlsqlinjectionchecksqlwildchars,omitempty"` - Xmlsqlinjectionparsecomments string `json:"xmlsqlinjectionparsecomments,omitempty"` - Xmlxssaction []string `json:"xmlxssaction,omitempty"` - Xmlwsiaction []string `json:"xmlwsiaction,omitempty"` - Xmlattachmentaction []string `json:"xmlattachmentaction,omitempty"` - Xmlvalidationaction []string `json:"xmlvalidationaction,omitempty"` - Xmlerrorobject string `json:"xmlerrorobject,omitempty"` - Xmlerrorstatuscode int `json:"xmlerrorstatuscode,omitempty"` - Xmlerrorstatusmessage string `json:"xmlerrorstatusmessage,omitempty"` - Customsettings string `json:"customsettings,omitempty"` - Signatures string `json:"signatures,omitempty"` - Xmlsoapfaultaction []string `json:"xmlsoapfaultaction,omitempty"` - Usehtmlerrorobject string `json:"usehtmlerrorobject,omitempty"` - Errorurl string `json:"errorurl,omitempty"` - Htmlerrorobject string `json:"htmlerrorobject,omitempty"` - Htmlerrorstatuscode int `json:"htmlerrorstatuscode,omitempty"` - Htmlerrorstatusmessage string `json:"htmlerrorstatusmessage,omitempty"` - Logeverypolicyhit string `json:"logeverypolicyhit,omitempty"` - Stripcomments string `json:"stripcomments,omitempty"` - Striphtmlcomments string `json:"striphtmlcomments,omitempty"` - Stripxmlcomments string `json:"stripxmlcomments,omitempty"` - Exemptclosureurlsfromsecuritychecks string `json:"exemptclosureurlsfromsecuritychecks,omitempty"` - Defaultcharset string `json:"defaultcharset,omitempty"` - Clientipexpression string `json:"clientipexpression,omitempty"` - Dynamiclearning []string `json:"dynamiclearning,omitempty"` - Postbodylimit int `json:"postbodylimit,omitempty"` - Postbodylimitaction []string `json:"postbodylimitaction,omitempty"` - Postbodylimitsignature int `json:"postbodylimitsignature,omitempty"` - Fileuploadmaxnum int `json:"fileuploadmaxnum,omitempty"` - Canonicalizehtmlresponse string `json:"canonicalizehtmlresponse,omitempty"` - Enableformtagging string `json:"enableformtagging,omitempty"` - Sessionlessfieldconsistency string `json:"sessionlessfieldconsistency,omitempty"` - Sessionlessurlclosure string `json:"sessionlessurlclosure,omitempty"` - Semicolonfieldseparator string `json:"semicolonfieldseparator,omitempty"` - Excludefileuploadfromchecks string `json:"excludefileuploadfromchecks,omitempty"` - Sqlinjectionparsecomments string `json:"sqlinjectionparsecomments,omitempty"` - Invalidpercenthandling string `json:"invalidpercenthandling,omitempty"` - Type []string `json:"type,omitempty"` - Checkrequestheaders string `json:"checkrequestheaders,omitempty"` - Inspectquerycontenttypes []string `json:"inspectquerycontenttypes,omitempty"` - Optimizepartialreqs string `json:"optimizepartialreqs,omitempty"` - Urldecoderequestcookies string `json:"urldecoderequestcookies,omitempty"` - Comment string `json:"comment,omitempty"` - Percentdecoderecursively string `json:"percentdecoderecursively,omitempty"` - Multipleheaderaction []string `json:"multipleheaderaction,omitempty"` - Rfcprofile string `json:"rfcprofile,omitempty"` - Fileuploadtypesaction []string `json:"fileuploadtypesaction,omitempty"` - Verboseloglevel string `json:"verboseloglevel,omitempty"` - Insertcookiesamesiteattribute string `json:"insertcookiesamesiteattribute,omitempty"` - Cookiesamesiteattribute string `json:"cookiesamesiteattribute,omitempty"` - Sqlinjectionruletype string `json:"sqlinjectionruletype,omitempty"` - Fakeaccountdetection string `json:"fakeaccountdetection,omitempty"` - Geolocationlogging string `json:"geolocationlogging,omitempty"` - Ceflogging string `json:"ceflogging,omitempty"` - Blockkeywordaction []string `json:"blockkeywordaction,omitempty"` - Jsonblockkeywordaction []string `json:"jsonblockkeywordaction,omitempty"` - Asprofbypasslistenable string `json:"as_prof_bypass_list_enable,omitempty"` - Asprofdenylistenable string `json:"as_prof_deny_list_enable,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Archivename string `json:"archivename,omitempty"` - Relaxationrules bool `json:"relaxationrules,omitempty"` - Importprofilename string `json:"importprofilename,omitempty"` - Matchurlstring string `json:"matchurlstring,omitempty"` - Replaceurlstring string `json:"replaceurlstring,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Augment bool `json:"augment,omitempty"` - State string `json:"state,omitempty"` - Learning string `json:"learning,omitempty"` - Csrftag string `json:"csrftag,omitempty"` - Builtin string `json:"builtin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwglobalauditsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AppfwprofileJsoncmdurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsValueExprJsonCmd string `json:"as_value_expr_json_cmd,omitempty"` + AsValueTypeJsonCmd string `json:"as_value_type_json_cmd,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IskeyregexJsonCmd string `json:"iskeyregex_json_cmd,omitempty"` + IsvalueregexJsonCmd string `json:"isvalueregex_json_cmd,omitempty"` + Jsoncmdurl string `json:"jsoncmdurl,omitempty"` + KeynameJsonCmd string `json:"keyname_json_cmd,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwglobalbinding struct { +type Appfwconfidfield struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Fieldname string `json:"fieldname,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` + Url string `json:"url,omitempty"` } -type Appfwpolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type AppfwglobalAuditnslogpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Appfwprofileblockkeywordbinding struct { - Blockkeyword string `json:"blockkeyword,omitempty"` - Asblockkeywordformurl string `json:"as_blockkeyword_formurl,omitempty"` - Fieldname string `json:"fieldname,omitempty"` - Asfieldnameisregexblockkeyword string `json:"as_fieldname_isregex_blockkeyword,omitempty"` - Blockkeywordtype string `json:"blockkeywordtype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appfwglobalauditnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Policytype string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` } -type Appfwprofilexmlvalidationurlbinding struct { - Xmlvalidationurl string `json:"xmlvalidationurl,omitempty"` - Xmlvalidateresponse string `json:"xmlvalidateresponse,omitempty"` - Xmlwsdl string `json:"xmlwsdl,omitempty"` +type AppfwprofileXmlvalidationurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` Xmladditionalsoapheaders string `json:"xmladditionalsoapheaders,omitempty"` - Xmlendpointcheck string `json:"xmlendpointcheck,omitempty"` - Xmlrequestschema string `json:"xmlrequestschema,omitempty"` - Xmlresponseschema string `json:"xmlresponseschema,omitempty"` - Xmlvalidatesoapenvelope string `json:"xmlvalidatesoapenvelope,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilexmlwsiurlbinding struct { - Xmlwsiurl string `json:"xmlwsiurl,omitempty"` - Xmlwsichecks string `json:"xmlwsichecks,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` + Xmlendpointcheck string `json:"xmlendpointcheck,omitempty"` + Xmlrequestschema string `json:"xmlrequestschema,omitempty"` + Xmlresponseschema string `json:"xmlresponseschema,omitempty"` + Xmlvalidateresponse string `json:"xmlvalidateresponse,omitempty"` + Xmlvalidatesoapenvelope string `json:"xmlvalidatesoapenvelope,omitempty"` + Xmlvalidationurl string `json:"xmlvalidationurl,omitempty"` + Xmlwsdl string `json:"xmlwsdl,omitempty"` +} + +type AppfwprofileAppfwconfidfieldBinding struct { + Alertonly string `json:"alertonly,omitempty"` + CffieldUrl string `json:"cffield_url,omitempty"` + Comment string `json:"comment,omitempty"` + Confidfield string `json:"confidfield,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexCffield string `json:"isregex_cffield,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppfwprofileCrosssitescriptingBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsScanLocationXss string `json:"as_scan_location_xss,omitempty"` + AsValueExprXss string `json:"as_value_expr_xss,omitempty"` + AsValueTypeXss string `json:"as_value_type_xss,omitempty"` + Comment string `json:"comment,omitempty"` + Crosssitescripting string `json:"crosssitescripting,omitempty"` + FormactionurlXss string `json:"formactionurl_xss,omitempty"` Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` + IsregexXss string `json:"isregex_xss,omitempty"` + IsvalueregexXss string `json:"isvalueregex_xss,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwfieldtype struct { - Name string `json:"name,omitempty"` - Regex string `json:"regex,omitempty"` - Priority int `json:"priority,omitempty"` - Comment string `json:"comment,omitempty"` - Nocharmaps bool `json:"nocharmaps,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` +type Appfwtransactionrecords struct { + Appfwsessionid string `json:"appfwsessionid,omitempty"` + Clientip string `json:"clientip,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Endtime string `json:"endtime,omitempty"` + Httptransactionid int `json:"httptransactionid,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Packetengineid int `json:"packetengineid,omitempty"` + Profilename string `json:"profilename,omitempty"` + Requestcontentlength int `json:"requestcontentlength,omitempty"` + Requestmaxprocessingtime int `json:"requestmaxprocessingtime,omitempty"` + Requestyields int `json:"requestyields,omitempty"` + Responsecontentlength int `json:"responsecontentlength,omitempty"` + Responsemaxprocessingtime int `json:"responsemaxprocessingtime,omitempty"` + Responseyields int `json:"responseyields,omitempty"` + Starttime string `json:"starttime,omitempty"` + Url string `json:"url,omitempty"` +} + +type AppfwprofileBinding struct { + AppfwprofileAppfwconfidfieldBinding []interface{} `json:"appfwprofile_appfwconfidfield_binding,omitempty"` + AppfwprofileBlockkeywordBinding []interface{} `json:"appfwprofile_blockkeyword_binding,omitempty"` + AppfwprofileBypasslistBinding []interface{} `json:"appfwprofile_bypasslist_binding,omitempty"` + AppfwprofileCmdinjectionBinding []interface{} `json:"appfwprofile_cmdinjection_binding,omitempty"` + AppfwprofileContenttypeBinding []interface{} `json:"appfwprofile_contenttype_binding,omitempty"` + AppfwprofileCookieconsistencyBinding []interface{} `json:"appfwprofile_cookieconsistency_binding,omitempty"` + AppfwprofileCreditcardnumberBinding []interface{} `json:"appfwprofile_creditcardnumber_binding,omitempty"` + AppfwprofileCrosssitescriptingBinding []interface{} `json:"appfwprofile_crosssitescripting_binding,omitempty"` + AppfwprofileCsrftagBinding []interface{} `json:"appfwprofile_csrftag_binding,omitempty"` + AppfwprofileDenylistBinding []interface{} `json:"appfwprofile_denylist_binding,omitempty"` + AppfwprofileDenyurlBinding []interface{} `json:"appfwprofile_denyurl_binding,omitempty"` + AppfwprofileExcluderescontenttypeBinding []interface{} `json:"appfwprofile_excluderescontenttype_binding,omitempty"` + AppfwprofileFakeaccountBinding []interface{} `json:"appfwprofile_fakeaccount_binding,omitempty"` + AppfwprofileFieldconsistencyBinding []interface{} `json:"appfwprofile_fieldconsistency_binding,omitempty"` + AppfwprofileFieldformatBinding []interface{} `json:"appfwprofile_fieldformat_binding,omitempty"` + AppfwprofileFileuploadtypeBinding []interface{} `json:"appfwprofile_fileuploadtype_binding,omitempty"` + AppfwprofileGrpcvalidationBinding []interface{} `json:"appfwprofile_grpcvalidation_binding,omitempty"` + AppfwprofileJsonblockkeywordBinding []interface{} `json:"appfwprofile_jsonblockkeyword_binding,omitempty"` + AppfwprofileJsoncmdurlBinding []interface{} `json:"appfwprofile_jsoncmdurl_binding,omitempty"` + AppfwprofileJsondosurlBinding []interface{} `json:"appfwprofile_jsondosurl_binding,omitempty"` + AppfwprofileJsonsqlurlBinding []interface{} `json:"appfwprofile_jsonsqlurl_binding,omitempty"` + AppfwprofileJsonxssurlBinding []interface{} `json:"appfwprofile_jsonxssurl_binding,omitempty"` + AppfwprofileLogexpressionBinding []interface{} `json:"appfwprofile_logexpression_binding,omitempty"` + AppfwprofileRestvalidationBinding []interface{} `json:"appfwprofile_restvalidation_binding,omitempty"` + AppfwprofileSafeobjectBinding []interface{} `json:"appfwprofile_safeobject_binding,omitempty"` + AppfwprofileSqlinjectionBinding []interface{} `json:"appfwprofile_sqlinjection_binding,omitempty"` + AppfwprofileStarturlBinding []interface{} `json:"appfwprofile_starturl_binding,omitempty"` + AppfwprofileTrustedlearningclientsBinding []interface{} `json:"appfwprofile_trustedlearningclients_binding,omitempty"` + AppfwprofileXmlattachmenturlBinding []interface{} `json:"appfwprofile_xmlattachmenturl_binding,omitempty"` + AppfwprofileXmldosurlBinding []interface{} `json:"appfwprofile_xmldosurl_binding,omitempty"` + AppfwprofileXmlsqlinjectionBinding []interface{} `json:"appfwprofile_xmlsqlinjection_binding,omitempty"` + AppfwprofileXmlvalidationurlBinding []interface{} `json:"appfwprofile_xmlvalidationurl_binding,omitempty"` + AppfwprofileXmlwsiurlBinding []interface{} `json:"appfwprofile_xmlwsiurl_binding,omitempty"` + AppfwprofileXmlxssBinding []interface{} `json:"appfwprofile_xmlxss_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Appfwglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - State string `json:"state,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Appfwpolicylabelappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AppfwprofileCsrftagBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Csrfformactionurl string `json:"csrfformactionurl,omitempty"` + Csrftag string `json:"csrftag,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwprofilecreditcardnumberbinding struct { - Creditcardnumber string `json:"creditcardnumber,omitempty"` - Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type Appfwwsdl struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Appfwpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Profilename string `json:"profilename,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Policytype string `json:"policytype,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` +type Appfwpolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Policytype string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwhtmlerrorpage struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` +type Appfwprotofile struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Appfwprofileappfwconfidfieldbinding struct { - Confidfield string `json:"confidfield,omitempty"` - Isregexcffield string `json:"isregex_cffield,omitempty"` - Cffieldurl string `json:"cffield_url,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` +type AppfwglobalAuditsyslogpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Policytype string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AppfwglobalBinding struct { + AppfwglobalAppfwpolicyBinding []interface{} `json:"appfwglobal_appfwpolicy_binding,omitempty"` + AppfwglobalAuditnslogpolicyBinding []interface{} `json:"appfwglobal_auditnslogpolicy_binding,omitempty"` + AppfwglobalAuditsyslogpolicyBinding []interface{} `json:"appfwglobal_auditsyslogpolicy_binding,omitempty"` +} + +type AppfwprofileJsonxssurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsValueExprJsonXss string `json:"as_value_expr_json_xss,omitempty"` + AsValueTypeJsonXss string `json:"as_value_type_json_xss,omitempty"` + Comment string `json:"comment,omitempty"` Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` + IskeyregexJsonXss string `json:"iskeyregex_json_xss,omitempty"` + IsvalueregexJsonXss string `json:"isvalueregex_json_xss,omitempty"` + Jsonxssurl string `json:"jsonxssurl,omitempty"` + KeynameJsonXss string `json:"keyname_json_xss,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwprofilexmlxssbinding struct { - Xmlxss string `json:"xmlxss,omitempty"` - Isregexxmlxss string `json:"isregex_xmlxss,omitempty"` - Asscanlocationxmlxss string `json:"as_scan_location_xmlxss,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwprofileFileuploadtypeBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsFileuploadtypesUrl string `json:"as_fileuploadtypes_url,omitempty"` + Comment string `json:"comment,omitempty"` + Filetype []string `json:"filetype,omitempty"` + Fileuploadtype string `json:"fileuploadtype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Isnameregex string `json:"isnameregex,omitempty"` + IsregexFileuploadtypesUrl string `json:"isregex_fileuploadtypes_url,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppfwprofileXmlattachmenturlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Xmlattachmentcontenttype string `json:"xmlattachmentcontenttype,omitempty"` + Xmlattachmentcontenttypecheck string `json:"xmlattachmentcontenttypecheck,omitempty"` + Xmlattachmenturl string `json:"xmlattachmenturl,omitempty"` + Xmlmaxattachmentsize int `json:"xmlmaxattachmentsize,omitempty"` + Xmlmaxattachmentsizecheck string `json:"xmlmaxattachmentsizecheck,omitempty"` } type Appfwurlencodedformcontenttype struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Urlencodedformcontenttypevalue string `json:"urlencodedformcontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwprofilecookieconsistencybinding struct { - Cookieconsistency string `json:"cookieconsistency,omitempty"` - Isregex string `json:"isregex,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwpolicyBinding struct { + AppfwpolicyAppfwglobalBinding []interface{} `json:"appfwpolicy_appfwglobal_binding,omitempty"` + AppfwpolicyAppfwpolicylabelBinding []interface{} `json:"appfwpolicy_appfwpolicylabel_binding,omitempty"` + AppfwpolicyCsvserverBinding []interface{} `json:"appfwpolicy_csvserver_binding,omitempty"` + AppfwpolicyLbvserverBinding []interface{} `json:"appfwpolicy_lbvserver_binding,omitempty"` + AppfwpolicyVpnvserverBinding []interface{} `json:"appfwpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Appfwprofilecrosssitescriptingbinding struct { - Crosssitescripting string `json:"crosssitescripting,omitempty"` - Isregexxss string `json:"isregex_xss,omitempty"` - Formactionurlxss string `json:"formactionurl_xss,omitempty"` - Asscanlocationxss string `json:"as_scan_location_xss,omitempty"` - Asvaluetypexss string `json:"as_value_type_xss,omitempty"` - Asvalueexprxss string `json:"as_value_expr_xss,omitempty"` - Isvalueregexxss string `json:"isvalueregex_xss,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilexmlsqlinjectionbinding struct { - Xmlsqlinjection string `json:"xmlsqlinjection,omitempty"` - Isregexxmlsql string `json:"isregex_xmlsql,omitempty"` - Asscanlocationxmlsql string `json:"as_scan_location_xmlsql,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwprofileFieldconsistencyBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Fieldconsistency string `json:"fieldconsistency,omitempty"` + FormactionurlFfc string `json:"formactionurl_ffc,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexFfc string `json:"isregex_ffc,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwsignatures struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Xslt string `json:"xslt,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Merge bool `json:"merge,omitempty"` - Preservedefactions bool `json:"preservedefactions,omitempty"` - Sha1 string `json:"sha1,omitempty"` - Vendortype string `json:"vendortype,omitempty"` - Autoenablenewsignatures string `json:"autoenablenewsignatures,omitempty"` - Ruleid []int `json:"ruleid,omitempty"` - Category string `json:"category,omitempty"` - Enabled string `json:"enabled,omitempty"` - Action []string `json:"action,omitempty"` - Mergedefault bool `json:"mergedefault,omitempty"` - Response string `json:"response,omitempty"` - Encryptedversion string `json:"encryptedversion,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Appfwxmlschema struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Appfwpolicylabelbinding struct { +type Appfwarchive struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` + Target string `json:"target,omitempty"` +} + +type AppfwpolicyAppfwpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwprofileexcluderescontenttypebinding struct { - Excluderescontenttype string `json:"excluderescontenttype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwprofileBlockkeywordBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsBlockkeywordFormurl string `json:"as_blockkeyword_formurl,omitempty"` + AsFieldnameIsregexBlockkeyword string `json:"as_fieldname_isregex_blockkeyword,omitempty"` + Blockkeyword string `json:"blockkeyword,omitempty"` + Blockkeywordtype string `json:"blockkeywordtype,omitempty"` + Comment string `json:"comment,omitempty"` + Fieldname string `json:"fieldname,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwprofilefakeaccountbinding struct { - Fakeaccount string `json:"fakeaccount,omitempty"` - Isfieldnameregex string `json:"isfieldnameregex,omitempty"` - Formurlfad string `json:"formurl_fad,omitempty"` - Formexpression string `json:"formexpression,omitempty"` - Tag string `json:"tag,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilefieldconsistencybinding struct { - Fieldconsistency string `json:"fieldconsistency,omitempty"` - Isregexffc string `json:"isregex_ffc,omitempty"` - Formactionurlffc string `json:"formactionurl_ffc,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilejsonxssurlbinding struct { - Jsonxssurl string `json:"jsonxssurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Iskeyregexjsonxss string `json:"iskeyregex_json_xss,omitempty"` - Keynamejsonxss string `json:"keyname_json_xss,omitempty"` - Asvaluetypejsonxss string `json:"as_value_type_json_xss,omitempty"` - Asvalueexprjsonxss string `json:"as_value_expr_json_xss,omitempty"` - Isvalueregexjsonxss string `json:"isvalueregex_json_xss,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilexmlattachmenturlbinding struct { - Xmlattachmenturl string `json:"xmlattachmenturl,omitempty"` - Xmlmaxattachmentsizecheck string `json:"xmlmaxattachmentsizecheck,omitempty"` - Xmlmaxattachmentsize int `json:"xmlmaxattachmentsize,omitempty"` - Xmlattachmentcontenttypecheck string `json:"xmlattachmentcontenttypecheck,omitempty"` - Xmlattachmentcontenttype string `json:"xmlattachmentcontenttype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofiledenylistbinding struct { - Asdenylist string `json:"as_deny_list,omitempty"` - Asdenylistvaluetype string `json:"as_deny_list_value_type,omitempty"` - Asdenylistaction []string `json:"as_deny_list_action,omitempty"` - Asdenylistlocation string `json:"as_deny_list_location,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilejsonblockkeywordbinding struct { - Jsonblockkeyword string `json:"jsonblockkeyword,omitempty"` - Jsonblockkeywordurl string `json:"jsonblockkeywordurl,omitempty"` - Keynamejsonblockkeyword string `json:"keyname_json_blockkeyword,omitempty"` - Iskeyregexjsonblockkeyword string `json:"iskeyregex_json_blockkeyword,omitempty"` - Jsonblockkeywordtype string `json:"jsonblockkeywordtype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appfwglobalsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` +type Appfwsettings struct { + Builtin []string `json:"builtin,omitempty"` + Ceflogging string `json:"ceflogging,omitempty"` + Centralizedlearning string `json:"centralizedlearning,omitempty"` + Clientiploggingheader string `json:"clientiploggingheader,omitempty"` + Cookieflags string `json:"cookieflags,omitempty"` + Cookiepostencryptprefix string `json:"cookiepostencryptprefix,omitempty"` + Defaultprofile string `json:"defaultprofile,omitempty"` + Entitydecoding string `json:"entitydecoding,omitempty"` + Feature string `json:"feature,omitempty"` + Geolocationlogging string `json:"geolocationlogging,omitempty"` + Importsizelimit int `json:"importsizelimit,omitempty"` + Learning string `json:"learning,omitempty"` + Learnratelimit int `json:"learnratelimit,omitempty"` + Logmalformedreq string `json:"logmalformedreq,omitempty"` + Malformedreqaction []string `json:"malformedreqaction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Proxyport int `json:"proxyport,omitempty"` + Proxyserver string `json:"proxyserver,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Sessionlifetime int `json:"sessionlifetime,omitempty"` + Sessionlimit int `json:"sessionlimit,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Signatureautoupdate string `json:"signatureautoupdate,omitempty"` + Signatureurl string `json:"signatureurl,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Useconfigurablesecretkey string `json:"useconfigurablesecretkey,omitempty"` +} + +type AppfwpolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type AppfwprofileCmdinjectionBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsScanLocationCmd string `json:"as_scan_location_cmd,omitempty"` + AsValueExprCmd string `json:"as_value_expr_cmd,omitempty"` + AsValueTypeCmd string `json:"as_value_type_cmd,omitempty"` + Cmdinjection string `json:"cmdinjection,omitempty"` + Comment string `json:"comment,omitempty"` + FormactionurlCmd string `json:"formactionurl_cmd,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexCmd string `json:"isregex_cmd,omitempty"` + IsvalueregexCmd string `json:"isvalueregex_cmd,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` +type AppfwpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Description string `json:"description,omitempty"` - Policytype string `json:"policytype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Appfwprofilecmdinjectionbinding struct { - Cmdinjection string `json:"cmdinjection,omitempty"` - Isregexcmd string `json:"isregex_cmd,omitempty"` - Formactionurlcmd string `json:"formactionurl_cmd,omitempty"` - Asscanlocationcmd string `json:"as_scan_location_cmd,omitempty"` - Asvaluetypecmd string `json:"as_value_type_cmd,omitempty"` - Asvalueexprcmd string `json:"as_value_expr_cmd,omitempty"` - Isvalueregexcmd string `json:"isvalueregex_cmd,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilelogexpressionbinding struct { - Logexpression string `json:"logexpression,omitempty"` - Aslogexpression string `json:"as_logexpression,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwprofileStarturlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Starturl string `json:"starturl,omitempty"` + State string `json:"state,omitempty"` } -type Appfwconfidfield struct { - Fieldname string `json:"fieldname,omitempty"` - Url string `json:"url,omitempty"` - Isregex string `json:"isregex,omitempty"` - Comment string `json:"comment,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwprofileJsonblockkeywordBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IskeyregexJsonBlockkeyword string `json:"iskeyregex_json_blockkeyword,omitempty"` + Jsonblockkeyword string `json:"jsonblockkeyword,omitempty"` + Jsonblockkeywordtype string `json:"jsonblockkeywordtype,omitempty"` + Jsonblockkeywordurl string `json:"jsonblockkeywordurl,omitempty"` + KeynameJsonBlockkeyword string `json:"keyname_json_blockkeyword,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwpolicyappfwglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Appfwfieldtype struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nocharmaps bool `json:"nocharmaps,omitempty"` + Priority int `json:"priority,omitempty"` + Regex string `json:"regex,omitempty"` } -type Appfwprofilebinding struct { +type Appfwlearningdata struct { + AsScanLocationSql string `json:"as_scan_location_sql,omitempty"` + AsScanLocationXss string `json:"as_scan_location_xss,omitempty"` + AsValueExprSql string `json:"as_value_expr_sql,omitempty"` + AsValueExprXss string `json:"as_value_expr_xss,omitempty"` + AsValueTypeSql string `json:"as_value_type_sql,omitempty"` + AsValueTypeXss string `json:"as_value_type_xss,omitempty"` + Contenttype string `json:"contenttype,omitempty"` + Cookieconsistency string `json:"cookieconsistency,omitempty"` + Count float64 `json:"__count,omitempty"` + Creditcardnumber string `json:"creditcardnumber,omitempty"` + Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` + Crosssitescripting string `json:"crosssitescripting,omitempty"` + Csrfformoriginurl string `json:"csrfformoriginurl,omitempty"` + Csrftag string `json:"csrftag,omitempty"` + Data string `json:"data,omitempty"` + Fieldconsistency string `json:"fieldconsistency,omitempty"` + Fieldformat string `json:"fieldformat,omitempty"` + Fieldformatcharmappcre string `json:"fieldformatcharmappcre,omitempty"` + Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` + Fieldformatminlength int `json:"fieldformatminlength,omitempty"` + Fieldtype string `json:"fieldtype,omitempty"` + FormactionurlFf string `json:"formactionurl_ff,omitempty"` + FormactionurlFfc string `json:"formactionurl_ffc,omitempty"` + FormactionurlSql string `json:"formactionurl_sql,omitempty"` + FormactionurlXss string `json:"formactionurl_xss,omitempty"` + Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Securitycheck string `json:"securitycheck,omitempty"` + Sqlinjection string `json:"sqlinjection,omitempty"` + Starturl string `json:"starturl,omitempty"` + Target string `json:"target,omitempty"` + Totalxmlrequests bool `json:"totalxmlrequests,omitempty"` + Url string `json:"url,omitempty"` + Value string `json:"value,omitempty"` + ValueType string `json:"value_type,omitempty"` + Xmlattachmentcheck string `json:"xmlattachmentcheck,omitempty"` + Xmldoscheck string `json:"xmldoscheck,omitempty"` + Xmlwsicheck string `json:"xmlwsicheck,omitempty"` } -type Appfwprofilebypasslistbinding struct { - Asbypasslist string `json:"as_bypass_list,omitempty"` - Asbypasslistvaluetype string `json:"as_bypass_list_value_type,omitempty"` - Asbypasslistaction string `json:"as_bypass_list_action,omitempty"` - Asbypasslistlocation string `json:"as_bypass_list_location,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwpolicylabelAppfwpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwprofilecsrftagbinding struct { - Csrftag string `json:"csrftag,omitempty"` - Csrfformactionurl string `json:"csrfformactionurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwtransactionrecords struct { - Nodeid int `json:"nodeid,omitempty"` - Httptransactionid string `json:"httptransactionid,omitempty"` - Packetengineid string `json:"packetengineid,omitempty"` - Appfwsessionid string `json:"appfwsessionid,omitempty"` - Profilename string `json:"profilename,omitempty"` - Url string `json:"url,omitempty"` - Clientip string `json:"clientip,omitempty"` - Destip string `json:"destip,omitempty"` - Starttime string `json:"starttime,omitempty"` - Endtime string `json:"endtime,omitempty"` - Requestcontentlength string `json:"requestcontentlength,omitempty"` - Requestyields string `json:"requestyields,omitempty"` - Requestmaxprocessingtime string `json:"requestmaxprocessingtime,omitempty"` - Responsecontentlength string `json:"responsecontentlength,omitempty"` - Responseyields string `json:"responseyields,omitempty"` - Responsemaxprocessingtime string `json:"responsemaxprocessingtime,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwprofileXmlsqlinjectionBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsScanLocationXmlsql string `json:"as_scan_location_xmlsql,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexXmlsql string `json:"isregex_xmlsql,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Xmlsqlinjection string `json:"xmlsqlinjection,omitempty"` } type Appfwgrpcwebjsoncontenttype struct { + Count float64 `json:"__count,omitempty"` Grpcwebjsoncontenttypevalue string `json:"grpcwebjsoncontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwpolicyappfwpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appfwprofilejsoncmdurlbinding struct { - Jsoncmdurl string `json:"jsoncmdurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Iskeyregexjsoncmd string `json:"iskeyregex_json_cmd,omitempty"` - Keynamejsoncmd string `json:"keyname_json_cmd,omitempty"` - Asvaluetypejsoncmd string `json:"as_value_type_json_cmd,omitempty"` - Asvalueexprjsoncmd string `json:"as_value_expr_json_cmd,omitempty"` - Isvalueregexjsoncmd string `json:"isvalueregex_json_cmd,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilejsonsqlurlbinding struct { - Jsonsqlurl string `json:"jsonsqlurl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Iskeyregexjsonsql string `json:"iskeyregex_json_sql,omitempty"` - Keynamejsonsql string `json:"keyname_json_sql,omitempty"` - Asvaluetypejsonsql string `json:"as_value_type_json_sql,omitempty"` - Asvalueexprjsonsql string `json:"as_value_expr_json_sql,omitempty"` - Isvalueregexjsonsql string `json:"isvalueregex_json_sql,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type AppfwprofileTrustedlearningclientsBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Trustedlearningclients string `json:"trustedlearningclients,omitempty"` } -type Appfwprotofile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Comment string `json:"comment,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwprofileCreditcardnumberBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Creditcardnumber string `json:"creditcardnumber,omitempty"` + Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwsettings struct { - Defaultprofile string `json:"defaultprofile,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Learnratelimit int `json:"learnratelimit,omitempty"` - Sessionlifetime int `json:"sessionlifetime"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Clientiploggingheader string `json:"clientiploggingheader,omitempty"` - Importsizelimit int `json:"importsizelimit,omitempty"` - Signatureautoupdate string `json:"signatureautoupdate,omitempty"` - Signatureurl string `json:"signatureurl,omitempty"` - Cookiepostencryptprefix string `json:"cookiepostencryptprefix,omitempty"` - Logmalformedreq string `json:"logmalformedreq,omitempty"` - Geolocationlogging string `json:"geolocationlogging,omitempty"` - Ceflogging string `json:"ceflogging,omitempty"` - Entitydecoding string `json:"entitydecoding,omitempty"` - Useconfigurablesecretkey string `json:"useconfigurablesecretkey,omitempty"` - Sessionlimit int `json:"sessionlimit"` - Malformedreqaction []string `json:"malformedreqaction,omitempty"` - Centralizedlearning string `json:"centralizedlearning,omitempty"` - Proxyserver string `json:"proxyserver,omitempty"` - Proxyport int `json:"proxyport,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Cookieflags string `json:"cookieflags,omitempty"` - Learning string `json:"learning,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwglobalnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AppfwprofileExcluderescontenttypeBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Excluderescontenttype string `json:"excluderescontenttype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } type Appfwjsoncontenttype struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Isregex string `json:"isregex,omitempty"` Jsoncontenttypevalue string `json:"jsoncontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type AppfwprofileSqlinjectionBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsScanLocationSql string `json:"as_scan_location_sql,omitempty"` + AsValueExprSql string `json:"as_value_expr_sql,omitempty"` + AsValueTypeSql string `json:"as_value_type_sql,omitempty"` + Comment string `json:"comment,omitempty"` + FormactionurlSql string `json:"formactionurl_sql,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexSql string `json:"isregex_sql,omitempty"` + IsvalueregexSql string `json:"isvalueregex_sql,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Sqlinjection string `json:"sqlinjection,omitempty"` + State string `json:"state,omitempty"` } -type Appfwprofilestarturlbinding struct { - Starturl string `json:"starturl,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` +type AppfwprofileRestvalidationBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + RestValidationAction string `json:"rest_validation_action,omitempty"` + Restvalidation string `json:"restvalidation,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type Appfwgrpccontenttype struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Grpccontenttypevalue string `json:"grpccontenttypevalue,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwpolicybinding struct { +type AppfwprofileBypasslistBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsBypassList string `json:"as_bypass_list,omitempty"` + AsBypassListAction string `json:"as_bypass_list_action,omitempty"` + AsBypassListLocation string `json:"as_bypass_list_location,omitempty"` + AsBypassListValueType string `json:"as_bypass_list_value_type,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwarchive struct { - Name string `json:"name,omitempty"` - Target string `json:"target,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Response string `json:"response,omitempty"` +type Appfwhtmlerrorpage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppfwprofileSafeobjectBinding struct { + Action []string `json:"action,omitempty"` + Alertonly string `json:"alertonly,omitempty"` + AsExpression string `json:"as_expression,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Maxmatchlength int `json:"maxmatchlength,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + Safeobject string `json:"safeobject,omitempty"` + State string `json:"state,omitempty"` +} + +type AppfwprofileGrpcvalidationBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + GrpcRelaxValidationAction string `json:"grpc_relax_validation_action,omitempty"` + Grpcvalidation string `json:"grpcvalidation,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwglobalappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type AppfwprofileXmlwsiurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Xmlwsichecks string `json:"xmlwsichecks,omitempty"` + Xmlwsiurl string `json:"xmlwsiurl,omitempty"` +} + +type AppfwpolicyAppfwglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - State string `json:"state,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Type string `json:"type,omitempty"` - Policytype string `json:"policytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Appfwgrpccontenttype struct { - Grpccontenttypevalue string `json:"grpccontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwprofileDenylistBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsDenyList string `json:"as_deny_list,omitempty"` + AsDenyListAction []string `json:"as_deny_list_action,omitempty"` + AsDenyListLocation string `json:"as_deny_list_location,omitempty"` + AsDenyListValueType string `json:"as_deny_list_value_type,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` } -type Appfwjsonerrorpage struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppfwpolicylabelBinding struct { + AppfwpolicylabelAppfwpolicyBinding []interface{} `json:"appfwpolicylabel_appfwpolicy_binding,omitempty"` + AppfwpolicylabelPolicybindingBinding []interface{} `json:"appfwpolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Appfwprofiletrustedlearningclientsbinding struct { - Trustedlearningclients string `json:"trustedlearningclients,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilexmldosurlbinding struct { - Xmldosurl string `json:"xmldosurl,omitempty"` - Xmlmaxelementdepthcheck string `json:"xmlmaxelementdepthcheck,omitempty"` - Xmlmaxelementdepth int `json:"xmlmaxelementdepth,omitempty"` - Xmlmaxelementnamelengthcheck string `json:"xmlmaxelementnamelengthcheck,omitempty"` - Xmlmaxelementnamelength int `json:"xmlmaxelementnamelength,omitempty"` - Xmlmaxelementscheck string `json:"xmlmaxelementscheck,omitempty"` - Xmlmaxelements int `json:"xmlmaxelements,omitempty"` - Xmlmaxelementchildrencheck string `json:"xmlmaxelementchildrencheck,omitempty"` - Xmlmaxelementchildren int `json:"xmlmaxelementchildren,omitempty"` - Xmlmaxnodescheck string `json:"xmlmaxnodescheck,omitempty"` - Xmlmaxnodes int `json:"xmlmaxnodes,omitempty"` - Xmlmaxentityexpansionscheck string `json:"xmlmaxentityexpansionscheck,omitempty"` - Xmlmaxentityexpansions int `json:"xmlmaxentityexpansions,omitempty"` - Xmlmaxentityexpansiondepthcheck string `json:"xmlmaxentityexpansiondepthcheck,omitempty"` - Xmlmaxentityexpansiondepth int `json:"xmlmaxentityexpansiondepth,omitempty"` - Xmlmaxattributescheck string `json:"xmlmaxattributescheck,omitempty"` - Xmlmaxattributes int `json:"xmlmaxattributes,omitempty"` - Xmlmaxattributenamelengthcheck string `json:"xmlmaxattributenamelengthcheck,omitempty"` - Xmlmaxattributenamelength int `json:"xmlmaxattributenamelength,omitempty"` - Xmlmaxattributevaluelengthcheck string `json:"xmlmaxattributevaluelengthcheck,omitempty"` - Xmlmaxattributevaluelength int `json:"xmlmaxattributevaluelength,omitempty"` - Xmlmaxnamespacescheck string `json:"xmlmaxnamespacescheck,omitempty"` - Xmlmaxnamespaces int `json:"xmlmaxnamespaces,omitempty"` - Xmlmaxnamespaceurilengthcheck string `json:"xmlmaxnamespaceurilengthcheck,omitempty"` - Xmlmaxnamespaceurilength int `json:"xmlmaxnamespaceurilength,omitempty"` - Xmlmaxchardatalengthcheck string `json:"xmlmaxchardatalengthcheck,omitempty"` - Xmlmaxchardatalength int `json:"xmlmaxchardatalength,omitempty"` - Xmlmaxfilesizecheck string `json:"xmlmaxfilesizecheck,omitempty"` - Xmlmaxfilesize int `json:"xmlmaxfilesize,omitempty"` - Xmlminfilesizecheck string `json:"xmlminfilesizecheck,omitempty"` - Xmlminfilesize int `json:"xmlminfilesize,omitempty"` - Xmlblockpi string `json:"xmlblockpi,omitempty"` - Xmlblockdtd string `json:"xmlblockdtd,omitempty"` - Xmlblockexternalentities string `json:"xmlblockexternalentities,omitempty"` - Xmlsoaparraycheck string `json:"xmlsoaparraycheck,omitempty"` - Xmlmaxsoaparraysize int `json:"xmlmaxsoaparraysize,omitempty"` - Xmlmaxsoaparrayrank int `json:"xmlmaxsoaparrayrank,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilefieldformatbinding struct { - Fieldformat string `json:"fieldformat,omitempty"` - Isregexff string `json:"isregex_ff,omitempty"` - Formactionurlff string `json:"formactionurl_ff,omitempty"` - Fieldtype string `json:"fieldtype,omitempty"` - Fieldformatminlength int `json:"fieldformatminlength,omitempty"` - Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilesafeobjectbinding struct { - Safeobject string `json:"safeobject,omitempty"` - Asexpression string `json:"as_expression,omitempty"` - Maxmatchlength int `json:"maxmatchlength,omitempty"` - Action []string `json:"action,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilesqlinjectionbinding struct { - Sqlinjection string `json:"sqlinjection,omitempty"` - Isregexsql string `json:"isregex_sql,omitempty"` - Formactionurlsql string `json:"formactionurl_sql,omitempty"` - Asscanlocationsql string `json:"as_scan_location_sql,omitempty"` - Asvaluetypesql string `json:"as_value_type_sql,omitempty"` - Asvalueexprsql string `json:"as_value_expr_sql,omitempty"` - Isvalueregexsql string `json:"isvalueregex_sql,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` +type Appfwprofile struct { + Addcookieflags string `json:"addcookieflags,omitempty"` + Apispec string `json:"apispec,omitempty"` + Archivename string `json:"archivename,omitempty"` + AsProfBypassListEnable string `json:"as_prof_bypass_list_enable,omitempty"` + AsProfDenyListEnable string `json:"as_prof_deny_list_enable,omitempty"` + Augment bool `json:"augment,omitempty"` + Blockkeywordaction []string `json:"blockkeywordaction,omitempty"` + Bufferoverflowaction []string `json:"bufferoverflowaction,omitempty"` + Bufferoverflowmaxcookielength int `json:"bufferoverflowmaxcookielength,omitempty"` + Bufferoverflowmaxheaderlength int `json:"bufferoverflowmaxheaderlength,omitempty"` + Bufferoverflowmaxquerylength int `json:"bufferoverflowmaxquerylength,omitempty"` + Bufferoverflowmaxtotalheaderlength int `json:"bufferoverflowmaxtotalheaderlength,omitempty"` + Bufferoverflowmaxurllength int `json:"bufferoverflowmaxurllength,omitempty"` + Builtin bool `json:"builtin,omitempty"` + Canonicalizehtmlresponse string `json:"canonicalizehtmlresponse,omitempty"` + Ceflogging string `json:"ceflogging,omitempty"` + Checkrequestheaders string `json:"checkrequestheaders,omitempty"` + Clientipexpression string `json:"clientipexpression,omitempty"` + Cmdinjectionaction []string `json:"cmdinjectionaction,omitempty"` + Cmdinjectiongrammar string `json:"cmdinjectiongrammar,omitempty"` + Cmdinjectiontype string `json:"cmdinjectiontype,omitempty"` + Comment string `json:"comment,omitempty"` + Contenttypeaction []string `json:"contenttypeaction,omitempty"` + Cookieconsistencyaction []string `json:"cookieconsistencyaction,omitempty"` + Cookieencryption string `json:"cookieencryption,omitempty"` + Cookiehijackingaction []string `json:"cookiehijackingaction,omitempty"` + Cookieproxying string `json:"cookieproxying,omitempty"` + Cookiesamesiteattribute string `json:"cookiesamesiteattribute,omitempty"` + Cookietransforms string `json:"cookietransforms,omitempty"` + Count float64 `json:"__count,omitempty"` + Creditcard []string `json:"creditcard,omitempty"` + Creditcardaction []string `json:"creditcardaction,omitempty"` + Creditcardmaxallowed int `json:"creditcardmaxallowed,omitempty"` + Creditcardxout string `json:"creditcardxout,omitempty"` + Crosssitescriptingaction []string `json:"crosssitescriptingaction,omitempty"` + Crosssitescriptingcheckcompleteurls string `json:"crosssitescriptingcheckcompleteurls,omitempty"` + Crosssitescriptingtransformunsafehtml string `json:"crosssitescriptingtransformunsafehtml,omitempty"` + Csrftag string `json:"csrftag,omitempty"` + Csrftagaction []string `json:"csrftagaction,omitempty"` + Customsettings string `json:"customsettings,omitempty"` + Defaultcharset string `json:"defaultcharset,omitempty"` + Defaultfieldformatmaxlength int `json:"defaultfieldformatmaxlength,omitempty"` + Defaultfieldformatmaxoccurrences int `json:"defaultfieldformatmaxoccurrences,omitempty"` + Defaultfieldformatminlength int `json:"defaultfieldformatminlength,omitempty"` + Defaultfieldformattype string `json:"defaultfieldformattype,omitempty"` + Defaults string `json:"defaults,omitempty"` + Denyurlaction []string `json:"denyurlaction,omitempty"` + Dosecurecreditcardlogging string `json:"dosecurecreditcardlogging,omitempty"` + Dynamiclearning []string `json:"dynamiclearning,omitempty"` + Enableformtagging string `json:"enableformtagging,omitempty"` + Errorurl string `json:"errorurl,omitempty"` + Excludefileuploadfromchecks string `json:"excludefileuploadfromchecks,omitempty"` + Exemptclosureurlsfromsecuritychecks string `json:"exemptclosureurlsfromsecuritychecks,omitempty"` + Fakeaccountdetection string `json:"fakeaccountdetection,omitempty"` + Fieldconsistencyaction []string `json:"fieldconsistencyaction,omitempty"` + Fieldformataction []string `json:"fieldformataction,omitempty"` + Fieldscan string `json:"fieldscan,omitempty"` + Fieldscanlimit int `json:"fieldscanlimit,omitempty"` + Fileuploadmaxnum int `json:"fileuploadmaxnum,omitempty"` + Fileuploadtypesaction []string `json:"fileuploadtypesaction,omitempty"` + Geolocationlogging string `json:"geolocationlogging,omitempty"` + Grpcaction []string `json:"grpcaction,omitempty"` + Htmlerrorobject string `json:"htmlerrorobject,omitempty"` + Htmlerrorstatuscode int `json:"htmlerrorstatuscode,omitempty"` + Htmlerrorstatusmessage string `json:"htmlerrorstatusmessage,omitempty"` + Importprofilename string `json:"importprofilename,omitempty"` + Infercontenttypexmlpayloadaction []string `json:"infercontenttypexmlpayloadaction,omitempty"` + Insertcookiesamesiteattribute string `json:"insertcookiesamesiteattribute,omitempty"` + Inspectcontenttypes []string `json:"inspectcontenttypes,omitempty"` + Inspectquerycontenttypes []string `json:"inspectquerycontenttypes,omitempty"` + Invalidpercenthandling string `json:"invalidpercenthandling,omitempty"` + Jsonblockkeywordaction []string `json:"jsonblockkeywordaction,omitempty"` + Jsoncmdinjectionaction []string `json:"jsoncmdinjectionaction,omitempty"` + Jsoncmdinjectiongrammar string `json:"jsoncmdinjectiongrammar,omitempty"` + Jsoncmdinjectiontype string `json:"jsoncmdinjectiontype,omitempty"` + Jsondosaction []string `json:"jsondosaction,omitempty"` + Jsonerrorobject string `json:"jsonerrorobject,omitempty"` + Jsonerrorstatuscode int `json:"jsonerrorstatuscode,omitempty"` + Jsonerrorstatusmessage string `json:"jsonerrorstatusmessage,omitempty"` + Jsonfieldscan string `json:"jsonfieldscan,omitempty"` + Jsonfieldscanlimit int `json:"jsonfieldscanlimit,omitempty"` + Jsonmessagescan string `json:"jsonmessagescan,omitempty"` + Jsonmessagescanlimit int `json:"jsonmessagescanlimit,omitempty"` + Jsonsqlinjectionaction []string `json:"jsonsqlinjectionaction,omitempty"` + Jsonsqlinjectiongrammar string `json:"jsonsqlinjectiongrammar,omitempty"` + Jsonsqlinjectiontype string `json:"jsonsqlinjectiontype,omitempty"` + Jsonxssaction []string `json:"jsonxssaction,omitempty"` + Learning string `json:"learning,omitempty"` + Logeverypolicyhit string `json:"logeverypolicyhit,omitempty"` + Matchurlstring string `json:"matchurlstring,omitempty"` + Messagescan string `json:"messagescan,omitempty"` + Messagescanlimit int `json:"messagescanlimit,omitempty"` + Messagescanlimitcontenttypes []string `json:"messagescanlimitcontenttypes,omitempty"` + Multipleheaderaction []string `json:"multipleheaderaction,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Optimizepartialreqs string `json:"optimizepartialreqs,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Percentdecoderecursively string `json:"percentdecoderecursively,omitempty"` + Postbodylimit int `json:"postbodylimit,omitempty"` + Postbodylimitaction []string `json:"postbodylimitaction,omitempty"` + Postbodylimitsignature int `json:"postbodylimitsignature,omitempty"` + Protofileobject string `json:"protofileobject,omitempty"` + Refererheadercheck string `json:"refererheadercheck,omitempty"` + Relaxationrules bool `json:"relaxationrules,omitempty"` + Replaceurlstring string `json:"replaceurlstring,omitempty"` + Requestcontenttype string `json:"requestcontenttype,omitempty"` + Responsecontenttype string `json:"responsecontenttype,omitempty"` + Restaction []string `json:"restaction,omitempty"` + Rfcprofile string `json:"rfcprofile,omitempty"` + Semicolonfieldseparator string `json:"semicolonfieldseparator,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Sessionlessfieldconsistency string `json:"sessionlessfieldconsistency,omitempty"` + Sessionlessurlclosure string `json:"sessionlessurlclosure,omitempty"` + Signatures string `json:"signatures,omitempty"` + Sqlinjectionaction []string `json:"sqlinjectionaction,omitempty"` + Sqlinjectionchecksqlwildchars string `json:"sqlinjectionchecksqlwildchars,omitempty"` + Sqlinjectiongrammar string `json:"sqlinjectiongrammar,omitempty"` + Sqlinjectiononlycheckfieldswithsqlchars string `json:"sqlinjectiononlycheckfieldswithsqlchars,omitempty"` + Sqlinjectionparsecomments string `json:"sqlinjectionparsecomments,omitempty"` + Sqlinjectionruletype string `json:"sqlinjectionruletype,omitempty"` + Sqlinjectiontransformspecialchars string `json:"sqlinjectiontransformspecialchars,omitempty"` + Sqlinjectiontype string `json:"sqlinjectiontype,omitempty"` + Starturlaction []string `json:"starturlaction,omitempty"` + Starturlclosure string `json:"starturlclosure,omitempty"` + State string `json:"state,omitempty"` + Streaming string `json:"streaming,omitempty"` + Stripcomments string `json:"stripcomments,omitempty"` + Striphtmlcomments string `json:"striphtmlcomments,omitempty"` + Stripxmlcomments string `json:"stripxmlcomments,omitempty"` + Trace string `json:"trace,omitempty"` + TypeField []string `json:"type,omitempty"` + Urldecoderequestcookies string `json:"urldecoderequestcookies,omitempty"` + Usehtmlerrorobject string `json:"usehtmlerrorobject,omitempty"` + Verboseloglevel string `json:"verboseloglevel,omitempty"` + Xmlattachmentaction []string `json:"xmlattachmentaction,omitempty"` + Xmldosaction []string `json:"xmldosaction,omitempty"` + Xmlerrorobject string `json:"xmlerrorobject,omitempty"` + Xmlerrorstatuscode int `json:"xmlerrorstatuscode,omitempty"` + Xmlerrorstatusmessage string `json:"xmlerrorstatusmessage,omitempty"` + Xmlformataction []string `json:"xmlformataction,omitempty"` + Xmlsoapfaultaction []string `json:"xmlsoapfaultaction,omitempty"` + Xmlsqlinjectionaction []string `json:"xmlsqlinjectionaction,omitempty"` + Xmlsqlinjectionchecksqlwildchars string `json:"xmlsqlinjectionchecksqlwildchars,omitempty"` + Xmlsqlinjectiononlycheckfieldswithsqlchars string `json:"xmlsqlinjectiononlycheckfieldswithsqlchars,omitempty"` + Xmlsqlinjectionparsecomments string `json:"xmlsqlinjectionparsecomments,omitempty"` + Xmlsqlinjectiontype string `json:"xmlsqlinjectiontype,omitempty"` + Xmlvalidationaction []string `json:"xmlvalidationaction,omitempty"` + Xmlwsiaction []string `json:"xmlwsiaction,omitempty"` + Xmlxssaction []string `json:"xmlxssaction,omitempty"` } -type Appfwlearningsettings struct { - Profilename string `json:"profilename,omitempty"` - Starturlminthreshold int `json:"starturlminthreshold,omitempty"` - Starturlpercentthreshold int `json:"starturlpercentthreshold,omitempty"` - Cookieconsistencyminthreshold int `json:"cookieconsistencyminthreshold,omitempty"` - Cookieconsistencypercentthreshold int `json:"cookieconsistencypercentthreshold,omitempty"` - Csrftagminthreshold int `json:"csrftagminthreshold,omitempty"` - Csrftagpercentthreshold int `json:"csrftagpercentthreshold,omitempty"` - Fieldconsistencyminthreshold int `json:"fieldconsistencyminthreshold,omitempty"` - Fieldconsistencypercentthreshold int `json:"fieldconsistencypercentthreshold,omitempty"` - Crosssitescriptingminthreshold int `json:"crosssitescriptingminthreshold,omitempty"` - Crosssitescriptingpercentthreshold int `json:"crosssitescriptingpercentthreshold,omitempty"` - Sqlinjectionminthreshold int `json:"sqlinjectionminthreshold,omitempty"` - Sqlinjectionpercentthreshold int `json:"sqlinjectionpercentthreshold,omitempty"` - Fieldformatminthreshold int `json:"fieldformatminthreshold,omitempty"` - Fieldformatpercentthreshold int `json:"fieldformatpercentthreshold,omitempty"` - Creditcardnumberminthreshold int `json:"creditcardnumberminthreshold,omitempty"` - Creditcardnumberpercentthreshold int `json:"creditcardnumberpercentthreshold,omitempty"` - Contenttypeminthreshold int `json:"contenttypeminthreshold,omitempty"` - Contenttypepercentthreshold int `json:"contenttypepercentthreshold,omitempty"` - Xmlwsiminthreshold int `json:"xmlwsiminthreshold,omitempty"` - Xmlwsipercentthreshold int `json:"xmlwsipercentthreshold,omitempty"` - Xmlattachmentminthreshold int `json:"xmlattachmentminthreshold,omitempty"` - Xmlattachmentpercentthreshold int `json:"xmlattachmentpercentthreshold,omitempty"` - Fieldformatautodeploygraceperiod int `json:"fieldformatautodeploygraceperiod,omitempty"` - Sqlinjectionautodeploygraceperiod int `json:"sqlinjectionautodeploygraceperiod,omitempty"` - Crosssitescriptingautodeploygraceperiod int `json:"crosssitescriptingautodeploygraceperiod,omitempty"` - Starturlautodeploygraceperiod int `json:"starturlautodeploygraceperiod,omitempty"` - Cookieconsistencyautodeploygraceperiod int `json:"cookieconsistencyautodeploygraceperiod,omitempty"` - Csrftagautodeploygraceperiod int `json:"csrftagautodeploygraceperiod,omitempty"` - Fieldconsistencyautodeploygraceperiod int `json:"fieldconsistencyautodeploygraceperiod,omitempty"` - Contenttypeautodeploygraceperiod int `json:"contenttypeautodeploygraceperiod,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appfwprofilegrpcvalidationbinding struct { - Grpcvalidation string `json:"grpcvalidation,omitempty"` - Grpcrelaxvalidationaction string `json:"grpc_relax_validation_action,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` -} - -type Appfwprofilejsondosurlbinding struct { - Jsondosurl string `json:"jsondosurl,omitempty"` - Jsonmaxdocumentlengthcheck string `json:"jsonmaxdocumentlengthcheck,omitempty"` - Jsonmaxdocumentlength int `json:"jsonmaxdocumentlength,omitempty"` - Jsonmaxcontainerdepthcheck string `json:"jsonmaxcontainerdepthcheck,omitempty"` - Jsonmaxcontainerdepth int `json:"jsonmaxcontainerdepth,omitempty"` - Jsonmaxobjectkeycountcheck string `json:"jsonmaxobjectkeycountcheck,omitempty"` - Jsonmaxobjectkeycount int `json:"jsonmaxobjectkeycount,omitempty"` - Jsonmaxobjectkeylengthcheck string `json:"jsonmaxobjectkeylengthcheck,omitempty"` - Jsonmaxobjectkeylength int `json:"jsonmaxobjectkeylength,omitempty"` - Jsonmaxarraylengthcheck string `json:"jsonmaxarraylengthcheck,omitempty"` - Jsonmaxarraylength int `json:"jsonmaxarraylength,omitempty"` - Jsonmaxstringlengthcheck string `json:"jsonmaxstringlengthcheck,omitempty"` - Jsonmaxstringlength int `json:"jsonmaxstringlength,omitempty"` - State string `json:"state,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Name string `json:"name,omitempty"` - Ruletype string `json:"ruletype,omitempty"` +type Appfwxmlcontenttype struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Isregex string `json:"isregex,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Xmlcontenttypevalue string `json:"xmlcontenttypevalue,omitempty"` } -type Appfwwsdl struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` +type Appfwmultipartformcontenttype struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Isregex string `json:"isregex,omitempty"` + Multipartformcontenttypevalue string `json:"multipartformcontenttypevalue,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Appfwxmlerrorpage struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` +type Appfwlearningsettings struct { + Contenttypeautodeploygraceperiod int `json:"contenttypeautodeploygraceperiod,omitempty"` + Contenttypeminthreshold int `json:"contenttypeminthreshold,omitempty"` + Contenttypepercentthreshold int `json:"contenttypepercentthreshold,omitempty"` + Cookieconsistencyautodeploygraceperiod int `json:"cookieconsistencyautodeploygraceperiod,omitempty"` + Cookieconsistencyminthreshold int `json:"cookieconsistencyminthreshold,omitempty"` + Cookieconsistencypercentthreshold int `json:"cookieconsistencypercentthreshold,omitempty"` + Count float64 `json:"__count,omitempty"` + Creditcardnumberminthreshold int `json:"creditcardnumberminthreshold,omitempty"` + Creditcardnumberpercentthreshold int `json:"creditcardnumberpercentthreshold,omitempty"` + Crosssitescriptingautodeploygraceperiod int `json:"crosssitescriptingautodeploygraceperiod,omitempty"` + Crosssitescriptingminthreshold int `json:"crosssitescriptingminthreshold,omitempty"` + Crosssitescriptingpercentthreshold int `json:"crosssitescriptingpercentthreshold,omitempty"` + Csrftagautodeploygraceperiod int `json:"csrftagautodeploygraceperiod,omitempty"` + Csrftagminthreshold int `json:"csrftagminthreshold,omitempty"` + Csrftagpercentthreshold int `json:"csrftagpercentthreshold,omitempty"` + Fieldconsistencyautodeploygraceperiod int `json:"fieldconsistencyautodeploygraceperiod,omitempty"` + Fieldconsistencyminthreshold int `json:"fieldconsistencyminthreshold,omitempty"` + Fieldconsistencypercentthreshold int `json:"fieldconsistencypercentthreshold,omitempty"` + Fieldformatautodeploygraceperiod int `json:"fieldformatautodeploygraceperiod,omitempty"` + Fieldformatminthreshold int `json:"fieldformatminthreshold,omitempty"` + Fieldformatpercentthreshold int `json:"fieldformatpercentthreshold,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Sqlinjectionautodeploygraceperiod int `json:"sqlinjectionautodeploygraceperiod,omitempty"` + Sqlinjectionminthreshold int `json:"sqlinjectionminthreshold,omitempty"` + Sqlinjectionpercentthreshold int `json:"sqlinjectionpercentthreshold,omitempty"` + Starturlautodeploygraceperiod int `json:"starturlautodeploygraceperiod,omitempty"` + Starturlminthreshold int `json:"starturlminthreshold,omitempty"` + Starturlpercentthreshold int `json:"starturlpercentthreshold,omitempty"` + Xmlattachmentminthreshold int `json:"xmlattachmentminthreshold,omitempty"` + Xmlattachmentpercentthreshold int `json:"xmlattachmentpercentthreshold,omitempty"` + Xmlwsiminthreshold int `json:"xmlwsiminthreshold,omitempty"` + Xmlwsipercentthreshold int `json:"xmlwsipercentthreshold,omitempty"` +} + +type AppfwprofileXmlxssBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsScanLocationXmlxss string `json:"as_scan_location_xmlxss,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IsregexXmlxss string `json:"isregex_xmlxss,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Xmlxss string `json:"xmlxss,omitempty"` +} + +type AppfwprofileContenttypeBinding struct { + Alertonly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + Contenttype string `json:"contenttype,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppfwprofileJsonsqlurlBinding struct { + Alertonly string `json:"alertonly,omitempty"` + AsValueExprJsonSql string `json:"as_value_expr_json_sql,omitempty"` + AsValueTypeJsonSql string `json:"as_value_type_json_sql,omitempty"` + Comment string `json:"comment,omitempty"` + Isautodeployed string `json:"isautodeployed,omitempty"` + IskeyregexJsonSql string `json:"iskeyregex_json_sql,omitempty"` + IsvalueregexJsonSql string `json:"isvalueregex_json_sql,omitempty"` + Jsonsqlurl string `json:"jsonsqlurl,omitempty"` + KeynameJsonSql string `json:"keyname_json_sql,omitempty"` + Name string `json:"name,omitempty"` + Resourceid string `json:"resourceid,omitempty"` + Ruletype string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type Appfwcustomsettings struct { + Name string `json:"name,omitempty"` + Target string `json:"target,omitempty"` } diff --git a/nitrogo/models/appqoe.go b/nitrogo/models/appqoe.go index ef8b042..6682277 100644 --- a/nitrogo/models/appqoe.go +++ b/nitrogo/models/appqoe.go @@ -1,68 +1,61 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Appqoepolicybinding struct { - Name string `json:"name,omitempty"` +// appqoe configuration structs +type Appqoecustomresp struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Appqoepolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Bindpriority int `json:"bindpriority,omitempty"` +type AppqoepolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` -} - -type Appqoepolicyvserverbinding struct { + Bindpriority int `json:"bindpriority,omitempty"` Boundto string `json:"boundto,omitempty"` - Bindpriority uint32 `json:"bindpriority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` } -type Appqoeaction struct { - Name string `json:"name,omitempty"` - Priority string `json:"priority,omitempty"` - Respondwith string `json:"respondwith,omitempty"` - Customfile string `json:"customfile,omitempty"` - Altcontentsvcname string `json:"altcontentsvcname,omitempty"` - Altcontentpath string `json:"altcontentpath,omitempty"` - Polqdepth int `json:"polqdepth"` - Priqdepth int `json:"priqdepth"` - Maxconn int `json:"maxconn,omitempty"` - Delay int `json:"delay,omitempty"` - Dostrigexpression string `json:"dostrigexpression,omitempty"` - Dosaction string `json:"dosaction,omitempty"` - Tcpprofile string `json:"tcpprofile,omitempty"` - Retryonreset string `json:"retryonreset,omitempty"` - Retryontimeout int `json:"retryontimeout,omitempty"` - Numretries int `json:"numretries"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Appqoeparameter struct { + Avgwaitingclient int `json:"avgwaitingclient,omitempty"` + Dosattackthresh int `json:"dosattackthresh,omitempty"` + Maxaltrespbandwidth int `json:"maxaltrespbandwidth,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sessionlife int `json:"sessionlife,omitempty"` } -type Appqoecustomresp struct { - Src string `json:"src,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Appqoeaction struct { + Altcontentpath string `json:"altcontentpath,omitempty"` + Altcontentsvcname string `json:"altcontentsvcname,omitempty"` + Count float64 `json:"__count,omitempty"` + Customfile string `json:"customfile,omitempty"` + Delay int `json:"delay,omitempty"` + Dosaction string `json:"dosaction,omitempty"` + Dostrigexpression string `json:"dostrigexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numretries int `json:"numretries,omitempty"` + Polqdepth int `json:"polqdepth,omitempty"` + Priority string `json:"priority,omitempty"` + Priqdepth int `json:"priqdepth,omitempty"` + Respondwith string `json:"respondwith,omitempty"` + Retryonreset string `json:"retryonreset,omitempty"` + Retryontimeout int `json:"retryontimeout,omitempty"` + Tcpprofile string `json:"tcpprofile,omitempty"` } -type Appqoeparameter struct { - Sessionlife int `json:"sessionlife,omitempty"` - Avgwaitingclient int `json:"avgwaitingclient"` - Maxaltrespbandwidth int `json:"maxaltrespbandwidth,omitempty"` - Dosattackthresh int `json:"dosattackthresh"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AppqoepolicyBinding struct { + AppqoepolicyLbvserverBinding []interface{} `json:"appqoepolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type Appqoepolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } diff --git a/nitrogo/models/audit.go b/nitrogo/models/audit.go index 07986ce..d9f2bdb 100644 --- a/nitrogo/models/audit.go +++ b/nitrogo/models/audit.go @@ -1,433 +1,373 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Auditnslogpolicygroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +// audit configuration structs +type Auditsyslogaction struct { + Acl string `json:"acl,omitempty"` + Alg string `json:"alg,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Count float64 `json:"__count,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Dns string `json:"dns,omitempty"` + Domainresolvenow bool `json:"domainresolvenow,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Feature string `json:"feature,omitempty"` + Httpauthtoken string `json:"httpauthtoken,omitempty"` + Httpendpointurl string `json:"httpendpointurl,omitempty"` + Ip string `json:"ip,omitempty"` + Lbvservername string `json:"lbvservername,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Lsn string `json:"lsn,omitempty"` + Managementlog []string `json:"managementlog,omitempty"` + Maxlogdatasizetohold int `json:"maxlogdatasizetohold,omitempty"` + Mgmtloglevel []string `json:"mgmtloglevel,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Serverdomainname string `json:"serverdomainname,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Streamanalytics string `json:"streamanalytics,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Syslogcompliance string `json:"syslogcompliance,omitempty"` + Tcp string `json:"tcp,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Timezone string `json:"timezone,omitempty"` + Transport string `json:"transport,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` } -type Auditnslogpolicyuserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Auditsyslogparams struct { + Acl string `json:"acl,omitempty"` + Alg string `json:"alg,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + Dateformat string `json:"dateformat,omitempty"` + Dns string `json:"dns,omitempty"` + Feature string `json:"feature,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Lsn string `json:"lsn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Streamanalytics string `json:"streamanalytics,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Tcp string `json:"tcp,omitempty"` + Timezone string `json:"timezone,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` } -type Auditnslogpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditsyslogpolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Auditsyslogpolicyauthenticationvserverbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Auditsyslogpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Auditsyslogpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Auditsyslogpolicyglobalbinding struct { +type AuditnslogpolicyAuditnslogglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Auditsyslogpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Auditnslogpolicybinding struct { - Name string `json:"name,omitempty"` } -type Auditmessages struct { - Loglevel []string `json:"loglevel,omitempty"` - Numofmesgs int `json:"numofmesgs,omitempty"` - Value string `json:"value,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Auditnslogglobalbinding struct { -} - -type Auditnslogpolicytmglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditsyslogpolicyAaagroupBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Auditsyslogglobalauditsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` -} - -type Auditsyslogpolicyaaagroupbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Auditsyslogpolicyauditsyslogglobalbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Auditsyslogpolicysyslogglobalbinding struct { +type AuditsyslogpolicyRnatglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Auditnslogglobalnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Builtin []string `json:"builtin,omitempty"` -} - -type Auditnslogpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Auditsyslogglobalbinding struct { } -type Auditsyslogpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditnslogpolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicygroupbinding struct { +type AuditnslogpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicysystemglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditnslogpolicyVpnglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicytmglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditnslogpolicyTmglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditnslogpolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverdomainname string `json:"serverdomainname,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` - Lbvservername string `json:"lbvservername,omitempty"` - Serverport int `json:"serverport,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Managementlog []string `json:"managementlog,omitempty"` - Mgmtloglevel []string `json:"mgmtloglevel,omitempty"` - Syslogcompliance string `json:"syslogcompliance,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Tcp string `json:"tcp,omitempty"` +type Auditnslogaction struct { Acl string `json:"acl,omitempty"` - Timezone string `json:"timezone,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` - Lsn string `json:"lsn,omitempty"` Alg string `json:"alg,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Transport string `json:"transport,omitempty"` - Httpauthtoken string `json:"httpauthtoken,omitempty"` - Httpendpointurl string `json:"httpendpointurl,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Maxlogdatasizetohold int `json:"maxlogdatasizetohold,omitempty"` - Dns string `json:"dns,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Builtin []string `json:"builtin,omitempty"` Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Streamanalytics string `json:"streamanalytics,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` + Count float64 `json:"__count,omitempty"` + Dateformat string `json:"dateformat,omitempty"` Domainresolvenow bool `json:"domainresolvenow,omitempty"` - Ip string `json:"ip,omitempty"` - Builtin string `json:"builtin,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` Feature string `json:"feature,omitempty"` + Ip string `json:"ip,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Lsn string `json:"lsn,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Serverdomainname string `json:"serverdomainname,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Tcp string `json:"tcp,omitempty"` + Timezone string `json:"timezone,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` } -type Auditnslogpolicyappfwglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Auditsyslogpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Auditnslogpolicyauditnslogglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Auditmessageaction struct { + Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Loglevel string `json:"loglevel,omitempty"` + Loglevel1 string `json:"loglevel1,omitempty"` + Logtonewnslog string `json:"logtonewnslog,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type AuditsyslogpolicyVpnglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Auditmessages struct { + Count float64 `json:"__count,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numofmesgs int `json:"numofmesgs,omitempty"` + Value string `json:"value,omitempty"` } -type Auditnslogpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Auditnslogpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Auditnslogpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuditnslogglobalAuditnslogpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogpolicynslogglobalbinding struct { +type AuditnslogpolicySystemglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicyrnatglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuditsyslogpolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicyvpnvserverbinding struct { +type AuditnslogpolicyAppfwglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuditsyslogpolicyTmglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverdomainname string `json:"serverdomainname,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` - Serverport int `json:"serverport,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Tcp string `json:"tcp,omitempty"` - Acl string `json:"acl,omitempty"` - Timezone string `json:"timezone,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` - Lsn string `json:"lsn,omitempty"` - Alg string `json:"alg,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Domainresolvenow bool `json:"domainresolvenow,omitempty"` - Ip string `json:"ip,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuditnslogpolicyBinding struct { + AuditnslogpolicyAaagroupBinding []interface{} `json:"auditnslogpolicy_aaagroup_binding,omitempty"` + AuditnslogpolicyAaauserBinding []interface{} `json:"auditnslogpolicy_aaauser_binding,omitempty"` + AuditnslogpolicyAppfwglobalBinding []interface{} `json:"auditnslogpolicy_appfwglobal_binding,omitempty"` + AuditnslogpolicyAuditnslogglobalBinding []interface{} `json:"auditnslogpolicy_auditnslogglobal_binding,omitempty"` + AuditnslogpolicyAuthenticationvserverBinding []interface{} `json:"auditnslogpolicy_authenticationvserver_binding,omitempty"` + AuditnslogpolicyCsvserverBinding []interface{} `json:"auditnslogpolicy_csvserver_binding,omitempty"` + AuditnslogpolicyLbvserverBinding []interface{} `json:"auditnslogpolicy_lbvserver_binding,omitempty"` + AuditnslogpolicySystemglobalBinding []interface{} `json:"auditnslogpolicy_systemglobal_binding,omitempty"` + AuditnslogpolicyTmglobalBinding []interface{} `json:"auditnslogpolicy_tmglobal_binding,omitempty"` + AuditnslogpolicyVpnglobalBinding []interface{} `json:"auditnslogpolicy_vpnglobal_binding,omitempty"` + AuditnslogpolicyVpnvserverBinding []interface{} `json:"auditnslogpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuditsyslogpolicyBinding struct { + AuditsyslogpolicyAaagroupBinding []interface{} `json:"auditsyslogpolicy_aaagroup_binding,omitempty"` + AuditsyslogpolicyAaauserBinding []interface{} `json:"auditsyslogpolicy_aaauser_binding,omitempty"` + AuditsyslogpolicyAuditsyslogglobalBinding []interface{} `json:"auditsyslogpolicy_auditsyslogglobal_binding,omitempty"` + AuditsyslogpolicyAuthenticationvserverBinding []interface{} `json:"auditsyslogpolicy_authenticationvserver_binding,omitempty"` + AuditsyslogpolicyCsvserverBinding []interface{} `json:"auditsyslogpolicy_csvserver_binding,omitempty"` + AuditsyslogpolicyLbvserverBinding []interface{} `json:"auditsyslogpolicy_lbvserver_binding,omitempty"` + AuditsyslogpolicyRnatglobalBinding []interface{} `json:"auditsyslogpolicy_rnatglobal_binding,omitempty"` + AuditsyslogpolicySystemglobalBinding []interface{} `json:"auditsyslogpolicy_systemglobal_binding,omitempty"` + AuditsyslogpolicyTmglobalBinding []interface{} `json:"auditsyslogpolicy_tmglobal_binding,omitempty"` + AuditsyslogpolicyVpnglobalBinding []interface{} `json:"auditsyslogpolicy_vpnglobal_binding,omitempty"` + AuditsyslogpolicyVpnvserverBinding []interface{} `json:"auditsyslogpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuditsyslogglobalAuditsyslogpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuditsyslogglobalBinding struct { + AuditsyslogglobalAuditsyslogpolicyBinding []interface{} `json:"auditsyslogglobal_auditsyslogpolicy_binding,omitempty"` } -type Auditnslogpolicycsvserverbinding struct { +type AuditsyslogpolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuditnslogpolicyAaagroupBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditnslogpolicysystemglobalbinding struct { +type AuditsyslogpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuditnslogpolicyAaauserBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogglobalsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` +type AuditsyslogpolicyAuditsyslogglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogparams struct { - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Tcp string `json:"tcp,omitempty"` +type Auditnslogparams struct { Acl string `json:"acl,omitempty"` - Timezone string `json:"timezone,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` - Lsn string `json:"lsn,omitempty"` Alg string `json:"alg,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Dns string `json:"dns,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` + Appflowexport string `json:"appflowexport,omitempty"` + Builtin []string `json:"builtin,omitempty"` Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Streamanalytics string `json:"streamanalytics,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Builtin string `json:"builtin,omitempty"` + Dateformat string `json:"dateformat,omitempty"` Feature string `json:"feature,omitempty"` + Logfacility string `json:"logfacility,omitempty"` + Loglevel []string `json:"loglevel,omitempty"` + Lsn string `json:"lsn,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocolviolations string `json:"protocolviolations,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Subscriberlog string `json:"subscriberlog,omitempty"` + Tcp string `json:"tcp,omitempty"` + Timezone string `json:"timezone,omitempty"` + Urlfiltering string `json:"urlfiltering,omitempty"` + Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` } -type Auditsyslogpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Auditmessageaction struct { - Name string `json:"name,omitempty"` - Loglevel string `json:"loglevel,omitempty"` - Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` - Logtonewnslog string `json:"logtonewnslog,omitempty"` - Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` - Loglevel1 string `json:"loglevel1,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Auditnslogpolicyvserverbinding struct { +type AuditnslogpolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicyuserbinding struct { +type AuditsyslogpolicyAaauserBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Auditsyslogpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuditnslogglobalBinding struct { + AuditnslogglobalAuditnslogpolicyBinding []interface{} `json:"auditnslogglobal_auditnslogpolicy_binding,omitempty"` } -type Auditsyslogpolicyvserverbinding struct { +type AuditsyslogpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Auditnslogglobalauditnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Builtin []string `json:"builtin,omitempty"` -} - -type Auditnslogparams struct { - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Tcp string `json:"tcp,omitempty"` - Acl string `json:"acl,omitempty"` - Timezone string `json:"timezone,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` - Lsn string `json:"lsn,omitempty"` - Alg string `json:"alg,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Auditnslogpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/authentication.go b/nitrogo/models/authentication.go index 7831506..42bb40f 100644 --- a/nitrogo/models/authentication.go +++ b/nitrogo/models/authentication.go @@ -1,1715 +1,1453 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Authenticationwebauthpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +// authentication configuration structs +type AuthenticationdfapolicyBinding struct { + AuthenticationdfapolicyVpnvserverBinding []interface{} `json:"authenticationdfapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationwebauthpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationwebauthpolicy struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` +} + +type AuthenticationldappolicyBinding struct { + AuthenticationldappolicyAuthenticationvserverBinding []interface{} `json:"authenticationldappolicy_authenticationvserver_binding,omitempty"` + AuthenticationldappolicySystemglobalBinding []interface{} `json:"authenticationldappolicy_systemglobal_binding,omitempty"` + AuthenticationldappolicyVpnglobalBinding []interface{} `json:"authenticationldappolicy_vpnglobal_binding,omitempty"` + AuthenticationldappolicyVpnvserverBinding []interface{} `json:"authenticationldappolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationcertpolicyvserverbinding struct { +type AuthenticationwebauthpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserverrewritepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationpolicySystemglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserversessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Authenticationnegotiatepolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationcertpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationcertpolicyAuthenticationvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationldappolicysystemglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationloginschemapolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationldappolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationsamlidppolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationsmartaccessprofile struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tags string `json:"tags,omitempty"` } -type Authenticationtacacspolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationlocalpolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationradiuspolicybinding struct { - Name string `json:"name,omitempty"` +type Authenticationpushservice struct { + Certendpoint string `json:"certendpoint,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Count float64 `json:"__count,omitempty"` + Customerid string `json:"customerid,omitempty"` + Hubname string `json:"hubname,omitempty"` + Name string `json:"name,omitempty"` + Namespace string `json:"Namespace,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pushcloudserverstatus string `json:"pushcloudserverstatus,omitempty"` + Pushservicestatus string `json:"pushservicestatus,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Servicekey string `json:"servicekey,omitempty"` + Servicekeyname string `json:"servicekeyname,omitempty"` + Signingkey string `json:"signingkey,omitempty"` + Signingkeyname string `json:"signingkeyname,omitempty"` + Trustservice string `json:"trustservice,omitempty"` } -type Authenticationvserverauthenticationldappolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Authenticationstorefrontauthaction struct { + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Domain string `json:"domain,omitempty"` + Failure int `json:"failure,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Success int `json:"success,omitempty"` } -type Authenticationldappolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationwebauthpolicyBinding struct { + AuthenticationwebauthpolicyAuthenticationvserverBinding []interface{} `json:"authenticationwebauthpolicy_authenticationvserver_binding,omitempty"` + AuthenticationwebauthpolicySystemglobalBinding []interface{} `json:"authenticationwebauthpolicy_systemglobal_binding,omitempty"` + AuthenticationwebauthpolicyVpnglobalBinding []interface{} `json:"authenticationwebauthpolicy_vpnglobal_binding,omitempty"` + AuthenticationwebauthpolicyVpnvserverBinding []interface{} `json:"authenticationwebauthpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationlocalpolicybinding struct { - Name string `json:"name,omitempty"` +type AuthenticationlocalpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationloginschemapolicybinding struct { - Name string `json:"name,omitempty"` +type AuthenticationwebauthpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationsmartaccesspolicy struct { + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationtacacsaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Tacacssecret string `json:"tacacssecret,omitempty"` - Authorization string `json:"authorization,omitempty"` - Accounting string `json:"accounting,omitempty"` - Auditfailedcmds string `json:"auditfailedcmds,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attributes string `json:"attributes,omitempty"` - Success string `json:"success,omitempty"` - Failure string `json:"failure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationtacacspolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationsamlidppolicyBinding struct { + AuthenticationsamlidppolicyAuthenticationvserverBinding []interface{} `json:"authenticationsamlidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationsamlidppolicyVpnvserverBinding []interface{} `json:"authenticationsamlidppolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationvserversamlidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` +type Authenticationoauthidppolicy struct { + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` +} + +type AuthenticationvserverBinding struct { + AuthenticationvserverAuditnslogpolicyBinding []interface{} `json:"authenticationvserver_auditnslogpolicy_binding,omitempty"` + AuthenticationvserverAuditsyslogpolicyBinding []interface{} `json:"authenticationvserver_auditsyslogpolicy_binding,omitempty"` + AuthenticationvserverAuthenticationcertpolicyBinding []interface{} `json:"authenticationvserver_authenticationcertpolicy_binding,omitempty"` + AuthenticationvserverAuthenticationldappolicyBinding []interface{} `json:"authenticationvserver_authenticationldappolicy_binding,omitempty"` + AuthenticationvserverAuthenticationlocalpolicyBinding []interface{} `json:"authenticationvserver_authenticationlocalpolicy_binding,omitempty"` + AuthenticationvserverAuthenticationloginschemapolicyBinding []interface{} `json:"authenticationvserver_authenticationloginschemapolicy_binding,omitempty"` + AuthenticationvserverAuthenticationnegotiatepolicyBinding []interface{} `json:"authenticationvserver_authenticationnegotiatepolicy_binding,omitempty"` + AuthenticationvserverAuthenticationoauthidppolicyBinding []interface{} `json:"authenticationvserver_authenticationoauthidppolicy_binding,omitempty"` + AuthenticationvserverAuthenticationpolicyBinding []interface{} `json:"authenticationvserver_authenticationpolicy_binding,omitempty"` + AuthenticationvserverAuthenticationradiuspolicyBinding []interface{} `json:"authenticationvserver_authenticationradiuspolicy_binding,omitempty"` + AuthenticationvserverAuthenticationsamlidppolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlidppolicy_binding,omitempty"` + AuthenticationvserverAuthenticationsamlpolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlpolicy_binding,omitempty"` + AuthenticationvserverAuthenticationsmartaccesspolicyBinding []interface{} `json:"authenticationvserver_authenticationsmartaccesspolicy_binding,omitempty"` + AuthenticationvserverAuthenticationtacacspolicyBinding []interface{} `json:"authenticationvserver_authenticationtacacspolicy_binding,omitempty"` + AuthenticationvserverAuthenticationwebauthpolicyBinding []interface{} `json:"authenticationvserver_authenticationwebauthpolicy_binding,omitempty"` + AuthenticationvserverCachepolicyBinding []interface{} `json:"authenticationvserver_cachepolicy_binding,omitempty"` + AuthenticationvserverCspolicyBinding []interface{} `json:"authenticationvserver_cspolicy_binding,omitempty"` + AuthenticationvserverResponderpolicyBinding []interface{} `json:"authenticationvserver_responderpolicy_binding,omitempty"` + AuthenticationvserverRewritepolicyBinding []interface{} `json:"authenticationvserver_rewritepolicy_binding,omitempty"` + AuthenticationvserverTmsessionpolicyBinding []interface{} `json:"authenticationvserver_tmsessionpolicy_binding,omitempty"` + AuthenticationvserverVpnportalthemeBinding []interface{} `json:"authenticationvserver_vpnportaltheme_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuthenticationlocalpolicyBinding struct { + AuthenticationlocalpolicyAuthenticationvserverBinding []interface{} `json:"authenticationlocalpolicy_authenticationvserver_binding,omitempty"` + AuthenticationlocalpolicySystemglobalBinding []interface{} `json:"authenticationlocalpolicy_systemglobal_binding,omitempty"` + AuthenticationlocalpolicyVpnglobalBinding []interface{} `json:"authenticationlocalpolicy_vpnglobal_binding,omitempty"` + AuthenticationlocalpolicyVpnvserverBinding []interface{} `json:"authenticationlocalpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuthenticationsmartaccesspolicyBinding struct { + AuthenticationsmartaccesspolicyAuthenticationvserverBinding []interface{} `json:"authenticationsmartaccesspolicy_authenticationvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuthenticationvserverAuthenticationwebauthpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationldapaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Ldapbase string `json:"ldapbase,omitempty"` - Ldapbinddn string `json:"ldapbinddn,omitempty"` - Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` - Ldaploginname string `json:"ldaploginname,omitempty"` - Searchfilter string `json:"searchfilter,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Subattributename string `json:"subattributename,omitempty"` - Sectype string `json:"sectype,omitempty"` - Svrtype string `json:"svrtype,omitempty"` - Ssonameattribute string `json:"ssonameattribute,omitempty"` - Authentication string `json:"authentication,omitempty"` - Requireuser string `json:"requireuser,omitempty"` - Passwdchange string `json:"passwdchange,omitempty"` - Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` - Maxnestinglevel int `json:"maxnestinglevel,omitempty"` - Followreferrals string `json:"followreferrals,omitempty"` - Maxldapreferrals int `json:"maxldapreferrals,omitempty"` - Referraldnslookup string `json:"referraldnslookup,omitempty"` - Mssrvrecordlocation string `json:"mssrvrecordlocation,omitempty"` - Validateservercert string `json:"validateservercert,omitempty"` - Ldaphostname string `json:"ldaphostname,omitempty"` - Groupnameidentifier string `json:"groupnameidentifier,omitempty"` - Groupsearchattribute string `json:"groupsearchattribute,omitempty"` - Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` - Groupsearchfilter string `json:"groupsearchfilter,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attributes string `json:"attributes,omitempty"` - Sshpublickey string `json:"sshpublickey,omitempty"` - Pushservice string `json:"pushservice,omitempty"` - Otpsecret string `json:"otpsecret,omitempty"` - Email string `json:"email,omitempty"` - Kbattribute string `json:"kbattribute,omitempty"` - Alternateemailattr string `json:"alternateemailattr,omitempty"` - Cloudattributes string `json:"cloudattributes,omitempty"` - Success string `json:"success,omitempty"` - Failure string `json:"failure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationldappolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationvserverAuditsyslogpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationlocalpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationradiuspolicyAuthenticationvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationoauthidppolicybinding struct { - Name string `json:"name,omitempty"` +type Authenticationsamlidppolicy struct { + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` } -type Authenticationtacacspolicybinding struct { - Name string `json:"name,omitempty"` +type Authenticationradiusaction struct { + Accounting string `json:"accounting,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authservretry int `json:"authservretry,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Callingstationid string `json:"callingstationid,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Failure int `json:"failure,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Ipattributetype int `json:"ipattributetype,omitempty"` + Ipvendorid int `json:"ipvendorid,omitempty"` + Messageauthenticator string `json:"messageauthenticator,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passencoding string `json:"passencoding,omitempty"` + Pwdattributetype int `json:"pwdattributetype,omitempty"` + Pwdvendorid int `json:"pwdvendorid,omitempty"` + Radattributetype int `json:"radattributetype,omitempty"` + Radgroupseparator string `json:"radgroupseparator,omitempty"` + Radgroupsprefix string `json:"radgroupsprefix,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Radvendorid int `json:"radvendorid,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + Success int `json:"success,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Transport string `json:"transport,omitempty"` + Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` } -type Authenticationcaptchaaction struct { - Name string `json:"name,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Secretkey string `json:"secretkey,omitempty"` - Sitekey string `json:"sitekey,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Scorethreshold int `json:"scorethreshold,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Authenticationazurekeyvault struct { + Authentication string `json:"authentication,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pushservice string `json:"pushservice,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Servicekeyname string `json:"servicekeyname,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Vaultname string `json:"vaultname,omitempty"` } -type Authenticationvserverauthenticationloginschemapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` +type Authenticationemailaction struct { + Content string `json:"content,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Timeout int `json:"timeout,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AuthenticationvserverTmsessionpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` + Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationvserverloginschemapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Authenticationtacacspolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationcertpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationldappolicyAuthenticationvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationoauthidpprofile struct { - Name string `json:"name,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Issuer string `json:"issuer,omitempty"` - Configservice string `json:"configservice,omitempty"` - Audience string `json:"audience,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Relyingpartymetadataurl string `json:"relyingpartymetadataurl,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Encrypttoken string `json:"encrypttoken,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Attributes string `json:"attributes,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Oauthstatus string `json:"oauthstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationradiuspolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationnegotiatepolicyBinding struct { + AuthenticationnegotiatepolicyAuthenticationvserverBinding []interface{} `json:"authenticationnegotiatepolicy_authenticationvserver_binding,omitempty"` + AuthenticationnegotiatepolicyVpnglobalBinding []interface{} `json:"authenticationnegotiatepolicy_vpnglobal_binding,omitempty"` + AuthenticationnegotiatepolicyVpnvserverBinding []interface{} `json:"authenticationnegotiatepolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationsamlpolicybinding struct { - Name string `json:"name,omitempty"` +type AuthenticationsmartaccesspolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationsmartaccesspolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationloginschemapolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationsmartaccesspolicybinding struct { - Name string `json:"name,omitempty"` +type AuthenticationnegotiatepolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserverauditsyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Authenticationsamlaction struct { + Artifactresolutionserviceurl string `json:"artifactresolutionserviceurl,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attributeconsumingserviceindex int `json:"attributeconsumingserviceindex,omitempty"` + Attributes string `json:"attributes,omitempty"` + Audience string `json:"audience,omitempty"` + Authnctxclassref []string `json:"authnctxclassref,omitempty"` + Count float64 `json:"__count,omitempty"` + Customauthnctxclassref string `json:"customauthnctxclassref,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Enforceusername string `json:"enforceusername,omitempty"` + Forceauthn string `json:"forceauthn,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` + Logoutbinding string `json:"logoutbinding,omitempty"` + Logouturl string `json:"logouturl,omitempty"` + Metadataimportstatus string `json:"metadataimportstatus,omitempty"` + Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preferredbindtype []string `json:"preferredbindtype,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Requestedauthncontext string `json:"requestedauthncontext,omitempty"` + Samlacsindex int `json:"samlacsindex,omitempty"` + Samlbinding string `json:"samlbinding,omitempty"` + Samlidpcertname string `json:"samlidpcertname,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Samlredirecturl string `json:"samlredirecturl,omitempty"` + Samlrejectunsignedassertion string `json:"samlrejectunsignedassertion,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Samltwofactor string `json:"samltwofactor,omitempty"` + Samluserfield string `json:"samluserfield,omitempty"` + Sendthumbprint string `json:"sendthumbprint,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Statechecks string `json:"statechecks,omitempty"` + Storesamlresponse string `json:"storesamlresponse,omitempty"` } -type Authenticationvservervpnportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` +type AuthenticationvserverVpnportalthemeBinding struct { Acttype int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` + Portaltheme string `json:"portaltheme,omitempty"` } -type Authenticationazurekeyvault struct { - Name string `json:"name,omitempty"` - Vaultname string `json:"vaultname,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` - Servicekeyname string `json:"servicekeyname,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Pushservice string `json:"pushservice,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Authentication string `json:"authentication,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationlocalpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Authenticationloginschemapolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type AuthenticationloginschemapolicyBinding struct { + AuthenticationloginschemapolicyAuthenticationvserverBinding []interface{} `json:"authenticationloginschemapolicy_authenticationvserver_binding,omitempty"` + AuthenticationloginschemapolicyVpnvserverBinding []interface{} `json:"authenticationloginschemapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationldappolicybinding struct { - Name string `json:"name,omitempty"` +type Authenticationprotecteduseraction struct { + Count float64 `json:"__count,omitempty"` + Maxconcurrentusers int `json:"maxconcurrentusers,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Realmstr string `json:"realmstr,omitempty"` } -type Authenticationloginschemapolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationloginschemapolicyvserverbinding struct { +type AuthenticationpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationoauthidppolicyauthenticationvserverbinding struct { +type AuthenticationsamlpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type Authenticationtacacsaction struct { + Accounting string `json:"accounting,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attributes string `json:"attributes,omitempty"` + Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + Authorization string `json:"authorization,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Failure int `json:"failure,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Success int `json:"success,omitempty"` + Tacacssecret string `json:"tacacssecret,omitempty"` +} + +type AuthenticationcertpolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationpolicysystemglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` +type AuthenticationvserverAuthenticationloginschemapolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationpolicylabelauthenticationpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Authenticationvserverldappolicybinding struct { Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationnegotiatepolicyvpnvserverbinding struct { +type AuthenticationsamlidppolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuthenticationnegotiatepolicyVpnglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationsmartaccessprofile struct { - Name string `json:"name,omitempty"` - Tags string `json:"tags,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationsamlpolicyBinding struct { + AuthenticationsamlpolicyAuthenticationvserverBinding []interface{} `json:"authenticationsamlpolicy_authenticationvserver_binding,omitempty"` + AuthenticationsamlpolicyVpnglobalBinding []interface{} `json:"authenticationsamlpolicy_vpnglobal_binding,omitempty"` + AuthenticationsamlpolicyVpnvserverBinding []interface{} `json:"authenticationsamlpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationvserverauthenticationwebauthpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationvserverAuthenticationlocalpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvservernegotiatepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationsamlpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationvserverauthenticationsmartaccesspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvservertmsessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvserverwebauthpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationadfsproxyprofile struct { - Name string `json:"name,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Adfstruststatus string `json:"adfstruststatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationcertaction struct { - Name string `json:"name,omitempty"` - Twofactor string `json:"twofactor,omitempty"` - Usernamefield string `json:"usernamefield,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationoauthidppolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserverauthenticationcertpolicybinding struct { Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationprotecteduseraction struct { - Name string `json:"name,omitempty"` - Realmstr string `json:"realmstr,omitempty"` - Maxconcurrentusers int `json:"maxconcurrentusers,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationdfapolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Authenticationdfapolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Authenticationnegotiatepolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Authenticationpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationradiuspolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationradiuspolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvservertacacspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Description string `json:"description,omitempty"` - Policysubtype string `json:"policysubtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Type string `json:"type,omitempty"` - Comment string `json:"comment,omitempty"` - Loginschema string `json:"loginschema,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationsamlidpprofile struct { - Name string `json:"name,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Samlidpcertname string `json:"samlidpcertname,omitempty"` - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Rejectunsignedrequests string `json:"rejectunsignedrequests,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Audience string `json:"audience,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` - Samlbinding string `json:"samlbinding,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Serviceproviderid string `json:"serviceproviderid,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Keytransportalg string `json:"keytransportalg,omitempty"` - Splogouturl string `json:"splogouturl,omitempty"` - Logoutbinding string `json:"logoutbinding,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` - Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Samlsigningcertversion string `json:"samlsigningcertversion,omitempty"` - Samlspcertversion string `json:"samlspcertversion,omitempty"` - Acsurlrule string `json:"acsurlrule,omitempty"` - Metadataimportstatus string `json:"metadataimportstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserverbinding struct { - Name string `json:"name,omitempty"` +type Authenticationvserver struct { + Appflowlog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authenticationdomain string `json:"authenticationdomain,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Certkeynames string `json:"certkeynames,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Curaaausers int `json:"curaaausers,omitempty"` + Curstate string `json:"curstate,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Ip string `json:"ip,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Policy string `json:"policy,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + Priority int `json:"priority,omitempty"` + Range int `json:"range,omitempty"` + Redirect string `json:"redirect,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Samesite string `json:"samesite,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + Status int `json:"status,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + TypeField string `json:"type,omitempty"` + Value string `json:"value,omitempty"` + Vstype int `json:"vstype,omitempty"` + Weight int `json:"weight,omitempty"` } -type Authenticationoauthaction struct { - Name string `json:"name,omitempty"` - Oauthtype string `json:"oauthtype,omitempty"` - Authorizationendpoint string `json:"authorizationendpoint,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Idtokendecryptendpoint string `json:"idtokendecryptendpoint,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` +type Authenticationnoauthaction struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Oauthmiscflags []string `json:"oauthmiscflags,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attributes string `json:"attributes,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Graphendpoint string `json:"graphendpoint,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Certendpoint string `json:"certendpoint,omitempty"` - Audience string `json:"audience,omitempty"` - Usernamefield string `json:"usernamefield,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Issuer string `json:"issuer,omitempty"` - Userinfourl string `json:"userinfourl,omitempty"` - Certfilepath string `json:"certfilepath,omitempty"` - Granttype string `json:"granttype,omitempty"` - Authentication string `json:"authentication,omitempty"` - Introspecturl string `json:"introspecturl,omitempty"` - Allowedalgorithms []string `json:"allowedalgorithms,omitempty"` - Pkce string `json:"pkce,omitempty"` - Tokenendpointauthmethod string `json:"tokenendpointauthmethod,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` - Resourceuri string `json:"resourceuri,omitempty"` - Requestattribute string `json:"requestattribute,omitempty"` - Intunedeviceidexpression string `json:"intunedeviceidexpression,omitempty"` - Oauthstatus string `json:"oauthstatus,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Authenticationtacacspolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationnegotiatepolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationvservercspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvserverportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationwebauthpolicysystemglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationnegotiatepolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationoauthidppolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationpolicyauthenticationpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` } -type Authenticationradiusaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radnasip string `json:"radnasip,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radvendorid int `json:"radvendorid,omitempty"` - Radattributetype int `json:"radattributetype,omitempty"` - Radgroupsprefix string `json:"radgroupsprefix,omitempty"` - Radgroupseparator string `json:"radgroupseparator,omitempty"` - Passencoding string `json:"passencoding,omitempty"` - Ipvendorid int `json:"ipvendorid,omitempty"` - Ipattributetype int `json:"ipattributetype,omitempty"` - Accounting string `json:"accounting,omitempty"` - Pwdvendorid int `json:"pwdvendorid,omitempty"` - Pwdattributetype int `json:"pwdattributetype,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Callingstationid string `json:"callingstationid,omitempty"` - Authservretry int `json:"authservretry,omitempty"` - Authentication string `json:"authentication,omitempty"` - Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` - Transport string `json:"transport,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Messageauthenticator string `json:"messageauthenticator,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Success string `json:"success,omitempty"` - Failure string `json:"failure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationsamlpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationtacacspolicyglobalbinding struct { +type AuthenticationsamlpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationtacacspolicysystemglobalbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Authenticationdfapolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationauthnprofile struct { + Authenticationdomain string `json:"authenticationdomain,omitempty"` + Authenticationhost string `json:"authenticationhost,omitempty"` + Authenticationlevel int `json:"authenticationlevel,omitempty"` + Authnvsname string `json:"authnvsname,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Authenticationlocalpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationcaptchaaction struct { + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Scorethreshold int `json:"scorethreshold,omitempty"` + Secretkey string `json:"secretkey,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Sitekey string `json:"sitekey,omitempty"` } -type Authenticationnegotiatepolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationradiuspolicyBinding struct { + AuthenticationradiuspolicyAuthenticationvserverBinding []interface{} `json:"authenticationradiuspolicy_authenticationvserver_binding,omitempty"` + AuthenticationradiuspolicySystemglobalBinding []interface{} `json:"authenticationradiuspolicy_systemglobal_binding,omitempty"` + AuthenticationradiuspolicyVpnglobalBinding []interface{} `json:"authenticationradiuspolicy_vpnglobal_binding,omitempty"` + AuthenticationradiuspolicyVpnvserverBinding []interface{} `json:"authenticationradiuspolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationtacacspolicyBinding struct { + AuthenticationtacacspolicyAuthenticationvserverBinding []interface{} `json:"authenticationtacacspolicy_authenticationvserver_binding,omitempty"` + AuthenticationtacacspolicySystemglobalBinding []interface{} `json:"authenticationtacacspolicy_systemglobal_binding,omitempty"` + AuthenticationtacacspolicyVpnglobalBinding []interface{} `json:"authenticationtacacspolicy_vpnglobal_binding,omitempty"` + AuthenticationtacacspolicyVpnvserverBinding []interface{} `json:"authenticationtacacspolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationsamlidppolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationsamlpolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationwebauthpolicyvserverbinding struct { +type AuthenticationldappolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationcertpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationlocalpolicysystemglobalbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Authenticationoauthidppolicyvserverbinding struct { +type AuthenticationwebauthpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationradiuspolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationlocalpolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationcitrixauthaction struct { - Name string `json:"name,omitempty"` - Authenticationtype string `json:"authenticationtype,omitempty"` - Authentication string `json:"authentication,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationvserverAuthenticationradiuspolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationnegotiatepolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationloginschemapolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationnegotiatepolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationlocalpolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationpushservice struct { - Name string `json:"name,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` - Customerid string `json:"customerid,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Namespace string `json:"Namespace,omitempty"` - Hubname string `json:"hubname,omitempty"` - Servicekey string `json:"servicekey,omitempty"` - Servicekeyname string `json:"servicekeyname,omitempty"` - Certendpoint string `json:"certendpoint,omitempty"` - Pushservicestatus string `json:"pushservicestatus,omitempty"` - Trustservice string `json:"trustservice,omitempty"` - Pushcloudserverstatus string `json:"pushcloudserverstatus,omitempty"` - Signingkeyname string `json:"signingkeyname,omitempty"` - Signingkey string `json:"signingkey,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationradiuspolicyvpnglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationsamlpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Authenticationvserversamlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationvserverAuthenticationsamlpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationwebauthpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationnegotiateaction struct { - Name string `json:"name,omitempty"` - Domain string `json:"domain,omitempty"` - Domainuser string `json:"domainuser,omitempty"` - Domainuserpasswd string `json:"domainuserpasswd,omitempty"` - Ou string `json:"ou,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Keytab string `json:"keytab,omitempty"` - Ntlmpath string `json:"ntlmpath,omitempty"` - Kcdspn string `json:"kcdspn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserverauthenticationnegotiatepolicybinding struct { Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationepaaction struct { - Name string `json:"name,omitempty"` - Csecexpr string `json:"csecexpr,omitempty"` - Killprocess string `json:"killprocess,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` - Defaultepagroup string `json:"defaultepagroup,omitempty"` - Quarantinegroup string `json:"quarantinegroup,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationradiuspolicysystemglobalbinding struct { +type AuthenticationsamlidppolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuthenticationoauthidppolicyAuthenticationvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationstorefrontauthaction struct { - Name string `json:"name,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Domain string `json:"domain,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Success string `json:"success,omitempty"` - Failure string `json:"failure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Authenticationcitrixauthaction struct { + Authentication string `json:"authentication,omitempty"` + Authenticationtype string `json:"authenticationtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Authenticationvserverauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationvserverAuthenticationcertpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvserverauthenticationsamlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvservercertpolicybinding struct { Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationcertpolicybinding struct { - Name string `json:"name,omitempty"` +type AuthenticationpolicylabelBinding struct { + AuthenticationpolicylabelAuthenticationpolicyBinding []interface{} `json:"authenticationpolicylabel_authenticationpolicy_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Authenticationcertpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationdfapolicy struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationldappolicyvserverbinding struct { +type AuthenticationtacacspolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Authenticationsamlpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationvserversyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationemailaction struct { - Name string `json:"name,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Content string `json:"content,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Timeout int `json:"timeout,omitempty"` - Type string `json:"type,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationlocalpolicyvserverbinding struct { +type AuthenticationradiuspolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserverpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AuthenticationvserverAuthenticationldappolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Bindpoint string `json:"bindpoint,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Authenticationvserverresponderpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` -} - -type Authenticationsamlaction struct { - Name string `json:"name,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` - Samlidpcertname string `json:"samlidpcertname,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Samlredirecturl string `json:"samlredirecturl,omitempty"` - Samlacsindex int `json:"samlacsindex,omitempty"` - Samluserfield string `json:"samluserfield,omitempty"` - Samlrejectunsignedassertion string `json:"samlrejectunsignedassertion,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Samltwofactor string `json:"samltwofactor,omitempty"` - Preferredbindtype []string `json:"preferredbindtype,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attributes string `json:"attributes,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Requestedauthncontext string `json:"requestedauthncontext,omitempty"` - Authnctxclassref []string `json:"authnctxclassref,omitempty"` - Customauthnctxclassref string `json:"customauthnctxclassref,omitempty"` - Samlbinding string `json:"samlbinding,omitempty"` - Attributeconsumingserviceindex int `json:"attributeconsumingserviceindex,omitempty"` - Sendthumbprint string `json:"sendthumbprint,omitempty"` - Enforceusername string `json:"enforceusername,omitempty"` - Logouturl string `json:"logouturl,omitempty"` - Artifactresolutionserviceurl string `json:"artifactresolutionserviceurl,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Logoutbinding string `json:"logoutbinding,omitempty"` - Forceauthn string `json:"forceauthn,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` - Audience string `json:"audience,omitempty"` - Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` - Storesamlresponse string `json:"storesamlresponse,omitempty"` - Statechecks string `json:"statechecks,omitempty"` - Metadataimportstatus string `json:"metadataimportstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserverauditnslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvserverauthenticationtacacspolicybinding struct { Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationcertpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` } -type Authenticationdfapolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationlocalpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Authenticationoauthidpprofile struct { + Attributes string `json:"attributes,omitempty"` + Audience string `json:"audience,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Configservice string `json:"configservice,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Encrypttoken string `json:"encrypttoken,omitempty"` + Issuer string `json:"issuer,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oauthstatus string `json:"oauthstatus,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Relyingpartymetadataurl string `json:"relyingpartymetadataurl,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Skewtime int `json:"skewtime,omitempty"` +} + +type AuthenticationtacacspolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authenticationloginschema struct { - Name string `json:"name,omitempty"` - Authenticationschema string `json:"authenticationschema,omitempty"` - Userexpression string `json:"userexpression,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` - Usercredentialindex int `json:"usercredentialindex,omitempty"` - Passwordcredentialindex int `json:"passwordcredentialindex,omitempty"` - Authenticationstrength int `json:"authenticationstrength,omitempty"` - Ssocredentials string `json:"ssocredentials,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationsamlidppolicyauthenticationvserverbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvservernslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Authenticationepaaction struct { + Count float64 `json:"__count,omitempty"` + Csecexpr string `json:"csecexpr,omitempty"` + Defaultepagroup string `json:"defaultepagroup,omitempty"` + Deletefiles string `json:"deletefiles,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Killprocess string `json:"killprocess,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Quarantinegroup string `json:"quarantinegroup,omitempty"` } -type Authenticationwebauthpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationpolicyBinding struct { + AuthenticationpolicyAuthenticationpolicylabelBinding []interface{} `json:"authenticationpolicy_authenticationpolicylabel_binding,omitempty"` + AuthenticationpolicyAuthenticationvserverBinding []interface{} `json:"authenticationpolicy_authenticationvserver_binding,omitempty"` + AuthenticationpolicySystemglobalBinding []interface{} `json:"authenticationpolicy_systemglobal_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationwebauthpolicyglobalbinding struct { +type AuthenticationcertpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationlocalpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationdfapolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationnegotiatepolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationwebauthaction struct { + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Fullreqexpr string `json:"fullreqexpr,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Scheme string `json:"scheme,omitempty"` + Serverip string `json:"serverip,omitempty"` + Serverport int `json:"serverport,omitempty"` + Successrule string `json:"successrule,omitempty"` } -type Authenticationradiuspolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Authenticationpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Loginschema string `json:"loginschema,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Authenticationradiuspolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationradiuspolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authenticationsamlidppolicy struct { +type AuthenticationvserverAuthenticationoauthidppolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` +} + +type AuthenticationvserverRewritepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationauthnprofile struct { - Name string `json:"name,omitempty"` - Authnvsname string `json:"authnvsname,omitempty"` - Authenticationhost string `json:"authenticationhost,omitempty"` - Authenticationdomain string `json:"authenticationdomain,omitempty"` - Authenticationlevel int `json:"authenticationlevel,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Authenticationdfaaction struct { + Clientid string `json:"clientid,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Failure int `json:"failure,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passphrase string `json:"passphrase,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Success int `json:"success,omitempty"` } -type Authenticationnoauthaction struct { - Name string `json:"name,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationoauthidppolicyBinding struct { + AuthenticationoauthidppolicyAuthenticationvserverBinding []interface{} `json:"authenticationoauthidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationoauthidppolicyVpnvserverBinding []interface{} `json:"authenticationoauthidppolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AuthenticationvserverCachepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type AuthenticationvserverAuthenticationnegotiatepolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationsamlpolicyvpnglobalbinding struct { +type AuthenticationtacacspolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` +} + +type AuthenticationtacacspolicyVpnglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserverauthenticationoauthidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationvserverAuthenticationsamlidppolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Authenticationvserverauthenticationradiuspolicybinding struct { + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationvserverauthenticationsamlidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationvserverAuthenticationtacacspolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Authenticationvserverlocalpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` +type Authenticationldapaction struct { + Alternateemailattr string `json:"alternateemailattr,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attributes string `json:"attributes,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authtimeout int `json:"authtimeout,omitempty"` + Cloudattributes string `json:"cloudattributes,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Email string `json:"email,omitempty"` + Failure int `json:"failure,omitempty"` + Followreferrals string `json:"followreferrals,omitempty"` + Groupattrname string `json:"groupattrname,omitempty"` + Groupnameidentifier string `json:"groupnameidentifier,omitempty"` + Groupsearchattribute string `json:"groupsearchattribute,omitempty"` + Groupsearchfilter string `json:"groupsearchfilter,omitempty"` + Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` + Kbattribute string `json:"kbattribute,omitempty"` + Ldapbase string `json:"ldapbase,omitempty"` + Ldapbinddn string `json:"ldapbinddn,omitempty"` + Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` + Ldaphostname string `json:"ldaphostname,omitempty"` + Ldaploginname string `json:"ldaploginname,omitempty"` + Maxldapreferrals int `json:"maxldapreferrals,omitempty"` + Maxnestinglevel int `json:"maxnestinglevel,omitempty"` + Mssrvrecordlocation string `json:"mssrvrecordlocation,omitempty"` + Name string `json:"name,omitempty"` + Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Otpsecret string `json:"otpsecret,omitempty"` + Passwdchange string `json:"passwdchange,omitempty"` + Pushservice string `json:"pushservice,omitempty"` + Referraldnslookup string `json:"referraldnslookup,omitempty"` + Requireuser string `json:"requireuser,omitempty"` + Searchfilter string `json:"searchfilter,omitempty"` + Sectype string `json:"sectype,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + Sshpublickey string `json:"sshpublickey,omitempty"` + Ssonameattribute string `json:"ssonameattribute,omitempty"` + Subattributename string `json:"subattributename,omitempty"` + Success int `json:"success,omitempty"` + Svrtype string `json:"svrtype,omitempty"` + Validateservercert string `json:"validateservercert,omitempty"` +} + +type AuthenticationvserverAuthenticationpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationdfaaction struct { - Name string `json:"name,omitempty"` - Clientid string `json:"clientid,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Passphrase string `json:"passphrase,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Success string `json:"success,omitempty"` - Failure string `json:"failure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthenticationcertpolicyBinding struct { + AuthenticationcertpolicyAuthenticationvserverBinding []interface{} `json:"authenticationcertpolicy_authenticationvserver_binding,omitempty"` + AuthenticationcertpolicyVpnglobalBinding []interface{} `json:"authenticationcertpolicy_vpnglobal_binding,omitempty"` + AuthenticationcertpolicyVpnvserverBinding []interface{} `json:"authenticationcertpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authenticationldappolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationwebauthpolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationsamlidppolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Authenticationsamlpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserver struct { - Name string `json:"name,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Range int `json:"range,omitempty"` - Port int `json:"port,omitempty"` - State string `json:"state,omitempty"` - Authentication string `json:"authentication,omitempty"` - Authenticationdomain string `json:"authenticationdomain,omitempty"` - Comment string `json:"comment,omitempty"` - Td int `json:"td,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` - Certkeynames string `json:"certkeynames,omitempty"` - Samesite string `json:"samesite,omitempty"` - Newname string `json:"newname,omitempty"` - Ip string `json:"ip,omitempty"` - Value string `json:"value,omitempty"` - Type string `json:"type,omitempty"` - Curstate string `json:"curstate,omitempty"` - Status string `json:"status,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Redirect string `json:"redirect,omitempty"` - Precedence string `json:"precedence,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Curaaausers string `json:"curaaausers,omitempty"` - Policy string `json:"policy,omitempty"` - Servicename string `json:"servicename,omitempty"` - Weight string `json:"weight,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Clttimeout string `json:"clttimeout,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sothreshold string `json:"sothreshold,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout string `json:"sopersistencetimeout,omitempty"` - Priority string `json:"priority,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority string `json:"listenpriority,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Vstype string `json:"vstype,omitempty"` - Ngname string `json:"ngname,omitempty"` - Secondary string `json:"secondary,omitempty"` - Groupextraction string `json:"groupextraction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationvserverradiuspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` +type AuthenticationvserverAuditnslogpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationldappolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationsamlpolicyAuthenticationvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Labelname string `json:"labelname,omitempty"` +type Authenticationoauthaction struct { + Allowedalgorithms []string `json:"allowedalgorithms,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attributes string `json:"attributes,omitempty"` + Audience string `json:"audience,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authorizationendpoint string `json:"authorizationendpoint,omitempty"` + Certendpoint string `json:"certendpoint,omitempty"` + Certfilepath string `json:"certfilepath,omitempty"` + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Granttype string `json:"granttype,omitempty"` + Graphendpoint string `json:"graphendpoint,omitempty"` + Idtokendecryptendpoint string `json:"idtokendecryptendpoint,omitempty"` + Introspecturl string `json:"introspecturl,omitempty"` + Intunedeviceidexpression string `json:"intunedeviceidexpression,omitempty"` + Issuer string `json:"issuer,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oauthmiscflags []string `json:"oauthmiscflags,omitempty"` + Oauthstatus string `json:"oauthstatus,omitempty"` + Oauthtype string `json:"oauthtype,omitempty"` + Pkce string `json:"pkce,omitempty"` + Refreshinterval int `json:"refreshinterval,omitempty"` + Requestattribute string `json:"requestattribute,omitempty"` + Resourceuri string `json:"resourceuri,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Tokenendpointauthmethod string `json:"tokenendpointauthmethod,omitempty"` + Userinfourl string `json:"userinfourl,omitempty"` + Usernamefield string `json:"usernamefield,omitempty"` } -type Authenticationsmartaccesspolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Authenticationnegotiateaction struct { + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Domain string `json:"domain,omitempty"` + Domainuser string `json:"domainuser,omitempty"` + Domainuserpasswd string `json:"domainuserpasswd,omitempty"` + Kcdspn string `json:"kcdspn,omitempty"` + Keytab string `json:"keytab,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ntlmpath string `json:"ntlmpath,omitempty"` + Ou string `json:"ou,omitempty"` +} + +type AuthenticationldappolicySystemglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvserveroauthidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` +type Authenticationloginschema struct { + Authenticationschema string `json:"authenticationschema,omitempty"` + Authenticationstrength int `json:"authenticationstrength,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Passwordcredentialindex int `json:"passwordcredentialindex,omitempty"` + Ssocredentials string `json:"ssocredentials,omitempty"` + Usercredentialindex int `json:"usercredentialindex,omitempty"` + Userexpression string `json:"userexpression,omitempty"` +} + +type AuthenticationpolicylabelAuthenticationpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Labelname string `json:"labelname,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationldappolicyglobalbinding struct { +type AuthenticationradiuspolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationlocalpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationpolicybinding struct { - Name string `json:"name,omitempty"` +type Authenticationcertaction struct { + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Groupnamefield string `json:"groupnamefield,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Twofactor string `json:"twofactor,omitempty"` + Usernamefield string `json:"usernamefield,omitempty"` } -type Authenticationtacacspolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Authenticationadfsproxyprofile struct { + Adfstruststatus string `json:"adfstruststatus,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Serverurl string `json:"serverurl,omitempty"` + Username string `json:"username,omitempty"` } -type Authenticationvserverauthenticationlocalpolicybinding struct { +type AuthenticationvserverResponderpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` +} + +type AuthenticationvserverCspolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Authenticationwebauthaction struct { - Name string `json:"name,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Fullreqexpr string `json:"fullreqexpr,omitempty"` - Scheme string `json:"scheme,omitempty"` - Successrule string `json:"successrule,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authenticationwebauthpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Authenticationloginschemapolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthenticationpolicyAuthenticationpolicylabelBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationtacacspolicyvserverbinding struct { +type AuthenticationoauthidppolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authenticationvservercachepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type Authenticationpolicy struct { + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policysubtype string `json:"policysubtype,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` +} + +type Authenticationsamlidpprofile struct { + Acsurlrule string `json:"acsurlrule,omitempty"` + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Audience string `json:"audience,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Keytransportalg string `json:"keytransportalg,omitempty"` + Logoutbinding string `json:"logoutbinding,omitempty"` + Metadataimportstatus string `json:"metadataimportstatus,omitempty"` + Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` + Metadataurl string `json:"metadataurl,omitempty"` + Name string `json:"name,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rejectunsignedrequests string `json:"rejectunsignedrequests,omitempty"` + Samlbinding string `json:"samlbinding,omitempty"` + Samlidpcertname string `json:"samlidpcertname,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Samlsigningcertversion string `json:"samlsigningcertversion,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Samlspcertversion string `json:"samlspcertversion,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Serviceproviderid string `json:"serviceproviderid,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Skewtime int `json:"skewtime,omitempty"` + Splogouturl string `json:"splogouturl,omitempty"` +} + +type AuthenticationldappolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AuthenticationvserverAuthenticationsmartaccesspolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Nextfactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` +} + +type Authenticationcertpolicy struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` } diff --git a/nitrogo/models/authorization.go b/nitrogo/models/authorization.go index 307d480..5528228 100644 --- a/nitrogo/models/authorization.go +++ b/nitrogo/models/authorization.go @@ -1,118 +1,90 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Authorizationpolicyaaauserbinding struct { +// authorization configuration structs +type AuthorizationpolicyAuthorizationpolicylabelBinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authorizationpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authorizationpolicylabelauthorizationpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type AuthorizationpolicylabelAuthorizationpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authorizationpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Newname string `json:"newname,omitempty"` - Activepolicy string `json:"activepolicy,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authorizationpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Authorizationpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` -} - -type Authorizationpolicyuserbinding struct { +type AuthorizationpolicyCsvserverBinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authorizationaction struct { - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type AuthorizationpolicyBinding struct { + AuthorizationpolicyAaagroupBinding []interface{} `json:"authorizationpolicy_aaagroup_binding,omitempty"` + AuthorizationpolicyAaauserBinding []interface{} `json:"authorizationpolicy_aaauser_binding,omitempty"` + AuthorizationpolicyAuthorizationpolicylabelBinding []interface{} `json:"authorizationpolicy_authorizationpolicylabel_binding,omitempty"` + AuthorizationpolicyCsvserverBinding []interface{} `json:"authorizationpolicy_csvserver_binding,omitempty"` + AuthorizationpolicyLbvserverBinding []interface{} `json:"authorizationpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Authorizationpolicyauthorizationpolicylabelbinding struct { +type AuthorizationpolicyLbvserverBinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` Name string `json:"name,omitempty"` -} - -type Authorizationpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` } -type Authorizationpolicyvserverbinding struct { +type Authorizationpolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AuthorizationpolicyAaagroupBinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Authorizationpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Authorizationpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type Authorizationpolicy struct { + Action string `json:"action,omitempty"` + Activepolicy int `json:"activepolicy,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Authorizationpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Invoke bool `json:"invoke,omitempty"` +type Authorizationaction struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Authorizationpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` +type AuthorizationpolicylabelBinding struct { + AuthorizationpolicylabelAuthorizationpolicyBinding []interface{} `json:"authorizationpolicylabel_authorizationpolicy_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Authorizationpolicygroupbinding struct { +type AuthorizationpolicyAaauserBinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/autoscale.go b/nitrogo/models/autoscale.go index e3971d6..21c8c15 100644 --- a/nitrogo/models/autoscale.go +++ b/nitrogo/models/autoscale.go @@ -1,56 +1,50 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Autoscaleaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Profilename string `json:"profilename,omitempty"` - Parameters string `json:"parameters,omitempty"` - Vmdestroygraceperiod int `json:"vmdestroygraceperiod,omitempty"` - Quiettime int `json:"quiettime,omitempty"` - Vserver string `json:"vserver,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Autoscalepolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Priority string `json:"priority,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// autoscale configuration structs +type Autoscaleprofile struct { + Apikey string `json:"apikey,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sharedsecret string `json:"sharedsecret,omitempty"` + TypeField string `json:"type,omitempty"` + Url string `json:"url,omitempty"` } -type Autoscalepolicybinding struct { - Name string `json:"name,omitempty"` +type Autoscaleaction struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Parameters string `json:"parameters,omitempty"` + Profilename string `json:"profilename,omitempty"` + Quiettime int `json:"quiettime,omitempty"` + TypeField string `json:"type,omitempty"` + Vmdestroygraceperiod int `json:"vmdestroygraceperiod,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Autoscalepolicynstimerbinding struct { +type AutoscalepolicyNstimerBinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Autoscalepolicytimerbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` +type AutoscalepolicyBinding struct { + AutoscalepolicyNstimerBinding []interface{} `json:"autoscalepolicy_nstimer_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Autoscaleprofile struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Url string `json:"url,omitempty"` - Apikey string `json:"apikey,omitempty"` - Sharedsecret string `json:"sharedsecret,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Autoscalepolicy struct { + Action string `json:"action,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } diff --git a/nitrogo/models/azure.go b/nitrogo/models/azure.go index c4486b1..634112e 100644 --- a/nitrogo/models/azure.go +++ b/nitrogo/models/azure.go @@ -1,23 +1,22 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Azureapplication struct { - Name string `json:"name,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Vaultresource string `json:"vaultresource,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// azure configuration structs +type Azurekeyvault struct { + Azureapplication string `json:"azureapplication,omitempty"` + Azurevaultname string `json:"azurevaultname,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` } -type Azurekeyvault struct { - Name string `json:"name,omitempty"` - Azurevaultname string `json:"azurevaultname,omitempty"` - Azureapplication string `json:"azureapplication,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Azureapplication struct { + Clientid string `json:"clientid,omitempty"` + Clientsecret string `json:"clientsecret,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tenantid string `json:"tenantid,omitempty"` + Tokenendpoint string `json:"tokenendpoint,omitempty"` + Vaultresource string `json:"vaultresource,omitempty"` } diff --git a/nitrogo/models/basic.go b/nitrogo/models/basic.go index e0773cf..f6d8f77 100644 --- a/nitrogo/models/basic.go +++ b/nitrogo/models/basic.go @@ -1,75 +1,548 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2025 - package models -type ServiceGroupBinding struct { - ServiceGroupName string `json:"servicegroupname,omitempty"` - ServiceGroupLBMonitorBinding []ServiceGroupLBMonitorBinding `json:"servicegroup_lbmonitor_binding,omitempty"` - ServiceGroupServiceGroupEntityMonBindingsBinding []ServiceGroupServiceGroupEntityMonBindingsBinding `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` - ServiceGroupServiceGroupMemberBinding []ServiceGroupServiceGroupMemberBinding `json:"servicegroup_servicegroupmember_binding,omitempty"` +// basic configuration structs +type ServerGslbservicegroupBinding struct { + Appflowlog string `json:"appflowlog,omitempty"` + Boundtd int `json:"boundtd,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Customserverid string `json:"customserverid,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + DupPort int `json:"dup_port,omitempty"` + DupSvctype string `json:"dup_svctype,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Name string `json:"name,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Serviceipaddress string `json:"serviceipaddress,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Svctype string `json:"svctype,omitempty"` + Svrcfgflags int `json:"svrcfgflags,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` } -type ServiceGroupServiceGroupEntityMonBindingsBinding struct { - CustomServerid string `json:"customserverid,omitempty"` +type ServerServiceBinding struct { + Name string `json:"name,omitempty"` + Port int `json:"port,omitempty"` + Serviceipaddress string `json:"serviceipaddress,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicename string `json:"servicename,omitempty"` + Svctype string `json:"svctype,omitempty"` + Svrstate string `json:"svrstate,omitempty"` +} + +type Servicegroupbindings struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + State string `json:"state,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type Locationparameter struct { + Builtin []string `json:"builtin,omitempty"` + Context string `json:"context,omitempty"` + Custom int `json:"custom,omitempty"` + Custom6 int `json:"custom6,omitempty"` + Databasemode string `json:"databasemode,omitempty"` + Entries int `json:"entries,omitempty"` + Entries6 int `json:"entries6,omitempty"` + Errors int `json:"errors,omitempty"` + Errors6 int `json:"errors6,omitempty"` + Feature string `json:"feature,omitempty"` + Flags int `json:"flags,omitempty"` + Flushing string `json:"flushing,omitempty"` + Format string `json:"format,omitempty"` + Format6 string `json:"format6,omitempty"` + Lines int `json:"lines,omitempty"` + Lines6 int `json:"lines6,omitempty"` + Loading string `json:"loading,omitempty"` + Locationfile string `json:"Locationfile,omitempty"` + Locationfile6 string `json:"locationfile6,omitempty"` + Matchwildcardtoany string `json:"matchwildcardtoany,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Q1label string `json:"q1label,omitempty"` + Q2label string `json:"q2label,omitempty"` + Q3label string `json:"q3label,omitempty"` + Q4label string `json:"q4label,omitempty"` + Q5label string `json:"q5label,omitempty"` + Q6label string `json:"q6label,omitempty"` + Static int `json:"Static,omitempty"` + Static6 int `json:"static6,omitempty"` + Status int `json:"status,omitempty"` + Warnings int `json:"warnings,omitempty"` + Warnings6 int `json:"warnings6,omitempty"` +} + +type Locationdata struct { +} + +type ServicegroupServicegroupentitymonbindingsBinding struct { + Customserverid string `json:"customserverid,omitempty"` Dbsttl int `json:"dbsttl,omitempty"` Hashid int `json:"hashid,omitempty"` - LastResponse string `json:"lastresponse,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` MonitorName string `json:"monitor_name,omitempty"` - MonitorCurrentFailedProbes string `json:"monitorcurrentfailedprobes,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - MonitorTotalFailedProbes string `json:"monitortotalfailedprobes,omitempty"` - MonitorTotalProbes string `json:"monitortotalprobes,omitempty"` - NameServer string `json:"nameserver,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Nameserver string `json:"nameserver,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` - ResponseTime string `json:"responsetime,omitempty"` + Responsetime int `json:"responsetime,omitempty"` Serverid int `json:"serverid,omitempty"` - ServiceGroupEntName2 string `json:"servicegroupentname2,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` + Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } -type ServiceGroupServiceGroupMemberBinding struct { - CustomServerid string `json:"customserverid,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` - Delay int `json:"delay,omitempty"` - Graceful string `json:"graceful,omitempty"` - Hashid string `json:"hashid,omitempty"` - IP string `json:"ip,omitempty"` - NameServer string `json:"nameserver,omitempty"` - Order int `json:"order,omitempty"` - OrderStr string `json:"orderstr,omitempty"` - Port int `json:"port,omitempty"` - Serverid string `json:"serverid,omitempty"` - ServerName string `json:"servername,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` - State string `json:"state,omitempty"` - StateChangeTimeSec string `json:"statechangetimesec,omitempty"` - SvcitmPriority int `json:"svcitmpriority,omitempty"` - SvrState string `json:"svrstate,omitempty"` - TicksSinceLastStateChange string `json:"tickssincelaststatechange,omitempty"` - TROFSDelay string `json:"trofsdelay,omitempty"` - TROFSReason string `json:"trofsreason,omitempty"` - Weight string `json:"weight,omitempty"` +type ServiceGroupBinding struct { + ServicegroupLbmonitorBinding []interface{} `json:"servicegroup_lbmonitor_binding,omitempty"` + ServicegroupServicegroupentitymonbindingsBinding []interface{} `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` + ServicegroupServicegroupmemberBinding []interface{} `json:"servicegroup_servicegroupmember_binding,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type ServiceGroupLBMonitorBinding struct { - CustomServerid string `json:"customserverid,omitempty"` +type ServicegroupLbmonitorBinding struct { + Customserverid string `json:"customserverid,omitempty"` Dbsttl int `json:"dbsttl,omitempty"` Hashid int `json:"hashid,omitempty"` MonitorName string `json:"monitor_name,omitempty"` - MonState string `json:"monstate,omitempty"` - MonWeight string `json:"monweight,omitempty"` - NameServer string `json:"nameserver,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monweight int `json:"monweight,omitempty"` + Nameserver string `json:"nameserver,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` Serverid int `json:"serverid,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` - Weight string `json:"weight,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type ServiceBinding struct { + Name string `json:"name,omitempty"` + ServiceLbmonitorBinding []interface{} `json:"service_lbmonitor_binding,omitempty"` +} + +type Radiusnode struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeprefix string `json:"nodeprefix,omitempty"` + Radkey string `json:"radkey,omitempty"` +} + +type Svcbindings struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Servicename string `json:"servicename,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type ServicegroupServicegroupmemberBinding struct { + Customserverid string `json:"customserverid,omitempty"` + Dbsttl int `json:"dbsttl,omitempty"` + Delay int `json:"delay,omitempty"` + Graceful string `json:"graceful,omitempty"` + Hashid int `json:"hashid,omitempty"` + Ip string `json:"ip,omitempty"` + Nameserver string `json:"nameserver,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` + Serverid int `json:"serverid,omitempty"` + Servername string `json:"servername,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + State string `json:"state,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Svcitmpriority int `json:"svcitmpriority,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Trofsdelay int `json:"trofsdelay,omitempty"` + Trofsreason string `json:"trofsreason,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Vserver struct { + Backupvserver string `json:"backupvserver,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Name string `json:"name,omitempty"` + Pushvserver string `json:"pushvserver,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` +} + +type Nstrace struct { + Capdroppkt string `json:"capdroppkt,omitempty"` + Capsslkeys string `json:"capsslkeys,omitempty"` + Doruntimecleanup string `json:"doruntimecleanup,omitempty"` + Fileid string `json:"fileid,omitempty"` + Filename string `json:"filename,omitempty"` + Filesize int `json:"filesize,omitempty"` + Filter string `json:"filter,omitempty"` + Inmemorytrace string `json:"inmemorytrace,omitempty"` + Link string `json:"link,omitempty"` + Merge string `json:"merge,omitempty"` + Mode []string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nf int `json:"nf,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Nodes []interface{} `json:"nodes,omitempty"` + Pernic string `json:"pernic,omitempty"` + Scope string `json:"scope,omitempty"` + Size int `json:"size,omitempty"` + Skiplocalssh string `json:"skiplocalssh,omitempty"` + Skiprpc string `json:"skiprpc,omitempty"` + State string `json:"state,omitempty"` + Time int `json:"time,omitempty"` + Tracebuffers int `json:"tracebuffers,omitempty"` + Traceformat string `json:"traceformat,omitempty"` + Tracelocation string `json:"tracelocation,omitempty"` +} + +type Locationfile struct { + Curlocfilestatus string `json:"curlocfilestatus,omitempty"` + Format string `json:"format,omitempty"` + Locationfile string `json:"Locationfile,omitempty"` + Locfilestatusstr string `json:"locfilestatusstr,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Prevlocationfile string `json:"prevlocationfile,omitempty"` + Prevlocfileformat string `json:"prevlocfileformat,omitempty"` + Prevlocfilestatus string `json:"prevlocfilestatus,omitempty"` + Src string `json:"src,omitempty"` +} + +type ServerGslbserviceBinding struct { + Name string `json:"name,omitempty"` + Port int `json:"port,omitempty"` + Serviceipaddress string `json:"serviceipaddress,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicename string `json:"servicename,omitempty"` + Svctype string `json:"svctype,omitempty"` + Svrstate string `json:"svrstate,omitempty"` +} + +type Extendedmemoryparam struct { + Maxmemlimit int `json:"maxmemlimit,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Memlimitactive int `json:"memlimitactive,omitempty"` + Minrequiredmemory int `json:"minrequiredmemory,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Service struct { + Accessdown string `json:"accessdown,omitempty"` + All bool `json:"all,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cka string `json:"cka,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Clmonowner int `json:"clmonowner,omitempty"` + Clmonview int `json:"clmonview,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Cmp string `json:"cmp,omitempty"` + Comment string `json:"comment,omitempty"` + Contentinspectionprofilename string `json:"contentinspectionprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + Customserverid string `json:"customserverid,omitempty"` + Delay int `json:"delay,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + DupState string `json:"dup_state,omitempty"` + Feature string `json:"feature,omitempty"` + Graceful string `json:"graceful,omitempty"` + Gslb string `json:"gslb,omitempty"` + Hashid int `json:"hashid,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Internal bool `json:"Internal,omitempty"` + Ip string `json:"ip,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Monconnectionclose string `json:"monconnectionclose,omitempty"` + MonitorNameSvc string `json:"monitor_name_svc,omitempty"` + MonitorState string `json:"monitor_state,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Monuserstatusmesg string `json:"monuserstatusmesg,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Numofconnections int `json:"numofconnections,omitempty"` + Oracleserverversion string `json:"oracleserverversion,omitempty"` + Pathmonitor string `json:"pathmonitor,omitempty"` + Pathmonitorindv string `json:"pathmonitorindv,omitempty"` + Policyname string `json:"policyname,omitempty"` + Port int `json:"port,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Responsetime int `json:"responsetime,omitempty"` + Rtspsessionidremap string `json:"rtspsessionidremap,omitempty"` + Serverid int `json:"serverid,omitempty"` + Servername string `json:"servername,omitempty"` + Serviceconftype bool `json:"serviceconftype,omitempty"` + Serviceconftype2 string `json:"serviceconftype2,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sp string `json:"sp,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Stateupdatereason int `json:"stateupdatereason,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Tcpb string `json:"tcpb,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` + Usip string `json:"usip,omitempty"` + Value string `json:"value,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type ServerServicegroupBinding struct { + Appflowlog string `json:"appflowlog,omitempty"` + Boundtd int `json:"boundtd,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cka string `json:"cka,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Cmp string `json:"cmp,omitempty"` + Customserverid string `json:"customserverid,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + DupPort int `json:"dup_port,omitempty"` + DupSvctype string `json:"dup_svctype,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Name string `json:"name,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Serviceipaddress string `json:"serviceipaddress,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Sp string `json:"sp,omitempty"` + Svcitmactsvcs int `json:"svcitmactsvcs,omitempty"` + Svcitmboundsvcs int `json:"svcitmboundsvcs,omitempty"` + Svcitmpriority int `json:"svcitmpriority,omitempty"` + Svctype string `json:"svctype,omitempty"` + Svrcfgflags int `json:"svrcfgflags,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Tcpb string `json:"tcpb,omitempty"` + Usip string `json:"usip,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type Dbsmonitors struct { +} + +type Locationfile6 struct { + Count float64 `json:"__count,omitempty"` + Curlocfilestatus string `json:"curlocfilestatus,omitempty"` + Format string `json:"format,omitempty"` + Locationfile string `json:"Locationfile,omitempty"` + Locfilestatusstr string `json:"locfilestatusstr,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Prevlocationfile string `json:"prevlocationfile,omitempty"` + Prevlocfileformat string `json:"prevlocfileformat,omitempty"` + Prevlocfilestatus string `json:"prevlocfilestatus,omitempty"` + Src string `json:"src,omitempty"` +} + +type Servicegroup struct { + Appflowlog string `json:"appflowlog,omitempty"` + Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` + Autodisabledelay int `json:"autodisabledelay,omitempty"` + Autodisablegraceful string `json:"autodisablegraceful,omitempty"` + Autoscale string `json:"autoscale,omitempty"` + Bootstrap string `json:"bootstrap,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cka string `json:"cka,omitempty"` + Clmonowner int `json:"clmonowner,omitempty"` + Clmonview int `json:"clmonview,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Cmp string `json:"cmp,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Customserverid string `json:"customserverid,omitempty"` + Dbsttl int `json:"dbsttl,omitempty"` + Delay int `json:"delay,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Graceful string `json:"graceful,omitempty"` + Groupcount int `json:"groupcount,omitempty"` + Hashid int `json:"hashid,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Includemembers bool `json:"includemembers,omitempty"` + Ip string `json:"ip,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Memberport int `json:"memberport,omitempty"` + Monconnectionclose string `json:"monconnectionclose,omitempty"` + MonitorNameSvc string `json:"monitor_name_svc,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Monuserstatusmesg string `json:"monuserstatusmesg,omitempty"` + Nameserver string `json:"nameserver,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Numofconnections int `json:"numofconnections,omitempty"` + Order int `json:"order,omitempty"` + Pathmonitor string `json:"pathmonitor,omitempty"` + Pathmonitorindv string `json:"pathmonitorindv,omitempty"` + Port int `json:"port,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Rtspsessionidremap string `json:"rtspsessionidremap,omitempty"` + Serverid int `json:"serverid,omitempty"` + Servername string `json:"servername,omitempty"` + Serviceconftype bool `json:"serviceconftype,omitempty"` + Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sp string `json:"sp,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Stateupdatereason int `json:"stateupdatereason,omitempty"` + Svcitmactsvcs int `json:"svcitmactsvcs,omitempty"` + Svcitmboundsvcs int `json:"svcitmboundsvcs,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Tcpb string `json:"tcpb,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + Topicname string `json:"topicname,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` + Usip string `json:"usip,omitempty"` + Value string `json:"value,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type ServerBinding struct { + Name string `json:"name,omitempty"` + ServerGslbserviceBinding []interface{} `json:"server_gslbservice_binding,omitempty"` + ServerGslbservicegroupBinding []interface{} `json:"server_gslbservicegroup_binding,omitempty"` + ServerServiceBinding []interface{} `json:"server_service_binding,omitempty"` + ServerServicegroupBinding []interface{} `json:"server_servicegroup_binding,omitempty"` +} + +type ServiceLbmonitorBinding struct { + DupState string `json:"dup_state,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + MonitorName string `json:"monitor_name,omitempty"` + MonitorState string `json:"monitor_state,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Name string `json:"name,omitempty"` + Passive bool `json:"passive,omitempty"` + Responsetime int `json:"responsetime,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Totalprobes int `json:"totalprobes,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type ServicegroupServicegroupmemberlistBinding struct { + Failedmembers []interface{} `json:"failedmembers,omitempty"` + Members []interface{} `json:"members,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` +} + +type Server struct { + Autoscale string `json:"autoscale,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cka string `json:"cka,omitempty"` + Cmp string `json:"cmp,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Delay int `json:"delay,omitempty"` + Domain string `json:"domain,omitempty"` + Domainresolvenow bool `json:"domainresolvenow,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Graceful string `json:"graceful,omitempty"` + Internal bool `json:"Internal,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Querytype string `json:"querytype,omitempty"` + Sp string `json:"sp,omitempty"` + State string `json:"state,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Tcpb string `json:"tcpb,omitempty"` + Td int `json:"td,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Translationip string `json:"translationip,omitempty"` + Translationmask string `json:"translationmask,omitempty"` + Usip string `json:"usip,omitempty"` +} + +type Location struct { + Count float64 `json:"__count,omitempty"` + Ipfrom string `json:"ipfrom,omitempty"` + Ipto string `json:"ipto,omitempty"` + Latitude int `json:"latitude,omitempty"` + Longitude int `json:"longitude,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Q1label string `json:"q1label,omitempty"` + Q2label string `json:"q2label,omitempty"` + Q3label string `json:"q3label,omitempty"` + Q4label string `json:"q4label,omitempty"` + Q5label string `json:"q5label,omitempty"` + Q6label string `json:"q6label,omitempty"` } diff --git a/nitrogo/models/bfd.go b/nitrogo/models/bfd.go index 35e5f79..23ca627 100644 --- a/nitrogo/models/bfd.go +++ b/nitrogo/models/bfd.go @@ -1,30 +1,28 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// bfd configuration structs type Bfdsession struct { - Localip string `json:"localip,omitempty"` - Remoteip string `json:"remoteip,omitempty"` - State string `json:"state,omitempty"` - Localport string `json:"localport,omitempty"` - Remoteport string `json:"remoteport,omitempty"` - Minimumtransmitinterval string `json:"minimumtransmitinterval,omitempty"` - Negotiatedminimumtransmitinterval string `json:"negotiatedminimumtransmitinterval,omitempty"` - Minimumreceiveinterval string `json:"minimumreceiveinterval,omitempty"` - Negotiatedminimumreceiveinterval string `json:"negotiatedminimumreceiveinterval,omitempty"` - Multiplier string `json:"multiplier,omitempty"` - Remotemultiplier string `json:"remotemultiplier,omitempty"` - Vlan string `json:"vlan,omitempty"` - Localdiagnotic string `json:"localdiagnotic,omitempty"` - Localdiscriminator string `json:"localdiscriminator,omitempty"` - Remotediscriminator string `json:"remotediscriminator,omitempty"` - Passive string `json:"passive,omitempty"` - Multihop string `json:"multihop,omitempty"` - Admindown string `json:"admindown,omitempty"` - Originalownerpe string `json:"originalownerpe,omitempty"` - Currentownerpe string `json:"currentownerpe,omitempty"` - Ownernode string `json:"ownernode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Admindown bool `json:"admindown,omitempty"` + Count float64 `json:"__count,omitempty"` + Currentownerpe int `json:"currentownerpe,omitempty"` + Localdiagnotic int `json:"localdiagnotic,omitempty"` + Localdiscriminator int `json:"localdiscriminator,omitempty"` + Localip string `json:"localip,omitempty"` + Localport int `json:"localport,omitempty"` + Minimumreceiveinterval int `json:"minimumreceiveinterval,omitempty"` + Minimumtransmitinterval int `json:"minimumtransmitinterval,omitempty"` + Multihop bool `json:"multihop,omitempty"` + Multiplier int `json:"multiplier,omitempty"` + Negotiatedminimumreceiveinterval int `json:"negotiatedminimumreceiveinterval,omitempty"` + Negotiatedminimumtransmitinterval int `json:"negotiatedminimumtransmitinterval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Originalownerpe int `json:"originalownerpe,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Passive bool `json:"passive,omitempty"` + Remotediscriminator int `json:"remotediscriminator,omitempty"` + Remoteip string `json:"remoteip,omitempty"` + Remotemultiplier int `json:"remotemultiplier,omitempty"` + Remoteport int `json:"remoteport,omitempty"` + State string `json:"state,omitempty"` + Vlan int `json:"vlan,omitempty"` } diff --git a/nitrogo/models/bot.go b/nitrogo/models/bot.go index 1656015..3b43544 100644 --- a/nitrogo/models/bot.go +++ b/nitrogo/models/bot.go @@ -1,339 +1,302 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Botprofileblacklistbinding struct { - Botblacklist bool `json:"bot_blacklist,omitempty"` - Botblacklisttype string `json:"bot_blacklist_type,omitempty"` - Botblacklistenabled string `json:"bot_blacklist_enabled,omitempty"` - Botblacklistvalue string `json:"bot_blacklist_value,omitempty"` - Botblacklistaction []string `json:"bot_blacklist_action,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` -} - -type Botsignature struct { - Src string `json:"src,omitempty"` - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Botpolicybinding struct { - Name string `json:"name,omitempty"` +// bot configuration structs +type Botprofile struct { + Addcookieflags string `json:"addcookieflags,omitempty"` + BotEnableBlackList string `json:"bot_enable_black_list,omitempty"` + BotEnableIpReputation string `json:"bot_enable_ip_reputation,omitempty"` + BotEnableRateLimit string `json:"bot_enable_rate_limit,omitempty"` + BotEnableTps string `json:"bot_enable_tps,omitempty"` + BotEnableWhiteList string `json:"bot_enable_white_list,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Clientipexpression string `json:"clientipexpression,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Devicefingerprint string `json:"devicefingerprint,omitempty"` + Devicefingerprintaction []string `json:"devicefingerprintaction,omitempty"` + Devicefingerprintmobile []string `json:"devicefingerprintmobile,omitempty"` + Dfprequestlimit int `json:"dfprequestlimit,omitempty"` + Errorurl string `json:"errorurl,omitempty"` + Feature string `json:"feature,omitempty"` + Headlessbrowserdetection string `json:"headlessbrowserdetection,omitempty"` + Kmdetection string `json:"kmdetection,omitempty"` + Kmeventspostbodylimit int `json:"kmeventspostbodylimit,omitempty"` + Kmjavascriptname string `json:"kmjavascriptname,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Signature string `json:"signature,omitempty"` + Signaturemultipleuseragentheaderaction []string `json:"signaturemultipleuseragentheaderaction,omitempty"` + Signaturenouseragentheaderaction []string `json:"signaturenouseragentheaderaction,omitempty"` + Spoofedreqaction []string `json:"spoofedreqaction,omitempty"` + Trap string `json:"trap,omitempty"` + Trapaction []string `json:"trapaction,omitempty"` + Trapurl string `json:"trapurl,omitempty"` + Verboseloglevel string `json:"verboseloglevel,omitempty"` } -type Botpolicyglobalbinding struct { +type BotpolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Botprofilecaptchabinding struct { - Captcharesource bool `json:"captcharesource,omitempty"` - Botcaptchaurl string `json:"bot_captcha_url,omitempty"` - Botcaptchaenabled string `json:"bot_captcha_enabled,omitempty"` - Waittime int `json:"waittime,omitempty"` - Graceperiod int `json:"graceperiod,omitempty"` - Muteperiod int `json:"muteperiod,omitempty"` - Requestsizelimit int `json:"requestsizelimit,omitempty"` - Retryattempts int `json:"retryattempts,omitempty"` - Botcaptchaaction []string `json:"bot_captcha_action,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` +type BotprofileKmdetectionexprBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotKmDetectionEnabled string `json:"bot_km_detection_enabled,omitempty"` + BotKmExpressionName string `json:"bot_km_expression_name,omitempty"` + BotKmExpressionValue string `json:"bot_km_expression_value,omitempty"` + Kmdetectionexpr bool `json:"kmdetectionexpr,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` } -type Botprofiletpsbinding struct { - Bottps bool `json:"bot_tps,omitempty"` - Bottpstype string `json:"bot_tps_type,omitempty"` - Threshold int `json:"threshold,omitempty"` - Percentage int `json:"percentage,omitempty"` - Bottpsaction []string `json:"bot_tps_action,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Bottpsenabled string `json:"bot_tps_enabled,omitempty"` - Name string `json:"name,omitempty"` +type BotprofileIpreputationBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotIprepAction []string `json:"bot_iprep_action,omitempty"` + BotIprepEnabled string `json:"bot_iprep_enabled,omitempty"` + BotIpreputation bool `json:"bot_ipreputation,omitempty"` + Category string `json:"category,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` } -type Botpolicybotpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Botsignature struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` } -type Botpolicyvserverbinding struct { +type BotpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` -} - -type Botpolicylabelbotpolicybinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Botglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` } -type Botpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Botsettings struct { + Builtin []string `json:"builtin,omitempty"` + Defaultnonintrusiveprofile string `json:"defaultnonintrusiveprofile,omitempty"` + Defaultprofile string `json:"defaultprofile,omitempty"` + Dfprequestlimit int `json:"dfprequestlimit,omitempty"` + Feature string `json:"feature,omitempty"` + Javascriptname string `json:"javascriptname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` + Proxyport int `json:"proxyport,omitempty"` + Proxyserver string `json:"proxyserver,omitempty"` + Proxyusername string `json:"proxyusername,omitempty"` + Sessioncookiename string `json:"sessioncookiename,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Signatureautoupdate string `json:"signatureautoupdate,omitempty"` + Signatureurl string `json:"signatureurl,omitempty"` + Trapurlautogenerate string `json:"trapurlautogenerate,omitempty"` + Trapurlinterval int `json:"trapurlinterval,omitempty"` + Trapurllength int `json:"trapurllength,omitempty"` } -type Botprofilelogexpressionbinding struct { - Logexpression bool `json:"logexpression,omitempty"` - Botlogexpressionname string `json:"bot_log_expression_name,omitempty"` - Botlogexpressionvalue string `json:"bot_log_expression_value,omitempty"` - Botlogexpressionenabled string `json:"bot_log_expression_enabled,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` - Logmessage string `json:"logmessage,omitempty"` +type BotpolicylabelBinding struct { + BotpolicylabelBotpolicyBinding []interface{} `json:"botpolicylabel_botpolicy_binding,omitempty"` + BotpolicylabelPolicybindingBinding []interface{} `json:"botpolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Botpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type BotglobalBotpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Botpolicylabelpolicybindingbinding struct { + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Botprofileratelimitbinding struct { - Botratelimit bool `json:"bot_ratelimit,omitempty"` - Botratelimittype string `json:"bot_rate_limit_type,omitempty"` - Botratelimitenabled string `json:"bot_rate_limit_enabled,omitempty"` - Botratelimiturl string `json:"bot_rate_limit_url,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Countrycode string `json:"countrycode,omitempty"` - Rate int `json:"rate,omitempty"` - Timeslice int `json:"timeslice,omitempty"` - Limittype string `json:"limittype,omitempty"` - Condition string `json:"condition,omitempty"` - Botratelimitaction []string `json:"bot_rate_limit_action,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` -} - -type Botsettings struct { - Defaultprofile string `json:"defaultprofile,omitempty"` - Defaultnonintrusiveprofile string `json:"defaultnonintrusiveprofile,omitempty"` - Javascriptname string `json:"javascriptname,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Dfprequestlimit int `json:"dfprequestlimit,omitempty"` - Signatureautoupdate string `json:"signatureautoupdate,omitempty"` - Signatureurl string `json:"signatureurl,omitempty"` - Proxyserver string `json:"proxyserver,omitempty"` - Proxyport int `json:"proxyport,omitempty"` - Trapurlautogenerate string `json:"trapurlautogenerate,omitempty"` - Trapurlinterval int `json:"trapurlinterval,omitempty"` - Trapurllength int `json:"trapurllength,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + TypeField string `json:"type,omitempty"` } -type Botpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type BotpolicyBinding struct { + BotpolicyBotglobalBinding []interface{} `json:"botpolicy_botglobal_binding,omitempty"` + BotpolicyBotpolicylabelBinding []interface{} `json:"botpolicy_botpolicylabel_binding,omitempty"` + BotpolicyCsvserverBinding []interface{} `json:"botpolicy_csvserver_binding,omitempty"` + BotpolicyLbvserverBinding []interface{} `json:"botpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Botpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type BotprofileTrapinsertionurlBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotTrapUrl string `json:"bot_trap_url,omitempty"` + BotTrapUrlInsertionEnabled string `json:"bot_trap_url_insertion_enabled,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` + Trapinsertionurl bool `json:"trapinsertionurl,omitempty"` } -type Botprofilebinding struct { - Name string `json:"name,omitempty"` +type BotprofileBinding struct { + BotprofileBlacklistBinding []interface{} `json:"botprofile_blacklist_binding,omitempty"` + BotprofileCaptchaBinding []interface{} `json:"botprofile_captcha_binding,omitempty"` + BotprofileIpreputationBinding []interface{} `json:"botprofile_ipreputation_binding,omitempty"` + BotprofileKmdetectionexprBinding []interface{} `json:"botprofile_kmdetectionexpr_binding,omitempty"` + BotprofileLogexpressionBinding []interface{} `json:"botprofile_logexpression_binding,omitempty"` + BotprofileRatelimitBinding []interface{} `json:"botprofile_ratelimit_binding,omitempty"` + BotprofileTpsBinding []interface{} `json:"botprofile_tps_binding,omitempty"` + BotprofileTrapinsertionurlBinding []interface{} `json:"botprofile_trapinsertionurl_binding,omitempty"` + BotprofileWhitelistBinding []interface{} `json:"botprofile_whitelist_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Botprofileipreputationbinding struct { - Botipreputation bool `json:"bot_ipreputation,omitempty"` - Category string `json:"category,omitempty"` - Botiprepenabled string `json:"bot_iprep_enabled,omitempty"` - Botiprepaction []string `json:"bot_iprep_action,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` +type Botpolicy struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Botprofiletrapinsertionurlbinding struct { - Trapinsertionurl bool `json:"trapinsertionurl,omitempty"` - Bottrapurl string `json:"bot_trap_url,omitempty"` - Bottrapurlinsertionenabled string `json:"bot_trap_url_insertion_enabled,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` - Logmessage string `json:"logmessage,omitempty"` +type BotpolicylabelBotpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Botprofilewhitelistbinding struct { - Botwhitelist bool `json:"bot_whitelist,omitempty"` - Botwhitelisttype string `json:"bot_whitelist_type,omitempty"` - Botwhitelistenabled string `json:"bot_whitelist_enabled,omitempty"` - Botwhitelistvalue string `json:"bot_whitelist_value,omitempty"` +type BotprofileWhitelistBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotWhitelist bool `json:"bot_whitelist,omitempty"` + BotWhitelistEnabled string `json:"bot_whitelist_enabled,omitempty"` + BotWhitelistType string `json:"bot_whitelist_type,omitempty"` + BotWhitelistValue string `json:"bot_whitelist_value,omitempty"` Log string `json:"log,omitempty"` Logmessage string `json:"logmessage,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` Name string `json:"name,omitempty"` } -type Botpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Botglobalbinding struct { +type BotglobalBinding struct { + BotglobalBotpolicyBinding []interface{} `json:"botglobal_botpolicy_binding,omitempty"` } -type Botglobalbotpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type BotprofileLogexpressionBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotLogExpressionEnabled string `json:"bot_log_expression_enabled,omitempty"` + BotLogExpressionName string `json:"bot_log_expression_name,omitempty"` + BotLogExpressionValue string `json:"bot_log_expression_value,omitempty"` + Logexpression bool `json:"logexpression,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` } -type Botpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Profilename string `json:"profilename,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Botpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` } -type Botprofilekmdetectionexprbinding struct { - Kmdetectionexpr bool `json:"kmdetectionexpr,omitempty"` - Botkmexpressionname string `json:"bot_km_expression_name,omitempty"` - Botkmexpressionvalue string `json:"bot_km_expression_value,omitempty"` - Botkmdetectionenabled string `json:"bot_km_detection_enabled,omitempty"` - Botbindcomment string `json:"bot_bind_comment,omitempty"` - Name string `json:"name,omitempty"` - Logmessage string `json:"logmessage,omitempty"` +type BotprofileCaptchaBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotCaptchaAction []string `json:"bot_captcha_action,omitempty"` + BotCaptchaEnabled string `json:"bot_captcha_enabled,omitempty"` + BotCaptchaUrl string `json:"bot_captcha_url,omitempty"` + Captcharesource bool `json:"captcharesource,omitempty"` + Graceperiod int `json:"graceperiod,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Muteperiod int `json:"muteperiod,omitempty"` + Name string `json:"name,omitempty"` + Requestsizelimit int `json:"requestsizelimit,omitempty"` + Retryattempts int `json:"retryattempts,omitempty"` + Waittime int `json:"waittime,omitempty"` } -type Botpolicybotglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type BotpolicyBotglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Botpolicypolicylabelbinding struct { +type BotpolicyBotpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Botprofile struct { - Name string `json:"name,omitempty"` - Signature string `json:"signature,omitempty"` - Errorurl string `json:"errorurl,omitempty"` - Trapurl string `json:"trapurl,omitempty"` - Comment string `json:"comment,omitempty"` - Botenablewhitelist string `json:"bot_enable_white_list,omitempty"` - Botenableblacklist string `json:"bot_enable_black_list,omitempty"` - Botenableratelimit string `json:"bot_enable_rate_limit,omitempty"` - Devicefingerprint string `json:"devicefingerprint,omitempty"` - Devicefingerprintaction []string `json:"devicefingerprintaction,omitempty"` - Botenableipreputation string `json:"bot_enable_ip_reputation,omitempty"` - Trap string `json:"trap,omitempty"` - Trapaction []string `json:"trapaction,omitempty"` - Signaturenouseragentheaderaction []string `json:"signaturenouseragentheaderaction,omitempty"` - Signaturemultipleuseragentheaderaction []string `json:"signaturemultipleuseragentheaderaction,omitempty"` - Botenabletps string `json:"bot_enable_tps,omitempty"` - Devicefingerprintmobile []string `json:"devicefingerprintmobile,omitempty"` - Headlessbrowserdetection string `json:"headlessbrowserdetection,omitempty"` - Clientipexpression string `json:"clientipexpression,omitempty"` - Kmjavascriptname string `json:"kmjavascriptname,omitempty"` - Kmdetection string `json:"kmdetection,omitempty"` - Kmeventspostbodylimit int `json:"kmeventspostbodylimit,omitempty"` - Verboseloglevel string `json:"verboseloglevel,omitempty"` - Spoofedreqaction []string `json:"spoofedreqaction,omitempty"` - Dfprequestlimit int `json:"dfprequestlimit,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Addcookieflags string `json:"addcookieflags,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type BotpolicylabelPolicybindingBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type BotprofileTpsBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotTps bool `json:"bot_tps,omitempty"` + BotTpsAction []string `json:"bot_tps_action,omitempty"` + BotTpsEnabled string `json:"bot_tps_enabled,omitempty"` + BotTpsType string `json:"bot_tps_type,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` + Percentage int `json:"percentage,omitempty"` + Threshold int `json:"threshold,omitempty"` +} + +type BotprofileRatelimitBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotRateLimitAction []string `json:"bot_rate_limit_action,omitempty"` + BotRateLimitEnabled string `json:"bot_rate_limit_enabled,omitempty"` + BotRateLimitType string `json:"bot_rate_limit_type,omitempty"` + BotRateLimitUrl string `json:"bot_rate_limit_url,omitempty"` + BotRatelimit bool `json:"bot_ratelimit,omitempty"` + Condition string `json:"condition,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Countrycode string `json:"countrycode,omitempty"` + Limittype string `json:"limittype,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` + Rate int `json:"rate,omitempty"` + Timeslice int `json:"timeslice,omitempty"` +} + +type BotprofileBlacklistBinding struct { + BotBindComment string `json:"bot_bind_comment,omitempty"` + BotBlacklist bool `json:"bot_blacklist,omitempty"` + BotBlacklistAction []string `json:"bot_blacklist_action,omitempty"` + BotBlacklistEnabled string `json:"bot_blacklist_enabled,omitempty"` + BotBlacklistType string `json:"bot_blacklist_type,omitempty"` + BotBlacklistValue string `json:"bot_blacklist_value,omitempty"` + Logmessage string `json:"logmessage,omitempty"` + Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/cache.go b/nitrogo/models/cache.go index 90e4a19..2f84093 100644 --- a/nitrogo/models/cache.go +++ b/nitrogo/models/cache.go @@ -1,348 +1,304 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Cacheglobalbinding struct { -} - -type Cacheglobalcachepolicybinding struct { - Policy string `json:"policy,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` +// cache configuration structs +type CachepolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Precededefrules string `json:"precededefrules,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cacheobject struct { - Url string `json:"url,omitempty"` - Locator int `json:"locator,omitempty"` - Httpstatus int `json:"httpstatus,omitempty"` - Host string `json:"host,omitempty"` - Port int `json:"port,omitempty"` - Groupname string `json:"groupname,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Group string `json:"group,omitempty"` - Ignoremarkerobjects string `json:"ignoremarkerobjects,omitempty"` - Includenotreadyobjects string `json:"includenotreadyobjects,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Tosecondary string `json:"tosecondary,omitempty"` - Cacheressize string `json:"cacheressize,omitempty"` - Cachereshdrsize string `json:"cachereshdrsize,omitempty"` - Cacheetag string `json:"cacheetag,omitempty"` - Httpstatusoutput string `json:"httpstatusoutput,omitempty"` - Cachereslastmod string `json:"cachereslastmod,omitempty"` - Cachecontrol string `json:"cachecontrol,omitempty"` - Cacheresdate string `json:"cacheresdate,omitempty"` - Contentgroup string `json:"contentgroup,omitempty"` - Destipv46 string `json:"destipv46,omitempty"` - Destport string `json:"destport,omitempty"` - Cachecellcomplex string `json:"cachecellcomplex,omitempty"` - Hitparams string `json:"hitparams,omitempty"` - Hitvalues string `json:"hitvalues,omitempty"` - Cachecellreqtime string `json:"cachecellreqtime,omitempty"` - Cachecellrestime string `json:"cachecellrestime,omitempty"` - Cachecurage string `json:"cachecurage,omitempty"` - Cachecellexpires string `json:"cachecellexpires,omitempty"` - Cachecellexpiresmillisec string `json:"cachecellexpiresmillisec,omitempty"` - Flushed string `json:"flushed,omitempty"` - Prefetch string `json:"prefetch,omitempty"` - Prefetchperiod string `json:"prefetchperiod,omitempty"` - Prefetchperiodmillisec string `json:"prefetchperiodmillisec,omitempty"` - Cachecellcurreaders string `json:"cachecellcurreaders,omitempty"` - Cachecellcurmisses string `json:"cachecellcurmisses,omitempty"` - Cachecellhits string `json:"cachecellhits,omitempty"` - Cachecellmisses string `json:"cachecellmisses,omitempty"` - Cachecelldhits string `json:"cachecelldhits,omitempty"` - Cachecellcompressionformat string `json:"cachecellcompressionformat,omitempty"` - Cachecellappfwmetadataexists string `json:"cachecellappfwmetadataexists,omitempty"` - Cachecellhttp11 string `json:"cachecellhttp11,omitempty"` - Cachecellweaketag string `json:"cachecellweaketag,omitempty"` - Cachecellresbadsize string `json:"cachecellresbadsize,omitempty"` - Markerreason string `json:"markerreason,omitempty"` - Cachecellpolleverytime string `json:"cachecellpolleverytime,omitempty"` - Cachecelletaginserted string `json:"cachecelletaginserted,omitempty"` - Cachecellreadywithlastbyte string `json:"cachecellreadywithlastbyte,omitempty"` - Cacheinmemory string `json:"cacheinmemory,omitempty"` - Cacheindisk string `json:"cacheindisk,omitempty"` - Cacheinsecondary string `json:"cacheinsecondary,omitempty"` - Cachedirname string `json:"cachedirname,omitempty"` - Cachefilename string `json:"cachefilename,omitempty"` - Cachecelldestipverified string `json:"cachecelldestipverified,omitempty"` - Cachecellfwpxyobj string `json:"cachecellfwpxyobj,omitempty"` - Cachecellbasefile string `json:"cachecellbasefile,omitempty"` - Cachecellminhitflag string `json:"cachecellminhitflag,omitempty"` - Cachecellminhit string `json:"cachecellminhit,omitempty"` - Policy string `json:"policy,omitempty"` - Policyname string `json:"policyname,omitempty"` - Selectorname string `json:"selectorname,omitempty"` - Rule string `json:"rule,omitempty"` - Selectorvalue string `json:"selectorvalue,omitempty"` - Cacheurls string `json:"cacheurls,omitempty"` - Warnbucketskip string `json:"warnbucketskip,omitempty"` - Totalobjs string `json:"totalobjs,omitempty"` - Httpcalloutcell string `json:"httpcalloutcell,omitempty"` - Httpcalloutname string `json:"httpcalloutname,omitempty"` - Returntype string `json:"returntype,omitempty"` - Httpcalloutresult string `json:"httpcalloutresult,omitempty"` - Locatorshow string `json:"locatorshow,omitempty"` - Ceflags string `json:"ceflags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type CacheglobalBinding struct { + CacheglobalCachepolicyBinding []interface{} `json:"cacheglobal_cachepolicy_binding,omitempty"` } -type Cacheparameter struct { - Memlimit int `json:"memlimit,omitempty"` - Via string `json:"via,omitempty"` - Verifyusing string `json:"verifyusing,omitempty"` - Maxpostlen int `json:"maxpostlen"` - Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` - Enablebypass string `json:"enablebypass,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Enablehaobjpersist string `json:"enablehaobjpersist,omitempty"` - Cacheevictionpolicy string `json:"cacheevictionpolicy,omitempty"` - Disklimit string `json:"disklimit,omitempty"` - Maxdisklimit string `json:"maxdisklimit,omitempty"` - Memlimitactive string `json:"memlimitactive,omitempty"` - Maxmemlimit string `json:"maxmemlimit,omitempty"` - Prefetchcur string `json:"prefetchcur,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type CachepolicyCachepolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } type Cachepolicy struct { - Policyname string `json:"policyname,omitempty"` - Rule string `json:"rule,omitempty"` Action string `json:"action,omitempty"` - Storeingroup string `json:"storeingroup,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Flags int `json:"flags,omitempty"` + Hits int `json:"hits,omitempty"` Invalgroups []string `json:"invalgroups,omitempty"` Invalobjects []string `json:"invalobjects,omitempty"` - Undefaction string `json:"undefaction,omitempty"` Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Flags string `json:"flags,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policyname string `json:"policyname,omitempty"` + Rule string `json:"rule,omitempty"` + Storeingroup string `json:"storeingroup,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Cachepolicybinding struct { - Policyname string `json:"policyname,omitempty"` -} - -type Cachepolicycacheglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type CachepolicyCacheglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` -} - -type Cachepolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Cachecontentgroup struct { - Name string `json:"name,omitempty"` - Weakposrelexpiry int `json:"weakposrelexpiry"` - Heurexpiryparam int `json:"heurexpiryparam"` - Relexpiry int `json:"relexpiry"` - Relexpirymillisec int `json:"relexpirymillisec"` - Absexpiry []string `json:"absexpiry,omitempty"` - Absexpirygmt []string `json:"absexpirygmt,omitempty"` - Weaknegrelexpiry int `json:"weaknegrelexpiry"` - Hitparams []string `json:"hitparams,omitempty"` - Invalparams []string `json:"invalparams,omitempty"` - Ignoreparamvaluecase string `json:"ignoreparamvaluecase,omitempty"` - Matchcookies string `json:"matchcookies,omitempty"` - Invalrestrictedtohost string `json:"invalrestrictedtohost,omitempty"` - Polleverytime string `json:"polleverytime,omitempty"` - Ignorereloadreq string `json:"ignorereloadreq,omitempty"` - Removecookies string `json:"removecookies,omitempty"` - Prefetch string `json:"prefetch,omitempty"` - Prefetchperiod int `json:"prefetchperiod"` - Prefetchperiodmillisec int `json:"prefetchperiodmillisec"` - Prefetchmaxpending int `json:"prefetchmaxpending"` - Flashcache string `json:"flashcache,omitempty"` - Expireatlastbyte string `json:"expireatlastbyte,omitempty"` - Insertvia string `json:"insertvia,omitempty"` - Insertage string `json:"insertage,omitempty"` - Insertetag string `json:"insertetag,omitempty"` - Cachecontrol string `json:"cachecontrol,omitempty"` - Quickabortsize int `json:"quickabortsize"` - Minressize int `json:"minressize"` - Maxressize int `json:"maxressize,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Ignorereqcachinghdrs string `json:"ignorereqcachinghdrs,omitempty"` - Minhits int `json:"minhits"` - Alwaysevalpolicies string `json:"alwaysevalpolicies,omitempty"` - Persistha string `json:"persistha,omitempty"` - Pinned string `json:"pinned,omitempty"` - Lazydnsresolve string `json:"lazydnsresolve,omitempty"` - Hitselector string `json:"hitselector,omitempty"` - Invalselector string `json:"invalselector,omitempty"` - Type string `json:"type,omitempty"` - Query string `json:"query,omitempty"` - Host string `json:"host,omitempty"` - Selectorvalue string `json:"selectorvalue,omitempty"` - Tosecondary string `json:"tosecondary,omitempty"` - Flags string `json:"flags,omitempty"` - Prefetchcur string `json:"prefetchcur,omitempty"` - Memusage string `json:"memusage,omitempty"` - Memdusage string `json:"memdusage,omitempty"` - Disklimit string `json:"disklimit,omitempty"` - Cachenon304hits string `json:"cachenon304hits,omitempty"` - Cache304hits string `json:"cache304hits,omitempty"` - Cachecells string `json:"cachecells,omitempty"` - Cachegroupincarnation string `json:"cachegroupincarnation,omitempty"` - Persist string `json:"persist,omitempty"` - Policyname string `json:"policyname,omitempty"` - Cachenuminvalpolicy string `json:"cachenuminvalpolicy,omitempty"` - Markercells string `json:"markercells,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cacheforwardproxy struct { - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cachepolicycsvserverbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` -} - -type Cachepolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cachepolicypolicylabelbinding struct { +type CachepolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cachepolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Evaluates string `json:"evaluates,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Cacheparameter struct { + Cacheevictionpolicy string `json:"cacheevictionpolicy,omitempty"` + Disklimit int `json:"disklimit,omitempty"` + Enablebypass string `json:"enablebypass,omitempty"` + Enablehaobjpersist string `json:"enablehaobjpersist,omitempty"` + Maxdisklimit int `json:"maxdisklimit,omitempty"` + Maxmemlimit int `json:"maxmemlimit,omitempty"` + Maxpostlen int `json:"maxpostlen,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Memlimitactive int `json:"memlimitactive,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Prefetchcur int `json:"prefetchcur,omitempty"` + Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Verifyusing string `json:"verifyusing,omitempty"` + Via string `json:"via,omitempty"` } -type Cachepolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type CachepolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type CachepolicyBinding struct { + CachepolicyCacheglobalBinding []interface{} `json:"cachepolicy_cacheglobal_binding,omitempty"` + CachepolicyCachepolicylabelBinding []interface{} `json:"cachepolicy_cachepolicylabel_binding,omitempty"` + CachepolicyCsvserverBinding []interface{} `json:"cachepolicy_csvserver_binding,omitempty"` + CachepolicyLbvserverBinding []interface{} `json:"cachepolicy_lbvserver_binding,omitempty"` + Policyname string `json:"policyname,omitempty"` } type Cacheselector struct { - Selectorname string `json:"selectorname,omitempty"` - Rule []string `json:"rule,omitempty"` - Flags string `json:"flags,omitempty"` - Builtin string `json:"builtin,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` + Flags int `json:"flags,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule []string `json:"rule,omitempty"` + Selectorname string `json:"selectorname,omitempty"` } -type Cacheglobalpolicybinding struct { - Policy string `json:"policy,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type Cachepolicylabel struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Evaluates string `json:"evaluates,omitempty"` + Feature string `json:"feature,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type CacheglobalCachepolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policy string `json:"policy,omitempty"` Precededefrules string `json:"precededefrules,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Cachepolicycachepolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` +type Cacheobject struct { + Cachecellappfwmetadataexists string `json:"cachecellappfwmetadataexists,omitempty"` + Cachecellbasefile string `json:"cachecellbasefile,omitempty"` + Cachecellcomplex string `json:"cachecellcomplex,omitempty"` + Cachecellcompressionformat string `json:"cachecellcompressionformat,omitempty"` + Cachecellcurmisses int `json:"cachecellcurmisses,omitempty"` + Cachecellcurreaders int `json:"cachecellcurreaders,omitempty"` + Cachecelldestipverified string `json:"cachecelldestipverified,omitempty"` + Cachecelldhits int `json:"cachecelldhits,omitempty"` + Cachecelletaginserted string `json:"cachecelletaginserted,omitempty"` + Cachecellexpires int `json:"cachecellexpires,omitempty"` + Cachecellexpiresmillisec int `json:"cachecellexpiresmillisec,omitempty"` + Cachecellfwpxyobj string `json:"cachecellfwpxyobj,omitempty"` + Cachecellhits int `json:"cachecellhits,omitempty"` + Cachecellhttp11 string `json:"cachecellhttp11,omitempty"` + Cachecellminhit int `json:"cachecellminhit,omitempty"` + Cachecellminhitflag string `json:"cachecellminhitflag,omitempty"` + Cachecellmisses int `json:"cachecellmisses,omitempty"` + Cachecellpolleverytime string `json:"cachecellpolleverytime,omitempty"` + Cachecellreadywithlastbyte string `json:"cachecellreadywithlastbyte,omitempty"` + Cachecellreqtime int `json:"cachecellreqtime,omitempty"` + Cachecellresbadsize string `json:"cachecellresbadsize,omitempty"` + Cachecellrestime int `json:"cachecellrestime,omitempty"` + Cachecellweaketag string `json:"cachecellweaketag,omitempty"` + Cachecontrol string `json:"cachecontrol,omitempty"` + Cachecurage int `json:"cachecurage,omitempty"` + Cachedirname string `json:"cachedirname,omitempty"` + Cacheetag string `json:"cacheetag,omitempty"` + Cachefilename string `json:"cachefilename,omitempty"` + Cacheindisk string `json:"cacheindisk,omitempty"` + Cacheinmemory string `json:"cacheinmemory,omitempty"` + Cacheinsecondary string `json:"cacheinsecondary,omitempty"` + Cacheresdate string `json:"cacheresdate,omitempty"` + Cachereshdrsize int `json:"cachereshdrsize,omitempty"` + Cachereslastmod string `json:"cachereslastmod,omitempty"` + Cacheressize int `json:"cacheressize,omitempty"` + Cacheurls string `json:"cacheurls,omitempty"` + Ceflags int `json:"ceflags,omitempty"` + Contentgroup string `json:"contentgroup,omitempty"` + Count float64 `json:"__count,omitempty"` + Destipv46 string `json:"destipv46,omitempty"` + Destport int `json:"destport,omitempty"` + Flushed string `json:"flushed,omitempty"` + Group string `json:"group,omitempty"` + Groupname string `json:"groupname,omitempty"` + Hitparams []string `json:"hitparams,omitempty"` + Hitvalues []string `json:"hitvalues,omitempty"` + Host string `json:"host,omitempty"` + Httpcalloutcell string `json:"httpcalloutcell,omitempty"` + Httpcalloutname string `json:"httpcalloutname,omitempty"` + Httpcalloutresult string `json:"httpcalloutresult,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httpstatus int `json:"httpstatus,omitempty"` + Httpstatusoutput int `json:"httpstatusoutput,omitempty"` + Ignoremarkerobjects string `json:"ignoremarkerobjects,omitempty"` + Includenotreadyobjects string `json:"includenotreadyobjects,omitempty"` + Locator int `json:"locator,omitempty"` + Locatorshow int `json:"locatorshow,omitempty"` + Markerreason string `json:"markerreason,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Policy int `json:"policy,omitempty"` + Policyname string `json:"policyname,omitempty"` + Port int `json:"port,omitempty"` + Prefetch string `json:"prefetch,omitempty"` + Prefetchperiod int `json:"prefetchperiod,omitempty"` + Prefetchperiodmillisec int `json:"prefetchperiodmillisec,omitempty"` + Returntype string `json:"returntype,omitempty"` + Rule []string `json:"rule,omitempty"` + Selectorname []string `json:"selectorname,omitempty"` + Selectorvalue []string `json:"selectorvalue,omitempty"` + Tosecondary string `json:"tosecondary,omitempty"` + Totalobjs int `json:"totalobjs,omitempty"` + Url string `json:"url,omitempty"` + Warnbucketskip int `json:"warnbucketskip,omitempty"` } -type Cachepolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachepolicylabelBinding struct { + CachepolicylabelCachepolicyBinding []interface{} `json:"cachepolicylabel_cachepolicy_binding,omitempty"` + CachepolicylabelPolicybindingBinding []interface{} `json:"cachepolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Cachepolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type CachepolicylabelCachepolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cachepolicylabelcachepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` +type Cachecontentgroup struct { + Absexpiry []string `json:"absexpiry,omitempty"` + Absexpirygmt []string `json:"absexpirygmt,omitempty"` + Alwaysevalpolicies string `json:"alwaysevalpolicies,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cache304hits int `json:"cache304hits,omitempty"` + Cachecells int `json:"cachecells,omitempty"` + Cachecontrol string `json:"cachecontrol,omitempty"` + Cachegroupincarnation int `json:"cachegroupincarnation,omitempty"` + Cachenon304hits int `json:"cachenon304hits,omitempty"` + Cachenuminvalpolicy int `json:"cachenuminvalpolicy,omitempty"` + Count float64 `json:"__count,omitempty"` + Disklimit int `json:"disklimit,omitempty"` + Expireatlastbyte string `json:"expireatlastbyte,omitempty"` + Feature string `json:"feature,omitempty"` + Flags int `json:"flags,omitempty"` + Flashcache string `json:"flashcache,omitempty"` + Heurexpiryparam int `json:"heurexpiryparam,omitempty"` + Hitparams []string `json:"hitparams,omitempty"` + Hitselector string `json:"hitselector,omitempty"` + Host string `json:"host,omitempty"` + Ignoreparamvaluecase string `json:"ignoreparamvaluecase,omitempty"` + Ignorereloadreq string `json:"ignorereloadreq,omitempty"` + Ignorereqcachinghdrs string `json:"ignorereqcachinghdrs,omitempty"` + Insertage string `json:"insertage,omitempty"` + Insertetag string `json:"insertetag,omitempty"` + Insertvia string `json:"insertvia,omitempty"` + Invalparams []string `json:"invalparams,omitempty"` + Invalrestrictedtohost string `json:"invalrestrictedtohost,omitempty"` + Invalselector string `json:"invalselector,omitempty"` + Lazydnsresolve string `json:"lazydnsresolve,omitempty"` + Markercells int `json:"markercells,omitempty"` + Matchcookies string `json:"matchcookies,omitempty"` + Maxressize int `json:"maxressize,omitempty"` + Memdusage int `json:"memdusage,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Memusage int `json:"memusage,omitempty"` + Minhits int `json:"minhits,omitempty"` + Minressize int `json:"minressize,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Persist string `json:"persist,omitempty"` + Persistha string `json:"persistha,omitempty"` + Pinned string `json:"pinned,omitempty"` + Policyname []string `json:"policyname,omitempty"` + Polleverytime string `json:"polleverytime,omitempty"` + Prefetch string `json:"prefetch,omitempty"` + Prefetchcur int `json:"prefetchcur,omitempty"` + Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` + Prefetchperiod int `json:"prefetchperiod,omitempty"` + Prefetchperiodmillisec int `json:"prefetchperiodmillisec,omitempty"` + Query string `json:"query,omitempty"` + Quickabortsize int `json:"quickabortsize,omitempty"` + Relexpiry int `json:"relexpiry,omitempty"` + Relexpirymillisec int `json:"relexpirymillisec,omitempty"` + Removecookies string `json:"removecookies,omitempty"` + Selectorvalue string `json:"selectorvalue,omitempty"` + Tosecondary string `json:"tosecondary,omitempty"` + TypeField string `json:"type,omitempty"` + Weaknegrelexpiry int `json:"weaknegrelexpiry,omitempty"` + Weakposrelexpiry int `json:"weakposrelexpiry,omitempty"` } -type Cachepolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` +type Cacheforwardproxy struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` } diff --git a/nitrogo/models/cloud.go b/nitrogo/models/cloud.go index 3eebb3a..716d203 100644 --- a/nitrogo/models/cloud.go +++ b/nitrogo/models/cloud.go @@ -1,86 +1,88 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Cloudservice struct { - Response string `json:"response,omitempty"` -} - -type Cloudvserverip struct { - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cloudautoscalegroup struct { - Name string `json:"name,omitempty"` - Azcount string `json:"azcount,omitempty"` - Aznames string `json:"aznames,omitempty"` - Graceful string `json:"graceful,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// cloud configuration structs type Cloudcredential struct { - Tenantidentifier string `json:"tenantidentifier,omitempty"` Applicationid string `json:"applicationid,omitempty"` Applicationsecret string `json:"applicationsecret,omitempty"` - Isset string `json:"isset,omitempty"` + Isset int `json:"isset,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tenantidentifier string `json:"tenantidentifier,omitempty"` } type Cloudngsparameter struct { - Blockonallowedngstktprof string `json:"blockonallowedngstktprof,omitempty"` + Allowdtls12 string `json:"allowdtls12,omitempty"` Allowedudtversion string `json:"allowedudtversion,omitempty"` + Blockonallowedngstktprof string `json:"blockonallowedngstktprof,omitempty"` Csvserverticketingdecouple string `json:"csvserverticketingdecouple,omitempty"` - Allowdtls12 string `json:"allowdtls12,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Cloudparaminternal struct { - Nonftumode string `json:"nonftumode,omitempty"` - Iamperm string `json:"iamperm,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cloudallowedngsticketprofile struct { - Name string `json:"name,omitempty"` - Creator string `json:"creator,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - type Cloudawsparam struct { - Rolearn string `json:"rolearn,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rolearn string `json:"rolearn,omitempty"` } type Cloudparameter struct { + Activationcode string `json:"activationcode,omitempty"` + Connectorresidence string `json:"connectorresidence,omitempty"` + Controlconnectionstatus string `json:"controlconnectionstatus,omitempty"` Controllerfqdn string `json:"controllerfqdn,omitempty"` Controllerport int `json:"controllerport,omitempty"` - Instanceid string `json:"instanceid,omitempty"` Customerid string `json:"customerid,omitempty"` - Resourcelocation string `json:"resourcelocation,omitempty"` - Activationcode string `json:"activationcode,omitempty"` Deployment string `json:"deployment,omitempty"` - Connectorresidence string `json:"connectorresidence,omitempty"` - Controlconnectionstatus string `json:"controlconnectionstatus,omitempty"` + Instanceid string `json:"instanceid,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Resourcelocation string `json:"resourcelocation,omitempty"` +} + +type Cloudallowedngsticketprofile struct { + Count float64 `json:"__count,omitempty"` + Creator string `json:"creator,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudservice struct { + Response string `json:"response,omitempty"` +} + +type Cloudparaminternal struct { + Count float64 `json:"__count,omitempty"` + Iamperm string `json:"iamperm,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nonftumode string `json:"nonftumode,omitempty"` } type Cloudprofile struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Boundservicegroupsvctype string `json:"boundservicegroupsvctype,omitempty"` - Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` - Graceful string `json:"graceful,omitempty"` - Delay int `json:"delay,omitempty"` - Azuretagname string `json:"azuretagname,omitempty"` - Azuretagvalue string `json:"azuretagvalue,omitempty"` - Azurepollperiod int `json:"azurepollperiod,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Azurepollperiod int `json:"azurepollperiod,omitempty"` + Azuretagname string `json:"azuretagname,omitempty"` + Azuretagvalue string `json:"azuretagvalue,omitempty"` + Boundservicegroupsvctype string `json:"boundservicegroupsvctype,omitempty"` + Count float64 `json:"__count,omitempty"` + Delay int `json:"delay,omitempty"` + Graceful string `json:"graceful,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` + Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` +} + +type Cloudautoscalegroup struct { + Azcount int `json:"azcount,omitempty"` + Aznames []string `json:"aznames,omitempty"` + Count float64 `json:"__count,omitempty"` + Graceful string `json:"graceful,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudvserverip struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/cloudtunnel.go b/nitrogo/models/cloudtunnel.go index 298ccbd..8f6cd55 100644 --- a/nitrogo/models/cloudtunnel.go +++ b/nitrogo/models/cloudtunnel.go @@ -1,30 +1,28 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Cloudtunnelvserver struct { - Name string `json:"name,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - State string `json:"state,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Type string `json:"type,omitempty"` - Ip string `json:"ip,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Ippattern string `json:"ippattern,omitempty"` - Port string `json:"port,omitempty"` - Range string `json:"range,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// cloudtunnel configuration structs type Cloudtunnelparameter struct { Controllerfqdn string `json:"controllerfqdn,omitempty"` Fqdn string `json:"fqdn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Resourcelocation string `json:"resourcelocation,omitempty"` Subnetresourcelocationmappings string `json:"subnetresourcelocationmappings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Cloudtunnelvserver struct { + Cachetype string `json:"cachetype,omitempty"` + Count float64 `json:"__count,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Ip string `json:"ip,omitempty"` + Ippattern string `json:"ippattern,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Range int `json:"range,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/cluster.go b/nitrogo/models/cluster.go index 5256219..248852d 100644 --- a/nitrogo/models/cluster.go +++ b/nitrogo/models/cluster.go @@ -1,246 +1,219 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Clusternodegroup struct { - Name string `json:"name,omitempty"` - Strict string `json:"strict,omitempty"` - Sticky string `json:"sticky,omitempty"` - State string `json:"state,omitempty"` - Priority int `json:"priority,omitempty"` - Currentnodemask string `json:"currentnodemask,omitempty"` - Backupnodemask string `json:"backupnodemask,omitempty"` - Boundedentitiescntfrompe string `json:"boundedentitiescntfrompe,omitempty"` - Activelist string `json:"activelist,omitempty"` - Backuplist string `json:"backuplist,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Clusternodegroupauthenticationvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Name string `json:"name,omitempty"` -} - -type Clusternodegroupcsvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Name string `json:"name,omitempty"` +// cluster configuration structs +type ClusternodeBinding struct { + ClusternodeRoutemonitorBinding []interface{} `json:"clusternode_routemonitor_binding,omitempty"` + Nodeid int `json:"nodeid,omitempty"` } -type Clusternodegrouplimitidentifierbinding struct { +type Clusternode struct { + Backplane string `json:"backplane,omitempty"` + Cfgflags int `json:"cfgflags,omitempty"` + Clearnodegroupconfig string `json:"clearnodegroupconfig,omitempty"` + Clusterhealth string `json:"clusterhealth,omitempty"` + Count float64 `json:"__count,omitempty"` + Delay int `json:"delay,omitempty"` + Disabledifaces string `json:"disabledifaces,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Enabledifaces string `json:"enabledifaces,omitempty"` + Force bool `json:"force,omitempty"` + Hamonifaces string `json:"hamonifaces,omitempty"` + Health string `json:"health,omitempty"` + Ifaceslist []string `json:"ifaceslist,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` + Islocalnode bool `json:"islocalnode,omitempty"` + Masterstate string `json:"masterstate,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodegroup string `json:"nodegroup,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` + Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` + Nodelist []interface{} `json:"nodelist,omitempty"` + Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` + Operationalsyncstate string `json:"operationalsyncstate,omitempty"` + Partialfailifaces string `json:"partialfailifaces,omitempty"` + Priority int `json:"priority,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` + State string `json:"state,omitempty"` + Syncfailurereason string `json:"syncfailurereason,omitempty"` + Syncstate string `json:"syncstate,omitempty"` + Tunnelmode string `json:"tunnelmode,omitempty"` +} + +type ClusternodegroupStreamidentifierBinding struct { Identifiername string `json:"identifiername,omitempty"` Name string `json:"name,omitempty"` } -type Clusternodegroupvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Name string `json:"name,omitempty"` -} - -type Clustersyncfailures struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Cluster struct { + Clip string `json:"clip,omitempty"` + Password string `json:"password,omitempty"` } type Clusterinstance struct { - Clid int `json:"clid,omitempty"` - Deadinterval int `json:"deadinterval,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Preemption string `json:"preemption,omitempty"` - Quorumtype string `json:"quorumtype,omitempty"` - Inc string `json:"inc,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` - Backplanebasedview string `json:"backplanebasedview,omitempty"` - Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` - Dfdretainl2params string `json:"dfdretainl2params,omitempty"` - Clusterproxyarp string `json:"clusterproxyarp,omitempty"` - Secureheartbeats string `json:"secureheartbeats,omitempty"` - Nodegroup string `json:"nodegroup,omitempty"` - Adminstate string `json:"adminstate,omitempty"` - Propstate string `json:"propstate,omitempty"` - Validmtu string `json:"validmtu,omitempty"` - Heterogeneousflag string `json:"heterogeneousflag,omitempty"` - Operationalstate string `json:"operationalstate,omitempty"` - Status string `json:"status,omitempty"` - Rsskeymismatch string `json:"rsskeymismatch,omitempty"` - Penummismatch string `json:"penummismatch,omitempty"` - Nodegroupstatewarning string `json:"nodegroupstatewarning,omitempty"` - Licensemismatch string `json:"licensemismatch,omitempty"` - Jumbonotsupported string `json:"jumbonotsupported,omitempty"` - Clustertunnelmodemismatch string `json:"clustertunnelmodemismatch,omitempty"` - Clusternoheartbeatonnode string `json:"clusternoheartbeatonnode,omitempty"` - Clusternolinksetmbf string `json:"clusternolinksetmbf,omitempty"` - Clusternospottedip string `json:"clusternospottedip,omitempty"` - Clusterclipfailure string `json:"clusterclipfailure,omitempty"` - Clusterhbhmacerrordetected string `json:"clusterhbhmacerrordetected,omitempty"` - Nodepenummismatch string `json:"nodepenummismatch,omitempty"` - Operationalpropstate string `json:"operationalpropstate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Clusterinstancenodebinding struct { - Nodeid uint32 `json:"nodeid,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Health string `json:"health,omitempty"` - Clusterhealth string `json:"clusterhealth,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Masterstate string `json:"masterstate,omitempty"` - State string `json:"state,omitempty"` - Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` - Islocalnode bool `json:"islocalnode,omitempty"` - Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` - Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` - Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` - Clid uint32 `json:"clid,omitempty"` + Adminstate string `json:"adminstate,omitempty"` + Backplanebasedview string `json:"backplanebasedview,omitempty"` + Clid int `json:"clid,omitempty"` + Clusterclipfailure bool `json:"clusterclipfailure,omitempty"` + Clusterhbhmacerrordetected bool `json:"clusterhbhmacerrordetected,omitempty"` + Clusternoheartbeatonnode bool `json:"clusternoheartbeatonnode,omitempty"` + Clusternolinksetmbf bool `json:"clusternolinksetmbf,omitempty"` + Clusternospottedip bool `json:"clusternospottedip,omitempty"` + Clusterproxyarp string `json:"clusterproxyarp,omitempty"` + Clustertunnelmodemismatch bool `json:"clustertunnelmodemismatch,omitempty"` + Count float64 `json:"__count,omitempty"` + Deadinterval int `json:"deadinterval,omitempty"` + Dfdretainl2params string `json:"dfdretainl2params,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Heterogeneousflag string `json:"heterogeneousflag,omitempty"` + Inc string `json:"inc,omitempty"` + Jumbonotsupported bool `json:"jumbonotsupported,omitempty"` + Licensemismatch bool `json:"licensemismatch,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodegroup string `json:"nodegroup,omitempty"` + Nodegroupstatewarning bool `json:"nodegroupstatewarning,omitempty"` + Nodepenummismatch bool `json:"nodepenummismatch,omitempty"` + Operationalpropstate string `json:"operationalpropstate,omitempty"` + Operationalstate string `json:"operationalstate,omitempty"` + Penummismatch bool `json:"penummismatch,omitempty"` + Preemption string `json:"preemption,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Propstate string `json:"propstate,omitempty"` + Quorumtype string `json:"quorumtype,omitempty"` + Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` + Rsskeymismatch bool `json:"rsskeymismatch,omitempty"` + Secureheartbeats string `json:"secureheartbeats,omitempty"` + Status string `json:"status,omitempty"` + Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` + Validmtu int `json:"validmtu,omitempty"` +} + +type ClusternodeRoutemonitorBinding struct { + Netmask string `json:"netmask,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` + Routemonstate int `json:"routemonstate,omitempty"` } -type Clusternodegroupcrvserverbinding struct { - Vserver string `json:"vserver,omitempty"` +type ClusternodegroupGslbvserverBinding struct { Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Clusternodegroupnslimitidentifierbinding struct { - Identifiername string `json:"identifiername,omitempty"` - Name string `json:"name,omitempty"` -} - -type Clusterfiles struct { - Mode []string `json:"mode,omitempty"` -} - -type Clusterinstancebinding struct { - Clid int `json:"clid,omitempty"` +type ClusternodegroupBinding struct { + ClusternodegroupAuthenticationvserverBinding []interface{} `json:"clusternodegroup_authenticationvserver_binding,omitempty"` + ClusternodegroupClusternodeBinding []interface{} `json:"clusternodegroup_clusternode_binding,omitempty"` + ClusternodegroupCrvserverBinding []interface{} `json:"clusternodegroup_crvserver_binding,omitempty"` + ClusternodegroupCsvserverBinding []interface{} `json:"clusternodegroup_csvserver_binding,omitempty"` + ClusternodegroupGslbsiteBinding []interface{} `json:"clusternodegroup_gslbsite_binding,omitempty"` + ClusternodegroupGslbvserverBinding []interface{} `json:"clusternodegroup_gslbvserver_binding,omitempty"` + ClusternodegroupLbvserverBinding []interface{} `json:"clusternodegroup_lbvserver_binding,omitempty"` + ClusternodegroupNslimitidentifierBinding []interface{} `json:"clusternodegroup_nslimitidentifier_binding,omitempty"` + ClusternodegroupServiceBinding []interface{} `json:"clusternodegroup_service_binding,omitempty"` + ClusternodegroupStreamidentifierBinding []interface{} `json:"clusternodegroup_streamidentifier_binding,omitempty"` + ClusternodegroupVpnvserverBinding []interface{} `json:"clusternodegroup_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Clusternodegroupnodebinding struct { - Node uint32 `json:"node,omitempty"` - Name string `json:"name,omitempty"` +type ClusternodegroupAuthenticationvserverBinding struct { + Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Clusternodegroupgslbvserverbinding struct { - Vserver string `json:"vserver,omitempty"` +type ClusternodegroupLbvserverBinding struct { Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Clusternodegrouplbvserverbinding struct { - Vserver string `json:"vserver,omitempty"` +type ClusternodegroupCrvserverBinding struct { Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Clusternodegroupvpnvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Name string `json:"name,omitempty"` +type ClusternodegroupNslimitidentifierBinding struct { + Identifiername string `json:"identifiername,omitempty"` + Name string `json:"name,omitempty"` } -type Cluster struct { - Clip string `json:"clip,omitempty"` - Password string `json:"password,omitempty"` +type Clustersync struct { } -type Clusternode struct { - Nodeid int `json:"nodeid"` - Ipaddress string `json:"ipaddress,omitempty"` - State string `json:"state,omitempty"` - Backplane string `json:"backplane,omitempty"` - Priority int `json:"priority,omitempty"` - Nodegroup string `json:"nodegroup,omitempty"` - Delay int `json:"delay,omitempty"` - Tunnelmode string `json:"tunnelmode,omitempty"` - Clearnodegroupconfig string `json:"clearnodegroupconfig,omitempty"` - Force bool `json:"force,omitempty"` - Clusterhealth string `json:"clusterhealth,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Operationalsyncstate string `json:"operationalsyncstate,omitempty"` - Syncfailurereason string `json:"syncfailurereason,omitempty"` - Masterstate string `json:"masterstate,omitempty"` - Health string `json:"health,omitempty"` - Syncstate string `json:"syncstate,omitempty"` - Isconfigurationcoordinator string `json:"isconfigurationcoordinator,omitempty"` - Islocalnode string `json:"islocalnode,omitempty"` - Nodersskeymismatch string `json:"nodersskeymismatch,omitempty"` - Nodelicensemismatch string `json:"nodelicensemismatch,omitempty"` - Nodejumbonotsupported string `json:"nodejumbonotsupported,omitempty"` - Nodelist string `json:"nodelist,omitempty"` - Ifaceslist string `json:"ifaceslist,omitempty"` - Enabledifaces string `json:"enabledifaces,omitempty"` - Disabledifaces string `json:"disabledifaces,omitempty"` - Partialfailifaces string `json:"partialfailifaces,omitempty"` - Hamonifaces string `json:"hamonifaces,omitempty"` - Name string `json:"name,omitempty"` - Cfgflags string `json:"cfgflags,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Clusternodegroupgslbsitebinding struct { +type ClusternodegroupGslbsiteBinding struct { Gslbsite string `json:"gslbsite,omitempty"` Name string `json:"name,omitempty"` } -type Clusternodegroupservicebinding struct { - Service string `json:"service,omitempty"` +type ClusternodegroupServiceBinding struct { Name string `json:"name,omitempty"` + Service string `json:"service,omitempty"` } -type Clustersync struct { -} - -type Clusterinstanceclusternodebinding struct { - Nodeid int `json:"nodeid,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Health string `json:"health,omitempty"` - Clusterhealth string `json:"clusterhealth,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Masterstate string `json:"masterstate,omitempty"` - State string `json:"state,omitempty"` - Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` - Islocalnode bool `json:"islocalnode,omitempty"` - Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` - Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` - Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` - Clid int `json:"clid,omitempty"` -} - -type Clusternodegroupclusternodebinding struct { - Node int `json:"node,omitempty"` +type Clusternodegroup struct { + Activelist []interface{} `json:"activelist,omitempty"` + Backuplist []interface{} `json:"backuplist,omitempty"` + Backupnodemask int `json:"backupnodemask,omitempty"` + Boundedentitiescntfrompe int `json:"boundedentitiescntfrompe,omitempty"` + Count float64 `json:"__count,omitempty"` + Currentnodemask int `json:"currentnodemask,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Sticky string `json:"sticky,omitempty"` + Strict string `json:"strict,omitempty"` +} + +type ClusternodegroupClusternodeBinding struct { Name string `json:"name,omitempty"` + Node int `json:"node,omitempty"` } -type Clusternodegroupidentifierbinding struct { - Identifiername string `json:"identifiername,omitempty"` - Name string `json:"name,omitempty"` +type Clustersyncfailures struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Clusternodegroupsitebinding struct { - Gslbsite string `json:"gslbsite,omitempty"` - Name string `json:"name,omitempty"` +type Clusterpropstatus struct { + Cmdstrs string `json:"cmdstrs,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Numpropcmdfailed int `json:"numpropcmdfailed,omitempty"` } -type Clusternodegroupstreamidentifierbinding struct { - Identifiername string `json:"identifiername,omitempty"` - Name string `json:"name,omitempty"` +type ClusterinstanceBinding struct { + Clid int `json:"clid,omitempty"` + ClusterinstanceClusternodeBinding []interface{} `json:"clusterinstance_clusternode_binding,omitempty"` } -type Clusterpropstatus struct { - Nodeid int `json:"nodeid,omitempty"` - Numpropcmdfailed string `json:"numpropcmdfailed,omitempty"` - Cmdstrs string `json:"cmdstrs,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Clusterfiles struct { + Mode []string `json:"mode,omitempty"` } -type Clusternodebinding struct { - Nodeid int `json:"nodeid,omitempty"` +type ClusterinstanceClusternodeBinding struct { + Clid int `json:"clid,omitempty"` + Clusterhealth string `json:"clusterhealth,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Health string `json:"health,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` + Islocalnode bool `json:"islocalnode,omitempty"` + Masterstate string `json:"masterstate,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` + Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` + Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` + State string `json:"state,omitempty"` } -type Clusternoderoutemonitorbinding struct { - Routemonitor string `json:"routemonitor,omitempty"` - Netmask string `json:"netmask,omitempty"` - Routemonstate int `json:"routemonstate,omitempty"` - Nodeid int `json:"nodeid,omitempty"` +type ClusternodegroupVpnvserverBinding struct { + Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Clusternodegroupbinding struct { - Name string `json:"name,omitempty"` +type ClusternodegroupCsvserverBinding struct { + Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } diff --git a/nitrogo/models/cmp.go b/nitrogo/models/cmp.go index 3744cb9..8fa76ed 100644 --- a/nitrogo/models/cmp.go +++ b/nitrogo/models/cmp.go @@ -1,219 +1,173 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// cmp configuration structs type Cmpparameter struct { - Cmplevel string `json:"cmplevel,omitempty"` - Quantumsize int `json:"quantumsize,omitempty"` - Servercmp string `json:"servercmp,omitempty"` - Heurexpiry string `json:"heurexpiry,omitempty"` - Heurexpirythres int `json:"heurexpirythres,omitempty"` - Heurexpiryhistwt int `json:"heurexpiryhistwt,omitempty"` - Minressize int `json:"minressize,omitempty"` - Cmpbypasspct int `json:"cmpbypasspct,omitempty"` - Cmponpush string `json:"cmponpush,omitempty"` - Policytype string `json:"policytype,omitempty"` - Addvaryheader string `json:"addvaryheader,omitempty"` - Varyheadervalue string `json:"varyheadervalue,omitempty"` - Externalcache string `json:"externalcache,omitempty"` - Randomgzipfilename string `json:"randomgzipfilename,omitempty"` - Randomgzipfilenameminlength int `json:"randomgzipfilenameminlength,omitempty"` - Randomgzipfilenamemaxlength int `json:"randomgzipfilenamemaxlength,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cmppolicycmpglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + Addvaryheader string `json:"addvaryheader,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cmpbypasspct int `json:"cmpbypasspct,omitempty"` + Cmplevel string `json:"cmplevel,omitempty"` + Cmponpush string `json:"cmponpush,omitempty"` + Externalcache string `json:"externalcache,omitempty"` + Feature string `json:"feature,omitempty"` + Heurexpiry string `json:"heurexpiry,omitempty"` + Heurexpiryhistwt int `json:"heurexpiryhistwt,omitempty"` + Heurexpirythres int `json:"heurexpirythres,omitempty"` + Minressize int `json:"minressize,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policytype string `json:"policytype,omitempty"` + Quantumsize int `json:"quantumsize,omitempty"` + Randomgzipfilename string `json:"randomgzipfilename,omitempty"` + Randomgzipfilenamemaxlength int `json:"randomgzipfilenamemaxlength,omitempty"` + Randomgzipfilenameminlength int `json:"randomgzipfilenameminlength,omitempty"` + Servercmp string `json:"servercmp,omitempty"` + Varyheadervalue string `json:"varyheadervalue,omitempty"` +} + +type CmpglobalBinding struct { + CmpglobalCmppolicyBinding []interface{} `json:"cmpglobal_cmppolicy_binding,omitempty"` +} + +type CmppolicyBinding struct { + CmppolicyCmpglobalBinding []interface{} `json:"cmppolicy_cmpglobal_binding,omitempty"` + CmppolicyCmppolicylabelBinding []interface{} `json:"cmppolicy_cmppolicylabel_binding,omitempty"` + CmppolicyCrvserverBinding []interface{} `json:"cmppolicy_crvserver_binding,omitempty"` + CmppolicyCsvserverBinding []interface{} `json:"cmppolicy_csvserver_binding,omitempty"` + CmppolicyLbvserverBinding []interface{} `json:"cmppolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type CmppolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Cmppolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Cmppolicylabelpolicybindingbinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Cmpglobalbinding struct { -} - -type Cmppolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Resaction string `json:"resaction,omitempty"` - Newname string `json:"newname,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Hits string `json:"hits,omitempty"` - Txbytes string `json:"txbytes,omitempty"` - Rxbytes string `json:"rxbytes,omitempty"` - Clientttlb string `json:"clientttlb,omitempty"` - Clienttransactions string `json:"clienttransactions,omitempty"` - Serverttlb string `json:"serverttlb,omitempty"` - Servertransactions string `json:"servertransactions,omitempty"` - Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cmppolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type CmppolicyCmppolicylabelBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Cmppolicypolicylabelbinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Cmppolicylabel struct { Labelname string `json:"labelname,omitempty"` - Type string `json:"type,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cmppolicylabelcmppolicybinding struct { - Policyname string `json:"policyname,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Cmppolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type CmpglobalCmppolicyBinding struct { + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Cmpglobalcmppolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Type string `json:"type,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` + TypeField string `json:"type,omitempty"` } -type Cmppolicybinding struct { - Name string `json:"name,omitempty"` +type Cmppolicy struct { + Builtin []string `json:"builtin,omitempty"` + Clienttransactions int `json:"clienttransactions,omitempty"` + Clientttlb int `json:"clientttlb,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Resaction string `json:"resaction,omitempty"` + Rule string `json:"rule,omitempty"` + Rxbytes int `json:"rxbytes,omitempty"` + Servertransactions int `json:"servertransactions,omitempty"` + Serverttlb int `json:"serverttlb,omitempty"` + Txbytes int `json:"txbytes,omitempty"` } -type Cmppolicycmppolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Cmpaction struct { + Addvaryheader string `json:"addvaryheader,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cmptype string `json:"cmptype,omitempty"` + Count float64 `json:"__count,omitempty"` + Deltatype string `json:"deltatype,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Varyheadervalue string `json:"varyheadervalue,omitempty"` +} + +type CmppolicyCmpglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cmppolicycrvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Cmppolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type CmppolicyCrvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cmppolicyglobalbinding struct { +type CmppolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cmpaction struct { - Name string `json:"name,omitempty"` - Cmptype string `json:"cmptype,omitempty"` - Addvaryheader string `json:"addvaryheader,omitempty"` - Varyheadervalue string `json:"varyheadervalue,omitempty"` - Deltatype string `json:"deltatype,omitempty"` - Newname string `json:"newname,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cmpglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Policytype string `json:"policytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type CmppolicylabelCmppolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cmppolicyvserverbinding struct { +type CmppolicyCsvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cmppolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type CmppolicylabelBinding struct { + CmppolicylabelCmppolicyBinding []interface{} `json:"cmppolicylabel_cmppolicy_binding,omitempty"` + CmppolicylabelPolicybindingBinding []interface{} `json:"cmppolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } diff --git a/nitrogo/models/contentinspection.go b/nitrogo/models/contentinspection.go index 9da872d..283323b 100644 --- a/nitrogo/models/contentinspection.go +++ b/nitrogo/models/contentinspection.go @@ -1,223 +1,192 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Contentinspectionpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Contentinspectionpolicycontentinspectionglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +// contentinspection configuration structs +type ContentinspectionpolicyContentinspectionglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Contentinspectionpolicycsvserverbinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Contentinspectionpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Contentinspectionpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type Contentinspectionpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Type string `json:"type,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Contentinspectionpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Contentinspectionglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type Contentinspectionwasmprofile struct { + Anomalousdatasize int `json:"anomalousdatasize,omitempty"` + Anomalousttfbtime int `json:"anomalousttfbtime,omitempty"` + Count float64 `json:"__count,omitempty"` + Maxbodylen int `json:"maxbodylen,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Timeout int `json:"timeout,omitempty"` + Timeoutaction string `json:"timeoutaction,omitempty"` + Wasmmodule string `json:"wasmmodule,omitempty"` +} + +type ContentinspectionpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Contentinspectionpolicycontentinspectionpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type ContentinspectionpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Contentinspectionpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Contentinspectioncallout struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Resultexpr string `json:"resultexpr,omitempty"` + Returntype string `json:"returntype,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Undefreason string `json:"undefreason,omitempty"` } type Contentinspectionprofile struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Ingressinterface string `json:"ingressinterface,omitempty"` - Ingressvlan int `json:"ingressvlan,omitempty"` - Egressinterface string `json:"egressinterface,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Egressvlan int `json:"egressvlan,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Egressinterface string `json:"egressinterface,omitempty"` + Egressvlan int `json:"egressvlan,omitempty"` + Ingressinterface string `json:"ingressinterface,omitempty"` + Ingressvlan int `json:"ingressvlan,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type ContentinspectionglobalContentinspectionpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Contentinspectioncallout struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Profilename string `json:"profilename,omitempty"` - Servername string `json:"servername,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Returntype string `json:"returntype,omitempty"` - Resultexpr string `json:"resultexpr,omitempty"` - Comment string `json:"comment,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Undefreason string `json:"undefreason,omitempty"` +type Contentinspectionparameter struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Undefaction string `json:"undefaction,omitempty"` } -type Contentinspectionpolicybinding struct { - Name string `json:"name,omitempty"` +type ContentinspectionpolicylabelBinding struct { + ContentinspectionpolicylabelContentinspectionpolicyBinding []interface{} `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding,omitempty"` + ContentinspectionpolicylabelPolicybindingBinding []interface{} `json:"contentinspectionpolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Contentinspectionpolicyglobalbinding struct { +type Contentinspectionaction struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Icapprofilename string `json:"icapprofilename,omitempty"` + Ifserverdown string `json:"ifserverdown,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Reqtimeout int `json:"reqtimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Serverport int `json:"serverport,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Wasmprofilename string `json:"wasmprofilename,omitempty"` +} + +type ContentinspectionpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` -} - -type Contentinspectionpolicylabelcontentinspectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Contentinspectionaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Servername string `json:"servername,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Icapprofilename string `json:"icapprofilename,omitempty"` - Ifserverdown string `json:"ifserverdown,omitempty"` - Reqtimeout string `json:"reqtimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Contentinspectionglobalbinding struct { +type ContentinspectionglobalBinding struct { + ContentinspectionglobalContentinspectionpolicyBinding []interface{} `json:"contentinspectionglobal_contentinspectionpolicy_binding,omitempty"` } -type Contentinspectionglobalcontentinspectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` +type ContentinspectionpolicyContentinspectionpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Contentinspectionparameter struct { - Undefaction string `json:"undefaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ContentinspectionpolicyBinding struct { + ContentinspectionpolicyContentinspectionglobalBinding []interface{} `json:"contentinspectionpolicy_contentinspectionglobal_binding,omitempty"` + ContentinspectionpolicyContentinspectionpolicylabelBinding []interface{} `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding,omitempty"` + ContentinspectionpolicyCsvserverBinding []interface{} `json:"contentinspectionpolicy_csvserver_binding,omitempty"` + ContentinspectionpolicyLbvserverBinding []interface{} `json:"contentinspectionpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Contentinspectionpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type ContentinspectionpolicylabelContentinspectionpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Contentinspectionpolicylabelpolicybindingbinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` +} + +type Contentinspectionpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } diff --git a/nitrogo/models/cr.go b/nitrogo/models/cr.go index 426adcc..7f97a21 100644 --- a/nitrogo/models/cr.go +++ b/nitrogo/models/cr.go @@ -1,370 +1,322 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Craction struct { - Name string `json:"name,omitempty"` - Crtype string `json:"crtype,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Crpolicybinding struct { - Policyname string `json:"policyname,omitempty"` -} - -type Crpolicycrvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Hits int `json:"hits,omitempty"` - Bindhits int `json:"bindhits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` +// cr configuration structs +type CrvserverAppqoepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverappflowpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type CrvserverCrpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Crvservercmppolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Inherited string `json:"inherited,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverCachepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverlbvserverbinding struct { - Lbvserver string `json:"lbvserver,omitempty"` - Hits int `json:"hits,omitempty"` - Name string `json:"name,omitempty"` +type CrpolicyBinding struct { + CrpolicyCrvserverBinding []interface{} `json:"crpolicy_crvserver_binding,omitempty"` + Policyname string `json:"policyname,omitempty"` } -type Crvserverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverCmppolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Inherited string `json:"inherited,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Inherited string `json:"inherited,omitempty"` - Sc string `json:"sc,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverprofilebinding struct { +type CrvserverAnalyticsprofileBinding struct { Analyticsprofile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type Crvservericapolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` +type CrvserverLbvserverBinding struct { + Hits int `json:"hits,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Name string `json:"name,omitempty"` } -type Crvservermapbinding struct { - Policyname string `json:"policyname,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Name string `json:"name,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverAppflowpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Crvserverpolicymapbinding struct { - Policyname string `json:"policyname,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverrewritepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverFeopolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` -} - -type Crpolicy struct { - Policyname string `json:"policyname,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Boundto string `json:"boundto,omitempty"` - Vstype string `json:"vstype,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Activepolicy string `json:"activepolicy,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Crpolicyvserverbinding struct { - Domain string `json:"domain,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Pihits uint32 `json:"pihits,omitempty"` - Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserver struct { - Name string `json:"name,omitempty"` - Td int `json:"td,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Port int `json:"port,omitempty"` - Ipset string `json:"ipset,omitempty"` - Range int `json:"range,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Redirect string `json:"redirect,omitempty"` - Onpolicymatch string `json:"onpolicymatch,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Precedence string `json:"precedence,omitempty"` - Arp string `json:"arp,omitempty"` - Ghost string `json:"ghost,omitempty"` - Map string `json:"map,omitempty"` - Format string `json:"format,omitempty"` - Via string `json:"via,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Destinationvserver string `json:"destinationvserver,omitempty"` - Domain string `json:"domain,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` - Reuse string `json:"reuse,omitempty"` - State string `json:"state,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Backendssl string `json:"backendssl,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Comment string `json:"comment,omitempty"` - Srcipexpr string `json:"srcipexpr,omitempty"` - Originusip string `json:"originusip,omitempty"` - Useportrange string `json:"useportrange,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Rhistate string `json:"rhistate,omitempty"` - Useoriginipportforcache string `json:"useoriginipportforcache,omitempty"` - Tcpprobeport int `json:"tcpprobeport,omitempty"` - Probeprotocol string `json:"probeprotocol,omitempty"` - Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` - Probeport int `json:"probeport,omitempty"` - Disallowserviceaccess string `json:"disallowserviceaccess,omitempty"` - Newname string `json:"newname,omitempty"` - Ip string `json:"ip,omitempty"` - Value string `json:"value,omitempty"` - Ngname string `json:"ngname,omitempty"` - Type string `json:"type,omitempty"` - Curstate string `json:"curstate,omitempty"` - Status string `json:"status,omitempty"` - Authentication string `json:"authentication,omitempty"` - Homepage string `json:"homepage,omitempty"` - Rule string `json:"rule,omitempty"` - Policyname string `json:"policyname,omitempty"` - Pipolicyhits string `json:"pipolicyhits,omitempty"` - Servicename string `json:"servicename,omitempty"` - Weight string `json:"weight,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Priority string `json:"priority,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke string `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Crvserveranalyticsprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` -} - -type Crvserverappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverIcapolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverappqoepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverResponderpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverbinding struct { - Name string `json:"name,omitempty"` +type Craction struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Crtype string `json:"crtype,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Crvservercachepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverAppfwpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` } -type Crvservercrpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Hits int `json:"hits,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` +type CrvserverPolicymapBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` } -type Crvservercspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Priority int `json:"priority,omitempty"` - Hits int `json:"hits,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverRewritepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` -} - -type Crvserverfeopolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Crvserverfilterpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Inherited string `json:"inherited,omitempty"` - Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CrvserverSpilloverpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` } -type Crvserverresponderpolicybinding struct { +type Crpolicy struct { + Action string `json:"action,omitempty"` + Activepolicy bool `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Rule string `json:"rule,omitempty"` + Vstype int `json:"vstype,omitempty"` +} + +type CrvserverBinding struct { + CrvserverAnalyticsprofileBinding []interface{} `json:"crvserver_analyticsprofile_binding,omitempty"` + CrvserverAppflowpolicyBinding []interface{} `json:"crvserver_appflowpolicy_binding,omitempty"` + CrvserverAppfwpolicyBinding []interface{} `json:"crvserver_appfwpolicy_binding,omitempty"` + CrvserverAppqoepolicyBinding []interface{} `json:"crvserver_appqoepolicy_binding,omitempty"` + CrvserverCachepolicyBinding []interface{} `json:"crvserver_cachepolicy_binding,omitempty"` + CrvserverCmppolicyBinding []interface{} `json:"crvserver_cmppolicy_binding,omitempty"` + CrvserverCrpolicyBinding []interface{} `json:"crvserver_crpolicy_binding,omitempty"` + CrvserverCspolicyBinding []interface{} `json:"crvserver_cspolicy_binding,omitempty"` + CrvserverFeopolicyBinding []interface{} `json:"crvserver_feopolicy_binding,omitempty"` + CrvserverIcapolicyBinding []interface{} `json:"crvserver_icapolicy_binding,omitempty"` + CrvserverLbvserverBinding []interface{} `json:"crvserver_lbvserver_binding,omitempty"` + CrvserverPolicymapBinding []interface{} `json:"crvserver_policymap_binding,omitempty"` + CrvserverResponderpolicyBinding []interface{} `json:"crvserver_responderpolicy_binding,omitempty"` + CrvserverRewritepolicyBinding []interface{} `json:"crvserver_rewritepolicy_binding,omitempty"` + CrvserverSpilloverpolicyBinding []interface{} `json:"crvserver_spilloverpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type Crvserver struct { + Appflowlog string `json:"appflowlog,omitempty"` + Arp string `json:"arp,omitempty"` + Authentication string `json:"authentication,omitempty"` + Backendssl string `json:"backendssl,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate string `json:"curstate,omitempty"` + Destinationvserver string `json:"destinationvserver,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Disallowserviceaccess string `json:"disallowserviceaccess,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Format string `json:"format,omitempty"` + Ghost string `json:"ghost,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Ip string `json:"ip,omitempty"` + Ipset string `json:"ipset,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + MapField string `json:"map,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Onpolicymatch string `json:"onpolicymatch,omitempty"` + Originusip string `json:"originusip,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + Priority int `json:"priority,omitempty"` + Probeport int `json:"probeport,omitempty"` + Probeprotocol string `json:"probeprotocol,omitempty"` + Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + Range int `json:"range,omitempty"` + Redirect string `json:"redirect,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Reuse string `json:"reuse,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Rule string `json:"rule,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + Srcipexpr string `json:"srcipexpr,omitempty"` + State string `json:"state,omitempty"` + Status int `json:"status,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Tcpprobeport int `json:"tcpprobeport,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + TypeField string `json:"type,omitempty"` + Useoriginipportforcache string `json:"useoriginipportforcache,omitempty"` + Useportrange string `json:"useportrange,omitempty"` + Value string `json:"value,omitempty"` + Via string `json:"via,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type CrpolicyCrvserverBinding struct { + Bindhits int `json:"bindhits,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` +} + +type CrvserverCspolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Crvserverspilloverpolicybinding struct { + Pipolicyhits int `json:"pipolicyhits,omitempty"` Policyname string `json:"policyname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` Targetvserver string `json:"targetvserver,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Crvservervserverbinding struct { - Lbvserver string `json:"lbvserver,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/cs.go b/nitrogo/models/cs.go index 937619c..90c5122 100644 --- a/nitrogo/models/cs.go +++ b/nitrogo/models/cs.go @@ -1,589 +1,498 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Csvserverresponderpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +// cs configuration structs +type CsvserverTransformpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvserversyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` +type CsvserverDomainBinding struct { + Appflowlog string `json:"appflowlog,omitempty"` + Backupip string `json:"backupip,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Domainname string `json:"domainname,omitempty"` + Name string `json:"name,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Ttl int `json:"ttl,omitempty"` +} + +type CsvserverBotpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type Csparameter struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Stateupdate string `json:"stateupdate,omitempty"` +} + +type CsvserverVpnvserverBinding struct { + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` +} + +type CsvserverResponderpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` } type Cspolicy struct { - Policyname string `json:"policyname,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Vstype string `json:"vstype,omitempty"` - Hits string `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Priority string `json:"priority,omitempty"` - Activepolicy string `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cspolicycrvserverbinding struct { + Action string `json:"action,omitempty"` + Activepolicy bool `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Logaction string `json:"logaction,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Rule string `json:"rule,omitempty"` + Vstype int `json:"vstype,omitempty"` +} + +type CsvserverBinding struct { + CsvserverAnalyticsprofileBinding []interface{} `json:"csvserver_analyticsprofile_binding,omitempty"` + CsvserverAppflowpolicyBinding []interface{} `json:"csvserver_appflowpolicy_binding,omitempty"` + CsvserverAppfwpolicyBinding []interface{} `json:"csvserver_appfwpolicy_binding,omitempty"` + CsvserverAppqoepolicyBinding []interface{} `json:"csvserver_appqoepolicy_binding,omitempty"` + CsvserverAuditnslogpolicyBinding []interface{} `json:"csvserver_auditnslogpolicy_binding,omitempty"` + CsvserverAuditsyslogpolicyBinding []interface{} `json:"csvserver_auditsyslogpolicy_binding,omitempty"` + CsvserverAuthorizationpolicyBinding []interface{} `json:"csvserver_authorizationpolicy_binding,omitempty"` + CsvserverBotpolicyBinding []interface{} `json:"csvserver_botpolicy_binding,omitempty"` + CsvserverCachepolicyBinding []interface{} `json:"csvserver_cachepolicy_binding,omitempty"` + CsvserverCmppolicyBinding []interface{} `json:"csvserver_cmppolicy_binding,omitempty"` + CsvserverContentinspectionpolicyBinding []interface{} `json:"csvserver_contentinspectionpolicy_binding,omitempty"` + CsvserverCspolicyBinding []interface{} `json:"csvserver_cspolicy_binding,omitempty"` + CsvserverFeopolicyBinding []interface{} `json:"csvserver_feopolicy_binding,omitempty"` + CsvserverGslbdomainBinding []interface{} `json:"csvserver_gslbdomain_binding,omitempty"` + CsvserverGslbvserverBinding []interface{} `json:"csvserver_gslbvserver_binding,omitempty"` + CsvserverLbvserverBinding []interface{} `json:"csvserver_lbvserver_binding,omitempty"` + CsvserverResponderpolicyBinding []interface{} `json:"csvserver_responderpolicy_binding,omitempty"` + CsvserverRewritepolicyBinding []interface{} `json:"csvserver_rewritepolicy_binding,omitempty"` + CsvserverSpilloverpolicyBinding []interface{} `json:"csvserver_spilloverpolicy_binding,omitempty"` + CsvserverTmtrafficpolicyBinding []interface{} `json:"csvserver_tmtrafficpolicy_binding,omitempty"` + CsvserverTransformpolicyBinding []interface{} `json:"csvserver_transformpolicy_binding,omitempty"` + CsvserverVpnvserverBinding []interface{} `json:"csvserver_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type CspolicyCsvserverBinding struct { + Action string `json:"action,omitempty"` + Bindhits int `json:"bindhits,omitempty"` Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Priority int `json:"priority,omitempty"` Hits int `json:"hits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cspolicycsvserverbinding struct { +type CspolicyCspolicylabelBinding struct { Boundto string `json:"boundto,omitempty"` - Action string `json:"action,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Priority int `json:"priority,omitempty"` Hits int `json:"hits,omitempty"` - Bindhits int `json:"bindhits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Cspolicypolicylabelbinding struct { - Domain string `json:"domain,omitempty"` - Url string `json:"url,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` -} - -type Csvserver struct { - Name string `json:"name,omitempty"` - Td int `json:"td,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Targettype string `json:"targettype,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Ippattern string `json:"ippattern,omitempty"` - Ipmask string `json:"ipmask,omitempty"` - Range int `json:"range,omitempty"` - Port int `json:"port,omitempty"` - Ipset string `json:"ipset,omitempty"` - State string `json:"state,omitempty"` - Stateupdate string `json:"stateupdate,omitempty"` - Cacheable string `json:"cacheable,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Precedence string `json:"precedence,omitempty"` - Casesensitive string `json:"casesensitive,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` - Sobackupaction string `json:"sobackupaction,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Insertvserveripport string `json:"insertvserveripport,omitempty"` - Vipheader string `json:"vipheader,omitempty"` - Rtspnat string `json:"rtspnat,omitempty"` - Authenticationhost string `json:"authenticationhost,omitempty"` - Authentication string `json:"authentication,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Authn401 string `json:"authn401,omitempty"` - Authnvsname string `json:"authnvsname,omitempty"` - Push string `json:"push,omitempty"` - Pushvserver string `json:"pushvserver,omitempty"` - Pushlabel string `json:"pushlabel,omitempty"` - Pushmulticlients string `json:"pushmulticlients,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Dbprofilename string `json:"dbprofilename,omitempty"` - Oracleserverversion string `json:"oracleserverversion,omitempty"` - Comment string `json:"comment,omitempty"` - Mssqlserverversion string `json:"mssqlserverversion,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` - Mysqlserverversion string `json:"mysqlserverversion,omitempty"` - Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` - Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Rhistate string `json:"rhistate,omitempty"` - Authnprofile string `json:"authnprofile,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Dtls string `json:"dtls,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Timeout int `json:"timeout,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Persistencebackup string `json:"persistencebackup,omitempty"` - Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` - Tcpprobeport int `json:"tcpprobeport,omitempty"` - Probeprotocol string `json:"probeprotocol,omitempty"` - Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` - Probeport int `json:"probeport,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` - Redirectfromport int `json:"redirectfromport,omitempty"` - Dnsoverhttps string `json:"dnsoverhttps,omitempty"` - Httpsredirecturl string `json:"httpsredirecturl,omitempty"` - Apiprofile string `json:"apiprofile,omitempty"` - Domainname string `json:"domainname,omitempty"` - Ttl int `json:"ttl,omitempty"` - Backupip string `json:"backupip,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Newname string `json:"newname,omitempty"` - Ip string `json:"ip,omitempty"` - Value string `json:"value,omitempty"` - Ngname string `json:"ngname,omitempty"` - Type string `json:"type,omitempty"` - Curstate string `json:"curstate,omitempty"` - Status string `json:"status,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Redirect string `json:"redirect,omitempty"` - Homepage string `json:"homepage,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Domain string `json:"domain,omitempty"` - Servicename string `json:"servicename,omitempty"` - Weight string `json:"weight,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Url string `json:"url,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gt2gb string `json:"gt2gb,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Statechangetimemsec string `json:"statechangetimemsec,omitempty"` - Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Version string `json:"version,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Csvserveranalyticsprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` -} - -type Csvservercachepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAuditnslogpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` -} - -type Csvserverdomainbinding struct { - Domainname string `json:"domainname,omitempty"` - Ttl int `json:"ttl,omitempty"` - Backupip string `json:"backupip,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Name string `json:"name,omitempty"` -} - -type Csparameter struct { - Stateupdate string `json:"stateupdate,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cspolicybinding struct { - Policyname string `json:"policyname,omitempty"` -} - -type Csvserverauditnslogpolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Csvserverauthorizationpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAppflowpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` -} - -type Csvserverlbvserverbinding struct { - Lbvserver string `json:"lbvserver,omitempty"` - Hits int `json:"hits,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` - Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` -} - -type Csvserverspilloverpolicybinding struct { Policyname string `json:"policyname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Csvservertmtrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAuditsyslogpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Cspolicyvserverbinding struct { - Domain string `json:"domain,omitempty"` - Action string `json:"action,omitempty"` - Url string `json:"url,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Pihits uint32 `json:"pihits,omitempty"` - Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` -} - -type Csvservercmppolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` -} - -type Csvservernslogpolicybinding struct { Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Csvserverrewritepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverTmtrafficpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvservervpnvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Hits int `json:"hits,omitempty"` - Name string `json:"name,omitempty"` -} - -type Cspolicycspolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` +type CsvserverCachepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Priority int `json:"priority,omitempty"` - Hits int `json:"hits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Policyname string `json:"policyname,omitempty"` -} - -type Cspolicylabel struct { + Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` - Cspolicylabeltype string `json:"cspolicylabeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Cspolicylabelcspolicybinding struct { + Name string `json:"name,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvserverappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAppfwpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvservervserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` - Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` -} - -type Csvserverappflowpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type CsvserverCspolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Cookieipport string `json:"cookieipport,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Rule string `json:"rule,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Vserverid string `json:"vserverid,omitempty"` } -type Csvserverappqoepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAppqoepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvserverbotpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type CsvserverSpilloverpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Csvserverfeopolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Csvserverfilterpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverAuthorizationpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Csvservertrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Csaction struct { - Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Targetvserverexpr string `json:"targetvserverexpr,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Csvserverprofilebinding struct { +type CsvserverAnalyticsprofileBinding struct { Analyticsprofile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type Csvservertransformpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type CspolicyCrvserverBinding struct { + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Hits int `json:"hits,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` -} - -type Cspolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Csvserverbinding struct { - Name string `json:"name,omitempty"` +type CspolicylabelBinding struct { + CspolicylabelCspolicyBinding []interface{} `json:"cspolicylabel_cspolicy_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` } -type Csvservercontentinspectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CsvserverContentinspectionpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Cspolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type Cspolicylabel struct { + Count float64 `json:"__count,omitempty"` + Cspolicylabeltype string `json:"cspolicylabeltype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type CsvserverGslbvserverBinding struct { + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Csvserverauditsyslogpolicybinding struct { +type CsvserverFeopolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` Targetlbvserver string `json:"targetlbvserver,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type CsvserverRewritepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Csvservercspolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Policyname string `json:"policyname,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` +} + +type CsvserverCmppolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Hits int `json:"hits,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Rule string `json:"rule,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` } -type Csvservergslbvserverbinding struct { - Vserver string `json:"vserver,omitempty"` - Hits int `json:"hits,omitempty"` - Name string `json:"name,omitempty"` -} - -type Csvserverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` +type Csaction struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Targetvserverexpr string `json:"targetvserverexpr,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type CspolicylabelCspolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` - Rule string `json:"rule,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` +} + +type Csvserver struct { + Apiprofile string `json:"apiprofile,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authenticationhost string `json:"authenticationhost,omitempty"` + Authn401 string `json:"authn401,omitempty"` + Authnprofile string `json:"authnprofile,omitempty"` + Authnvsname string `json:"authnvsname,omitempty"` + Backupip string `json:"backupip,omitempty"` + Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Casesensitive string `json:"casesensitive,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate string `json:"curstate,omitempty"` + Dbprofilename string `json:"dbprofilename,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Dnsoverhttps string `json:"dnsoverhttps,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + Domainname string `json:"domainname,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Dtls string `json:"dtls,omitempty"` + Gt2gb string `json:"gt2gb,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Httpsredirecturl string `json:"httpsredirecturl,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Insertvserveripport string `json:"insertvserveripport,omitempty"` + Ip string `json:"ip,omitempty"` + Ipmask string `json:"ipmask,omitempty"` + Ippattern string `json:"ippattern,omitempty"` + Ipset string `json:"ipset,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Mssqlserverversion string `json:"mssqlserverversion,omitempty"` + Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` + Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` + Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` + Mysqlserverversion string `json:"mysqlserverversion,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Oracleserverversion string `json:"oracleserverversion,omitempty"` + Persistencebackup string `json:"persistencebackup,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + Probeport int `json:"probeport,omitempty"` + Probeprotocol string `json:"probeprotocol,omitempty"` + Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + Push string `json:"push,omitempty"` + Pushlabel string `json:"pushlabel,omitempty"` + Pushmulticlients string `json:"pushmulticlients,omitempty"` + Pushvserver string `json:"pushvserver,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Range int `json:"range,omitempty"` + Redirect string `json:"redirect,omitempty"` + Redirectfromport int `json:"redirectfromport,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Rtspnat string `json:"rtspnat,omitempty"` + Ruletype int `json:"ruletype,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Sobackupaction string `json:"sobackupaction,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Stateupdate string `json:"stateupdate,omitempty"` + Status int `json:"status,omitempty"` + Targetlbvserver string `json:"targetlbvserver,omitempty"` + Targettype string `json:"targettype,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Tcpprobeport int `json:"tcpprobeport,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Timeout int `json:"timeout,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Url string `json:"url,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Value string `json:"value,omitempty"` + Version int `json:"version,omitempty"` + Vipheader string `json:"vipheader,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type CspolicyBinding struct { + CspolicyCrvserverBinding []interface{} `json:"cspolicy_crvserver_binding,omitempty"` + CspolicyCspolicylabelBinding []interface{} `json:"cspolicy_cspolicylabel_binding,omitempty"` + CspolicyCsvserverBinding []interface{} `json:"cspolicy_csvserver_binding,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type CsvserverLbvserverBinding struct { + Cookieipport string `json:"cookieipport,omitempty"` + Hits int `json:"hits,omitempty"` + Lbvserver string `json:"lbvserver,omitempty"` + Name string `json:"name,omitempty"` + Targetvserver string `json:"targetvserver,omitempty"` + Vserverid string `json:"vserverid,omitempty"` } diff --git a/nitrogo/models/db.go b/nitrogo/models/db.go index 86941c6..8fdc7da 100644 --- a/nitrogo/models/db.go +++ b/nitrogo/models/db.go @@ -1,23 +1,22 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Dbdbprofile struct { - Name string `json:"name,omitempty"` - Interpretquery string `json:"interpretquery,omitempty"` - Stickiness string `json:"stickiness,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Conmultiplex string `json:"conmultiplex,omitempty"` - Enablecachingconmuxoff string `json:"enablecachingconmuxoff,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// db configuration structs +type Dbuser struct { + Count float64 `json:"__count,omitempty"` + Loggedin bool `json:"loggedin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` } -type Dbuser struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dbdbprofile struct { + Conmultiplex string `json:"conmultiplex,omitempty"` + Count float64 `json:"__count,omitempty"` + Enablecachingconmuxoff string `json:"enablecachingconmuxoff,omitempty"` + Interpretquery string `json:"interpretquery,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Stickiness string `json:"stickiness,omitempty"` } diff --git a/nitrogo/models/dns.go b/nitrogo/models/dns.go index b40c2d4..d260124 100644 --- a/nitrogo/models/dns.go +++ b/nitrogo/models/dns.go @@ -1,558 +1,521 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Dnsaddrec struct { - Hostname string `json:"hostname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Vservername string `json:"vservername,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// dns configuration structs +type Dnsnsecrec struct { + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Hostname string `json:"hostname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextnsec string `json:"nextnsec,omitempty"` + Nextrecs []string `json:"nextrecs,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` } -type Dnscnamerec struct { - Aliasname string `json:"aliasname,omitempty"` - Canonicalname string `json:"canonicalname,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Vservername string `json:"vservername,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnstxtrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Recordid int `json:"recordid,omitempty"` + String []string `json:"String,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` } -type Dnsglobaldnspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type Dnszone struct { + Count float64 `json:"__count,omitempty"` + Dnssecoffload string `json:"dnssecoffload,omitempty"` + Flags int `json:"flags,omitempty"` + Keyname []string `json:"keyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nsec string `json:"nsec,omitempty"` + Proxymode string `json:"proxymode,omitempty"` + TypeField string `json:"type,omitempty"` + Zonename string `json:"zonename,omitempty"` } -type Dnskey struct { +type DnspolicylabelBinding struct { + DnspolicylabelDnspolicyBinding []interface{} `json:"dnspolicylabel_dnspolicy_binding,omitempty"` + DnspolicylabelPolicybindingBinding []interface{} `json:"dnspolicylabel_policybinding_binding,omitempty"` + Labelname string `json:"labelname,omitempty"` +} + +type Dnsdsfile struct { Keyname string `json:"keyname,omitempty"` - Publickey string `json:"publickey,omitempty"` - Privatekey string `json:"privatekey,omitempty"` - Expires int `json:"expires,omitempty"` - Units1 string `json:"units1,omitempty"` - Notificationperiod int `json:"notificationperiod,omitempty"` - Units2 string `json:"units2,omitempty"` - Ttl int `json:"ttl,omitempty"` - Password string `json:"password,omitempty"` - Autorollover string `json:"autorollover,omitempty"` - Rollovermethod string `json:"rollovermethod,omitempty"` - Revoke bool `json:"revoke,omitempty"` - Zonename string `json:"zonename,omitempty"` - Keytype string `json:"keytype,omitempty"` - Algorithm string `json:"algorithm,omitempty"` - Keysize int `json:"keysize,omitempty"` - Filenameprefix string `json:"filenameprefix,omitempty"` - Src string `json:"src,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Tag string `json:"tag,omitempty"` - Createtimestr string `json:"createtimestr,omitempty"` - Activationtimestr string `json:"activationtimestr,omitempty"` - Expirytimestr string `json:"expirytimestr,omitempty"` - Deletiontimestr string `json:"deletiontimestr,omitempty"` - Rolloverfailrc string `json:"rolloverfailrc,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Dnspolicydnspolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` +type Dnsnegativecacherecords struct { + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Hostname string `json:"hostname,omitempty"` + Negcachetype string `json:"negcachetype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Peid int `json:"peid,omitempty"` + Querytype string `json:"querytype,omitempty"` + Rdclient string `json:"rdclient,omitempty"` + Ttl int `json:"ttl,omitempty"` +} + +type DnspolicylabelDnspolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Dnspolicylabel struct { + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Transform string `json:"transform,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsprofile struct { - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Recursiveresolution string `json:"recursiveresolution,omitempty"` - Dnsquerylogging string `json:"dnsquerylogging,omitempty"` - Dnsanswerseclogging string `json:"dnsanswerseclogging,omitempty"` - Dnsextendedlogging string `json:"dnsextendedlogging,omitempty"` - Dnserrorlogging string `json:"dnserrorlogging,omitempty"` - Cacherecords string `json:"cacherecords,omitempty"` - Cachenegativeresponses string `json:"cachenegativeresponses,omitempty"` - Dropmultiqueryrequest string `json:"dropmultiqueryrequest,omitempty"` - Cacheecsresponses string `json:"cacheecsresponses,omitempty"` - Insertecs string `json:"insertecs,omitempty"` - Replaceecs string `json:"replaceecs,omitempty"` - Maxcacheableecsprefixlength int `json:"maxcacheableecsprefixlength,omitempty"` - Maxcacheableecsprefixlength6 int `json:"maxcacheableecsprefixlength6,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsviewpolicybinding struct { - Dnspolicyname string `json:"dnspolicyname,omitempty"` - Viewname string `json:"viewname,omitempty"` -} - -type Dnsaction struct { - Actionname string `json:"actionname,omitempty"` - Actiontype string `json:"actiontype,omitempty"` - Ipaddress []string `json:"ipaddress,omitempty"` - Ttl int `json:"ttl,omitempty"` - Viewname string `json:"viewname,omitempty"` - Preferredloclist []string `json:"preferredloclist,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Drop string `json:"drop,omitempty"` - Cachebypass string `json:"cachebypass,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsaction64 struct { - Actionname string `json:"actionname,omitempty"` - Prefix string `json:"prefix,omitempty"` - Mappedrule string `json:"mappedrule,omitempty"` - Excluderule string `json:"excluderule,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Dnsviewbinding struct { - Viewname string `json:"viewname,omitempty"` +type Dnsptrrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Reversedomain string `json:"reversedomain,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type DnszoneDomainBinding struct { + Domain string `json:"domain,omitempty"` + Nextrecs []string `json:"nextrecs,omitempty"` + Zonename string `json:"zonename,omitempty"` } -type Dnszonebinding struct { - Zonename string `json:"zonename,omitempty"` +type DnszoneBinding struct { + DnszoneDnskeyBinding []interface{} `json:"dnszone_dnskey_binding,omitempty"` + DnszoneGslbdomainBinding []interface{} `json:"dnszone_gslbdomain_binding,omitempty"` + Zonename string `json:"zonename,omitempty"` } -type Dnspolicybinding struct { - Name string `json:"name,omitempty"` +type DnsglobalDnspolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Dnspolicyglobalbinding struct { +type Dnsnameserver struct { + Clmonowner int `json:"clmonowner,omitempty"` + Clmonview int `json:"clmonview,omitempty"` + Count float64 `json:"__count,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Ip string `json:"ip,omitempty"` + Local bool `json:"local,omitempty"` + Nameserverstate string `json:"nameserverstate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Servicename string `json:"servicename,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type DnspolicyDnspolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Dnspolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Dnsptrrec struct { - Reversedomain string `json:"reversedomain,omitempty"` - Domain string `json:"domain,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnssubnetcache struct { - Ecssubnet string `json:"ecssubnet,omitempty"` - All bool `json:"all,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Hostname string `json:"hostname,omitempty"` - Nextrecs string `json:"nextrecs,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnstxtrec struct { - Domain string `json:"domain,omitempty"` - String []string `json:"String,omitempty"` - Ttl int `json:"ttl,omitempty"` - Recordid int `json:"recordid,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnssrvrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Port int `json:"port,omitempty"` + Priority int `json:"priority,omitempty"` + Target string `json:"target,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type DnsviewBinding struct { + DnsviewDnspolicyBinding []interface{} `json:"dnsview_dnspolicy_binding,omitempty"` + DnsviewGslbserviceBinding []interface{} `json:"dnsview_gslbservice_binding,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Dnszone struct { - Zonename string `json:"zonename,omitempty"` - Proxymode string `json:"proxymode,omitempty"` - Dnssecoffload string `json:"dnssecoffload,omitempty"` - Nsec string `json:"nsec,omitempty"` - Keyname []string `json:"keyname,omitempty"` - Type string `json:"type,omitempty"` - Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnspolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Priority int `json:"priority,omitempty"` + Transform string `json:"transform,omitempty"` } -type Dnszonedomainbinding struct { - Domain string `json:"domain,omitempty"` - Nextrecs []string `json:"nextrecs,omitempty"` - Zonename string `json:"zonename,omitempty"` +type Dnsproxyrecords struct { + Negrectype string `json:"negrectype,omitempty"` + TypeField string `json:"type,omitempty"` } type Dnsnsrec struct { - Domain string `json:"domain,omitempty"` - Nameserver string `json:"nameserver,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsparameter struct { - Retries int `json:"retries,omitempty"` - Minttl int `json:"minttl"` - Maxttl int `json:"maxttl,omitempty"` - Cacherecords string `json:"cacherecords,omitempty"` - Namelookuppriority string `json:"namelookuppriority,omitempty"` - Recursion string `json:"recursion,omitempty"` - Resolutionorder string `json:"resolutionorder,omitempty"` - Dnssec string `json:"dnssec,omitempty"` - Maxpipeline int `json:"maxpipeline,omitempty"` - Dnsrootreferral string `json:"dnsrootreferral,omitempty"` - Dns64timeout int `json:"dns64timeout"` - Ecsmaxsubnets int `json:"ecsmaxsubnets"` - Maxnegcachettl int `json:"maxnegcachettl,omitempty"` - Cachehitbypass string `json:"cachehitbypass,omitempty"` - Maxcachesize int `json:"maxcachesize"` - Resolvermaxactiveresolutions int `json:"resolvermaxactiveresolutions,omitempty"` - Resolvermaxtcpconnections int `json:"resolvermaxtcpconnections,omitempty"` - Resolvermaxtcptimeout int `json:"resolvermaxtcptimeout,omitempty"` - Maxnegativecachesize int `json:"maxnegativecachesize"` - Cachenoexpire string `json:"cachenoexpire,omitempty"` - Splitpktqueryprocessing string `json:"splitpktqueryprocessing,omitempty"` - Cacheecszeroprefix string `json:"cacheecszeroprefix,omitempty"` - Maxudppacketsize int `json:"maxudppacketsize,omitempty"` - Zonetransfer string `json:"zonetransfer,omitempty"` - Autosavekeyops string `json:"autosavekeyops,omitempty"` - Nxdomainratelimitthreshold int `json:"nxdomainratelimitthreshold"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nxdomainthresholdcrossed string `json:"nxdomainthresholdcrossed,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nameserver string `json:"nameserver,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type DnspolicyDnsglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type Dnspolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Viewname string `json:"viewname,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Preferredloclist []string `json:"preferredloclist,omitempty"` - Drop string `json:"drop,omitempty"` - Cachebypass string `json:"cachebypass,omitempty"` Actionname string `json:"actionname,omitempty"` - Logaction string `json:"logaction,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cachebypass string `json:"cachebypass,omitempty"` + Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` + Drop string `json:"drop,omitempty"` Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Preferredloclist []string `json:"preferredloclist,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Dnsnameserver struct { - Ip string `json:"ip,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Local bool `json:"local,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Servicename string `json:"servicename,omitempty"` - Port string `json:"port,omitempty"` - Nameserverstate string `json:"nameserverstate,omitempty"` - Clmonowner string `json:"clmonowner,omitempty"` - Clmonview string `json:"clmonview,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsnaptrrec struct { - Domain string `json:"domain,omitempty"` - Order int `json:"order,omitempty"` - Preference int `json:"preference,omitempty"` - Flags string `json:"flags,omitempty"` - Services string `json:"services,omitempty"` - Regexp string `json:"regexp,omitempty"` - Replacement string `json:"replacement,omitempty"` - Ttl int `json:"ttl,omitempty"` - Recordid int `json:"recordid,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Vservername string `json:"vservername,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnsaction struct { + Actionname string `json:"actionname,omitempty"` + Actiontype string `json:"actiontype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cachebypass string `json:"cachebypass,omitempty"` + Count float64 `json:"__count,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Drop string `json:"drop,omitempty"` + Feature string `json:"feature,omitempty"` + Ipaddress []string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preferredloclist []string `json:"preferredloclist,omitempty"` + Ttl int `json:"ttl,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Dnsmxrec struct { - Domain string `json:"domain,omitempty"` - Mx string `json:"mx,omitempty"` - Pref int `json:"pref,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type DnsglobalBinding struct { + DnsglobalDnspolicyBinding []interface{} `json:"dnsglobal_dnspolicy_binding,omitempty"` } -type Dnspolicy64vserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` -} - -type Dnspolicydnsglobalbinding struct { +type Dnssoarec struct { + Authtype string `json:"authtype,omitempty"` + Contact string `json:"contact,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Expire int `json:"expire,omitempty"` + Minimum int `json:"minimum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Originserver string `json:"originserver,omitempty"` + Refresh int `json:"refresh,omitempty"` + Retry int `json:"retry,omitempty"` + Serial int `json:"serial,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type Dnspolicy64Binding struct { + Dnspolicy64LbvserverBinding []interface{} `json:"dnspolicy64_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type DnspolicyBinding struct { + DnspolicyDnsglobalBinding []interface{} `json:"dnspolicy_dnsglobal_binding,omitempty"` + DnspolicyDnspolicylabelBinding []interface{} `json:"dnspolicy_dnspolicylabel_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type DnszoneDnskeyBinding struct { + Expires int `json:"expires,omitempty"` + Keyname []string `json:"keyname,omitempty"` + Siginceptiontime []interface{} `json:"siginceptiontime,omitempty"` + Signed int `json:"signed,omitempty"` + Zonename string `json:"zonename,omitempty"` +} + +type Dnspolicy64LbvserverBinding struct { Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` -} - -type Dnspolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Dnszonekeybinding struct { - Keyname []string `json:"keyname,omitempty"` - Siginceptiontime []uint32 `json:"siginceptiontime,omitempty"` - Signed uint32 `json:"signed,omitempty"` - Expires uint32 `json:"expires,omitempty"` - Zonename string `json:"zonename,omitempty"` -} - -type Dnscaarec struct { - Domain string `json:"domain,omitempty"` - Valuestring string `json:"valuestring,omitempty"` - Tag string `json:"tag,omitempty"` - Flag string `json:"flag,omitempty"` - Ttl int `json:"ttl,omitempty"` - Recordid int `json:"recordid,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsnegativecacherecords struct { - Nodeid int `json:"nodeid,omitempty"` - Hostname string `json:"hostname,omitempty"` - Negcachetype string `json:"negcachetype,omitempty"` - Rdclient string `json:"rdclient,omitempty"` - Querytype string `json:"querytype,omitempty"` - Ttl string `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnspolicylabeldnspolicybinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } type Dnssuffix struct { - Dnssuffix string `json:"Dnssuffix,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsviewdnspolicybinding struct { - Dnspolicyname string `json:"dnspolicyname,omitempty"` - Viewname string `json:"viewname,omitempty"` + Count float64 `json:"__count,omitempty"` + Dnssuffix string `json:"Dnssuffix,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Dnszonednskeybinding struct { - Keyname []string `json:"keyname,omitempty"` - Siginceptiontime []int `json:"siginceptiontime,omitempty"` - Signed int `json:"signed,omitempty"` - Expires int `json:"expires,omitempty"` - Zonename string `json:"zonename,omitempty"` -} - -type Dnsaaaarec struct { - Hostname string `json:"hostname,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Vservername string `json:"vservername,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsdsfile struct { - Keyname string `json:"keyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Dnsglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type Dnsparameter struct { + Autosavekeyops string `json:"autosavekeyops,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cacheecszeroprefix string `json:"cacheecszeroprefix,omitempty"` + Cachehitbypass string `json:"cachehitbypass,omitempty"` + Cachenoexpire string `json:"cachenoexpire,omitempty"` + Cacherecords string `json:"cacherecords,omitempty"` + Dns64timeout int `json:"dns64timeout,omitempty"` + Dnsrootreferral string `json:"dnsrootreferral,omitempty"` + Dnssec string `json:"dnssec,omitempty"` + Ecsmaxsubnets int `json:"ecsmaxsubnets,omitempty"` + Feature string `json:"feature,omitempty"` + Maxcachesize int `json:"maxcachesize,omitempty"` + Maxnegativecachesize int `json:"maxnegativecachesize,omitempty"` + Maxnegcachettl int `json:"maxnegcachettl,omitempty"` + Maxpipeline int `json:"maxpipeline,omitempty"` + Maxttl int `json:"maxttl,omitempty"` + Maxudppacketsize int `json:"maxudppacketsize,omitempty"` + Minttl int `json:"minttl,omitempty"` + Namelookuppriority string `json:"namelookuppriority,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nxdomainratelimitthreshold int `json:"nxdomainratelimitthreshold,omitempty"` + Nxdomainthresholdcrossed int `json:"nxdomainthresholdcrossed,omitempty"` + Recursion string `json:"recursion,omitempty"` + Resolutionorder string `json:"resolutionorder,omitempty"` + Resolvermaxactiveresolutions int `json:"resolvermaxactiveresolutions,omitempty"` + Resolvermaxtcpconnections int `json:"resolvermaxtcpconnections,omitempty"` + Resolvermaxtcptimeout int `json:"resolvermaxtcptimeout,omitempty"` + Retries int `json:"retries,omitempty"` + Splitpktqueryprocessing string `json:"splitpktqueryprocessing,omitempty"` + Zonetransfer string `json:"zonetransfer,omitempty"` } -type Dnsproxyrecords struct { - Type string `json:"type,omitempty"` - Negrectype string `json:"negrectype,omitempty"` +type Dnsaction64 struct { + Actionname string `json:"actionname,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Excluderule string `json:"excluderule,omitempty"` + Feature string `json:"feature,omitempty"` + Mappedrule string `json:"mappedrule,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Prefix string `json:"prefix,omitempty"` } -type Dnssoarec struct { - Domain string `json:"domain,omitempty"` - Originserver string `json:"originserver,omitempty"` - Contact string `json:"contact,omitempty"` - Serial int `json:"serial,omitempty"` - Refresh int `json:"refresh,omitempty"` - Retry int `json:"retry,omitempty"` - Expire int `json:"expire,omitempty"` - Minimum int `json:"minimum,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnscnamerec struct { + Aliasname string `json:"aliasname,omitempty"` + Authtype string `json:"authtype,omitempty"` + Canonicalname string `json:"canonicalname,omitempty"` + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Dnssrvrec struct { - Domain string `json:"domain,omitempty"` - Target string `json:"target,omitempty"` - Priority int `json:"priority,omitempty"` - Weight int `json:"weight,omitempty"` - Port int `json:"port,omitempty"` - Ttl int `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Authtype string `json:"authtype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnspolicy64 struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Hits int `json:"hits,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Dnsviewgslbservicebinding struct { +type Dnsprofile struct { + Cacheecsresponses string `json:"cacheecsresponses,omitempty"` + Cachenegativeresponses string `json:"cachenegativeresponses,omitempty"` + Cacherecords string `json:"cacherecords,omitempty"` + Count float64 `json:"__count,omitempty"` + Dnsanswerseclogging string `json:"dnsanswerseclogging,omitempty"` + Dnserrorlogging string `json:"dnserrorlogging,omitempty"` + Dnsextendedlogging string `json:"dnsextendedlogging,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Dnsquerylogging string `json:"dnsquerylogging,omitempty"` + Dropmultiqueryrequest string `json:"dropmultiqueryrequest,omitempty"` + Insertecs string `json:"insertecs,omitempty"` + Maxcacheableecsprefixlength int `json:"maxcacheableecsprefixlength,omitempty"` + Maxcacheableecsprefixlength6 int `json:"maxcacheableecsprefixlength6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Recursiveresolution string `json:"recursiveresolution,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Replaceecs string `json:"replaceecs,omitempty"` +} + +type DnsviewGslbserviceBinding struct { Gslbservicename string `json:"gslbservicename,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` Viewname string `json:"viewname,omitempty"` } -type Dnsviewservicebinding struct { - Gslbservicename string `json:"gslbservicename,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Viewname string `json:"viewname,omitempty"` +type Dnsaaaarec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Hostname string `json:"hostname,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Dnsglobalbinding struct { +type Dnsview struct { + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Dnsnsecrec struct { - Hostname string `json:"hostname,omitempty"` - Type string `json:"type,omitempty"` - Nextnsec string `json:"nextnsec,omitempty"` - Nextrecs string `json:"nextrecs,omitempty"` - Ttl string `json:"ttl,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnskey struct { + Activationtimestr string `json:"activationtimestr,omitempty"` + Algorithm string `json:"algorithm,omitempty"` + Autorollover string `json:"autorollover,omitempty"` + Count float64 `json:"__count,omitempty"` + Createtimestr string `json:"createtimestr,omitempty"` + Deletiontimestr string `json:"deletiontimestr,omitempty"` + Expires int `json:"expires,omitempty"` + Expirytimestr string `json:"expirytimestr,omitempty"` + Filenameprefix string `json:"filenameprefix,omitempty"` + Keyname string `json:"keyname,omitempty"` + Keysize int `json:"keysize,omitempty"` + Keytype string `json:"keytype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Notificationperiod int `json:"notificationperiod,omitempty"` + Password string `json:"password,omitempty"` + Privatekey string `json:"privatekey,omitempty"` + Publickey string `json:"publickey,omitempty"` + Revoke bool `json:"revoke,omitempty"` + Rolloverfailrc int `json:"rolloverfailrc,omitempty"` + Rollovermethod string `json:"rollovermethod,omitempty"` + Src string `json:"src,omitempty"` + State string `json:"state,omitempty"` + Tag int `json:"tag,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Units1 string `json:"units1,omitempty"` + Units2 string `json:"units2,omitempty"` + Zonename string `json:"zonename,omitempty"` } -type Dnspolicy64 struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Hits string `json:"hits,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Dnsnaptrrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Flags string `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Order int `json:"order,omitempty"` + Preference int `json:"preference,omitempty"` + Recordid int `json:"recordid,omitempty"` + Regexp string `json:"regexp,omitempty"` + Replacement string `json:"replacement,omitempty"` + Services string `json:"services,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type DnsviewDnspolicyBinding struct { + Dnspolicyname string `json:"dnspolicyname,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Dnspolicy64binding struct { - Name string `json:"name,omitempty"` +type Dnssubnetcache struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Hostname string `json:"hostname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextrecs []string `json:"nextrecs,omitempty"` + Nodeid int `json:"nodeid,omitempty"` } -type Dnspolicy64lbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` +type Dnsaddrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Hostname string `json:"hostname,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Dnspolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Dnsmxrec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Mx string `json:"mx,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Pref int `json:"pref,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` } -type Dnspolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type Dnscaarec struct { + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Ecssubnet string `json:"ecssubnet,omitempty"` + Flag string `json:"flag,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Recordid int `json:"recordid,omitempty"` + Tag string `json:"tag,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Valuestring string `json:"valuestring,omitempty"` +} + +type DnspolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Dnsview struct { - Viewname string `json:"viewname,omitempty"` - Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/dps.go b/nitrogo/models/dps.go new file mode 100644 index 0000000..9be5840 --- /dev/null +++ b/nitrogo/models/dps.go @@ -0,0 +1,11 @@ +package models + +// dps configuration structs +type Dpsparameter struct { + Builtin []string `json:"builtin,omitempty"` + Customerid string `json:"customerid,omitempty"` + Deployment string `json:"deployment,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Serviceurl string `json:"serviceurl,omitempty"` +} diff --git a/nitrogo/models/endpoint.go b/nitrogo/models/endpoint.go index de62b60..863b6c9 100644 --- a/nitrogo/models/endpoint.go +++ b/nitrogo/models/endpoint.go @@ -1,13 +1,11 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// endpoint configuration structs type Endpointinfo struct { - Endpointkind string `json:"endpointkind,omitempty"` - Endpointname string `json:"endpointname,omitempty"` - Endpointmetadata string `json:"endpointmetadata,omitempty"` - Endpointlabelsjson string `json:"endpointlabelsjson,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Endpointkind string `json:"endpointkind,omitempty"` + Endpointlabelsjson string `json:"endpointlabelsjson,omitempty"` + Endpointmetadata string `json:"endpointmetadata,omitempty"` + Endpointname string `json:"endpointname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/feo.go b/nitrogo/models/feo.go index ddf38d1..d169e07 100644 --- a/nitrogo/models/feo.go +++ b/nitrogo/models/feo.go @@ -1,131 +1,109 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Feoglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Feoparameter struct { - Jpegqualitypercent int `json:"jpegqualitypercent"` - Cssinlinethressize int `json:"cssinlinethressize,omitempty"` - Jsinlinethressize int `json:"jsinlinethressize,omitempty"` - Imginlinethressize int `json:"imginlinethressize,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Feopolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Feopolicyfeoglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +// feo configuration structs +type FeopolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` -} - -type Feoglobalfeopolicybinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` } -type Feopolicybinding struct { - Name string `json:"name,omitempty"` +type FeoglobalBinding struct { + FeoglobalFeopolicyBinding []interface{} `json:"feoglobal_feopolicy_binding,omitempty"` } -type Feopolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type FeopolicyFeoglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` -} - -type Feopolicyglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Feopolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type FeopolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Feopolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` +type Feopolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } type Feoaction struct { - Name string `json:"name,omitempty"` - Pageextendcache bool `json:"pageextendcache,omitempty"` - Cachemaxage int `json:"cachemaxage"` - Imgshrinktoattrib bool `json:"imgshrinktoattrib,omitempty"` - Imggiftopng bool `json:"imggiftopng,omitempty"` - Imgtowebp bool `json:"imgtowebp,omitempty"` - Imgtojpegxr bool `json:"imgtojpegxr,omitempty"` - Imginline bool `json:"imginline,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cachemaxage int `json:"cachemaxage,omitempty"` + Clientsidemeasurements bool `json:"clientsidemeasurements,omitempty"` + Convertimporttolink bool `json:"convertimporttolink,omitempty"` + Count float64 `json:"__count,omitempty"` + Csscombine bool `json:"csscombine,omitempty"` + Cssflattenimports bool `json:"cssflattenimports,omitempty"` Cssimginline bool `json:"cssimginline,omitempty"` - Jpgoptimize bool `json:"jpgoptimize,omitempty"` - Imglazyload bool `json:"imglazyload,omitempty"` - Cssminify bool `json:"cssminify,omitempty"` Cssinline bool `json:"cssinline,omitempty"` - Csscombine bool `json:"csscombine,omitempty"` - Convertimporttolink bool `json:"convertimporttolink,omitempty"` - Jsminify bool `json:"jsminify,omitempty"` - Jsinline bool `json:"jsinline,omitempty"` - Htmlminify bool `json:"htmlminify,omitempty"` + Cssminify bool `json:"cssminify,omitempty"` Cssmovetohead bool `json:"cssmovetohead,omitempty"` - Jsmovetoend bool `json:"jsmovetoend,omitempty"` - Domainsharding string `json:"domainsharding,omitempty"` Dnsshards []string `json:"dnsshards,omitempty"` - Clientsidemeasurements bool `json:"clientsidemeasurements,omitempty"` - Imgadddimensions string `json:"imgadddimensions,omitempty"` - Imgshrinkformobile string `json:"imgshrinkformobile,omitempty"` - Imgweaken string `json:"imgweaken,omitempty"` - Jpgprogressive string `json:"jpgprogressive,omitempty"` - Cssflattenimports string `json:"cssflattenimports,omitempty"` - Jscombine string `json:"jscombine,omitempty"` - Htmlrmdefaultattribs string `json:"htmlrmdefaultattribs,omitempty"` - Htmlrmattribquotes string `json:"htmlrmattribquotes,omitempty"` - Htmltrimurls string `json:"htmltrimurls,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` + Domainsharding string `json:"domainsharding,omitempty"` Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Htmlminify bool `json:"htmlminify,omitempty"` + Htmlrmattribquotes bool `json:"htmlrmattribquotes,omitempty"` + Htmlrmdefaultattribs bool `json:"htmlrmdefaultattribs,omitempty"` + Htmltrimurls bool `json:"htmltrimurls,omitempty"` + Imgadddimensions bool `json:"imgadddimensions,omitempty"` + Imggiftopng bool `json:"imggiftopng,omitempty"` + Imginline bool `json:"imginline,omitempty"` + Imglazyload bool `json:"imglazyload,omitempty"` + Imgshrinkformobile bool `json:"imgshrinkformobile,omitempty"` + Imgshrinktoattrib bool `json:"imgshrinktoattrib,omitempty"` + Imgtojpegxr bool `json:"imgtojpegxr,omitempty"` + Imgtowebp bool `json:"imgtowebp,omitempty"` + Imgweaken bool `json:"imgweaken,omitempty"` + Jpgoptimize bool `json:"jpgoptimize,omitempty"` + Jpgprogressive bool `json:"jpgprogressive,omitempty"` + Jscombine bool `json:"jscombine,omitempty"` + Jsinline bool `json:"jsinline,omitempty"` + Jsminify bool `json:"jsminify,omitempty"` + Jsmovetoend bool `json:"jsmovetoend,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pageextendcache bool `json:"pageextendcache,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Feoglobalbinding struct { +type FeopolicyBinding struct { + FeopolicyCsvserverBinding []interface{} `json:"feopolicy_csvserver_binding,omitempty"` + FeopolicyFeoglobalBinding []interface{} `json:"feopolicy_feoglobal_binding,omitempty"` + FeopolicyLbvserverBinding []interface{} `json:"feopolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type Feoparameter struct { + Builtin []string `json:"builtin,omitempty"` + Cssinlinethressize int `json:"cssinlinethressize,omitempty"` + Feature string `json:"feature,omitempty"` + Imginlinethressize int `json:"imginlinethressize,omitempty"` + Jpegqualitypercent int `json:"jpegqualitypercent,omitempty"` + Jsinlinethressize int `json:"jsinlinethressize,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type FeoglobalFeopolicyBinding struct { + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/gslb.go b/nitrogo/models/gslb.go index 809abe9..975c2f7 100644 --- a/nitrogo/models/gslb.go +++ b/nitrogo/models/gslb.go @@ -1,778 +1,588 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Gslbservicegrouplbmonitorbinding struct { - Monitorname string `json:"monitor_name,omitempty"` - Monweight int `json:"monweight,omitempty"` - Monstate string `json:"monstate,omitempty"` - Weight int `json:"weight,omitempty"` - Passive bool `json:"passive,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Port int `json:"port,omitempty"` - State string `json:"state,omitempty"` - Hashid int `json:"hashid,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Order int `json:"order,omitempty"` +// gslb configuration structs +type GslbservicegroupBinding struct { + GslbservicegroupGslbservicegroupmemberBinding []interface{} `json:"gslbservicegroup_gslbservicegroupmember_binding,omitempty"` + GslbservicegroupLbmonitorBinding []interface{} `json:"gslbservicegroup_lbmonitor_binding,omitempty"` + GslbservicegroupServicegroupentitymonbindingsBinding []interface{} `json:"gslbservicegroup_servicegroupentitymonbindings_binding,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type Gslbconfig struct { - Preview bool `json:"preview,omitempty"` - Debug bool `json:"debug,omitempty"` - Forcesync string `json:"forcesync,omitempty"` - Nowarn bool `json:"nowarn,omitempty"` - Saveconfig bool `json:"saveconfig,omitempty"` - Command string `json:"command,omitempty"` +type Gslbservicegroup struct { + Appflowlog string `json:"appflowlog,omitempty"` + Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` + Autoscale string `json:"autoscale,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Clmonowner int `json:"clmonowner,omitempty"` + Clmonview int `json:"clmonview,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Delay int `json:"delay,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Graceful string `json:"graceful,omitempty"` + Groupcount int `json:"groupcount,omitempty"` + Gslb string `json:"gslb,omitempty"` + Hashid int `json:"hashid,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Includemembers bool `json:"includemembers,omitempty"` + Ip string `json:"ip,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + MonitorNameSvc string `json:"monitor_name_svc,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Numofconnections int `json:"numofconnections,omitempty"` + Order int `json:"order,omitempty"` + Port int `json:"port,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Servername string `json:"servername,omitempty"` + Serviceconftype bool `json:"serviceconftype,omitempty"` + Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Serviceipstr string `json:"serviceipstr,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Stateupdatereason int `json:"stateupdatereason,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Value string `json:"value,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbdomain struct { - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Gslbldnsentries struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Numsites int `json:"numsites,omitempty"` + Rtt []interface{} `json:"rtt,omitempty"` + Sitename string `json:"sitename,omitempty"` + Ttl int `json:"ttl,omitempty"` +} + +type GslbservicegroupServicegroupentitymonbindingsBinding struct { + Hashid int `json:"hashid,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + MonitorName string `json:"monitor_name,omitempty"` + MonitorState string `json:"monitor_state,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Order int `json:"order,omitempty"` + Passive bool `json:"passive,omitempty"` + Port int `json:"port,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbdomainservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Vservername string `json:"vservername,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` - State string `json:"state,omitempty"` - Weight uint32 `json:"weight,omitempty"` - Dynamicconfwt uint32 `json:"dynamicconfwt,omitempty"` - Cumulativeweight uint32 `json:"cumulativeweight,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int32 `json:"gslbthreshold,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` - Name string `json:"name,omitempty"` +type GslbvserverLbpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Gslbservicelbmonitorbinding struct { - Monitorname string `json:"monitor_name,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monitorstate string `json:"monitor_state,omitempty"` - Weight int `json:"weight,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` +type Gslbvserver struct { + Activeservices int `json:"activeservices,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Backupip string `json:"backupip,omitempty"` + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Backupsessiontimeout int `json:"backupsessiontimeout,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Comment string `json:"comment,omitempty"` + Considereffectivestate string `json:"considereffectivestate,omitempty"` + CookieDomain string `json:"cookie_domain,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Currentactiveorder string `json:"currentactiveorder,omitempty"` + Curstate string `json:"curstate,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Domainname string `json:"domainname,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Ecs string `json:"ecs,omitempty"` + Ecsaddrvalidation string `json:"ecsaddrvalidation,omitempty"` + Edr string `json:"edr,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Health int `json:"health,omitempty"` + Iptype string `json:"iptype,omitempty"` + Iscname string `json:"iscname,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Lbrrreason int `json:"lbrrreason,omitempty"` + Mir string `json:"mir,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Order int `json:"order,omitempty"` + Orderthreshold int `json:"orderthreshold,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Rule string `json:"rule,omitempty"` + Servername string `json:"servername,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Sobackupaction string `json:"sobackupaction,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Status int `json:"status,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Timeout int `json:"timeout,omitempty"` + Toggleorder string `json:"toggleorder,omitempty"` + Tolerance int `json:"tolerance,omitempty"` + Totalservices int `json:"totalservices,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + V6netmasklen int `json:"v6netmasklen,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` + Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type GslbdomainLbmonitorBinding struct { + Customheaders string `json:"customheaders,omitempty"` + Grpchealthcheck string `json:"grpchealthcheck,omitempty"` + Grpcservicename string `json:"grpcservicename,omitempty"` + Grpcstatuscode int `json:"grpcstatuscode,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` + Monstate string `json:"monstate,omitempty"` + Name string `json:"name,omitempty"` + Respcode string `json:"respcode,omitempty"` Responsetime int `json:"responsetime,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` Servicename string `json:"servicename,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Gslbvservergslbservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Curstate string `json:"curstate,omitempty"` - Weight int `json:"weight,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Sitepersistcookie string `json:"sitepersistcookie,omitempty"` - Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbdomaingslbservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Vservername string `json:"vservername,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - State string `json:"state,omitempty"` - Weight int `json:"weight,omitempty"` - Dynamicconfwt int `json:"dynamicconfwt,omitempty"` - Cumulativeweight int `json:"cumulativeweight,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` - Order int `json:"order,omitempty"` - Name string `json:"name,omitempty"` +type Gslbparameter struct { + Automaticconfigsync string `json:"automaticconfigsync,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Dropldnsreq string `json:"dropldnsreq,omitempty"` + Feature string `json:"feature,omitempty"` + Flags int `json:"flags,omitempty"` + Gslbconfigsyncmonitor string `json:"gslbconfigsyncmonitor,omitempty"` + Gslbsvcstatedelaytime int `json:"gslbsvcstatedelaytime,omitempty"` + Gslbsyncinterval int `json:"gslbsyncinterval,omitempty"` + Gslbsynclocfiles string `json:"gslbsynclocfiles,omitempty"` + Gslbsyncmode string `json:"gslbsyncmode,omitempty"` + Gslbsyncsaveconfigcommand string `json:"gslbsyncsaveconfigcommand,omitempty"` + Incarnation int `json:"incarnation,omitempty"` + Ldnsentrytimeout int `json:"ldnsentrytimeout,omitempty"` + Ldnsmask string `json:"ldnsmask,omitempty"` + Ldnsprobeorder []string `json:"ldnsprobeorder,omitempty"` + Mepkeepalivetimeout int `json:"mepkeepalivetimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` + Rtttolerance int `json:"rtttolerance,omitempty"` + Svcstatelearningtime int `json:"svcstatelearningtime,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + V6ldnsmasklen int `json:"v6ldnsmasklen,omitempty"` } -type Gslbdomaingslbservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Weight int `json:"weight,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Order int `json:"order,omitempty"` - Name string `json:"name,omitempty"` +type GslbvserverSpilloverpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Gslbrunningconfig struct { - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type GslbvserverBinding struct { + GslbvserverGslbdomainBinding []interface{} `json:"gslbvserver_gslbdomain_binding,omitempty"` + GslbvserverGslbserviceBinding []interface{} `json:"gslbvserver_gslbservice_binding,omitempty"` + GslbvserverGslbservicegroupBinding []interface{} `json:"gslbvserver_gslbservicegroup_binding,omitempty"` + GslbvserverGslbservicegroupmemberBinding []interface{} `json:"gslbvserver_gslbservicegroupmember_binding,omitempty"` + GslbvserverLbpolicyBinding []interface{} `json:"gslbvserver_lbpolicy_binding,omitempty"` + GslbvserverSpilloverpolicyBinding []interface{} `json:"gslbvserver_spilloverpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Gslbservicebinding struct { +type GslbserviceDnsviewBinding struct { Servicename string `json:"servicename,omitempty"` + Viewip string `json:"viewip,omitempty"` + Viewname string `json:"viewname,omitempty"` } -type Gslbsitegslbservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - State string `json:"state,omitempty"` - Sitename string `json:"sitename,omitempty"` -} - -type Gslbvservergslbservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Order int `json:"order,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbvserverservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbdomaingslbvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - State string `json:"state,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Edr string `json:"edr,omitempty"` - Mir string `json:"mir,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Cip string `json:"cip,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Netmask string `json:"netmask,omitempty"` - V6netmasklen int `json:"v6netmasklen,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbldnsentry struct { - Ipaddress string `json:"ipaddress,omitempty"` -} - -type Gslbservice struct { - Servicename string `json:"servicename,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` +type GslbservicegroupGslbservicegroupmemberBinding struct { + Delay int `json:"delay,omitempty"` + Graceful string `json:"graceful,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Hashid int `json:"hashid,omitempty"` Ip string `json:"ip,omitempty"` - Servername string `json:"servername,omitempty"` - Servicetype string `json:"servicetype,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` Publicip string `json:"publicip,omitempty"` Publicport int `json:"publicport,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Sitename string `json:"sitename,omitempty"` - State string `json:"state,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` + Servername string `json:"servername,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` Siteprefix string `json:"siteprefix,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - Hashid int `json:"hashid,omitempty"` - Comment string `json:"comment,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Naptrreplacement string `json:"naptrreplacement,omitempty"` - Naptrorder int `json:"naptrorder,omitempty"` - Naptrservices string `json:"naptrservices,omitempty"` - Naptrdomainttl int `json:"naptrdomainttl,omitempty"` - Naptrpreference int `json:"naptrpreference,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Viewname string `json:"viewname,omitempty"` - Viewip string `json:"viewip,omitempty"` - Weight int `json:"weight,omitempty"` - Monitornamesvc string `json:"monitor_name_svc,omitempty"` - Newname string `json:"newname,omitempty"` - Gslb string `json:"gslb,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold string `json:"gslbthreshold,omitempty"` - Gslbsvcstats string `json:"gslbsvcstats,omitempty"` - Monstate string `json:"monstate,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Monitorstate string `json:"monitor_state,omitempty"` + State string `json:"state,omitempty"` Statechangetimesec string `json:"statechangetimesec,omitempty"` - Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` + Svrstate string `json:"svrstate,omitempty"` Threshold string `json:"threshold,omitempty"` - Clmonowner string `json:"clmonowner,omitempty"` - Clmonview string `json:"clmonview,omitempty"` - Gslbsvchealth string `json:"gslbsvchealth,omitempty"` - Glsbsvchealthdescr string `json:"glsbsvchealthdescr,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Trofsdelay int `json:"trofsdelay,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbservicegroupbinding struct { +type GslbdomainGslbservicegroupBinding struct { + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` Servicegroupname string `json:"servicegroupname,omitempty"` } -type Gslbvserverservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` +type Gslbdomain struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type GslbvserverGslbservicegroupmemberBinding struct { Curstate string `json:"curstate,omitempty"` - Weight uint32 `json:"weight,omitempty"` Dynamicweight string `json:"dynamicweight,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` Preferredlocation string `json:"preferredlocation,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Thresholdvalue int32 `json:"thresholdvalue,omitempty"` - Gslbthreshold int32 `json:"gslbthreshold,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` Sitepersistcookie string `json:"sitepersistcookie,omitempty"` Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Name string `json:"name,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type GslbsiteGslbserviceBinding struct { + Cnameentry string `json:"cnameentry,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` + State string `json:"state,omitempty"` } -type Gslbdomainservicegroupbinding struct { +type GslbsiteGslbservicegroupmemberBinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Port int `json:"port,omitempty"` Servicegroupname string `json:"servicegroupname,omitempty"` - Name string `json:"name,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` + State string `json:"state,omitempty"` } -type Gslbdomainvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - State string `json:"state,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Edr string `json:"edr,omitempty"` - Mir string `json:"mir,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Cip string `json:"cip,omitempty"` - Persistenceid uint32 `json:"persistenceid,omitempty"` - Netmask string `json:"netmask,omitempty"` - V6netmasklen uint32 `json:"v6netmasklen,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - V6persistmasklen uint32 `json:"v6persistmasklen,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbservicemonitorbinding struct { - Monitorname string `json:"monitor_name,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monitorstate string `json:"monitor_state,omitempty"` - Weight uint32 `json:"weight,omitempty"` - Totalfailedprobes uint32 `json:"totalfailedprobes,omitempty"` - Failedprobes uint32 `json:"failedprobes,omitempty"` - Monstatcode int32 `json:"monstatcode,omitempty"` - Monstatparam1 int32 `json:"monstatparam1,omitempty"` - Monstatparam2 int32 `json:"monstatparam2,omitempty"` - Monstatparam3 int32 `json:"monstatparam3,omitempty"` - Responsetime uint64 `json:"responsetime,omitempty"` - Monitortotalprobes uint32 `json:"monitortotalprobes,omitempty"` - Monitortotalfailedprobes uint32 `json:"monitortotalfailedprobes,omitempty"` - Monitorcurrentfailedprobes uint32 `json:"monitorcurrentfailedprobes,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Servicename string `json:"servicename,omitempty"` -} - -type Gslbservicegroup struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - State string `json:"state,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Comment string `json:"comment,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Autoscale string `json:"autoscale,omitempty"` - Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Servername string `json:"servername,omitempty"` - Port int `json:"port,omitempty"` - Weight int `json:"weight,omitempty"` - Hashid int `json:"hashid,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Order int `json:"order,omitempty"` - Monitornamesvc string `json:"monitor_name_svc,omitempty"` - Dupweight int `json:"dup_weight,omitempty"` - Delay int `json:"delay,omitempty"` - Graceful string `json:"graceful,omitempty"` - Includemembers bool `json:"includemembers,omitempty"` - Newname string `json:"newname,omitempty"` - Numofconnections string `json:"numofconnections,omitempty"` - Serviceconftype string `json:"serviceconftype,omitempty"` - Value string `json:"value,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Ip string `json:"ip,omitempty"` - Monstatcode string `json:"monstatcode,omitempty"` - Monstatparam1 string `json:"monstatparam1,omitempty"` - Monstatparam2 string `json:"monstatparam2,omitempty"` - Monstatparam3 string `json:"monstatparam3,omitempty"` - Statechangetimemsec string `json:"statechangetimemsec,omitempty"` - Stateupdatereason string `json:"stateupdatereason,omitempty"` - Clmonowner string `json:"clmonowner,omitempty"` - Clmonview string `json:"clmonview,omitempty"` - Groupcount string `json:"groupcount,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` - Gslb string `json:"gslb,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Gslbservicegroupservicegroupmemberbinding struct { - Ip string `json:"ip,omitempty"` - Port int32 `json:"port,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Tickssincelaststatechange uint32 `json:"tickssincelaststatechange,omitempty"` - Weight uint32 `json:"weight,omitempty"` - Servername string `json:"servername,omitempty"` - State string `json:"state,omitempty"` - Hashid uint32 `json:"hashid,omitempty"` - Graceful string `json:"graceful,omitempty"` - Delay uint64 `json:"delay,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int32 `json:"publicport,omitempty"` - Gslbthreshold int32 `json:"gslbthreshold,omitempty"` - Threshold string `json:"threshold,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type GslbsiteBinding struct { + GslbsiteGslbserviceBinding []interface{} `json:"gslbsite_gslbservice_binding,omitempty"` + GslbsiteGslbservicegroupBinding []interface{} `json:"gslbsite_gslbservicegroup_binding,omitempty"` + GslbsiteGslbservicegroupmemberBinding []interface{} `json:"gslbsite_gslbservicegroupmember_binding,omitempty"` + Sitename string `json:"sitename,omitempty"` } -type Gslbsitebinding struct { - Sitename string `json:"sitename,omitempty"` -} - -type Gslbsiteservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` +type GslbdomainGslbserviceBinding struct { + Cnameentry string `json:"cnameentry,omitempty"` + Cumulativeweight int `json:"cumulativeweight,omitempty"` + Dynamicconfwt int `json:"dynamicconfwt,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Port int `json:"port,omitempty"` + Servicename string `json:"servicename,omitempty"` Servicetype string `json:"servicetype,omitempty"` State string `json:"state,omitempty"` - Sitename string `json:"sitename,omitempty"` -} - -type Gslbvserverbinding struct { - Name string `json:"name,omitempty"` -} - -type Gslbdomainlbmonitorbinding struct { - Monitorname string `json:"monitorname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Vservername string `json:"vservername,omitempty"` - Monstate string `json:"monstate,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Respcode string `json:"respcode,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Grpchealthcheck string `json:"grpchealthcheck,omitempty"` - Grpcstatuscode int `json:"grpcstatuscode,omitempty"` - Grpcservicename string `json:"grpcservicename,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbldnsentries struct { - Nodeid int `json:"nodeid,omitempty"` - Sitename string `json:"sitename,omitempty"` - Numsites string `json:"numsites,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Ttl string `json:"ttl,omitempty"` - Name string `json:"name,omitempty"` - Rtt string `json:"rtt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Gslbservicednsviewbinding struct { - Viewname string `json:"viewname,omitempty"` - Viewip string `json:"viewip,omitempty"` - Servicename string `json:"servicename,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Vservername string `json:"vservername,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbserviceviewbinding struct { - Viewname string `json:"viewname,omitempty"` - Viewip string `json:"viewip,omitempty"` - Servicename string `json:"servicename,omitempty"` +type GslbvserverGslbservicegroupBinding struct { + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type Gslbsitegslbservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - State string `json:"state,omitempty"` - Sitename string `json:"sitename,omitempty"` +type GslbsiteGslbservicegroupBinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` } -type Gslbsyncstatus struct { - Summary bool `json:"summary,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type GslbservicegroupLbmonitorBinding struct { + Hashid int `json:"hashid,omitempty"` + MonitorName string `json:"monitor_name,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monweight int `json:"monweight,omitempty"` + Order int `json:"order,omitempty"` + Passive bool `json:"passive,omitempty"` + Port int `json:"port,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbvserverdomainbinding struct { - Domainname string `json:"domainname,omitempty"` - Ttl int `json:"ttl,omitempty"` +type GslbvserverDomainBinding struct { Backupip string `json:"backupip,omitempty"` - Cookiedomain string `json:"cookie_domain,omitempty"` + Backupipflag bool `json:"backupipflag,omitempty"` + CookieDomain string `json:"cookie_domain,omitempty"` + CookieDomainflag bool `json:"cookie_domainflag,omitempty"` Cookietimeout int `json:"cookietimeout,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` + Domainname string `json:"domainname,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Backupipflag bool `json:"backupipflag,omitempty"` - Cookiedomainflag bool `json:"cookie_domainflag,omitempty"` + Sitedomainttl int `json:"sitedomainttl,omitempty"` + Ttl int `json:"ttl,omitempty"` } -type Gslbvservergslbservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Weight int `json:"weight,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` - Curstate string `json:"curstate,omitempty"` - Dynamicconfwt int `json:"dynamicconfwt,omitempty"` - Cumulativeweight int `json:"cumulativeweight,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` - Iscname string `json:"iscname,omitempty"` - Domainname string `json:"domainname,omitempty"` - Sitepersistcookie string `json:"sitepersistcookie,omitempty"` - Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` - Name string `json:"name,omitempty"` +type GslbdomainBinding struct { + GslbdomainGslbserviceBinding []interface{} `json:"gslbdomain_gslbservice_binding,omitempty"` + GslbdomainGslbservicegroupBinding []interface{} `json:"gslbdomain_gslbservicegroup_binding,omitempty"` + GslbdomainGslbservicegroupmemberBinding []interface{} `json:"gslbdomain_gslbservicegroupmember_binding,omitempty"` + GslbdomainGslbvserverBinding []interface{} `json:"gslbdomain_gslbvserver_binding,omitempty"` + GslbdomainLbmonitorBinding []interface{} `json:"gslbdomain_lbmonitor_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Gslbdomainbinding struct { - Name string `json:"name,omitempty"` +type GslbserviceBinding struct { + GslbserviceDnsviewBinding []interface{} `json:"gslbservice_dnsview_binding,omitempty"` + GslbserviceLbmonitorBinding []interface{} `json:"gslbservice_lbmonitor_binding,omitempty"` + Servicename string `json:"servicename,omitempty"` } -type Gslbdomainservicegroupmemberbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` +type GslbserviceLbmonitorBinding struct { + Failedprobes int `json:"failedprobes,omitempty"` + Lastresponse string `json:"lastresponse,omitempty"` + MonitorName string `json:"monitor_name,omitempty"` + MonitorState string `json:"monitor_state,omitempty"` + Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` + Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` + Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Responsetime int `json:"responsetime,omitempty"` + Servicename string `json:"servicename,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type GslbdomainGslbservicegroupmemberBinding struct { + Gslbthreshold int `json:"gslbthreshold,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Port int `json:"port,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` Servicetype string `json:"servicetype,omitempty"` - Weight uint32 `json:"weight,omitempty"` Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int32 `json:"gslbthreshold,omitempty"` - Name string `json:"name,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbparameter struct { - Ldnsentrytimeout int `json:"ldnsentrytimeout,omitempty"` - Rtttolerance int `json:"rtttolerance,omitempty"` - Ldnsmask string `json:"ldnsmask,omitempty"` - V6ldnsmasklen int `json:"v6ldnsmasklen,omitempty"` - Ldnsprobeorder []string `json:"ldnsprobeorder,omitempty"` - Dropldnsreq string `json:"dropldnsreq,omitempty"` - Gslbsvcstatedelaytime int `json:"gslbsvcstatedelaytime,omitempty"` - Svcstatelearningtime int `json:"svcstatelearningtime,omitempty"` - Automaticconfigsync string `json:"automaticconfigsync,omitempty"` - Mepkeepalivetimeout int `json:"mepkeepalivetimeout,omitempty"` - Gslbsyncinterval int `json:"gslbsyncinterval,omitempty"` - Gslbsyncmode string `json:"gslbsyncmode,omitempty"` - Gslbsynclocfiles string `json:"gslbsynclocfiles,omitempty"` - Gslbconfigsyncmonitor string `json:"gslbconfigsyncmonitor,omitempty"` - Gslbsyncsaveconfigcommand string `json:"gslbsyncsaveconfigcommand,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Flags string `json:"flags,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Incarnation string `json:"incarnation,omitempty"` - Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Gslbservice struct { + Appflowlog string `json:"appflowlog,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Clmonowner int `json:"clmonowner,omitempty"` + Clmonview int `json:"clmonview,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Cnameentry string `json:"cnameentry,omitempty"` + Comment string `json:"comment,omitempty"` + Cookietimeout int `json:"cookietimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Glsbsvchealthdescr string `json:"glsbsvchealthdescr,omitempty"` + Gslb string `json:"gslb,omitempty"` + Gslbsvchealth int `json:"gslbsvchealth,omitempty"` + Gslbsvcstats int `json:"gslbsvcstats,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Hashid int `json:"hashid,omitempty"` + Healthmonitor string `json:"healthmonitor,omitempty"` + Ip string `json:"ip,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + MonitorNameSvc string `json:"monitor_name_svc,omitempty"` + MonitorState string `json:"monitor_state,omitempty"` + Monstate string `json:"monstate,omitempty"` + Monthreshold int `json:"monthreshold,omitempty"` + Naptrdomainttl int `json:"naptrdomainttl,omitempty"` + Naptrorder int `json:"naptrorder,omitempty"` + Naptrpreference int `json:"naptrpreference,omitempty"` + Naptrreplacement string `json:"naptrreplacement,omitempty"` + Naptrservices string `json:"naptrservices,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Port int `json:"port,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Publicip string `json:"publicip,omitempty"` + Publicport int `json:"publicport,omitempty"` + Servername string `json:"servername,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + State string `json:"state,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Svrtimeout int `json:"svrtimeout,omitempty"` + Threshold string `json:"threshold,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Viewip string `json:"viewip,omitempty"` + Viewname string `json:"viewname,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbservicegroupgslbservicegroupmemberbinding struct { - Ip string `json:"ip,omitempty"` - Port int `json:"port,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Weight int `json:"weight,omitempty"` - Servername string `json:"servername,omitempty"` - State string `json:"state,omitempty"` - Hashid int `json:"hashid,omitempty"` - Graceful string `json:"graceful,omitempty"` - Delay int `json:"delay,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Threshold string `json:"threshold,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` - Trofsdelay int `json:"trofsdelay,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type Gslbconfig struct { + Command string `json:"command,omitempty"` + Debug bool `json:"debug,omitempty"` + Forcesync string `json:"forcesync,omitempty"` + Nowarn bool `json:"nowarn,omitempty"` + Preview bool `json:"preview,omitempty"` + Saveconfig bool `json:"saveconfig,omitempty"` +} + +type Gslbrunningconfig struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` } type Gslbsite struct { - Sitename string `json:"sitename,omitempty"` - Sitetype string `json:"sitetype,omitempty"` - Siteipaddress string `json:"siteipaddress,omitempty"` - Publicip string `json:"publicip,omitempty"` + Backupparentlist []string `json:"backupparentlist,omitempty"` + Clip string `json:"clip,omitempty"` + Count float64 `json:"__count,omitempty"` + Curbackupparentip string `json:"curbackupparentip,omitempty"` Metricexchange string `json:"metricexchange,omitempty"` + Naptrreplacementsuffix string `json:"naptrreplacementsuffix,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Nwmetricexchange string `json:"nwmetricexchange,omitempty"` - Sessionexchange string `json:"sessionexchange,omitempty"` - Triggermonitor string `json:"triggermonitor,omitempty"` + Oldname string `json:"oldname,omitempty"` Parentsite string `json:"parentsite,omitempty"` - Clip string `json:"clip,omitempty"` + Persistencemepstatus string `json:"persistencemepstatus,omitempty"` Publicclip string `json:"publicclip,omitempty"` - Naptrreplacementsuffix string `json:"naptrreplacementsuffix,omitempty"` - Backupparentlist []string `json:"backupparentlist,omitempty"` + Publicip string `json:"publicip,omitempty"` + Sessionexchange string `json:"sessionexchange,omitempty"` + Siteipaddress string `json:"siteipaddress,omitempty"` + Sitename string `json:"sitename,omitempty"` Sitepassword string `json:"sitepassword,omitempty"` - Newname string `json:"newname,omitempty"` - Status string `json:"status,omitempty"` - Persistencemepstatus string `json:"persistencemepstatus,omitempty"` - Version string `json:"version,omitempty"` - Curbackupparentip string `json:"curbackupparentip,omitempty"` Sitestate string `json:"sitestate,omitempty"` - Oldname string `json:"oldname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Gslbsitegslbservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` -} - -type Gslbvserver struct { - Name string `json:"name,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Iptype string `json:"iptype,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Backupsessiontimeout int `json:"backupsessiontimeout,omitempty"` - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Netmask string `json:"netmask,omitempty"` - V6netmasklen int `json:"v6netmasklen,omitempty"` - Rule string `json:"rule,omitempty"` - Tolerance int `json:"tolerance,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Timeout int `json:"timeout,omitempty"` - Edr string `json:"edr,omitempty"` - Ecs string `json:"ecs,omitempty"` - Ecsaddrvalidation string `json:"ecsaddrvalidation,omitempty"` - Mir string `json:"mir,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - State string `json:"state,omitempty"` - Considereffectivestate string `json:"considereffectivestate,omitempty"` - Comment string `json:"comment,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` - Sobackupaction string `json:"sobackupaction,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Toggleorder string `json:"toggleorder,omitempty"` - Orderthreshold int `json:"orderthreshold,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Servicename string `json:"servicename,omitempty"` - Weight int `json:"weight,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Domainname string `json:"domainname,omitempty"` - Ttl int `json:"ttl,omitempty"` - Backupip string `json:"backupip,omitempty"` - Cookiedomain string `json:"cookie_domain,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Order int `json:"order,omitempty"` - Newname string `json:"newname,omitempty"` - Curstate string `json:"curstate,omitempty"` - Status string `json:"status,omitempty"` - Lbrrreason string `json:"lbrrreason,omitempty"` - Iscname string `json:"iscname,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Totalservices string `json:"totalservices,omitempty"` - Activeservices string `json:"activeservices,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Statechangetimemsec string `json:"statechangetimemsec,omitempty"` - Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` - Health string `json:"health,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` - Vsvrbindsvcport string `json:"vsvrbindsvcport,omitempty"` - Servername string `json:"servername,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Currentactiveorder string `json:"currentactiveorder,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Gslbvserverlbpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` + Sitetype string `json:"sitetype,omitempty"` + Status string `json:"status,omitempty"` + Triggermonitor string `json:"triggermonitor,omitempty"` + Version int `json:"version,omitempty"` } -type Gslbservicegroupmonitorbinding struct { - Monitorname string `json:"monitor_name,omitempty"` - Monweight uint32 `json:"monweight,omitempty"` - Monstate string `json:"monstate,omitempty"` - Weight uint32 `json:"weight,omitempty"` - Passive bool `json:"passive,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Port int32 `json:"port,omitempty"` - State string `json:"state,omitempty"` - Hashid uint32 `json:"hashid,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int32 `json:"publicport,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` +type Gslbsyncstatus struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` + Summary bool `json:"summary,omitempty"` } -type Gslbsiteservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - State string `json:"state,omitempty"` - Sitename string `json:"sitename,omitempty"` +type Gslbldnsentry struct { + Ipaddress string `json:"ipaddress,omitempty"` } -type Gslbvserverservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Weight uint32 `json:"weight,omitempty"` +type GslbvserverGslbserviceBinding struct { Cnameentry string `json:"cnameentry,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int32 `json:"port,omitempty"` - Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` + Cumulativeweight int `json:"cumulativeweight,omitempty"` Curstate string `json:"curstate,omitempty"` - Dynamicconfwt uint32 `json:"dynamicconfwt,omitempty"` - Cumulativeweight uint32 `json:"cumulativeweight,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Gslbthreshold int32 `json:"gslbthreshold,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Thresholdvalue int32 `json:"thresholdvalue,omitempty"` - Iscname string `json:"iscname,omitempty"` Domainname string `json:"domainname,omitempty"` + Dynamicconfwt int `json:"dynamicconfwt,omitempty"` + Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` + Gslbthreshold int `json:"gslbthreshold,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Iscname string `json:"iscname,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Servicename string `json:"servicename,omitempty"` Sitepersistcookie string `json:"sitepersistcookie,omitempty"` Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbvserverspilloverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` -} - -type Gslbdomaingslbservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Order int `json:"order,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbdomainmonitorbinding struct { - Monitorname string `json:"monitorname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Vservername string `json:"vservername,omitempty"` - Monstate string `json:"monstate,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Respcode string `json:"respcode,omitempty"` - Monitortotalprobes uint32 `json:"monitortotalprobes,omitempty"` - Monitortotalfailedprobes uint32 `json:"monitortotalfailedprobes,omitempty"` - Monitorcurrentfailedprobes uint32 `json:"monitorcurrentfailedprobes,omitempty"` - Responsetime uint64 `json:"responsetime,omitempty"` - Monstatcode int32 `json:"monstatcode,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Name string `json:"name,omitempty"` -} - -type Gslbservicegroupservicegroupentitymonbindingsbinding struct { - Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` - Monitorname string `json:"monitor_name,omitempty"` - Monitorstate string `json:"monitor_state,omitempty"` - Passive bool `json:"passive,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Port int `json:"port,omitempty"` - Weight int `json:"weight,omitempty"` - State string `json:"state,omitempty"` - Hashid int `json:"hashid,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` - Order int `json:"order,omitempty"` -} - -type Gslbsiteservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` + Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Weight int `json:"weight,omitempty"` } -type Gslbvserverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Name string `json:"name,omitempty"` +type GslbdomainGslbvserverBinding struct { + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Cip string `json:"cip,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Dnsrecordtype string `json:"dnsrecordtype,omitempty"` + Dynamicweight string `json:"dynamicweight,omitempty"` + Edr string `json:"edr,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Mir string `json:"mir,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Persistenceid int `json:"persistenceid,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sitename string `json:"sitename,omitempty"` + Sitepersistence string `json:"sitepersistence,omitempty"` + Siteprefix string `json:"siteprefix,omitempty"` + State string `json:"state,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + V6netmasklen int `json:"v6netmasklen,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Vservername string `json:"vservername,omitempty"` } diff --git a/nitrogo/models/ha.go b/nitrogo/models/ha.go index 590a5bf..40baaf8 100644 --- a/nitrogo/models/ha.go +++ b/nitrogo/models/ha.go @@ -1,97 +1,100 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Hafailover struct { - Force bool `json:"force,omitempty"` -} - -type Hanode struct { - Id int `json:"id"` - Ipaddress string `json:"ipaddress,omitempty"` - Inc string `json:"inc,omitempty"` - Rpcnodepassword string `json:"rpcnodepassword,omitempty"` - Hastatus string `json:"hastatus,omitempty"` - Hasync string `json:"hasync,omitempty"` - Haprop string `json:"haprop,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Deadinterval int `json:"deadinterval,omitempty"` - Failsafe string `json:"failsafe,omitempty"` - Maxflips int `json:"maxflips,omitempty"` - Maxfliptime int `json:"maxfliptime,omitempty"` - Syncvlan int `json:"syncvlan,omitempty"` - Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` - Name string `json:"name,omitempty"` - Flags string `json:"flags,omitempty"` - State string `json:"state,omitempty"` - Enaifaces string `json:"enaifaces,omitempty"` - Disifaces string `json:"disifaces,omitempty"` - Hamonifaces string `json:"hamonifaces,omitempty"` - Haheartbeatifaces string `json:"haheartbeatifaces,omitempty"` - Pfifaces string `json:"pfifaces,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Netmask string `json:"netmask,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Masterstatetime string `json:"masterstatetime,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Curflips string `json:"curflips,omitempty"` - Completedfliptime string `json:"completedfliptime,omitempty"` - Routemonitorstate string `json:"routemonitorstate,omitempty"` - Hasyncfailurereason string `json:"hasyncfailurereason,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Hanodepartialfailureinterfacesbinding struct { - Pfifaces string `json:"pfifaces,omitempty"` - Id int `json:"id,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` +// ha configuration structs +type Hasyncfailures struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` } -type Hanoderoutemonitor6binding struct { - Routemonitor string `json:"routemonitor,omitempty"` - Netmask string `json:"netmask,omitempty"` +type HanodeRoutemonitor6Binding struct { Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` Routemonitorstate string `json:"routemonitorstate,omitempty"` - Id int `json:"id"` } -type Hanoderoutemonitorbinding struct { - Routemonitor string `json:"routemonitor,omitempty"` - Netmask string `json:"netmask,omitempty"` +type HanodeRoutemonitorBinding struct { Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` Routemonitorstate string `json:"routemonitorstate,omitempty"` - Id int `json:"id"` -} - -type Hasync struct { - Force bool `json:"force,omitempty"` - Save string `json:"save,omitempty"` } type Hafiles struct { Mode []string `json:"mode,omitempty"` } -type Hanodebinding struct { - Id int `json:"id,omitempty"` +type HanodeCiBinding struct { + Enaifaces string `json:"enaifaces,omitempty"` + Id int `json:"id,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` +} + +type Hafailover struct { + Force bool `json:"force,omitempty"` +} + +type Hanode struct { + Completedfliptime int `json:"completedfliptime,omitempty"` + Count float64 `json:"__count,omitempty"` + Curflips int `json:"curflips,omitempty"` + Deadinterval int `json:"deadinterval,omitempty"` + Disifaces string `json:"disifaces,omitempty"` + Enaifaces string `json:"enaifaces,omitempty"` + Failsafe string `json:"failsafe,omitempty"` + Flags int `json:"flags,omitempty"` + Haheartbeatifaces string `json:"haheartbeatifaces,omitempty"` + Hamonifaces string `json:"hamonifaces,omitempty"` + Haprop string `json:"haprop,omitempty"` + Hastatus string `json:"hastatus,omitempty"` + Hasync string `json:"hasync,omitempty"` + Hasyncfailurereason string `json:"hasyncfailurereason,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Inc string `json:"inc,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Masterstatetime int `json:"masterstatetime,omitempty"` + Maxflips int `json:"maxflips,omitempty"` + Maxfliptime int `json:"maxfliptime,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pfifaces string `json:"pfifaces,omitempty"` + Routemonitor string `json:"routemonitor,omitempty"` + Routemonitorstate string `json:"routemonitorstate,omitempty"` + Rpcnodepassword string `json:"rpcnodepassword,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + State string `json:"state,omitempty"` + Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` + Syncvlan int `json:"syncvlan,omitempty"` } -type Hanodecibinding struct { +type HanodeFisBinding struct { Enaifaces string `json:"enaifaces,omitempty"` Id int `json:"id,omitempty"` + Name string `json:"name,omitempty"` Routemonitor string `json:"routemonitor,omitempty"` } -type Hanodefisbinding struct { - Name string `json:"name,omitempty"` - Enaifaces string `json:"enaifaces,omitempty"` +type HanodeBinding struct { + HanodeCiBinding []interface{} `json:"hanode_ci_binding,omitempty"` + HanodeFisBinding []interface{} `json:"hanode_fis_binding,omitempty"` + HanodePartialfailureinterfacesBinding []interface{} `json:"hanode_partialfailureinterfaces_binding,omitempty"` + HanodeRoutemonitor6Binding []interface{} `json:"hanode_routemonitor6_binding,omitempty"` + HanodeRoutemonitorBinding []interface{} `json:"hanode_routemonitor_binding,omitempty"` + Id int `json:"id,omitempty"` +} + +type HanodePartialfailureinterfacesBinding struct { Id int `json:"id,omitempty"` + Pfifaces string `json:"pfifaces,omitempty"` Routemonitor string `json:"routemonitor,omitempty"` } -type Hasyncfailures struct { - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Hasync struct { + Force bool `json:"force,omitempty"` + Save string `json:"save,omitempty"` } diff --git a/nitrogo/models/ica.go b/nitrogo/models/ica.go index 6487a7d..bfe009c 100644 --- a/nitrogo/models/ica.go +++ b/nitrogo/models/ica.go @@ -1,150 +1,130 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Icapolicyglobalbinding struct { +// ica configuration structs +type IcapolicyCrvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` -} - -type Icapolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` } -type Icapolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type IcaglobalIcapolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Icaaccessprofile struct { - Name string `json:"name,omitempty"` - Connectclientlptports string `json:"connectclientlptports,omitempty"` - Clientaudioredirection string `json:"clientaudioredirection,omitempty"` - Localremotedatasharing string `json:"localremotedatasharing,omitempty"` - Clientclipboardredirection string `json:"clientclipboardredirection,omitempty"` - Clientcomportredirection string `json:"clientcomportredirection,omitempty"` - Clientdriveredirection string `json:"clientdriveredirection,omitempty"` - Clientprinterredirection string `json:"clientprinterredirection,omitempty"` - Multistream string `json:"multistream,omitempty"` - Clientusbdriveredirection string `json:"clientusbdriveredirection,omitempty"` - Clienttwaindeviceredirection string `json:"clienttwaindeviceredirection,omitempty"` - Wiaredirection string `json:"wiaredirection,omitempty"` - Draganddrop string `json:"draganddrop,omitempty"` - Smartcardredirection string `json:"smartcardredirection,omitempty"` - Fido2redirection string `json:"fido2redirection,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Icalatencyprofile struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + L7latencymaxnotifycount int `json:"l7latencymaxnotifycount,omitempty"` + L7latencymonitoring string `json:"l7latencymonitoring,omitempty"` + L7latencynotifyinterval int `json:"l7latencynotifyinterval,omitempty"` + L7latencythresholdfactor int `json:"l7latencythresholdfactor,omitempty"` + L7latencywaittime int `json:"l7latencywaittime,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Refcnt int `json:"refcnt,omitempty"` } type Icaaction struct { - Name string `json:"name,omitempty"` - Accessprofilename string `json:"accessprofilename,omitempty"` - Latencyprofilename string `json:"latencyprofilename,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Accessprofilename string `json:"accessprofilename,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Latencyprofilename string `json:"latencyprofilename,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Icaglobalicapolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` +type IcapolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Icaglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type IcaglobalBinding struct { + IcaglobalIcapolicyBinding []interface{} `json:"icaglobal_icapolicy_binding,omitempty"` } type Icaparameter struct { - Enablesronhafailover string `json:"enablesronhafailover,omitempty"` - Hdxinsightnonnsap string `json:"hdxinsightnonnsap,omitempty"` - Edtpmtuddf string `json:"edtpmtuddf,omitempty"` - Edtpmtuddftimeout int `json:"edtpmtuddftimeout,omitempty"` - L7latencyfrequency int `json:"l7latencyfrequency,omitempty"` - Edtlosstolerant string `json:"edtlosstolerant,omitempty"` - Edtpmtudrediscovery string `json:"edtpmtudrediscovery,omitempty"` - Dfpersistence string `json:"dfpersistence,omitempty"` - Builtin string `json:"builtin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Dfpersistence string `json:"dfpersistence,omitempty"` + Edtlosstolerant string `json:"edtlosstolerant,omitempty"` + Edtpmtuddf string `json:"edtpmtuddf,omitempty"` + Edtpmtuddftimeout int `json:"edtpmtuddftimeout,omitempty"` + Edtpmtudrediscovery string `json:"edtpmtudrediscovery,omitempty"` + Enablesronhafailover string `json:"enablesronhafailover,omitempty"` + Hdxinsightnonnsap string `json:"hdxinsightnonnsap,omitempty"` + Insightonlytodirector string `json:"insightonlytodirector,omitempty"` + L7latencyfrequency int `json:"l7latencyfrequency,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Icapolicyicaglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type IcapolicyIcaglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` -} - -type Icaglobalbinding struct { -} - -type Icalatencyprofile struct { - Name string `json:"name,omitempty"` - L7latencymonitoring string `json:"l7latencymonitoring,omitempty"` - L7latencythresholdfactor int `json:"l7latencythresholdfactor,omitempty"` - L7latencywaittime int `json:"l7latencywaittime,omitempty"` - L7latencynotifyinterval int `json:"l7latencynotifyinterval,omitempty"` - L7latencymaxnotifycount int `json:"l7latencymaxnotifycount,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` } type Icapolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Icapolicybinding struct { - Name string `json:"name,omitempty"` +type IcapolicyBinding struct { + IcapolicyCrvserverBinding []interface{} `json:"icapolicy_crvserver_binding,omitempty"` + IcapolicyIcaglobalBinding []interface{} `json:"icapolicy_icaglobal_binding,omitempty"` + IcapolicyVpnvserverBinding []interface{} `json:"icapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Icapolicycrvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` +type Icaaccessprofile struct { + Builtin []string `json:"builtin,omitempty"` + Clientaudioredirection string `json:"clientaudioredirection,omitempty"` + Clientclipboardredirection string `json:"clientclipboardredirection,omitempty"` + Clientcomportredirection string `json:"clientcomportredirection,omitempty"` + Clientdriveredirection string `json:"clientdriveredirection,omitempty"` + Clientprinterredirection string `json:"clientprinterredirection,omitempty"` + Clienttwaindeviceredirection string `json:"clienttwaindeviceredirection,omitempty"` + Clientusbdriveredirection string `json:"clientusbdriveredirection,omitempty"` + Connectclientlptports string `json:"connectclientlptports,omitempty"` + Count float64 `json:"__count,omitempty"` + Draganddrop string `json:"draganddrop,omitempty"` + Feature string `json:"feature,omitempty"` + Fido2redirection string `json:"fido2redirection,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Localremotedatasharing string `json:"localremotedatasharing,omitempty"` + Multistream string `json:"multistream,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Smartcardredirection string `json:"smartcardredirection,omitempty"` + Wiaredirection string `json:"wiaredirection,omitempty"` } diff --git a/nitrogo/models/ipsec.go b/nitrogo/models/ipsec.go index 10dc69e..6af73d9 100644 --- a/nitrogo/models/ipsec.go +++ b/nitrogo/models/ipsec.go @@ -1,40 +1,38 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// ipsec configuration structs type Ipsecparameter struct { - Ikeversion string `json:"ikeversion,omitempty"` Encalgo []string `json:"encalgo,omitempty"` Hashalgo []string `json:"hashalgo,omitempty"` + Ikeretryinterval int `json:"ikeretryinterval,omitempty"` + Ikeversion string `json:"ikeversion,omitempty"` Lifetime int `json:"lifetime,omitempty"` Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` - Replaywindowsize int `json:"replaywindowsize,omitempty"` - Ikeretryinterval int `json:"ikeretryinterval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` - Retransmissiontime int `json:"retransmissiontime,omitempty"` + Replaywindowsize int `json:"replaywindowsize,omitempty"` Responderonly string `json:"responderonly,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Retransmissiontime int `json:"retransmissiontime,omitempty"` } type Ipsecprofile struct { - Name string `json:"name,omitempty"` - Ikeversion string `json:"ikeversion,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` Encalgo []string `json:"encalgo,omitempty"` + Feature string `json:"feature,omitempty"` Hashalgo []string `json:"hashalgo,omitempty"` + Ikeretryinterval int `json:"ikeretryinterval,omitempty"` + Ikeversion string `json:"ikeversion,omitempty"` Lifetime int `json:"lifetime,omitempty"` + Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Peerpublickey string `json:"peerpublickey,omitempty"` + Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` + Privatekey string `json:"privatekey,omitempty"` Psk string `json:"psk,omitempty"` Publickey string `json:"publickey,omitempty"` - Privatekey string `json:"privatekey,omitempty"` - Peerpublickey string `json:"peerpublickey,omitempty"` - Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` Replaywindowsize int `json:"replaywindowsize,omitempty"` - Ikeretryinterval int `json:"ikeretryinterval,omitempty"` - Retransmissiontime int `json:"retransmissiontime,omitempty"` - Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` Responderonly string `json:"responderonly,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Retransmissiontime int `json:"retransmissiontime,omitempty"` } diff --git a/nitrogo/models/ipsecalg.go b/nitrogo/models/ipsecalg.go index da2ce1d..9836d92 100644 --- a/nitrogo/models/ipsecalg.go +++ b/nitrogo/models/ipsecalg.go @@ -1,26 +1,25 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Ipsecalgprofile struct { - Name string `json:"name,omitempty"` - Ikesessiontimeout int `json:"ikesessiontimeout,omitempty"` - Espsessiontimeout int `json:"espsessiontimeout,omitempty"` - Espgatetimeout int `json:"espgatetimeout,omitempty"` - Connfailover string `json:"connfailover,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// ipsecalg configuration structs +type Ipsecalgsession struct { + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + DestipAlg string `json:"destip_alg,omitempty"` + Natip string `json:"natip,omitempty"` + NatipAlg string `json:"natip_alg,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sourceip string `json:"sourceip,omitempty"` + SourceipAlg string `json:"sourceip_alg,omitempty"` + Spiin int `json:"spiin,omitempty"` + Spiout int `json:"spiout,omitempty"` } -type Ipsecalgsession struct { - Sourceipalg string `json:"sourceip_alg,omitempty"` - Natipalg string `json:"natip_alg,omitempty"` - Destipalg string `json:"destip_alg,omitempty"` - Sourceip string `json:"sourceip,omitempty"` - Natip string `json:"natip,omitempty"` - Destip string `json:"destip,omitempty"` - Spiin string `json:"spiin,omitempty"` - Spiout string `json:"spiout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Ipsecalgprofile struct { + Connfailover string `json:"connfailover,omitempty"` + Count float64 `json:"__count,omitempty"` + Espgatetimeout int `json:"espgatetimeout,omitempty"` + Espsessiontimeout int `json:"espsessiontimeout,omitempty"` + Ikesessiontimeout int `json:"ikesessiontimeout,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/kafka.go b/nitrogo/models/kafka.go index 01eefbc..e3c056a 100644 --- a/nitrogo/models/kafka.go +++ b/nitrogo/models/kafka.go @@ -1,23 +1,22 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// kafka configuration structs type Kafkacluster struct { - Name string `json:"name,omitempty"` - Activesvc string `json:"activesvc,omitempty"` - Totalsvc string `json:"totalsvc,omitempty"` - Topicname string `json:"topicname,omitempty"` - Numtopics string `json:"numtopics,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Activesvc int `json:"activesvc,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numtopics int `json:"numtopics,omitempty"` + Topicname string `json:"topicname,omitempty"` + Totalsvc int `json:"totalsvc,omitempty"` } -type Kafkaclusterbinding struct { - Name string `json:"name,omitempty"` +type KafkaclusterBinding struct { + KafkaclusterServicegroupBinding []interface{} `json:"kafkacluster_servicegroup_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Kafkaclusterservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` +type KafkaclusterServicegroupBinding struct { Name string `json:"name,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } diff --git a/nitrogo/models/lb.go b/nitrogo/models/lb.go index 9aebdd6..51102d6 100644 --- a/nitrogo/models/lb.go +++ b/nitrogo/models/lb.go @@ -1,1109 +1,1006 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Lbvserverfilterpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +// lb configuration structs +type LbvserverRewritepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbpolicygslbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` +type LbvserverFeopolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbvserverprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` +type Lbmonbindings struct { + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Count float64 `json:"__count,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` } -type Lbvserverservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Port int `json:"port,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Curstate string `json:"curstate,omitempty"` - Weight int `json:"weight,omitempty"` - Dynamicweight int `json:"dynamicweight,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` - Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` - Name string `json:"name,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type LbvserverCsvserverBinding struct { + Cachetype string `json:"cachetype,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Pipolicyhits int `json:"pipolicyhits,omitempty"` + Policyname string `json:"policyname,omitempty"` + Policysubtype int `json:"policysubtype,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbvservertransformpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` +type LbmonitorBinding struct { + LbmonitorMetricBinding []interface{} `json:"lbmonitor_metric_binding,omitempty"` + LbmonitorSslcertkeyBinding []interface{} `json:"lbmonitor_sslcertkey_binding,omitempty"` + Monitorname string `json:"monitorname,omitempty"` } -type Lbvservervideooptimizationpacingpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbmonbindingsBinding struct { + LbmonbindingsGslbservicegroupBinding []interface{} `json:"lbmonbindings_gslbservicegroup_binding,omitempty"` + LbmonbindingsServiceBinding []interface{} `json:"lbmonbindings_service_binding,omitempty"` + LbmonbindingsServicegroupBinding []interface{} `json:"lbmonbindings_servicegroup_binding,omitempty"` + Monitorname string `json:"monitorname,omitempty"` +} + +type LbvserverBotpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbmetrictablebinding struct { - Metrictable string `json:"metrictable,omitempty"` +type Lbroute6 struct { + Count float64 `json:"__count,omitempty"` + Flags string `json:"flags,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` } -type Lbmonbindingsgslbservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monitorname string `json:"monitorname,omitempty"` +type LbpolicyGslbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbmonitorservicegroupbinding struct { - Monitorname string `json:"monitorname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Dupstate string `json:"dup_state,omitempty"` - Dupweight int `json:"dup_weight,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - State string `json:"state,omitempty"` - Weight int `json:"weight,omitempty"` +type LbvserverResponderpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbsipparameters struct { - Rnatsrcport int `json:"rnatsrcport,omitempty"` - Rnatdstport int `json:"rnatdstport,omitempty"` - Retrydur int `json:"retrydur,omitempty"` - Addrportvip string `json:"addrportvip,omitempty"` - Sip503ratethreshold int `json:"sip503ratethreshold,omitempty"` - Rnatsecuresrcport int `json:"rnatsecuresrcport,omitempty"` - Rnatsecuredstport int `json:"rnatsecuredstport,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbmonbindingsservicebinding struct { - Servicename string `json:"servicename,omitempty"` +type LbmonbindingsServiceBinding struct { Ipaddress string `json:"ipaddress,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Monsvcstate string `json:"monsvcstate,omitempty"` Port int `json:"port,omitempty"` + Servicename string `json:"servicename,omitempty"` Servicetype string `json:"servicetype,omitempty"` Svrstate string `json:"svrstate,omitempty"` - Monsvcstate string `json:"monsvcstate,omitempty"` - Monitorname string `json:"monitorname,omitempty"` } -type Lbvserverauditnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverTransformpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbmetrictable struct { - Metrictable string `json:"metrictable,omitempty"` - Metric string `json:"metric,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` - Metrictype string `json:"metrictype,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Lbaction struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Value []interface{} `json:"value,omitempty"` +} + +type LbvserverAuditsyslogpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbparameter struct { - Httponlycookieflag string `json:"httponlycookieflag,omitempty"` - Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` - Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` - Cookiepassphrase string `json:"cookiepassphrase,omitempty"` - Consolidatedlconn string `json:"consolidatedlconn,omitempty"` - Useportforhashlb string `json:"useportforhashlb,omitempty"` - Preferdirectroute string `json:"preferdirectroute,omitempty"` - Startuprrfactor int `json:"startuprrfactor,omitempty"` - Monitorskipmaxclient string `json:"monitorskipmaxclient,omitempty"` - Monitorconnectionclose string `json:"monitorconnectionclose,omitempty"` - Vserverspecificmac string `json:"vserverspecificmac,omitempty"` - Allowboundsvcremoval string `json:"allowboundsvcremoval,omitempty"` - Retainservicestate string `json:"retainservicestate,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` - Maxpipelinenat int `json:"maxpipelinenat,omitempty"` - Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` - Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` - Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` - Dropmqttjumbomessage string `json:"dropmqttjumbomessage,omitempty"` - Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` - Lbhashfingers int `json:"lbhashfingers,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Proximityfromself string `json:"proximityfromself,omitempty"` - Sessionsthreshold string `json:"sessionsthreshold,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` - Lbhashalgowinsize string `json:"lbhashalgowinsize,omitempty"` - Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LbglobalBinding struct { + LbglobalLbpolicyBinding []interface{} `json:"lbglobal_lbpolicy_binding,omitempty"` } -type LBVServer struct { - ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` - ActiveServices string `json:"activeservices,omitempty"` - APIProfile string `json:"apiprofile,omitempty"` - AppFlowLog string `json:"appflowlog,omitempty"` - Authentication string `json:"authentication,omitempty"` - AuthenticationHost string `json:"authenticationhost,omitempty"` - Authn401 string `json:"authn401,omitempty"` - AuthnProfile string `json:"authnprofile,omitempty"` - AuthnVSName string `json:"authnvsname,omitempty"` - BackupLBMethod string `json:"backuplbmethod,omitempty"` - BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` - BackupVServer string `json:"backupvserver,omitempty"` - BackupvServerStatus string `json:"backupvserverstatus,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - BypassAAAA string `json:"bypassaaaa,omitempty"` - Cacheable string `json:"cacheable,omitempty"` - CacheVServer string `json:"cachevserver,omitempty"` - CltTimeOut string `json:"clttimeout,omitempty"` - Comment string `json:"comment,omitempty"` - ConnFailOver string `json:"connfailover,omitempty"` - ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` - ConsolidatedLConngbl string `json:"consolidatedlconngbl,omitempty"` - CookieDomain string `json:"cookiedomain,omitempty"` - CookieName string `json:"cookiename,omitempty"` - CurrentactiveOrder string `json:"currentactiveorder,omitempty"` - CurState string `json:"curstate,omitempty"` - DataLength string `json:"datalength,omitempty"` - DataOffset string `json:"dataoffset,omitempty"` - DbProfileName string `json:"dbprofilename,omitempty"` - DbsLB string `json:"dbslb,omitempty"` - DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` - DNS64 string `json:"dns64,omitempty"` - DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` - DNSProfileName string `json:"dnsprofilename,omitempty"` - DNSVServerName string `json:"dnsvservername,omitempty"` - Domain string `json:"domain,omitempty"` - DownStateFlush string `json:"downstateflush,omitempty"` - EffectiveState string `json:"effectivestate,omitempty"` - GroupName string `json:"groupname,omitempty"` - Gt2GB string `json:"gt2gb,omitempty"` - HashLength int `json:"hashlength,omitempty"` - Health string `json:"health,omitempty"` - HealthThreshold string `json:"healththreshold,omitempty"` - Homepage string `json:"homepage,omitempty"` - HTTPProfileName string `json:"httpprofilename,omitempty"` - HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` - ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` - InsertVServerIPPort string `json:"insertvserveripport,omitempty"` - IPMapping string `json:"ipmapping,omitempty"` - IPMask string `json:"ipmask,omitempty"` - IPPattern string `json:"ippattern,omitempty"` - IPSet string `json:"ipset,omitempty"` - IPv46 string `json:"ipv46,omitempty"` - IsGSLB bool `json:"isgslb,omitempty"` - L2Conn string `json:"l2conn,omitempty"` - LBMethod string `json:"lbmethod,omitempty"` - LBProfileName string `json:"lbprofilename,omitempty"` - LBRRReason int `json:"lbrrreason,omitempty"` - ListenPolicy string `json:"listenpolicy,omitempty"` - ListenPriority string `json:"listenpriority,omitempty"` - M string `json:"m,omitempty"` - MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` - Map string `json:"map,omitempty"` - MaxAutoScaleMembers string `json:"maxautoscalemembers,omitempty"` - MinAutoScaleMembers string `json:"minautoscalemembers,omitempty"` - MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` - MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` - MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` - MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` - MySQLServerVersion string `json:"mysqlserverversion,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NetProfile string `json:"netprofile,omitempty"` - NewName string `json:"newname,omitempty"` - NewServiceRequest int `json:"newservicerequest,omitempty"` - NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` - NewserviceRequestUnit string `json:"newservicerequestunit,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NGName string `json:"ngname,omitempty"` - NodeFaultBindings string `json:"nodefaultbindings,omitempty"` - OracleServerVersion string `json:"oracleserverversion,omitempty"` - Order int `json:"order,omitempty"` - OrderThreshold string `json:"orderthreshold,omitempty"` - PersistAVPNO []int `json:"persistavpno,omitempty"` - PersistenceBackup string `json:"persistencebackup,omitempty"` - PersistenceType string `json:"persistencetype,omitempty"` - PersistMask string `json:"persistmask,omitempty"` - Port int `json:"port,omitempty"` - Precedence string `json:"precedence,omitempty"` - ProbePort int `json:"probeport,omitempty"` - ProbeProtocol string `json:"probeprotocol,omitempty"` - ProbeSuccessResponsecode string `json:"probesuccessresponsecode,omitempty"` - ProcessLocal string `json:"processlocal,omitempty"` - Push string `json:"push,omitempty"` - PushLabel string `json:"pushlabel,omitempty"` - PushMultiClients string `json:"pushmulticlients,omitempty"` - PushVServer string `json:"pushvserver,omitempty"` - QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` - QUICProfileName string `json:"quicprofilename,omitempty"` - Range string `json:"range,omitempty"` - RecursionAvailable string `json:"recursionavailable,omitempty"` - Redirect string `json:"redirect,omitempty"` - RedirectFromPort int `json:"redirectfromport,omitempty"` - RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` - RedirURL string `json:"redirurl,omitempty"` - RedirURLFlags bool `json:"redirurlflags,omitempty"` - Resrule string `json:"resrule,omitempty"` - RetainConnectionsonCluster string `json:"retainconnectionsoncluster,omitempty"` - RHIState string `json:"rhistate,omitempty"` - RTSPNAT string `json:"rtspnat,omitempty"` - Rule string `json:"rule,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - ServiceName string `json:"servicename,omitempty"` - ServiceType string `json:"servicetype,omitempty"` - Sessionless string `json:"sessionless,omitempty"` - SkipPersistency string `json:"skippersistency,omitempty"` - SoBackupAction string `json:"sobackupaction,omitempty"` - SoMethod string `json:"somethod,omitempty"` - SoPersistence string `json:"sopersistence,omitempty"` - SoPersistenceTimeout string `json:"sopersistencetimeout,omitempty"` - SoThreshold string `json:"sothreshold,omitempty"` - State string `json:"state,omitempty"` - StateChangeTimeMsec string `json:"statechangetimemsec,omitempty"` - StateChangeTimeSec string `json:"statechangetimesec,omitempty"` - StateChangeTimeSeconds string `json:"statechangetimeseconds,omitempty"` - Status int `json:"status,omitempty"` - TCPProbePort int `json:"tcpprobeport,omitempty"` - TCPProfileName string `json:"tcpprofilename,omitempty"` - Td string `json:"td,omitempty"` - ThresholdValue int `json:"thresholdvalue,omitempty"` - TicksSinceLastStateChange string `json:"tickssincelaststatechange,omitempty"` - Timeout int `json:"timeout,omitempty"` - ToggleOrder string `json:"toggleorder,omitempty"` - TOSID int `json:"tosid,omitempty"` - TotalServices string `json:"totalservices,omitempty"` - TROFSPersistence string `json:"trofspersistence,omitempty"` - Type string `json:"type,omitempty"` - V6NetMaskLen int `json:"v6netmasklen,omitempty"` - V6PersistMaskLen string `json:"v6persistmasklen,omitempty"` - Value string `json:"value,omitempty"` - Version int `json:"version,omitempty"` - VIPHeader string `json:"vipheader,omitempty"` - VSvrDynConnsoThreshold string `json:"vsvrdynconnsothreshold,omitempty"` - Weight int `json:"weight,omitempty"` -} - -type Lbvserverauditsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverAppflowpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Logaction string `json:"logaction,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Feature string `json:"feature,omitempty"` - Builtin string `json:"builtin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbgroupbinding struct { - Name string `json:"name,omitempty"` +type Lbroute struct { + Count float64 `json:"__count,omitempty"` + Flags string `json:"flags,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` +} + +type LbmonitorServiceBinding struct { + DupState string `json:"dup_state,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbpolicylabellbpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type LbvserverAppfwpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Lbvserverappqoepolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type LbvserverCachepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbvserverdnspolicy64binding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` +} + +type LbvserverBinding struct { + LbvserverAnalyticsprofileBinding []interface{} `json:"lbvserver_analyticsprofile_binding,omitempty"` + LbvserverAppflowpolicyBinding []interface{} `json:"lbvserver_appflowpolicy_binding,omitempty"` + LbvserverAppfwpolicyBinding []interface{} `json:"lbvserver_appfwpolicy_binding,omitempty"` + LbvserverAppqoepolicyBinding []interface{} `json:"lbvserver_appqoepolicy_binding,omitempty"` + LbvserverAuditnslogpolicyBinding []interface{} `json:"lbvserver_auditnslogpolicy_binding,omitempty"` + LbvserverAuditsyslogpolicyBinding []interface{} `json:"lbvserver_auditsyslogpolicy_binding,omitempty"` + LbvserverAuthorizationpolicyBinding []interface{} `json:"lbvserver_authorizationpolicy_binding,omitempty"` + LbvserverBotpolicyBinding []interface{} `json:"lbvserver_botpolicy_binding,omitempty"` + LbvserverCachepolicyBinding []interface{} `json:"lbvserver_cachepolicy_binding,omitempty"` + LbvserverCmppolicyBinding []interface{} `json:"lbvserver_cmppolicy_binding,omitempty"` + LbvserverContentinspectionpolicyBinding []interface{} `json:"lbvserver_contentinspectionpolicy_binding,omitempty"` + LbvserverCsvserverBinding []interface{} `json:"lbvserver_csvserver_binding,omitempty"` + LbvserverDnspolicy64Binding []interface{} `json:"lbvserver_dnspolicy64_binding,omitempty"` + LbvserverFeopolicyBinding []interface{} `json:"lbvserver_feopolicy_binding,omitempty"` + LbvserverLbpolicyBinding []interface{} `json:"lbvserver_lbpolicy_binding,omitempty"` + LbvserverResponderpolicyBinding []interface{} `json:"lbvserver_responderpolicy_binding,omitempty"` + LbvserverRewritepolicyBinding []interface{} `json:"lbvserver_rewritepolicy_binding,omitempty"` + LbvserverServiceBinding []interface{} `json:"lbvserver_service_binding,omitempty"` + LbvserverServicegroupBinding []interface{} `json:"lbvserver_servicegroup_binding,omitempty"` + LbvserverServicegroupmemberBinding []interface{} `json:"lbvserver_servicegroupmember_binding,omitempty"` + LbvserverSpilloverpolicyBinding []interface{} `json:"lbvserver_spilloverpolicy_binding,omitempty"` + LbvserverTmtrafficpolicyBinding []interface{} `json:"lbvserver_tmtrafficpolicy_binding,omitempty"` + LbvserverTransformpolicyBinding []interface{} `json:"lbvserver_transformpolicy_binding,omitempty"` + LbvserverVideooptimizationdetectionpolicyBinding []interface{} `json:"lbvserver_videooptimizationdetectionpolicy_binding,omitempty"` + LbvserverVideooptimizationpacingpolicyBinding []interface{} `json:"lbvserver_videooptimizationpacingpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type LbpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Order int `json:"order,omitempty"` -} - -type Lbvserverscpolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +} + +type LbvserverContentinspectionpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbvserversyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Name string `json:"name,omitempty"` +type LbglobalLbpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Lbmonitorcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Ca bool `json:"ca,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Monitorname string `json:"monitorname,omitempty"` -} - -type Lbpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Lbwlmbinding struct { - Wlmname string `json:"wlmname,omitempty"` +type LbvserverServiceBinding struct { + Cookieipport string `json:"cookieipport,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Curstate string `json:"curstate,omitempty"` + Dynamicweight int `json:"dynamicweight,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` + Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbvservercachepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverAppqoepolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbmonitorservicebinding struct { - Monitorname string `json:"monitorname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Dupstate string `json:"dup_state,omitempty"` - Dupweight int `json:"dup_weight,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - State string `json:"state,omitempty"` - Weight int `json:"weight,omitempty"` -} - -type Lbpolicylbglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type LbpolicyLbglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbprofile struct { - Lbprofilename string `json:"lbprofilename,omitempty"` - Dbslb string `json:"dbslb,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Httponlycookieflag string `json:"httponlycookieflag,omitempty"` - Cookiepassphrase string `json:"cookiepassphrase,omitempty"` - Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` - Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` - Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` - Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` - Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` - Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` - Lbhashfingers int `json:"lbhashfingers,omitempty"` - Proximityfromself string `json:"proximityfromself,omitempty"` - Vsvrcount string `json:"vsvrcount,omitempty"` - Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` - Lbhashalgowinsize string `json:"lbhashalgowinsize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbvserveranalyticsprofilebinding struct { +type Lbgroup struct { + Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Count float64 `json:"__count,omitempty"` + Mastervserver string `json:"mastervserver,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Persistencebackup string `json:"persistencebackup,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Rule string `json:"rule,omitempty"` + Td int `json:"td,omitempty"` + Timeout int `json:"timeout,omitempty"` + Usevserverpersistency string `json:"usevserverpersistency,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` +} + +type LbpolicylabelLbpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Lbsipparameters struct { + Addrportvip string `json:"addrportvip,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Retrydur int `json:"retrydur,omitempty"` + Rnatdstport int `json:"rnatdstport,omitempty"` + Rnatsecuredstport int `json:"rnatsecuredstport,omitempty"` + Rnatsecuresrcport int `json:"rnatsecuresrcport,omitempty"` + Rnatsrcport int `json:"rnatsrcport,omitempty"` + Sip503ratethreshold int `json:"sip503ratethreshold,omitempty"` +} + +type LbvserverAnalyticsprofileBinding struct { Analyticsprofile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` } -type Lbvservercsvserverbinding struct { - Cachevserver string `json:"cachevserver,omitempty"` - Policyname string `json:"policyname,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Priority int `json:"priority,omitempty"` - Hits int `json:"hits,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policysubtype int `json:"policysubtype,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` +type LbwlmLbvserverBinding struct { + Vservername string `json:"vservername,omitempty"` + Wlmname string `json:"wlmname,omitempty"` } -type Lbvserverdetectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverCmppolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbvserverdospolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` -} - -type Lbvserverspilloverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServer struct { + Activeservices int `json:"activeservices,omitempty"` + Adfsproxyprofile string `json:"adfsproxyprofile,omitempty"` + Apiprofile string `json:"apiprofile,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authenticationhost string `json:"authenticationhost,omitempty"` + Authn401 string `json:"authn401,omitempty"` + Authnprofile string `json:"authnprofile,omitempty"` + Authnvsname string `json:"authnvsname,omitempty"` + Backuplbmethod string `json:"backuplbmethod,omitempty"` + Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Backupvserverstatus string `json:"backupvserverstatus,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Bypassaaaa string `json:"bypassaaaa,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Consolidatedlconn string `json:"consolidatedlconn,omitempty"` + Consolidatedlconngbl string `json:"consolidatedlconngbl,omitempty"` + Cookiedomain string `json:"cookiedomain,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Count float64 `json:"__count,omitempty"` + Currentactiveorder string `json:"currentactiveorder,omitempty"` + Curstate string `json:"curstate,omitempty"` + Datalength int `json:"datalength,omitempty"` + Dataoffset int `json:"dataoffset,omitempty"` + Dbprofilename string `json:"dbprofilename,omitempty"` + Dbslb string `json:"dbslb,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Dns64 string `json:"dns64,omitempty"` + Dnsoverhttps string `json:"dnsoverhttps,omitempty"` + Dnsprofilename string `json:"dnsprofilename,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Groupname string `json:"groupname,omitempty"` + Gt2gb string `json:"gt2gb,omitempty"` + Hashlength int `json:"hashlength,omitempty"` + Health int `json:"health,omitempty"` + Healththreshold int `json:"healththreshold,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Httpsredirecturl string `json:"httpsredirecturl,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Insertvserveripport string `json:"insertvserveripport,omitempty"` + Ipmapping string `json:"ipmapping,omitempty"` + Ipmask string `json:"ipmask,omitempty"` + Ippattern string `json:"ippattern,omitempty"` + Ipset string `json:"ipset,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Isgslb bool `json:"isgslb,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Lbmethod string `json:"lbmethod,omitempty"` + Lbprofilename string `json:"lbprofilename,omitempty"` + Lbrrreason int `json:"lbrrreason,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + M string `json:"m,omitempty"` + Macmoderetainvlan string `json:"macmoderetainvlan,omitempty"` + MapField string `json:"map,omitempty"` + Maxautoscalemembers int `json:"maxautoscalemembers,omitempty"` + Minautoscalemembers int `json:"minautoscalemembers,omitempty"` + Mssqlserverversion string `json:"mssqlserverversion,omitempty"` + Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` + Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` + Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` + Mysqlserverversion string `json:"mysqlserverversion,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Newservicerequest int `json:"newservicerequest,omitempty"` + Newservicerequestincrementinterval int `json:"newservicerequestincrementinterval,omitempty"` + Newservicerequestunit string `json:"newservicerequestunit,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Oracleserverversion string `json:"oracleserverversion,omitempty"` + Order int `json:"order,omitempty"` + Orderthreshold int `json:"orderthreshold,omitempty"` + Persistavpno []interface{} `json:"persistavpno,omitempty"` + Persistencebackup string `json:"persistencebackup,omitempty"` + Persistencetype string `json:"persistencetype,omitempty"` + Persistmask string `json:"persistmask,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + Probeport int `json:"probeport,omitempty"` + Probeprotocol string `json:"probeprotocol,omitempty"` + Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Push string `json:"push,omitempty"` + Pushlabel string `json:"pushlabel,omitempty"` + Pushmulticlients string `json:"pushmulticlients,omitempty"` + Pushvserver string `json:"pushvserver,omitempty"` + Quicbridgeprofilename string `json:"quicbridgeprofilename,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Range int `json:"range,omitempty"` + Recursionavailable string `json:"recursionavailable,omitempty"` + Redirect string `json:"redirect,omitempty"` + Redirectfromport int `json:"redirectfromport,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Redirurl string `json:"redirurl,omitempty"` + Redirurlflags bool `json:"redirurlflags,omitempty"` + Resrule string `json:"resrule,omitempty"` + Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Rtspnat string `json:"rtspnat,omitempty"` + Rule string `json:"rule,omitempty"` + Ruletype int `json:"ruletype,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Sessionless string `json:"sessionless,omitempty"` + Skippersistency string `json:"skippersistency,omitempty"` + Sobackupaction string `json:"sobackupaction,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Statechangetimeseconds int `json:"statechangetimeseconds,omitempty"` + Status int `json:"status,omitempty"` + Tcpprobeport int `json:"tcpprobeport,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + Td int `json:"td,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Timeout int `json:"timeout,omitempty"` + Toggleorder string `json:"toggleorder,omitempty"` + Tosid int `json:"tosid,omitempty"` + Totalservices int `json:"totalservices,omitempty"` + Trofspersistence string `json:"trofspersistence,omitempty"` + TypeField string `json:"type,omitempty"` + V6netmasklen int `json:"v6netmasklen,omitempty"` + V6persistmasklen int `json:"v6persistmasklen,omitempty"` + Value string `json:"value,omitempty"` + Version int `json:"version,omitempty"` + Vipheader string `json:"vipheader,omitempty"` + Vsvrdynconnsothreshold int `json:"vsvrdynconnsothreshold,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type LbvserverTmtrafficpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbwlm struct { - Wlmname string `json:"wlmname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Lbuid string `json:"lbuid,omitempty"` - Katimeout int `json:"katimeout,omitempty"` - Secure string `json:"secure,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbgloballbpolicybinding struct { Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` } -type Lbmetrictablemetricbinding struct { - Metric string `json:"metric,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` - Metrictype string `json:"metrictype,omitempty"` - Metrictable string `json:"metrictable,omitempty"` +type Lbmonitor struct { + Acctapplicationid []interface{} `json:"acctapplicationid,omitempty"` + Action string `json:"action,omitempty"` + Alertretries int `json:"alertretries,omitempty"` + Application string `json:"application,omitempty"` + Attribute string `json:"attribute,omitempty"` + Authapplicationid []interface{} `json:"authapplicationid,omitempty"` + Basedn string `json:"basedn,omitempty"` + Binddn string `json:"binddn,omitempty"` + Count float64 `json:"__count,omitempty"` + Customheaders string `json:"customheaders,omitempty"` + Database string `json:"database,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Deviation int `json:"deviation,omitempty"` + Dispatcherip string `json:"dispatcherip,omitempty"` + Dispatcherport int `json:"dispatcherport,omitempty"` + Domain string `json:"domain,omitempty"` + Downtime int `json:"downtime,omitempty"` + DupState string `json:"dup_state,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Dynamicinterval int `json:"dynamicinterval,omitempty"` + Dynamicresponsetimeout int `json:"dynamicresponsetimeout,omitempty"` + Evalrule string `json:"evalrule,omitempty"` + Failureretries int `json:"failureretries,omitempty"` + Filename string `json:"filename,omitempty"` + Filter string `json:"filter,omitempty"` + Firmwarerevision int `json:"firmwarerevision,omitempty"` + Group string `json:"group,omitempty"` + Grpchealthcheck string `json:"grpchealthcheck,omitempty"` + Grpcservicename string `json:"grpcservicename,omitempty"` + Grpcstatuscode []interface{} `json:"grpcstatuscode,omitempty"` + Hostipaddress string `json:"hostipaddress,omitempty"` + Hostname string `json:"hostname,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Inbandsecurityid string `json:"inbandsecurityid,omitempty"` + Interval int `json:"interval,omitempty"` + Ipaddress []string `json:"ipaddress,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Lasversion string `json:"lasversion,omitempty"` + Logonpointname string `json:"logonpointname,omitempty"` + Lrtm string `json:"lrtm,omitempty"` + Lrtmconf int `json:"lrtmconf,omitempty"` + Lrtmconfstr string `json:"lrtmconfstr,omitempty"` + Maxforwards int `json:"maxforwards,omitempty"` + Metric string `json:"metric,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Metricthreshold int `json:"metricthreshold,omitempty"` + Metricweight int `json:"metricweight,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Mqttclientidentifier string `json:"mqttclientidentifier,omitempty"` + Mqttversion int `json:"mqttversion,omitempty"` + Mssqlprotocolversion string `json:"mssqlprotocolversion,omitempty"` + Multimetrictable []string `json:"multimetrictable,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oraclesid string `json:"oraclesid,omitempty"` + Originhost string `json:"originhost,omitempty"` + Originrealm string `json:"originrealm,omitempty"` + Password string `json:"password,omitempty"` + Productname string `json:"productname,omitempty"` + Query string `json:"query,omitempty"` + Querytype string `json:"querytype,omitempty"` + Radaccountsession string `json:"radaccountsession,omitempty"` + Radaccounttype int `json:"radaccounttype,omitempty"` + Radapn string `json:"radapn,omitempty"` + Radframedip string `json:"radframedip,omitempty"` + Radkey string `json:"radkey,omitempty"` + Radmsisdn string `json:"radmsisdn,omitempty"` + Radnasid string `json:"radnasid,omitempty"` + Radnasip string `json:"radnasip,omitempty"` + Recv string `json:"recv,omitempty"` + Respcode []string `json:"respcode,omitempty"` + Resptimeout int `json:"resptimeout,omitempty"` + Resptimeoutthresh int `json:"resptimeoutthresh,omitempty"` + Retries int `json:"retries,omitempty"` + Reverse string `json:"reverse,omitempty"` + Rtsprequest string `json:"rtsprequest,omitempty"` + Scriptargs string `json:"scriptargs,omitempty"` + Scriptname string `json:"scriptname,omitempty"` + Secondarypassword string `json:"secondarypassword,omitempty"` + Secure string `json:"secure,omitempty"` + Secureargs string `json:"secureargs,omitempty"` + Send string `json:"send,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Sipmethod string `json:"sipmethod,omitempty"` + Sipreguri string `json:"sipreguri,omitempty"` + Sipuri string `json:"sipuri,omitempty"` + Sitepath string `json:"sitepath,omitempty"` + Snmpcommunity string `json:"snmpcommunity,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` + Snmpthreshold string `json:"snmpthreshold,omitempty"` + Snmpversion string `json:"snmpversion,omitempty"` + Sqlquery string `json:"sqlquery,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + State string `json:"state,omitempty"` + Storedb string `json:"storedb,omitempty"` + Storefrontacctservice string `json:"storefrontacctservice,omitempty"` + Storefrontcheckbackendservices string `json:"storefrontcheckbackendservices,omitempty"` + Storename string `json:"storename,omitempty"` + Successretries int `json:"successretries,omitempty"` + Supportedvendorids []interface{} `json:"supportedvendorids,omitempty"` + Tos string `json:"tos,omitempty"` + Tosid int `json:"tosid,omitempty"` + Transparent string `json:"transparent,omitempty"` + Trofscode int `json:"trofscode,omitempty"` + Trofsstring string `json:"trofsstring,omitempty"` + TypeField string `json:"type,omitempty"` + Units1 string `json:"units1,omitempty"` + Units2 string `json:"units2,omitempty"` + Units3 string `json:"units3,omitempty"` + Units4 string `json:"units4,omitempty"` + Username string `json:"username,omitempty"` + Validatecred string `json:"validatecred,omitempty"` + Vendorid int `json:"vendorid,omitempty"` + Vendorspecificacctapplicationids []interface{} `json:"vendorspecificacctapplicationids,omitempty"` + Vendorspecificauthapplicationids []interface{} `json:"vendorspecificauthapplicationids,omitempty"` + Vendorspecificvendorid int `json:"vendorspecificvendorid,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbmonitormetricbinding struct { - Metric string `json:"metric,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Metricunit string `json:"metric_unit,omitempty"` - Metricweight int `json:"metricweight,omitempty"` - Metricthreshold int `json:"metricthreshold,omitempty"` - Monitorname string `json:"monitorname,omitempty"` +type Lbprofile struct { + Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` + Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` + Cookiepassphrase string `json:"cookiepassphrase,omitempty"` + Count float64 `json:"__count,omitempty"` + Dbslb string `json:"dbslb,omitempty"` + Httponlycookieflag string `json:"httponlycookieflag,omitempty"` + Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` + Lbhashalgowinsize int `json:"lbhashalgowinsize,omitempty"` + Lbhashfingers int `json:"lbhashfingers,omitempty"` + Lbprofilename string `json:"lbprofilename,omitempty"` + Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Proximityfromself string `json:"proximityfromself,omitempty"` + Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` + Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` + Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` + Vsvrcount int `json:"vsvrcount,omitempty"` +} + +type LbvserverServicegroupBinding struct { + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbpersistentsessions struct { - Vserver string `json:"vserver,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Persistenceparameter string `json:"persistenceparameter,omitempty"` - Type string `json:"type,omitempty"` - Typestring string `json:"typestring,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcipv6 string `json:"srcipv6,omitempty"` - Destip string `json:"destip,omitempty"` - Destipv6 string `json:"destipv6,omitempty"` - Flags string `json:"flags,omitempty"` - Destport string `json:"destport,omitempty"` - Vservername string `json:"vservername,omitempty"` - Timeout string `json:"timeout,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Persistenceparam string `json:"persistenceparam,omitempty"` - Cnamepersparam string `json:"cnamepersparam,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LbwlmBinding struct { + LbwlmLbvserverBinding []interface{} `json:"lbwlm_lbvserver_binding,omitempty"` + Wlmname string `json:"wlmname,omitempty"` } -type Lbroute6 struct { - Network string `json:"network,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Td int `json:"td,omitempty"` - Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LbmonbindingsGslbservicegroupBinding struct { + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Monstate string `json:"monstate,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` } -type Lbvserverpacingpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Lbpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type LbmonitorServicegroupBinding struct { + DupState string `json:"dup_state,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + State string `json:"state,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbvserverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverSpilloverpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Lbvserverresponderpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbgroup struct { - Name string `json:"name,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistencebackup string `json:"persistencebackup,omitempty"` - Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Timeout int `json:"timeout,omitempty"` - Rule string `json:"rule,omitempty"` - Mastervserver string `json:"mastervserver,omitempty"` - Usevserverpersistency string `json:"usevserverpersistency,omitempty"` - Newname string `json:"newname,omitempty"` - Td string `json:"td,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbvserverservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Order int `json:"order,omitempty"` - Name string `json:"name,omitempty"` - Weight int `json:"weight,omitempty"` +type Lbwlm struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Katimeout int `json:"katimeout,omitempty"` + Lbuid string `json:"lbuid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Secure string `json:"secure,omitempty"` + State string `json:"state,omitempty"` + Wlmname string `json:"wlmname,omitempty"` +} + +type LbgroupLbvserverBinding struct { + Name string `json:"name,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Lbvservertrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Name string `json:"name,omitempty"` +type LbmetrictableBinding struct { + LbmetrictableMetricBinding []interface{} `json:"lbmetrictable_metric_binding,omitempty"` + Metrictable string `json:"metrictable,omitempty"` +} + +type Lbpersistentsessions struct { + Cnamepersparam string `json:"cnamepersparam,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destipv6 string `json:"destipv6,omitempty"` + Destport int `json:"destport,omitempty"` + Flags bool `json:"flags,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Persistenceparam string `json:"persistenceparam,omitempty"` + Persistenceparameter string `json:"persistenceparameter,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcipv6 string `json:"srcipv6,omitempty"` + Timeout int `json:"timeout,omitempty"` + TypeField int `json:"type,omitempty"` + Typestring string `json:"typestring,omitempty"` + Vserver string `json:"vserver,omitempty"` + Vservername string `json:"vservername,omitempty"` +} + +type LbpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbvservervideooptimizationdetectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverAuditnslogpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbwlmlbvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Wlmname string `json:"wlmname,omitempty"` +type LbpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + LbpolicylabelLbpolicyBinding []interface{} `json:"lbpolicylabel_lbpolicy_binding,omitempty"` + LbpolicylabelPolicybindingBinding []interface{} `json:"lbpolicylabel_policybinding_binding,omitempty"` } -type Lbwlmvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Wlmname string `json:"wlmname,omitempty"` +type LbmetrictableMetricBinding struct { + Metric string `json:"metric,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Metrictype string `json:"metrictype,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` } -type Lbvservercmppolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverDnspolicy64Binding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbvserverpolicy64binding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Lbpolicylabelpolicybindingbinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Lbvserverappflowpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverVideooptimizationpacingpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbvserverauthorizationpolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` } -type Lbvservernslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Sc string `json:"sc,omitempty"` - Name string `json:"name,omitempty"` +type LbpolicyLbpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Lbvservertmtrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Order int `json:"order,omitempty"` -} - -type Lbvservervserverbinding struct { - Cachevserver string `json:"cachevserver,omitempty"` - Policyname string `json:"policyname,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Hits uint32 `json:"hits,omitempty"` - Pipolicyhits uint32 `json:"pipolicyhits,omitempty"` - Policysubtype uint32 `json:"policysubtype,omitempty"` - Name string `json:"name,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Lbaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Value []int `json:"value,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Feature string `json:"feature,omitempty"` - Builtin string `json:"builtin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbglobalbinding struct { -} - -type Lbgroupvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbmonitor struct { - Monitorname string `json:"monitorname,omitempty"` - Type string `json:"type,omitempty"` - Action string `json:"action,omitempty"` - Respcode []string `json:"respcode,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Rtsprequest string `json:"rtsprequest,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Maxforwards int `json:"maxforwards,omitempty"` - Sipmethod string `json:"sipmethod,omitempty"` - Sipuri string `json:"sipuri,omitempty"` - Sipreguri string `json:"sipreguri,omitempty"` - Send string `json:"send,omitempty"` - Recv string `json:"recv,omitempty"` - Query string `json:"query,omitempty"` - Querytype string `json:"querytype,omitempty"` - Scriptname string `json:"scriptname,omitempty"` - Scriptargs string `json:"scriptargs,omitempty"` - Secureargs string `json:"secureargs,omitempty"` - Dispatcherip string `json:"dispatcherip,omitempty"` - Dispatcherport int `json:"dispatcherport,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Secondarypassword string `json:"secondarypassword,omitempty"` - Logonpointname string `json:"logonpointname,omitempty"` - Lasversion string `json:"lasversion,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radnasip string `json:"radnasip,omitempty"` - Radaccounttype int `json:"radaccounttype,omitempty"` - Radframedip string `json:"radframedip,omitempty"` - Radapn string `json:"radapn,omitempty"` - Radmsisdn string `json:"radmsisdn,omitempty"` - Radaccountsession string `json:"radaccountsession,omitempty"` - Lrtm string `json:"lrtm,omitempty"` - Deviation int `json:"deviation"` - Units1 string `json:"units1,omitempty"` - Interval int `json:"interval,omitempty"` - Units3 string `json:"units3,omitempty"` - Resptimeout int `json:"resptimeout,omitempty"` - Units4 string `json:"units4,omitempty"` - Resptimeoutthresh int `json:"resptimeoutthresh,omitempty"` - Retries int `json:"retries,omitempty"` - Failureretries int `json:"failureretries,omitempty"` - Alertretries int `json:"alertretries,omitempty"` - Successretries int `json:"successretries,omitempty"` - Downtime int `json:"downtime,omitempty"` - Units2 string `json:"units2,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - State string `json:"state,omitempty"` - Reverse string `json:"reverse,omitempty"` - Transparent string `json:"transparent,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Tos string `json:"tos,omitempty"` - Tosid int `json:"tosid,omitempty"` - Secure string `json:"secure,omitempty"` - Validatecred string `json:"validatecred,omitempty"` - Domain string `json:"domain,omitempty"` - Ipaddress []string `json:"ipaddress,omitempty"` - Group string `json:"group,omitempty"` - Filename string `json:"filename,omitempty"` - Basedn string `json:"basedn,omitempty"` - Binddn string `json:"binddn,omitempty"` - Filter string `json:"filter,omitempty"` - Attribute string `json:"attribute,omitempty"` - Database string `json:"database,omitempty"` - Oraclesid string `json:"oraclesid,omitempty"` - Sqlquery string `json:"sqlquery,omitempty"` - Evalrule string `json:"evalrule,omitempty"` - Mssqlprotocolversion string `json:"mssqlprotocolversion,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` - Snmpcommunity string `json:"snmpcommunity,omitempty"` - Snmpthreshold string `json:"snmpthreshold,omitempty"` - Snmpversion string `json:"snmpversion,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Application string `json:"application,omitempty"` - Sitepath string `json:"sitepath,omitempty"` - Storename string `json:"storename,omitempty"` - Storefrontacctservice string `json:"storefrontacctservice,omitempty"` - Hostname string `json:"hostname,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Originhost string `json:"originhost,omitempty"` - Originrealm string `json:"originrealm,omitempty"` - Hostipaddress string `json:"hostipaddress,omitempty"` - Vendorid int `json:"vendorid,omitempty"` - Productname string `json:"productname,omitempty"` - Firmwarerevision int `json:"firmwarerevision,omitempty"` - Authapplicationid []int `json:"authapplicationid,omitempty"` - Acctapplicationid []int `json:"acctapplicationid,omitempty"` - Inbandsecurityid string `json:"inbandsecurityid,omitempty"` - Supportedvendorids []int `json:"supportedvendorids,omitempty"` - Vendorspecificvendorid int `json:"vendorspecificvendorid,omitempty"` - Vendorspecificauthapplicationids []int `json:"vendorspecificauthapplicationids,omitempty"` - Vendorspecificacctapplicationids []int `json:"vendorspecificacctapplicationids,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Storedb string `json:"storedb,omitempty"` - Storefrontcheckbackendservices string `json:"storefrontcheckbackendservices,omitempty"` - Trofscode int `json:"trofscode,omitempty"` - Trofsstring string `json:"trofsstring,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Mqttclientidentifier string `json:"mqttclientidentifier,omitempty"` - Mqttversion int `json:"mqttversion,omitempty"` - Grpchealthcheck string `json:"grpchealthcheck,omitempty"` - Grpcstatuscode []int `json:"grpcstatuscode,omitempty"` - Grpcservicename string `json:"grpcservicename,omitempty"` - Metric string `json:"metric,omitempty"` - Metricthreshold int `json:"metricthreshold,omitempty"` - Metricweight int `json:"metricweight,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Lrtmconf string `json:"lrtmconf,omitempty"` - Lrtmconfstr string `json:"lrtmconfstr,omitempty"` - Dynamicresponsetimeout string `json:"dynamicresponsetimeout,omitempty"` - Dynamicinterval string `json:"dynamicinterval,omitempty"` - Multimetrictable string `json:"multimetrictable,omitempty"` - Dupstate string `json:"dup_state,omitempty"` - Dupweight string `json:"dup_weight,omitempty"` - Weight string `json:"weight,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbmonitorbinding struct { - Monitorname string `json:"monitorname,omitempty"` +type LbmonbindingsServicegroupBinding struct { + Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` + Monitorname string `json:"monitorname,omitempty"` + Monstate string `json:"monstate,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` } -type Lbmonitorsslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` +type LbmonitorSslcertkeyBinding struct { Ca bool `json:"ca,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` Monitorname string `json:"monitorname,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` } -type Lbpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Lbvserverappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverAuthorizationpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbpolicylbpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` + Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` } -type Lbvserverlbpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type LbvserverVideooptimizationdetectionpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` -} - -type Lbvserverrewritepolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` } -type LBVServerServiceGroupMemberBinding struct { - CookieIPPort string `json:"cookieipport,omitempty"` - CookieName string `json:"cookiename,omitempty"` - CurState string `json:"curstate,omitempty"` - DynamicWeight string `json:"dynamicweight,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Name string `json:"name,omitempty"` - Order string `json:"order,omitempty"` - OrderStr string `json:"orderstr,omitempty"` - Port int `json:"port,omitempty"` - PreferredLocation string `json:"preferredlocation,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` - ServiceType string `json:"servicetype,omitempty"` - VServerid string `json:"vserverid,omitempty"` - Weight string `json:"weight,omitempty"` -} - -type Lbmonbindingsbinding struct { - Monitorname string `json:"monitorname,omitempty"` -} - -type Lbmonbindingsservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monitorname string `json:"monitorname,omitempty"` -} - -type Lbroute struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Td int `json:"td,omitempty"` - Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbvserverbinding struct { - Name string `json:"name,omitempty"` +type Lbpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` +} + +type LbpolicyBinding struct { + LbpolicyGslbvserverBinding []interface{} `json:"lbpolicy_gslbvserver_binding,omitempty"` + LbpolicyLbglobalBinding []interface{} `json:"lbpolicy_lbglobal_binding,omitempty"` + LbpolicyLbpolicylabelBinding []interface{} `json:"lbpolicy_lbpolicylabel_binding,omitempty"` + LbpolicyLbvserverBinding []interface{} `json:"lbpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type LbmonitorMetricBinding struct { + Metric string `json:"metric,omitempty"` + MetricUnit string `json:"metric_unit,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Metricthreshold int `json:"metricthreshold,omitempty"` + Metricweight int `json:"metricweight,omitempty"` + Monitorname string `json:"monitorname,omitempty"` } -type Lbvserverpqpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LbvserverLbpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Lbgrouplbvserverbinding struct { - Vservername string `json:"vservername,omitempty"` - Name string `json:"name,omitempty"` -} - -type Lbmonbindings struct { - Monitorname string `json:"monitorname,omitempty"` - Type string `json:"type,omitempty"` - State string `json:"state,omitempty"` - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lbpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Lbpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LbgroupBinding struct { + LbgroupLbvserverBinding []interface{} `json:"lbgroup_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Lbvserverbotpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` +type Lbparameter struct { + Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` + Allowboundsvcremoval string `json:"allowboundsvcremoval,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` + Consolidatedlconn string `json:"consolidatedlconn,omitempty"` + Cookiepassphrase string `json:"cookiepassphrase,omitempty"` + Dbsttl int `json:"dbsttl,omitempty"` + Dropmqttjumbomessage string `json:"dropmqttjumbomessage,omitempty"` + Feature string `json:"feature,omitempty"` + Httponlycookieflag string `json:"httponlycookieflag,omitempty"` + Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` + Lbhashalgowinsize int `json:"lbhashalgowinsize,omitempty"` + Lbhashfingers int `json:"lbhashfingers,omitempty"` + Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` + Maxpipelinenat int `json:"maxpipelinenat,omitempty"` + Monitorconnectionclose string `json:"monitorconnectionclose,omitempty"` + Monitorskipmaxclient string `json:"monitorskipmaxclient,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` + Preferdirectroute string `json:"preferdirectroute,omitempty"` + Proximityfromself string `json:"proximityfromself,omitempty"` + Radiusmessageauthenticator string `json:"radiusmessageauthenticator,omitempty"` + Retainservicestate string `json:"retainservicestate,omitempty"` + Sessionsthreshold int `json:"sessionsthreshold,omitempty"` + Startuprrfactor int `json:"startuprrfactor,omitempty"` + Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` + Useportforhashlb string `json:"useportforhashlb,omitempty"` + Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` + Vserverspecificmac string `json:"vserverspecificmac,omitempty"` } -type Lbvservercontentinspectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` - Order int `json:"order,omitempty"` +type LBVServerServiceGroupMemberBinding struct { + Cookieipport string `json:"cookieipport,omitempty"` + Cookiename string `json:"cookiename,omitempty"` + Curstate string `json:"curstate,omitempty"` + Dynamicweight int `json:"dynamicweight,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + Name string `json:"name,omitempty"` + Order int `json:"order,omitempty"` + Orderstr string `json:"orderstr,omitempty"` + Port int `json:"port,omitempty"` + Preferredlocation string `json:"preferredlocation,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Vserverid string `json:"vserverid,omitempty"` + Weight int `json:"weight,omitempty"` } -type Lbvserverfeopolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Order int `json:"order,omitempty"` +type Lbmetrictable struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Metric string `json:"metric,omitempty"` + Metrictable string `json:"metrictable,omitempty"` + Metrictype string `json:"metrictype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` } diff --git a/nitrogo/models/lldp.go b/nitrogo/models/lldp.go index 1471052..7420705 100644 --- a/nitrogo/models/lldp.go +++ b/nitrogo/models/lldp.go @@ -1,48 +1,46 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Lldpneighbors struct { - Ifnum string `json:"ifnum,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Chassisidsubtype string `json:"chassisidsubtype,omitempty"` - Chassisid string `json:"chassisid,omitempty"` - Portidsubtype string `json:"portidsubtype,omitempty"` - Portid string `json:"portid,omitempty"` - Ttl string `json:"ttl,omitempty"` - Portdescription string `json:"portdescription,omitempty"` - Sys string `json:"sys,omitempty"` - Sysdesc string `json:"sysdesc,omitempty"` - Mgmtaddresssubtype string `json:"mgmtaddresssubtype,omitempty"` - Mgmtaddress string `json:"mgmtaddress,omitempty"` - Iftype string `json:"iftype,omitempty"` - Ifnumber string `json:"ifnumber,omitempty"` - Vlan string `json:"vlan,omitempty"` - Vlanid string `json:"vlanid,omitempty"` - Portprotosupported string `json:"portprotosupported,omitempty"` - Portprotoenabled string `json:"portprotoenabled,omitempty"` - Portprotoid string `json:"portprotoid,omitempty"` - Portvlanid string `json:"portvlanid,omitempty"` - Protocolid string `json:"protocolid,omitempty"` - Linkaggrcapable string `json:"linkaggrcapable,omitempty"` - Linkaggrenabled string `json:"linkaggrenabled,omitempty"` - Linkaggrid string `json:"linkaggrid,omitempty"` - Flag string `json:"flag,omitempty"` - Syscapabilities string `json:"syscapabilities,omitempty"` - Syscapenabled string `json:"syscapenabled,omitempty"` - Autonegsupport string `json:"autonegsupport,omitempty"` - Autonegenabled string `json:"autonegenabled,omitempty"` - Autonegadvertised string `json:"autonegadvertised,omitempty"` - Autonegmautype string `json:"autonegmautype,omitempty"` - Mtu string `json:"mtu,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// lldp configuration structs type Lldpparam struct { Holdtimetxmult int `json:"holdtimetxmult,omitempty"` - Timer int `json:"timer,omitempty"` Mode string `json:"mode,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Timer int `json:"timer,omitempty"` +} + +type Lldpneighbors struct { + Autonegadvertised string `json:"autonegadvertised,omitempty"` + Autonegenabled string `json:"autonegenabled,omitempty"` + Autonegmautype string `json:"autonegmautype,omitempty"` + Autonegsupport string `json:"autonegsupport,omitempty"` + Chassisid string `json:"chassisid,omitempty"` + Chassisidsubtype string `json:"chassisidsubtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Flag int `json:"flag,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ifnumber int `json:"ifnumber,omitempty"` + Iftype string `json:"iftype,omitempty"` + Linkaggrcapable string `json:"linkaggrcapable,omitempty"` + Linkaggrenabled string `json:"linkaggrenabled,omitempty"` + Linkaggrid int `json:"linkaggrid,omitempty"` + Mgmtaddress string `json:"mgmtaddress,omitempty"` + Mgmtaddresssubtype string `json:"mgmtaddresssubtype,omitempty"` + Mtu int `json:"mtu,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Portdescription string `json:"portdescription,omitempty"` + Portid string `json:"portid,omitempty"` + Portidsubtype string `json:"portidsubtype,omitempty"` + Portprotoenabled int `json:"portprotoenabled,omitempty"` + Portprotoid int `json:"portprotoid,omitempty"` + Portprotosupported int `json:"portprotosupported,omitempty"` + Portvlanid int `json:"portvlanid,omitempty"` + Protocolid string `json:"protocolid,omitempty"` + Sys string `json:"sys,omitempty"` + Syscapabilities string `json:"syscapabilities,omitempty"` + Syscapenabled string `json:"syscapenabled,omitempty"` + Sysdesc string `json:"sysdesc,omitempty"` + Ttl int `json:"ttl,omitempty"` + Vlan string `json:"vlan,omitempty"` + Vlanid int `json:"vlanid,omitempty"` } diff --git a/nitrogo/models/lsn.go b/nitrogo/models/lsn.go index 00403c4..24436c0 100644 --- a/nitrogo/models/lsn.go +++ b/nitrogo/models/lsn.go @@ -1,419 +1,389 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Lsnsipalgcall struct { - Callid string `json:"callid,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Callflags string `json:"callflags,omitempty"` - Xlatip string `json:"xlatip,omitempty"` - Callrefcount string `json:"callrefcount,omitempty"` - Calltimer string `json:"calltimer,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// lsn configuration structs +type LsngroupLsnlogprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Logprofilename string `json:"logprofilename,omitempty"` } -type Lsnsipalgcallbinding struct { - Callid string `json:"callid,omitempty"` +type LsnclientNsaclBinding struct { + Aclname string `json:"aclname,omitempty"` + Clientname string `json:"clientname,omitempty"` + Td int `json:"td,omitempty"` } -type Lsngroupbinding struct { - Groupname string `json:"groupname,omitempty"` +type Lsnip6profile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Network6 string `json:"network6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + TypeField string `json:"type,omitempty"` } -type Lsngroupipsecalgprofilebinding struct { - Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsngroupLsnhttphdrlogprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` } -type Lsngrouplogprofilebinding struct { - Logprofilename string `json:"logprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsngroupLsntransportprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Transportprofilename string `json:"transportprofilename,omitempty"` } -type Lsngrouplsnrtspalgprofilebinding struct { - Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsnappsattributes struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port string `json:"port,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` } -type Lsngrouplsnsipalgprofilebinding struct { - Sipalgprofilename string `json:"sipalgprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsngroupLsnrtspalgprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` } -type Lsngroupprofilebinding struct { - Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsnclient struct { + Clientname string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Lsnlogprofile struct { - Logprofilename string `json:"logprofilename,omitempty"` - Logsubscrinfo string `json:"logsubscrinfo,omitempty"` - Logcompact string `json:"logcompact,omitempty"` - Logipfix string `json:"logipfix,omitempty"` - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Logsessdeletion string `json:"logsessdeletion,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LsnclientNsacl6Binding struct { + Acl6name string `json:"acl6name,omitempty"` + Clientname string `json:"clientname,omitempty"` + Td int `json:"td,omitempty"` } -type Lsnsipalgcallcontrolchannelbinding struct { - Channelip string `json:"channelip,omitempty"` - Channelnatip string `json:"channelnatip,omitempty"` - Channelport int `json:"channelport,omitempty"` - Channelnatport int `json:"channelnatport,omitempty"` - Channelprotocol string `json:"channelprotocol,omitempty"` - Channelflags int `json:"channelflags,omitempty"` - Channeltimeout int `json:"channeltimeout,omitempty"` - Callid string `json:"callid,omitempty"` +type Lsnparameter struct { + Maxmemlimit int `json:"maxmemlimit,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Memlimitactive int `json:"memlimitactive,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sessionsync string `json:"sessionsync,omitempty"` + Subscrsessionremoval string `json:"subscrsessionremoval,omitempty"` } -type Lsnclientnsacl6binding struct { - Acl6name string `json:"acl6name,omitempty"` - Td int `json:"td,omitempty"` +type LsnclientNetworkBinding struct { Clientname string `json:"clientname,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Td int `json:"td,omitempty"` } -type Lsnclientbinding struct { +type LsnclientNetwork6Binding struct { Clientname string `json:"clientname,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Network6 string `json:"network6,omitempty"` + Td int `json:"td,omitempty"` } -type Lsngrouppoolbinding struct { - Poolname string `json:"poolname,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsnappsprofilePortBinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + Lsnport string `json:"lsnport,omitempty"` } -type Lsngroupserverbinding struct { - Pcpserver string `json:"pcpserver,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsnsession struct { + Clientname string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Dsttd int `json:"dsttd,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + Natip string `json:"natip,omitempty"` + Natport int `json:"natport,omitempty"` + Natport2 int `json:"natport2,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Nattype string `json:"nattype,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Network6 string `json:"network6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Sessionestdir string `json:"sessionestdir,omitempty"` + Srctd int `json:"srctd,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Subscrport int `json:"subscrport,omitempty"` + Td int `json:"td,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` } -type Lsnrtspalgsessionbinding struct { - Sessionid string `json:"sessionid,omitempty"` +type Lsnsipalgprofile struct { + Count float64 `json:"__count,omitempty"` + Datasessionidletimeout int `json:"datasessionidletimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Opencontactpinhole string `json:"opencontactpinhole,omitempty"` + Openrecordroutepinhole string `json:"openrecordroutepinhole,omitempty"` + Openregisterpinhole string `json:"openregisterpinhole,omitempty"` + Openroutepinhole string `json:"openroutepinhole,omitempty"` + Openviapinhole string `json:"openviapinhole,omitempty"` + Registrationtimeout int `json:"registrationtimeout,omitempty"` + Rport string `json:"rport,omitempty"` + Sipalgprofilename string `json:"sipalgprofilename,omitempty"` + Sipdstportrange string `json:"sipdstportrange,omitempty"` + Sipsessiontimeout int `json:"sipsessiontimeout,omitempty"` + Sipsrcportrange string `json:"sipsrcportrange,omitempty"` + Siptransportprotocol string `json:"siptransportprotocol,omitempty"` +} + +type LsnrtspalgsessionBinding struct { + LsnrtspalgsessionDatachannelBinding []interface{} `json:"lsnrtspalgsession_datachannel_binding,omitempty"` + Sessionid string `json:"sessionid,omitempty"` } -type Lsnstatic struct { - Name string `json:"name,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Subscrport int `json:"subscrport,omitempty"` - Network6 string `json:"network6,omitempty"` - Td int `json:"td"` - Natip string `json:"natip,omitempty"` - Natport int `json:"natport,omitempty"` - Destip string `json:"destip,omitempty"` - Dsttd int `json:"dsttd,omitempty"` - Nattype string `json:"nattype,omitempty"` - Status string `json:"status,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Lsnlogprofile struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Count float64 `json:"__count,omitempty"` + Logcompact string `json:"logcompact,omitempty"` + Logipfix string `json:"logipfix,omitempty"` + Logprofilename string `json:"logprofilename,omitempty"` + Logsessdeletion string `json:"logsessdeletion,omitempty"` + Logsubscrinfo string `json:"logsubscrinfo,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Lsntransportprofile struct { - Transportprofilename string `json:"transportprofilename,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Finrsttimeout int `json:"finrsttimeout,omitempty"` - Stuntimeout int `json:"stuntimeout,omitempty"` - Synidletimeout int `json:"synidletimeout,omitempty"` - Portquota int `json:"portquota"` - Sessionquota int `json:"sessionquota"` - Groupsessionlimit int `json:"groupsessionlimit"` - Portpreserveparity string `json:"portpreserveparity,omitempty"` - Portpreserverange string `json:"portpreserverange,omitempty"` - Syncheck string `json:"syncheck,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LsngroupIpsecalgprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` } -type Lsnappsprofilebinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` +type Lsngroup struct { + Allocpolicy string `json:"allocpolicy,omitempty"` + Clientname string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Ftp string `json:"ftp,omitempty"` + Ftpcm string `json:"ftpcm,omitempty"` + Groupid int `json:"groupid,omitempty"` + Groupname string `json:"groupname,omitempty"` + Ip6profile string `json:"ip6profile,omitempty"` + Logging string `json:"logging,omitempty"` + Nattype string `json:"nattype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Portblocksize int `json:"portblocksize,omitempty"` + Pptp string `json:"pptp,omitempty"` + Rtspalg string `json:"rtspalg,omitempty"` + Sessionlogging string `json:"sessionlogging,omitempty"` + Sessionsync string `json:"sessionsync,omitempty"` + Sipalg string `json:"sipalg,omitempty"` + Snmptraplimit int `json:"snmptraplimit,omitempty"` } -type Lsnclientnetworkbinding struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Td int `json:"td,omitempty"` - Clientname string `json:"clientname,omitempty"` +type Lsnstatic struct { + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Dsttd int `json:"dsttd,omitempty"` + Name string `json:"name,omitempty"` + Natip string `json:"natip,omitempty"` + Natport int `json:"natport,omitempty"` + Nattype string `json:"nattype,omitempty"` + Network6 string `json:"network6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Status string `json:"status,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Subscrport int `json:"subscrport,omitempty"` + Td int `json:"td,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` } -type Lsngrouphttphdrlogprofilebinding struct { - Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsntransportprofile struct { + Count float64 `json:"__count,omitempty"` + Finrsttimeout int `json:"finrsttimeout,omitempty"` + Groupsessionlimit int `json:"groupsessionlimit,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Portpreserveparity string `json:"portpreserveparity,omitempty"` + Portpreserverange string `json:"portpreserverange,omitempty"` + Portquota int `json:"portquota,omitempty"` + Sessionquota int `json:"sessionquota,omitempty"` + Sessiontimeout int `json:"sessiontimeout,omitempty"` + Stuntimeout int `json:"stuntimeout,omitempty"` + Syncheck string `json:"syncheck,omitempty"` + Synidletimeout int `json:"synidletimeout,omitempty"` + Transportprofilename string `json:"transportprofilename,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` +} + +type LsnsipalgcallDatachannelBinding struct { + Callid string `json:"callid,omitempty"` + Channelflags int `json:"channelflags,omitempty"` + Channelip string `json:"channelip,omitempty"` + Channelnatip string `json:"channelnatip,omitempty"` + Channelnatport int `json:"channelnatport,omitempty"` + Channelport int `json:"channelport,omitempty"` + Channelprotocol string `json:"channelprotocol,omitempty"` + Channeltimeout int `json:"channeltimeout,omitempty"` } -type Lsngrouppcpserverbinding struct { - Pcpserver string `json:"pcpserver,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsnappsprofileBinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + LsnappsprofileLsnappsattributesBinding []interface{} `json:"lsnappsprofile_lsnappsattributes_binding,omitempty"` + LsnappsprofilePortBinding []interface{} `json:"lsnappsprofile_port_binding,omitempty"` } -type Lsngrouprtspalgprofilebinding struct { - Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsnpool struct { + Count float64 `json:"__count,omitempty"` + Maxportrealloctmq int `json:"maxportrealloctmq,omitempty"` + Nattype string `json:"nattype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Poolname string `json:"poolname,omitempty"` + Portblockallocation string `json:"portblockallocation,omitempty"` + Portrealloctimeout int `json:"portrealloctimeout,omitempty"` } -type Lsnpoollsnipbinding struct { - Lsnip string `json:"lsnip,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Poolname string `json:"poolname,omitempty"` +type LsnappsprofileLsnappsattributesBinding struct { + Appsattributesname string `json:"appsattributesname,omitempty"` + Appsprofilename string `json:"appsprofilename,omitempty"` } -type Lsnsipalgprofile struct { - Sipalgprofilename string `json:"sipalgprofilename,omitempty"` - Datasessionidletimeout int `json:"datasessionidletimeout,omitempty"` - Sipsessiontimeout int `json:"sipsessiontimeout,omitempty"` - Registrationtimeout int `json:"registrationtimeout,omitempty"` - Sipsrcportrange string `json:"sipsrcportrange,omitempty"` - Sipdstportrange string `json:"sipdstportrange,omitempty"` - Openregisterpinhole string `json:"openregisterpinhole,omitempty"` - Opencontactpinhole string `json:"opencontactpinhole,omitempty"` - Openviapinhole string `json:"openviapinhole,omitempty"` - Openrecordroutepinhole string `json:"openrecordroutepinhole,omitempty"` - Siptransportprotocol string `json:"siptransportprotocol,omitempty"` - Openroutepinhole string `json:"openroutepinhole,omitempty"` - Rport string `json:"rport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lsngrouplsnappsprofilebinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsngroupBinding struct { + Groupname string `json:"groupname,omitempty"` + LsngroupIpsecalgprofileBinding []interface{} `json:"lsngroup_ipsecalgprofile_binding,omitempty"` + LsngroupLsnappsprofileBinding []interface{} `json:"lsngroup_lsnappsprofile_binding,omitempty"` + LsngroupLsnhttphdrlogprofileBinding []interface{} `json:"lsngroup_lsnhttphdrlogprofile_binding,omitempty"` + LsngroupLsnlogprofileBinding []interface{} `json:"lsngroup_lsnlogprofile_binding,omitempty"` + LsngroupLsnpoolBinding []interface{} `json:"lsngroup_lsnpool_binding,omitempty"` + LsngroupLsnrtspalgprofileBinding []interface{} `json:"lsngroup_lsnrtspalgprofile_binding,omitempty"` + LsngroupLsnsipalgprofileBinding []interface{} `json:"lsngroup_lsnsipalgprofile_binding,omitempty"` + LsngroupLsntransportprofileBinding []interface{} `json:"lsngroup_lsntransportprofile_binding,omitempty"` + LsngroupPcpserverBinding []interface{} `json:"lsngroup_pcpserver_binding,omitempty"` } -type Lsngroup struct { - Groupname string `json:"groupname,omitempty"` - Clientname string `json:"clientname,omitempty"` - Nattype string `json:"nattype,omitempty"` - Allocpolicy string `json:"allocpolicy,omitempty"` - Portblocksize int `json:"portblocksize"` - Logging string `json:"logging,omitempty"` - Sessionlogging string `json:"sessionlogging,omitempty"` - Sessionsync string `json:"sessionsync,omitempty"` - Snmptraplimit int `json:"snmptraplimit"` - Ftp string `json:"ftp,omitempty"` - Pptp string `json:"pptp,omitempty"` - Sipalg string `json:"sipalg,omitempty"` - Rtspalg string `json:"rtspalg,omitempty"` - Ip6profile string `json:"ip6profile,omitempty"` - Ftpcm string `json:"ftpcm,omitempty"` - Groupid string `json:"groupid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lsngroupappsprofilebinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LsnpoolBinding struct { + LsnpoolLsnipBinding []interface{} `json:"lsnpool_lsnip_binding,omitempty"` + Poolname string `json:"poolname,omitempty"` } -type Lsngroupsipalgprofilebinding struct { - Sipalgprofilename string `json:"sipalgprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsndeterministicnat struct { + Clientname string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Firstport int `json:"firstport,omitempty"` + Lastport int `json:"lastport,omitempty"` + Natip string `json:"natip,omitempty"` + Natip2 string `json:"natip2,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Nattype string `json:"nattype,omitempty"` + Network6 string `json:"network6,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Srctd int `json:"srctd,omitempty"` + Subscrip string `json:"subscrip,omitempty"` + Subscrip2 string `json:"subscrip2,omitempty"` + Td int `json:"td,omitempty"` +} + +type LsngroupLsnappsprofileBinding struct { + Appsprofilename string `json:"appsprofilename,omitempty"` + Groupname string `json:"groupname,omitempty"` } -type Lsnrtspalgsession struct { - Sessionid string `json:"sessionid,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Callflags string `json:"callflags,omitempty"` - Xlatip string `json:"xlatip,omitempty"` - Callrefcount string `json:"callrefcount,omitempty"` - Calltimer string `json:"calltimer,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LsnsipalgcallBinding struct { + Callid string `json:"callid,omitempty"` + LsnsipalgcallControlchannelBinding []interface{} `json:"lsnsipalgcall_controlchannel_binding,omitempty"` + LsnsipalgcallDatachannelBinding []interface{} `json:"lsnsipalgcall_datachannel_binding,omitempty"` } type Lsnappsprofile struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` - Ippooling string `json:"ippooling,omitempty"` - Mapping string `json:"mapping,omitempty"` - Filtering string `json:"filtering,omitempty"` - Tcpproxy string `json:"tcpproxy,omitempty"` - Td int `json:"td,omitempty"` - L2info string `json:"l2info,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Appsprofilename string `json:"appsprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + Filtering string `json:"filtering,omitempty"` + Ippooling string `json:"ippooling,omitempty"` + L2info string `json:"l2info,omitempty"` + Mapping string `json:"mapping,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tcpproxy string `json:"tcpproxy,omitempty"` + Td int `json:"td,omitempty"` + Transportprotocol string `json:"transportprotocol,omitempty"` } -type Lsngrouplsnhttphdrlogprofilebinding struct { - Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` -} - -type Lsngrouptransportprofilebinding struct { - Transportprofilename string `json:"transportprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` -} - -type Lsnrtspalgprofile struct { - Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` - Rtspidletimeout int `json:"rtspidletimeout,omitempty"` - Rtspportrange string `json:"rtspportrange,omitempty"` - Rtsptransportprotocol string `json:"rtsptransportprotocol,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Lsnhttphdrlogprofile struct { + Count float64 `json:"__count,omitempty"` + Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` + Loghost string `json:"loghost,omitempty"` + Logmethod string `json:"logmethod,omitempty"` + Logurl string `json:"logurl,omitempty"` + Logversion string `json:"logversion,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Lsnsipalgcalldatachannelbinding struct { +type LsnsipalgcallControlchannelBinding struct { + Callid string `json:"callid,omitempty"` + Channelflags int `json:"channelflags,omitempty"` Channelip string `json:"channelip,omitempty"` Channelnatip string `json:"channelnatip,omitempty"` - Channelport int `json:"channelport,omitempty"` Channelnatport int `json:"channelnatport,omitempty"` + Channelport int `json:"channelport,omitempty"` Channelprotocol string `json:"channelprotocol,omitempty"` - Channelflags int `json:"channelflags,omitempty"` Channeltimeout int `json:"channeltimeout,omitempty"` - Callid string `json:"callid,omitempty"` -} - -type Lsnappsprofileappsattributesbinding struct { - Appsattributesname string `json:"appsattributesname,omitempty"` - Appsprofilename string `json:"appsprofilename,omitempty"` -} - -type Lsnappsprofilelsnappsattributesbinding struct { - Appsattributesname string `json:"appsattributesname,omitempty"` - Appsprofilename string `json:"appsprofilename,omitempty"` -} - -type Lsndeterministicnat struct { - Clientname string `json:"clientname,omitempty"` - Network6 string `json:"network6,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Td int `json:"td,omitempty"` - Natip string `json:"natip,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Subscrip2 string `json:"subscrip2,omitempty"` - Natip2 string `json:"natip2,omitempty"` - Firstport string `json:"firstport,omitempty"` - Lastport string `json:"lastport,omitempty"` - Srctd string `json:"srctd,omitempty"` - Nattype string `json:"nattype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lsngrouplsnlogprofilebinding struct { - Logprofilename string `json:"logprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` -} - -type Lsnpool struct { - Poolname string `json:"poolname,omitempty"` - Nattype string `json:"nattype,omitempty"` - Portblockallocation string `json:"portblockallocation,omitempty"` - Portrealloctimeout int `json:"portrealloctimeout"` - Maxportrealloctmq int `json:"maxportrealloctmq"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Lsnpoolbinding struct { - Poolname string `json:"poolname,omitempty"` +type LsngroupLsnpoolBinding struct { + Groupname string `json:"groupname,omitempty"` + Poolname string `json:"poolname,omitempty"` } -type Lsnclient struct { - Clientname string `json:"clientname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Lsnsipalgcall struct { + Callflags int `json:"callflags,omitempty"` + Callid string `json:"callid,omitempty"` + Callrefcount int `json:"callrefcount,omitempty"` + Calltimer int `json:"calltimer,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Xlatip string `json:"xlatip,omitempty"` } -type Lsngrouplsnpoolbinding struct { +type LsnpoolLsnipBinding struct { + Lsnip string `json:"lsnip,omitempty"` + Ownernode int `json:"ownernode,omitempty"` Poolname string `json:"poolname,omitempty"` - Groupname string `json:"groupname,omitempty"` } -type Lsngrouplsntransportprofilebinding struct { - Transportprofilename string `json:"transportprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type Lsnrtspalgsession struct { + Callflags int `json:"callflags,omitempty"` + Callrefcount int `json:"callrefcount,omitempty"` + Calltimer int `json:"calltimer,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Sessionid string `json:"sessionid,omitempty"` + Xlatip string `json:"xlatip,omitempty"` } -type Lsnhttphdrlogprofile struct { - Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` - Logurl string `json:"logurl,omitempty"` - Logmethod string `json:"logmethod,omitempty"` - Logversion string `json:"logversion,omitempty"` - Loghost string `json:"loghost,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Lsnrtspalgprofile struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` + Rtspidletimeout int `json:"rtspidletimeout,omitempty"` + Rtspportrange string `json:"rtspportrange,omitempty"` + Rtsptransportprotocol string `json:"rtsptransportprotocol,omitempty"` } -type Lsnip6profile struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Network6 string `json:"network6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LsngroupPcpserverBinding struct { + Groupname string `json:"groupname,omitempty"` + Pcpserver string `json:"pcpserver,omitempty"` } -type Lsnparameter struct { - Memlimit int `json:"memlimit,omitempty"` - Sessionsync string `json:"sessionsync,omitempty"` - Subscrsessionremoval string `json:"subscrsessionremoval,omitempty"` - Memlimitactive string `json:"memlimitactive,omitempty"` - Maxmemlimit string `json:"maxmemlimit,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LsnclientBinding struct { + Clientname string `json:"clientname,omitempty"` + LsnclientNetwork6Binding []interface{} `json:"lsnclient_network6_binding,omitempty"` + LsnclientNetworkBinding []interface{} `json:"lsnclient_network_binding,omitempty"` + LsnclientNsacl6Binding []interface{} `json:"lsnclient_nsacl6_binding,omitempty"` + LsnclientNsaclBinding []interface{} `json:"lsnclient_nsacl_binding,omitempty"` } -type Lsnrtspalgsessiondatachannelbinding struct { +type LsnrtspalgsessionDatachannelBinding struct { + Channelflags int `json:"channelflags,omitempty"` Channelip string `json:"channelip,omitempty"` Channelnatip string `json:"channelnatip,omitempty"` - Channelport int `json:"channelport,omitempty"` Channelnatport int `json:"channelnatport,omitempty"` + Channelport int `json:"channelport,omitempty"` Channelprotocol string `json:"channelprotocol,omitempty"` - Channelflags int `json:"channelflags,omitempty"` Channeltimeout int `json:"channeltimeout,omitempty"` Sessionid string `json:"sessionid,omitempty"` } -type Lsnsession struct { - Nattype string `json:"nattype,omitempty"` - Clientname string `json:"clientname,omitempty"` - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Network6 string `json:"network6,omitempty"` - Td int `json:"td,omitempty"` - Natip string `json:"natip,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Natport2 int `json:"natport2,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Subscrport string `json:"subscrport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Natport string `json:"natport,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` - Sessionestdir string `json:"sessionestdir,omitempty"` - Dsttd string `json:"dsttd,omitempty"` - Srctd string `json:"srctd,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lsnclientnsaclbinding struct { - Aclname string `json:"aclname,omitempty"` - Td int `json:"td,omitempty"` - Clientname string `json:"clientname,omitempty"` -} - -type Lsnappsattributes struct { - Name string `json:"name,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` - Port string `json:"port,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Lsnappsprofileportbinding struct { - Lsnport string `json:"lsnport,omitempty"` - Appsprofilename string `json:"appsprofilename,omitempty"` -} - -type Lsnclientacl6binding struct { - Acl6name string `json:"acl6name,omitempty"` - Td uint32 `json:"td,omitempty"` - Clientname string `json:"clientname,omitempty"` -} - -type Lsnclientaclbinding struct { - Aclname string `json:"aclname,omitempty"` - Td uint32 `json:"td,omitempty"` - Clientname string `json:"clientname,omitempty"` -} - -type Lsnclientnetwork6binding struct { - Network6 string `json:"network6,omitempty"` - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Td int `json:"td,omitempty"` - Clientname string `json:"clientname,omitempty"` +type LsngroupLsnsipalgprofileBinding struct { + Groupname string `json:"groupname,omitempty"` + Sipalgprofilename string `json:"sipalgprofilename,omitempty"` } diff --git a/nitrogo/models/metrics.go b/nitrogo/models/metrics.go index d5f626f..23486a2 100644 --- a/nitrogo/models/metrics.go +++ b/nitrogo/models/metrics.go @@ -1,76 +1,83 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Metricsprofileuservserverbinding struct { +// metrics configuration structs +type MetricsprofileAuthenticationvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofile struct { - Name string `json:"name,omitempty"` - Collector string `json:"collector,omitempty"` - Outputmode string `json:"outputmode,omitempty"` - Metrics string `json:"metrics,omitempty"` - Servemode string `json:"servemode,omitempty"` - Schemafile string `json:"schemafile,omitempty"` - Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` - Metricsauthtoken string `json:"metricsauthtoken,omitempty"` - Metricsendpointurl string `json:"metricsendpointurl,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Metricsprofilecrvserverbinding struct { +type MetricsprofileVpnvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofilecsvserverbinding struct { +type MetricsprofileGslbvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofilegslbvserverbinding struct { +type MetricsprofileBinding struct { + MetricsprofileAuthenticationvserverBinding []interface{} `json:"metricsprofile_authenticationvserver_binding,omitempty"` + MetricsprofileCrvserverBinding []interface{} `json:"metricsprofile_crvserver_binding,omitempty"` + MetricsprofileCsvserverBinding []interface{} `json:"metricsprofile_csvserver_binding,omitempty"` + MetricsprofileGslbvserverBinding []interface{} `json:"metricsprofile_gslbvserver_binding,omitempty"` + MetricsprofileLbvserverBinding []interface{} `json:"metricsprofile_lbvserver_binding,omitempty"` + MetricsprofileServiceBinding []interface{} `json:"metricsprofile_service_binding,omitempty"` + MetricsprofileServicegroupBinding []interface{} `json:"metricsprofile_servicegroup_binding,omitempty"` + MetricsprofileUservserverBinding []interface{} `json:"metricsprofile_uservserver_binding,omitempty"` + MetricsprofileVpnvserverBinding []interface{} `json:"metricsprofile_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type Metricsprofile struct { + Collector string `json:"collector,omitempty"` + Count float64 `json:"__count,omitempty"` + Metrics string `json:"metrics,omitempty"` + Metricsauthtoken string `json:"metricsauthtoken,omitempty"` + Metricsendpointurl string `json:"metricsendpointurl,omitempty"` + Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Outputmode string `json:"outputmode,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Schemafile string `json:"schemafile,omitempty"` + Servemode string `json:"servemode,omitempty"` +} + +type MetricsprofileCrvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofilevpnvserverbinding struct { +type MetricsprofileLbvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofileauthenticationvserverbinding struct { +type MetricsprofileCsvserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofilebinding struct { - Name string `json:"name,omitempty"` -} - -type Metricsprofilelbvserverbinding struct { +type MetricsprofileServicegroupBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofileservicebinding struct { +type MetricsprofileServiceBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofileservicegroupbinding struct { +type MetricsprofileUservserverBinding struct { Entityname string `json:"entityname,omitempty"` Entitytype string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` diff --git a/nitrogo/models/network.go b/nitrogo/models/network.go index 637624e..ae16891 100644 --- a/nitrogo/models/network.go +++ b/nitrogo/models/network.go @@ -1,1294 +1,1259 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Inatparam struct { - Nat46v6prefix string `json:"nat46v6prefix,omitempty"` - Td int `json:"td"` - Nat46ignoretos string `json:"nat46ignoretos,omitempty"` - Nat46zerochecksum string `json:"nat46zerochecksum,omitempty"` - Nat46v6mtu int `json:"nat46v6mtu,omitempty"` - Nat46fragheader string `json:"nat46fragheader,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Ipsetnsipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` -} - -type Mapbmr struct { - Name string `json:"name,omitempty"` - Ruleipv6prefix string `json:"ruleipv6prefix,omitempty"` - Psidoffset int `json:"psidoffset,omitempty"` - Eabitlength int `json:"eabitlength,omitempty"` - Psidlength int `json:"psidlength,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// network configuration structs +type ChannelInterfaceBinding struct { + Id string `json:"id,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Lamode string `json:"lamode,omitempty"` + Lractiveintf int `json:"lractiveintf,omitempty"` + Slaveduplex int `json:"slaveduplex,omitempty"` + Slaveflowctl int `json:"slaveflowctl,omitempty"` + Slavemedia int `json:"slavemedia,omitempty"` + Slavespeed int `json:"slavespeed,omitempty"` + Slavestate int `json:"slavestate,omitempty"` + Slavetime int `json:"slavetime,omitempty"` + Svmcmd int `json:"svmcmd,omitempty"` } -type Netprofile struct { - Name string `json:"name,omitempty"` - Td int `json:"td,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Overridelsn string `json:"overridelsn,omitempty"` - Mbf string `json:"mbf,omitempty"` - Proxyprotocol string `json:"proxyprotocol,omitempty"` - Proxyprotocoltxversion string `json:"proxyprotocoltxversion,omitempty"` - Proxyprotocolaftertlshandshake string `json:"proxyprotocolaftertlshandshake,omitempty"` - Proxyprotocoltlvoptions string `json:"proxyprotocoltlvoptions,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Netprofilebinding struct { - Name string `json:"name,omitempty"` +type Mapdmr struct { + Bripv6prefix string `json:"bripv6prefix,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Rnat6 struct { - Name string `json:"name,omitempty"` - Network string `json:"network,omitempty"` - Acl6name string `json:"acl6name,omitempty"` - Redirectport int `json:"redirectport,omitempty"` - Td int `json:"td,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Rnat6Binding struct { + Name string `json:"name,omitempty"` + Rnat6Nsip6Binding []interface{} `json:"rnat6_nsip6_binding,omitempty"` } -type Rnatnsipbinding struct { - Natip string `json:"natip,omitempty"` - Td int `json:"td,omitempty"` +type VlanNsip6Binding struct { + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` - Name string `json:"name,omitempty"` + Td int `json:"td,omitempty"` } -type Rnatglobalsyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - All bool `json:"all,omitempty"` +type Nd6ravariablesOnlinkipv6prefixBinding struct { + Ipv6prefix string `json:"ipv6prefix,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Ci struct { - Ifaces string `json:"ifaces,omitempty"` +type Ptp struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Route6 struct { - Network string `json:"network,omitempty"` - Gateway string `json:"gateway,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Weight int `json:"weight,omitempty"` - Distance int `json:"distance,omitempty"` - Cost int `json:"cost,omitempty"` - Advertise string `json:"advertise,omitempty"` - Msr string `json:"msr,omitempty"` - Monitor string `json:"monitor,omitempty"` - Td int `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Mgmt bool `json:"mgmt,omitempty"` - Routetype string `json:"routetype,omitempty"` - Detail bool `json:"detail,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Type string `json:"type,omitempty"` - Dynamic string `json:"dynamic,omitempty"` - Data string `json:"data,omitempty"` - Flags string `json:"flags,omitempty"` State string `json:"state,omitempty"` - Totalprobes string `json:"totalprobes,omitempty"` - Totalfailedprobes string `json:"totalfailedprobes,omitempty"` - Failedprobes string `json:"failedprobes,omitempty"` - Monstatcode string `json:"monstatcode,omitempty"` - Monstatparam1 string `json:"monstatparam1,omitempty"` - Monstatparam2 string `json:"monstatparam2,omitempty"` - Monstatparam3 string `json:"monstatparam3,omitempty"` - Data1 string `json:"data1,omitempty"` - Routeowners string `json:"routeowners,omitempty"` - Retain string `json:"retain,omitempty"` - Static string `json:"Static,omitempty"` - Permanent string `json:"permanent,omitempty"` - Connected string `json:"connected,omitempty"` - Ospfv3 string `json:"ospfv3,omitempty"` - Isis string `json:"isis,omitempty"` - Active string `json:"active,omitempty"` - Bgp string `json:"bgp,omitempty"` - Rip string `json:"rip,omitempty"` - Raroute string `json:"raroute,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vxlan struct { - Id int `json:"id,omitempty"` - Vlan int `json:"vlan,omitempty"` - Port int `json:"port,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Type string `json:"type,omitempty"` - Protocol string `json:"protocol,omitempty"` - Innervlantagging string `json:"innervlantagging,omitempty"` - Td string `json:"td,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Interfacepair struct { - Id int `json:"id,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nd6 struct { - Neighbor string `json:"neighbor,omitempty"` - Mac string `json:"mac,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Vtep string `json:"vtep,omitempty"` - Td int `json:"td"` - Nodeid int `json:"nodeid"` - State string `json:"state,omitempty"` - Timeout string `json:"timeout,omitempty"` - Flags string `json:"flags,omitempty"` - Controlplane string `json:"controlplane,omitempty"` - Channel string `json:"channel,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type RnatNsipBinding struct { + Name string `json:"name,omitempty"` + Natip string `json:"natip,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Td int `json:"td,omitempty"` } -type Netbridgeipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` +type Vrid6 struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Effectivepriority int `json:"effectivepriority,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Operationalownernode int `json:"operationalownernode,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Preemption string `json:"preemption,omitempty"` + Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + Priority int `json:"priority,omitempty"` + Sharing string `json:"sharing,omitempty"` + State int `json:"state,omitempty"` + Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + Tracking string `json:"tracking,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type NetprofileNatruleBinding struct { Name string `json:"name,omitempty"` + Natrule string `json:"natrule,omitempty"` + Netmask string `json:"netmask,omitempty"` + Rewriteip string `json:"rewriteip,omitempty"` } -type Vridinterfacebinding struct { - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` -} - -type Vridnsipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type Iptunnel struct { + Channel int `json:"channel,omitempty"` + Count float64 `json:"__count,omitempty"` + Destport int `json:"destport,omitempty"` + Encapip string `json:"encapip,omitempty"` + Grepayload string `json:"grepayload,omitempty"` + Ipsecprofilename string `json:"ipsecprofilename,omitempty"` + Ipsectunnelstatus string `json:"ipsectunnelstatus,omitempty"` + Local string `json:"local,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Protocol string `json:"protocol,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Remote string `json:"remote,omitempty"` + Remotesubnetmask string `json:"remotesubnetmask,omitempty"` + Sysname string `json:"sysname,omitempty"` + Tosinherit string `json:"tosinherit,omitempty"` + Tunneltype []string `json:"tunneltype,omitempty"` + TypeField int `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vlantagging string `json:"vlantagging,omitempty"` + Vnid int `json:"vnid,omitempty"` } -type Bridgegroupnsipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td int `json:"td,omitempty"` - Netmask string `json:"netmask,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Id int `json:"id,omitempty"` +type NetprofileSrcportsetBinding struct { + Name string `json:"name,omitempty"` + Srcportrange string `json:"srcportrange,omitempty"` } type L2param struct { - Mbfpeermacupdate int `json:"mbfpeermacupdate"` - Maxbridgecollision int `json:"maxbridgecollision"` Bdggrpproxyarp string `json:"bdggrpproxyarp,omitempty"` Bdgsetting string `json:"bdgsetting,omitempty"` + Bridgeagetimeout int `json:"bridgeagetimeout,omitempty"` Garponvridintf string `json:"garponvridintf,omitempty"` - Macmodefwdmypkt string `json:"macmodefwdmypkt,omitempty"` - Usemymac string `json:"usemymac,omitempty"` - Proxyarp string `json:"proxyarp,omitempty"` Garpreply string `json:"garpreply,omitempty"` + Macmodefwdmypkt string `json:"macmodefwdmypkt,omitempty"` + Maxbridgecollision int `json:"maxbridgecollision,omitempty"` Mbfinstlearning string `json:"mbfinstlearning,omitempty"` + Mbfpeermacupdate int `json:"mbfpeermacupdate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Proxyarp string `json:"proxyarp,omitempty"` + Returntoethernetsender string `json:"returntoethernetsender,omitempty"` Rstintfonhafo string `json:"rstintfonhafo,omitempty"` Skipproxyingbsdtraffic string `json:"skipproxyingbsdtraffic,omitempty"` - Returntoethernetsender string `json:"returntoethernetsender,omitempty"` Stopmacmoveupdate string `json:"stopmacmoveupdate,omitempty"` - Bridgeagetimeout int `json:"bridgeagetimeout,omitempty"` + Usemymac string `json:"usemymac,omitempty"` Usenetprofilebsdtraffic string `json:"usenetprofilebsdtraffic,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type L4param struct { - L2connmethod string `json:"l2connmethod,omitempty"` - L4switch string `json:"l4switch,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nd6ravariablesBinding struct { + Nd6ravariablesOnlinkipv6prefixBinding []interface{} `json:"nd6ravariables_onlinkipv6prefix_binding,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Ipsetip6binding struct { +type Bridgegroup struct { + Count float64 `json:"__count,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Flags bool `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Portbitmap int `json:"portbitmap,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Tagbitmap int `json:"tagbitmap,omitempty"` + Tagifaces string `json:"tagifaces,omitempty"` +} + +type IpsetNsip6Binding struct { Ipaddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` } -type Mapbmrbinding struct { - Name string `json:"name,omitempty"` -} - -type Nd6ravariables struct { - Vlan int `json:"vlan,omitempty"` - Ceaserouteradv string `json:"ceaserouteradv,omitempty"` - Sendrouteradv string `json:"sendrouteradv,omitempty"` - Srclinklayeraddroption string `json:"srclinklayeraddroption,omitempty"` - Onlyunicastrtadvresponse string `json:"onlyunicastrtadvresponse,omitempty"` - Managedaddrconfig string `json:"managedaddrconfig,omitempty"` - Otheraddrconfig string `json:"otheraddrconfig,omitempty"` - Currhoplimit int `json:"currhoplimit,omitempty"` - Maxrtadvinterval int `json:"maxrtadvinterval,omitempty"` - Minrtadvinterval int `json:"minrtadvinterval,omitempty"` - Linkmtu int `json:"linkmtu,omitempty"` - Reachabletime int `json:"reachabletime,omitempty"` - Retranstime int `json:"retranstime,omitempty"` - Defaultlifetime int `json:"defaultlifetime,omitempty"` - Lastrtadvtime string `json:"lastrtadvtime,omitempty"` - Nextrtadvdelay string `json:"nextrtadvdelay,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Ip6tunnelparam struct { - Srcip string `json:"srcip,omitempty"` - Dropfrag string `json:"dropfrag,omitempty"` - Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` - Srciproundrobin string `json:"srciproundrobin,omitempty"` - Useclientsourceipv6 string `json:"useclientsourceipv6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Vrid6ChannelBinding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Netprofilenatrulebinding struct { - Natrule string `json:"natrule,omitempty"` - Netmask string `json:"netmask,omitempty"` - Rewriteip string `json:"rewriteip,omitempty"` - Name string `json:"name,omitempty"` +type ChannelBinding struct { + ChannelInterfaceBinding []interface{} `json:"channel_interface_binding,omitempty"` + Id string `json:"id,omitempty"` } -type Vlannsipbinding struct { +type Rnat6 struct { + Acl6name string `json:"acl6name,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Redirectport int `json:"redirectport,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Td int `json:"td,omitempty"` +} + +type BridgegroupNsip6Binding struct { + Id int `json:"id,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Td int `json:"td,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` - Id int `json:"id,omitempty"` -} - -type Vrid6ip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags uint32 `json:"flags,omitempty"` - Id uint32 `json:"id,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Td int `json:"td,omitempty"` } -type L3param struct { - Srcnat string `json:"srcnat,omitempty"` - Icmpgenratethreshold int `json:"icmpgenratethreshold,omitempty"` - Overridernat string `json:"overridernat,omitempty"` - Dropdfflag string `json:"dropdfflag,omitempty"` - Miproundrobin string `json:"miproundrobin,omitempty"` - Externalloopback string `json:"externalloopback,omitempty"` - Tnlpmtuwoconn string `json:"tnlpmtuwoconn,omitempty"` - Usipserverstraypkt string `json:"usipserverstraypkt,omitempty"` - Forwardicmpfragments string `json:"forwardicmpfragments,omitempty"` - Dropipfragments string `json:"dropipfragments,omitempty"` - Acllogtime int `json:"acllogtime,omitempty"` - Implicitaclallow string `json:"implicitaclallow,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Allowclasseipv4 string `json:"allowclasseipv4,omitempty"` - Implicitpbr string `json:"implicitpbr,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type BridgegroupVlanBinding struct { + Id int `json:"id,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Netbridge struct { - Name string `json:"name,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nd6ravariables struct { + Ceaserouteradv string `json:"ceaserouteradv,omitempty"` + Count float64 `json:"__count,omitempty"` + Currhoplimit int `json:"currhoplimit,omitempty"` + Defaultlifetime int `json:"defaultlifetime,omitempty"` + Lastrtadvtime int `json:"lastrtadvtime,omitempty"` + Linkmtu int `json:"linkmtu,omitempty"` + Managedaddrconfig string `json:"managedaddrconfig,omitempty"` + Maxrtadvinterval int `json:"maxrtadvinterval,omitempty"` + Minrtadvinterval int `json:"minrtadvinterval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextrtadvdelay int `json:"nextrtadvdelay,omitempty"` + Onlyunicastrtadvresponse string `json:"onlyunicastrtadvresponse,omitempty"` + Otheraddrconfig string `json:"otheraddrconfig,omitempty"` + Reachabletime int `json:"reachabletime,omitempty"` + Retranstime int `json:"retranstime,omitempty"` + Sendrouteradv string `json:"sendrouteradv,omitempty"` + Srclinklayeraddroption string `json:"srclinklayeraddroption,omitempty"` + Vlan int `json:"vlan,omitempty"` +} + +type VridNsipBinding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` } -type Vlanlinksetbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Tagged bool `json:"tagged,omitempty"` +type VlanInterfaceBinding struct { Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } -type Vrid6channelbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` -} - -type Ipsetnsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` -} - -type Linkset struct { - Id string `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Linksetchannelbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Id string `json:"id,omitempty"` -} - -type Fischannelbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Name string `json:"name,omitempty"` -} - -type Inat struct { - Name string `json:"name,omitempty"` - Publicip string `json:"publicip,omitempty"` - Privateip string `json:"privateip,omitempty"` - Mode string `json:"mode,omitempty"` - Tcpproxy string `json:"tcpproxy,omitempty"` - Ftp string `json:"ftp,omitempty"` - Tftp string `json:"tftp,omitempty"` - Usip string `json:"usip,omitempty"` - Usnip string `json:"usnip,omitempty"` - Proxyip string `json:"proxyip,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` - Td int `json:"td,omitempty"` - Connfailover string `json:"connfailover,omitempty"` - Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Netbridgevlanbinding struct { - Vlan int `json:"vlan,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vrid6 struct { - Id int `json:"id,omitempty"` - Priority int `json:"priority,omitempty"` - Preemption string `json:"preemption,omitempty"` - Sharing string `json:"sharing,omitempty"` - Tracking string `json:"tracking,omitempty"` - Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` - Trackifnumpriority int `json:"trackifnumpriority,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - All bool `json:"all,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Type string `json:"type,omitempty"` - State string `json:"state,omitempty"` - Flags string `json:"flags,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Effectivepriority string `json:"effectivepriority,omitempty"` - Operationalownernode string `json:"operationalownernode,omitempty"` +type Ip6tunnelparam struct { + Dropfrag string `json:"dropfrag,omitempty"` + Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srciproundrobin string `json:"srciproundrobin,omitempty"` + Useclientsourceipv6 string `json:"useclientsourceipv6,omitempty"` } -type Rnat6binding struct { - Name string `json:"name,omitempty"` -} - -type Vlanbinding struct { - Id int `json:"id,omitempty"` -} - -type Mapdomainmapbmrbinding struct { - Mapbmrname string `json:"mapbmrname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Netbridgebinding struct { - Name string `json:"name,omitempty"` -} - -type Netbridgeiptunnelbinding struct { - Tunnel string `json:"tunnel,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vxlanip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Id uint32 `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` -} - -type Vxlanvlanmapbinding struct { - Name string `json:"name,omitempty"` -} - -type Fis struct { - Name string `json:"name,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vlannsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td int `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` +type Vrid6TrackinterfaceBinding struct { + Flags int `json:"flags,omitempty"` Id int `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` + Trackifnum string `json:"trackifnum,omitempty"` } -type Vrid6interfacebinding struct { - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type RnatglobalAuditsyslogpolicyBinding struct { + All bool `json:"all,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vrid6nsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type Arpparam struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Spoofvalidation string `json:"spoofvalidation,omitempty"` + Timeout int `json:"timeout,omitempty"` } type Channel struct { - Id string `json:"id,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - State string `json:"state,omitempty"` - Mode string `json:"mode,omitempty"` - Conndistr string `json:"conndistr,omitempty"` - Macdistr string `json:"macdistr,omitempty"` - Lamac string `json:"lamac,omitempty"` - Speed string `json:"speed,omitempty"` - Flowctl string `json:"flowctl,omitempty"` - Hamonitor string `json:"hamonitor,omitempty"` - Haheartbeat string `json:"haheartbeat,omitempty"` - Tagall string `json:"tagall,omitempty"` - Trunk string `json:"trunk,omitempty"` - Ifalias string `json:"ifalias,omitempty"` - Throughput int `json:"throughput,omitempty"` + Actflowctl string `json:"actflowctl,omitempty"` + Actspeed string `json:"actspeed,omitempty"` + Actthroughput int `json:"actthroughput,omitempty"` + Actualmtu int `json:"actualmtu,omitempty"` + Autoneg int `json:"autoneg,omitempty"` + Autonegresult int `json:"autonegresult,omitempty"` + Backplane string `json:"backplane,omitempty"` Bandwidthhigh int `json:"bandwidthhigh,omitempty"` Bandwidthnormal int `json:"bandwidthnormal,omitempty"` - Mtu int `json:"mtu,omitempty"` - Lrminthroughput int `json:"lrminthroughput,omitempty"` - Linkredundancy string `json:"linkredundancy,omitempty"` - Devicename string `json:"devicename,omitempty"` - Unit string `json:"unit,omitempty"` + Bdgmuted int `json:"bdgmuted,omitempty"` + Cleartime int `json:"cleartime,omitempty"` + Conndistr string `json:"conndistr,omitempty"` + Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flags string `json:"flags,omitempty"` - Actualmtu string `json:"actualmtu,omitempty"` - Vlan string `json:"vlan,omitempty"` - Mac string `json:"mac,omitempty"` - Uptime string `json:"uptime,omitempty"` - Downtime string `json:"downtime,omitempty"` - Reqmedia string `json:"reqmedia,omitempty"` - Reqspeed string `json:"reqspeed,omitempty"` - Reqduplex string `json:"reqduplex,omitempty"` - Reqflowcontrol string `json:"reqflowcontrol,omitempty"` - Media string `json:"media,omitempty"` - Actspeed string `json:"actspeed,omitempty"` + Devicename string `json:"devicename,omitempty"` + Downtime int `json:"downtime,omitempty"` Duplex string `json:"duplex,omitempty"` - Actflowctl string `json:"actflowctl,omitempty"` - Lamode string `json:"lamode,omitempty"` - Autoneg string `json:"autoneg,omitempty"` - Autonegresult string `json:"autonegresult,omitempty"` - Tagged string `json:"tagged,omitempty"` - Taggedany string `json:"taggedany,omitempty"` - Taggedautolearn string `json:"taggedautolearn,omitempty"` - Hangdetect string `json:"hangdetect,omitempty"` - Hangreset string `json:"hangreset,omitempty"` - Linkstate string `json:"linkstate,omitempty"` - Intfstate string `json:"intfstate,omitempty"` - Rxpackets string `json:"rxpackets,omitempty"` - Rxbytes string `json:"rxbytes,omitempty"` - Rxerrors string `json:"rxerrors,omitempty"` - Rxdrops string `json:"rxdrops,omitempty"` - Txpackets string `json:"txpackets,omitempty"` - Txbytes string `json:"txbytes,omitempty"` - Txerrors string `json:"txerrors,omitempty"` - Txdrops string `json:"txdrops,omitempty"` - Indisc string `json:"indisc,omitempty"` - Outdisc string `json:"outdisc,omitempty"` - Fctls string `json:"fctls,omitempty"` - Hangs string `json:"hangs,omitempty"` - Stsstalls string `json:"stsstalls,omitempty"` - Txstalls string `json:"txstalls,omitempty"` - Rxstalls string `json:"rxstalls,omitempty"` - Bdgmuted string `json:"bdgmuted,omitempty"` - Vmac string `json:"vmac,omitempty"` - Vmac6 string `json:"vmac6,omitempty"` - Reqthroughput string `json:"reqthroughput,omitempty"` - Actthroughput string `json:"actthroughput,omitempty"` - Backplane string `json:"backplane,omitempty"` - Cleartime string `json:"cleartime,omitempty"` + Fctls int `json:"fctls,omitempty"` + Flags int `json:"flags,omitempty"` + Flowctl string `json:"flowctl,omitempty"` + Haheartbeat string `json:"haheartbeat,omitempty"` + Hamonitor string `json:"hamonitor,omitempty"` + Hangdetect int `json:"hangdetect,omitempty"` + Hangreset int `json:"hangreset,omitempty"` + Hangs int `json:"hangs,omitempty"` + Id string `json:"id,omitempty"` + Ifalias string `json:"ifalias,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Indisc int `json:"indisc,omitempty"` + Intfstate int `json:"intfstate,omitempty"` + Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` + Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` + Lacpactordistributing string `json:"lacpactordistributing,omitempty"` + Lacpactorinsync string `json:"lacpactorinsync,omitempty"` + Lacpactorportno int `json:"lacpactorportno,omitempty"` + Lacpactorpriority int `json:"lacpactorpriority,omitempty"` Lacpmode string `json:"lacpmode,omitempty"` - Lacptimeout string `json:"lacptimeout,omitempty"` - Lacpactorpriority string `json:"lacpactorpriority,omitempty"` - Lacpactorportno string `json:"lacpactorportno,omitempty"` - Lacppartnerstate string `json:"lacppartnerstate,omitempty"` - Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` - Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` - Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` + Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` - Lacppartnerpriority string `json:"lacppartnerpriority,omitempty"` + Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` + Lacppartnerkey int `json:"lacppartnerkey,omitempty"` + Lacppartnerportno int `json:"lacppartnerportno,omitempty"` + Lacppartnerpriority int `json:"lacppartnerpriority,omitempty"` + Lacppartnerstate string `json:"lacppartnerstate,omitempty"` Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` - Lacppartnersystempriority string `json:"lacppartnersystempriority,omitempty"` - Lacppartnerportno string `json:"lacppartnerportno,omitempty"` - Lacppartnerkey string `json:"lacppartnerkey,omitempty"` - Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` - Lacpactorinsync string `json:"lacpactorinsync,omitempty"` - Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` - Lacpactordistributing string `json:"lacpactordistributing,omitempty"` + Lacppartnersystempriority int `json:"lacppartnersystempriority,omitempty"` + Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` Lacpportrxstat string `json:"lacpportrxstat,omitempty"` Lacpportselectstate string `json:"lacpportselectstate,omitempty"` + Lacptimeout string `json:"lacptimeout,omitempty"` + Lamac string `json:"lamac,omitempty"` + Lamode string `json:"lamode,omitempty"` + Linkredundancy string `json:"linkredundancy,omitempty"` + Linkstate int `json:"linkstate,omitempty"` Lldpmode string `json:"lldpmode,omitempty"` + Lrminthroughput int `json:"lrminthroughput,omitempty"` + Mac string `json:"mac,omitempty"` + Macdistr string `json:"macdistr,omitempty"` + Media string `json:"media,omitempty"` + Mode string `json:"mode,omitempty"` + Mtu int `json:"mtu,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Outdisc int `json:"outdisc,omitempty"` + Reqduplex string `json:"reqduplex,omitempty"` + Reqflowcontrol string `json:"reqflowcontrol,omitempty"` + Reqmedia string `json:"reqmedia,omitempty"` + Reqspeed string `json:"reqspeed,omitempty"` + Reqthroughput int `json:"reqthroughput,omitempty"` + Rxbytes int `json:"rxbytes,omitempty"` + Rxdrops int `json:"rxdrops,omitempty"` + Rxerrors int `json:"rxerrors,omitempty"` + Rxpackets int `json:"rxpackets,omitempty"` + Rxstalls int `json:"rxstalls,omitempty"` + Speed string `json:"speed,omitempty"` + State string `json:"state,omitempty"` + Stsstalls int `json:"stsstalls,omitempty"` + Tagall string `json:"tagall,omitempty"` + Tagged int `json:"tagged,omitempty"` + Taggedany int `json:"taggedany,omitempty"` + Taggedautolearn int `json:"taggedautolearn,omitempty"` + Throughput int `json:"throughput,omitempty"` + Trunk string `json:"trunk,omitempty"` + Txbytes int `json:"txbytes,omitempty"` + Txdrops int `json:"txdrops,omitempty"` + Txerrors int `json:"txerrors,omitempty"` + Txpackets int `json:"txpackets,omitempty"` + Txstalls int `json:"txstalls,omitempty"` + Unit int `json:"unit,omitempty"` + Uptime int `json:"uptime,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vmac string `json:"vmac,omitempty"` + Vmac6 string `json:"vmac6,omitempty"` } -type Fisinterfacebinding struct { - Ifnum string `json:"ifnum,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Name string `json:"name,omitempty"` -} - -type Nd6ravariablesbinding struct { - Vlan int `json:"vlan,omitempty"` -} - -type Netbridgensipbinding struct { +type Netprofile struct { + Badipactionthreshold int `json:"badipactionthreshold,omitempty"` + Count float64 `json:"__count,omitempty"` + Mbf string `json:"mbf,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overridelsn string `json:"overridelsn,omitempty"` + Proxyprotocol string `json:"proxyprotocol,omitempty"` + Proxyprotocolaftertlshandshake string `json:"proxyprotocolaftertlshandshake,omitempty"` + Proxyprotocoltlvoptions []string `json:"proxyprotocoltlvoptions,omitempty"` + Proxyprotocoltxversion string `json:"proxyprotocoltxversion,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Td int `json:"td,omitempty"` +} + +type VxlanNsipBinding struct { + Id int `json:"id,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vrid6ipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags uint32 `json:"flags,omitempty"` - Id uint32 `json:"id,omitempty"` -} - -type Vridip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags uint32 `json:"flags,omitempty"` - Id uint32 `json:"id,omitempty"` -} - -type Bridgetable struct { - Mac string `json:"mac,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Vtep string `json:"vtep,omitempty"` - Vni int `json:"vni,omitempty"` - Devicevlan int `json:"devicevlan,omitempty"` - Bridgeage int `json:"bridgeage,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Vlan int `json:"vlan,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Flags string `json:"flags,omitempty"` - Type string `json:"type,omitempty"` - Channel string `json:"channel,omitempty"` - Controlplane string `json:"controlplane,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Channelbinding struct { - Id string `json:"id,omitempty"` +type Rnat struct { + Aclname string `json:"aclname,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Natip string `json:"natip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Redirectport int `json:"redirectport,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Td int `json:"td,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` } -type Ipset struct { - Name string `json:"name,omitempty"` - Td int `json:"td,omitempty"` +type Appalgparam struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pptpgreidletimeout int `json:"pptpgreidletimeout,omitempty"` } -type Mapbmrbmrv4networkbinding struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vlan struct { - Id int `json:"id,omitempty"` - Aliasname string `json:"aliasname,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Mtu int `json:"mtu,omitempty"` - Sharing string `json:"sharing,omitempty"` - Linklocalipv6addr string `json:"linklocalipv6addr,omitempty"` - Rnat string `json:"rnat,omitempty"` - Portbitmap string `json:"portbitmap,omitempty"` - Lsbitmap string `json:"lsbitmap,omitempty"` - Tagbitmap string `json:"tagbitmap,omitempty"` - Lstagbitmap string `json:"lstagbitmap,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Tagifaces string `json:"tagifaces,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Tagged string `json:"tagged,omitempty"` - Vlantd string `json:"vlantd,omitempty"` - Sdxvlan string `json:"sdxvlan,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Vxlan string `json:"vxlan,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Iptunnelparam struct { + Dropfrag string `json:"dropfrag,omitempty"` + Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` + Enablestrictrx string `json:"enablestrictrx,omitempty"` + Enablestricttx string `json:"enablestricttx,omitempty"` + Mac string `json:"mac,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srciproundrobin string `json:"srciproundrobin,omitempty"` + Useclientsourceip string `json:"useclientsourceip,omitempty"` } -type Vxlanbinding struct { - Id int `json:"id,omitempty"` +type VridNsip6Binding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` } -type Bridgegroupbinding struct { - Id int `json:"id,omitempty"` +type BridgegroupBinding struct { + BridgegroupNsip6Binding []interface{} `json:"bridgegroup_nsip6_binding,omitempty"` + BridgegroupNsipBinding []interface{} `json:"bridgegroup_nsip_binding,omitempty"` + BridgegroupVlanBinding []interface{} `json:"bridgegroup_vlan_binding,omitempty"` + Id int `json:"id,omitempty"` } -type Linksetinterfacebinding struct { - Ifnum string `json:"ifnum,omitempty"` - Id string `json:"id,omitempty"` +type Ipset struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` } -type Mapdomainbinding struct { - Name string `json:"name,omitempty"` +type Arp struct { + All bool `json:"all,omitempty"` + Channel int `json:"channel,omitempty"` + Controlplane bool `json:"controlplane,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Mac string `json:"mac,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + State int `json:"state,omitempty"` + Td int `json:"td,omitempty"` + Timeout int `json:"timeout,omitempty"` + TypeField string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vtep string `json:"vtep,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Linksetbinding struct { - Id string `json:"id,omitempty"` +type Inatparam struct { + Count float64 `json:"__count,omitempty"` + Nat46fragheader string `json:"nat46fragheader,omitempty"` + Nat46ignoretos string `json:"nat46ignoretos,omitempty"` + Nat46v6mtu int `json:"nat46v6mtu,omitempty"` + Nat46v6prefix string `json:"nat46v6prefix,omitempty"` + Nat46zerochecksum string `json:"nat46zerochecksum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` } -type Nat64 struct { - Name string `json:"name,omitempty"` - Acl6name string `json:"acl6name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type L3param struct { + Acllogtime int `json:"acllogtime,omitempty"` + Allowclasseipv4 string `json:"allowclasseipv4,omitempty"` + Dropdfflag string `json:"dropdfflag,omitempty"` + Dropipfragments string `json:"dropipfragments,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Externalloopback string `json:"externalloopback,omitempty"` + Forwardicmpfragments string `json:"forwardicmpfragments,omitempty"` + Icmpgenratethreshold int `json:"icmpgenratethreshold,omitempty"` + Implicitaclallow string `json:"implicitaclallow,omitempty"` + Implicitpbr string `json:"implicitpbr,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Miproundrobin string `json:"miproundrobin,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overridernat string `json:"overridernat,omitempty"` + Srcnat string `json:"srcnat,omitempty"` + Tnlpmtuwoconn string `json:"tnlpmtuwoconn,omitempty"` + Usipserverstraypkt string `json:"usipserverstraypkt,omitempty"` } type Nat64param struct { - Td int `json:"td"` - Nat64ignoretos string `json:"nat64ignoretos,omitempty"` - Nat64zerochecksum string `json:"nat64zerochecksum,omitempty"` - Nat64v6mtu int `json:"nat64v6mtu,omitempty"` - Nat64fragheader string `json:"nat64fragheader,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Rnat6nsip6binding struct { - Natip6 string `json:"natip6,omitempty"` - Td int `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + Nat64fragheader string `json:"nat64fragheader,omitempty"` + Nat64ignoretos string `json:"nat64ignoretos,omitempty"` + Nat64v6mtu int `json:"nat64v6mtu,omitempty"` + Nat64zerochecksum string `json:"nat64zerochecksum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` } -type Rnatretainsourceportsetbinding struct { - Retainsourceportrange string `json:"retainsourceportrange,omitempty"` - Name string `json:"name,omitempty"` +type Lacp struct { + Clustermac string `json:"clustermac,omitempty"` + Clustersyspriority int `json:"clustersyspriority,omitempty"` + Count float64 `json:"__count,omitempty"` + Devicename string `json:"devicename,omitempty"` + Flags int `json:"flags,omitempty"` + Lacpkey int `json:"lacpkey,omitempty"` + Mac string `json:"mac,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Syspriority int `json:"syspriority,omitempty"` } -type Vrid struct { - Id int `json:"id,omitempty"` - Priority int `json:"priority,omitempty"` - Preemption string `json:"preemption,omitempty"` - Sharing string `json:"sharing,omitempty"` - Tracking string `json:"tracking,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Trackifnumpriority int `json:"trackifnumpriority,omitempty"` - Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` - All bool `json:"all,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Type string `json:"type,omitempty"` - Effectivepriority string `json:"effectivepriority,omitempty"` - Flags string `json:"flags,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - State string `json:"state,omitempty"` - Operationalownernode string `json:"operationalownernode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Mapdomain struct { + Count float64 `json:"__count,omitempty"` + Mapdmrname string `json:"mapdmrname,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } type Forwardingsession struct { - Name string `json:"name,omitempty"` - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Acl6name string `json:"acl6name,omitempty"` - Aclname string `json:"aclname,omitempty"` - Td int `json:"td,omitempty"` - Connfailover string `json:"connfailover,omitempty"` - Sourceroutecache string `json:"sourceroutecache,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Acl6name string `json:"acl6name,omitempty"` + Aclname string `json:"aclname,omitempty"` + Connfailover string `json:"connfailover,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Processlocal string `json:"processlocal,omitempty"` + Sourceroutecache string `json:"sourceroutecache,omitempty"` + Td int `json:"td,omitempty"` } -type Route struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Gateway string `json:"gateway,omitempty"` - Vlan int `json:"vlan,omitempty"` +type Route6 struct { + Active bool `json:"active,omitempty"` + Advertise string `json:"advertise,omitempty"` + Bgp bool `json:"bgp,omitempty"` + Connected bool `json:"connected,omitempty"` Cost int `json:"cost,omitempty"` - Td int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + Data bool `json:"data,omitempty"` + Data1 string `json:"data1,omitempty"` + Detail bool `json:"detail,omitempty"` Distance int `json:"distance,omitempty"` - Cost1 int `json:"cost1,omitempty"` - Weight int `json:"weight,omitempty"` - Advertise string `json:"advertise,omitempty"` - Protocol []string `json:"protocol,omitempty"` - Msr string `json:"msr,omitempty"` + Dynamic bool `json:"dynamic,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Flags bool `json:"flags,omitempty"` + Gateway string `json:"gateway,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Isis bool `json:"isis,omitempty"` + Mgmt bool `json:"mgmt,omitempty"` Monitor string `json:"monitor,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Msr string `json:"msr,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ospfv3 bool `json:"ospfv3,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` - Mgmt bool `json:"mgmt,omitempty"` + Permanent bool `json:"permanent,omitempty"` + Raroute bool `json:"raroute,omitempty"` + Retain int `json:"retain,omitempty"` + Rip bool `json:"rip,omitempty"` + Routeowners []string `json:"routeowners,omitempty"` Routetype string `json:"routetype,omitempty"` - Detail bool `json:"detail,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Type string `json:"type,omitempty"` - Dynamic string `json:"dynamic,omitempty"` - Static string `json:"Static,omitempty"` - Permanent string `json:"permanent,omitempty"` - Direct string `json:"direct,omitempty"` - Nat string `json:"nat,omitempty"` - Lbroute string `json:"lbroute,omitempty"` - Adv string `json:"adv,omitempty"` - Tunnel string `json:"tunnel,omitempty"` - Data string `json:"data,omitempty"` - Data0 string `json:"data0,omitempty"` - Flags string `json:"flags,omitempty"` - Routeowners string `json:"routeowners,omitempty"` - Retain string `json:"retain,omitempty"` - Ospf string `json:"ospf,omitempty"` - Isis string `json:"isis,omitempty"` - Rip string `json:"rip,omitempty"` - Bgp string `json:"bgp,omitempty"` - Dhcp string `json:"dhcp,omitempty"` - Advospf string `json:"advospf,omitempty"` - Advisis string `json:"advisis,omitempty"` - Advrip string `json:"advrip,omitempty"` - Advbgp string `json:"advbgp,omitempty"` - State string `json:"state,omitempty"` - Totalprobes string `json:"totalprobes,omitempty"` - Totalfailedprobes string `json:"totalfailedprobes,omitempty"` - Failedprobes string `json:"failedprobes,omitempty"` - Monstatcode string `json:"monstatcode,omitempty"` - Monstatparam1 string `json:"monstatparam1,omitempty"` - Monstatparam2 string `json:"monstatparam2,omitempty"` - Monstatparam3 string `json:"monstatparam3,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State int `json:"state,omitempty"` + Static bool `json:"Static,omitempty"` + Td int `json:"td,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Totalprobes int `json:"totalprobes,omitempty"` + TypeField bool `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Weight int `json:"weight,omitempty"` } -type Arpparam struct { - Timeout int `json:"timeout,omitempty"` - Spoofvalidation string `json:"spoofvalidation,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VlanLinksetBinding struct { + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } -type Vridipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags uint32 `json:"flags,omitempty"` - Id uint32 `json:"id,omitempty"` +type VlanChannelBinding struct { + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } -type Ipsetbinding struct { - Name string `json:"name,omitempty"` +type FisBinding struct { + FisChannelBinding []interface{} `json:"fis_channel_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Interface struct { - Id string `json:"id,omitempty"` - Speed string `json:"speed,omitempty"` - Duplex string `json:"duplex,omitempty"` - Flowctl string `json:"flowctl,omitempty"` - Autoneg string `json:"autoneg,omitempty"` - Hamonitor string `json:"hamonitor,omitempty"` - Haheartbeat string `json:"haheartbeat,omitempty"` - Mtu int `json:"mtu,omitempty"` - Ringsize int `json:"ringsize,omitempty"` - Ringtype string `json:"ringtype,omitempty"` - Tagall string `json:"tagall,omitempty"` - Trunk string `json:"trunk,omitempty"` - Trunkmode string `json:"trunkmode,omitempty"` - Trunkallowedvlan []string `json:"trunkallowedvlan,omitempty"` - Lacpmode string `json:"lacpmode,omitempty"` - Lacpkey int `json:"lacpkey,omitempty"` - Lagtype string `json:"lagtype,omitempty"` - Lacppriority int `json:"lacppriority,omitempty"` - Lacptimeout string `json:"lacptimeout,omitempty"` - Ifalias string `json:"ifalias,omitempty"` - Throughput int `json:"throughput,omitempty"` - Linkredundancy string `json:"linkredundancy,omitempty"` - Bandwidthhigh int `json:"bandwidthhigh,omitempty"` - Bandwidthnormal int `json:"bandwidthnormal,omitempty"` - Lldpmode string `json:"lldpmode,omitempty"` - Lrsetpriority int `json:"lrsetpriority,omitempty"` - Devicename string `json:"devicename,omitempty"` - Unit string `json:"unit,omitempty"` - Description string `json:"description,omitempty"` - Flags string `json:"flags,omitempty"` - Actualmtu string `json:"actualmtu,omitempty"` - Vlan string `json:"vlan,omitempty"` - Mac string `json:"mac,omitempty"` - Uptime string `json:"uptime,omitempty"` - Downtime string `json:"downtime,omitempty"` - Actualringsize string `json:"actualringsize,omitempty"` - Reqmedia string `json:"reqmedia,omitempty"` - Reqspeed string `json:"reqspeed,omitempty"` - Reqduplex string `json:"reqduplex,omitempty"` - Reqflowcontrol string `json:"reqflowcontrol,omitempty"` - Actmedia string `json:"actmedia,omitempty"` - Actspeed string `json:"actspeed,omitempty"` - Actduplex string `json:"actduplex,omitempty"` - Actflowctl string `json:"actflowctl,omitempty"` - Mode string `json:"mode,omitempty"` - State string `json:"state,omitempty"` - Autonegresult string `json:"autonegresult,omitempty"` - Tagged string `json:"tagged,omitempty"` - Taggedany string `json:"taggedany,omitempty"` - Taggedautolearn string `json:"taggedautolearn,omitempty"` - Hangdetect string `json:"hangdetect,omitempty"` - Hangreset string `json:"hangreset,omitempty"` - Linkstate string `json:"linkstate,omitempty"` - Intfstate string `json:"intfstate,omitempty"` - Rxpackets string `json:"rxpackets,omitempty"` - Rxbytes string `json:"rxbytes,omitempty"` - Rxerrors string `json:"rxerrors,omitempty"` - Rxdrops string `json:"rxdrops,omitempty"` - Txpackets string `json:"txpackets,omitempty"` - Txbytes string `json:"txbytes,omitempty"` - Txerrors string `json:"txerrors,omitempty"` - Txdrops string `json:"txdrops,omitempty"` - Indisc string `json:"indisc,omitempty"` - Outdisc string `json:"outdisc,omitempty"` - Fctls string `json:"fctls,omitempty"` - Hangs string `json:"hangs,omitempty"` - Stsstalls string `json:"stsstalls,omitempty"` - Txstalls string `json:"txstalls,omitempty"` - Rxstalls string `json:"rxstalls,omitempty"` - Bdgmacmoved string `json:"bdgmacmoved,omitempty"` - Bdgmuted string `json:"bdgmuted,omitempty"` - Vmac string `json:"vmac,omitempty"` - Vmac6 string `json:"vmac6,omitempty"` - Reqthroughput string `json:"reqthroughput,omitempty"` - Actthroughput string `json:"actthroughput,omitempty"` - Backplane string `json:"backplane,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Cleartime string `json:"cleartime,omitempty"` - Slavestate string `json:"slavestate,omitempty"` - Slavemedia string `json:"slavemedia,omitempty"` - Slavespeed string `json:"slavespeed,omitempty"` - Slaveduplex string `json:"slaveduplex,omitempty"` - Slaveflowctl string `json:"slaveflowctl,omitempty"` - Slavetime string `json:"slavetime,omitempty"` - Intftype string `json:"intftype,omitempty"` - Svmcmd string `json:"svmcmd,omitempty"` - Lacpactormode string `json:"lacpactormode,omitempty"` - Lacpactortimeout string `json:"lacpactortimeout,omitempty"` - Lacpactorpriority string `json:"lacpactorpriority,omitempty"` - Lacpactorportno string `json:"lacpactorportno,omitempty"` - Lacppartnerstate string `json:"lacppartnerstate,omitempty"` - Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` - Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` - Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` - Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` - Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` - Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` - Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` - Lacppartnerpriority string `json:"lacppartnerpriority,omitempty"` - Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` - Lacppartnersystempriority string `json:"lacppartnersystempriority,omitempty"` - Lacppartnerportno string `json:"lacppartnerportno,omitempty"` - Lacppartnerkey string `json:"lacppartnerkey,omitempty"` - Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` - Lacpactorinsync string `json:"lacpactorinsync,omitempty"` - Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` - Lacpactordistributing string `json:"lacpactordistributing,omitempty"` - Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` - Lacpportrxstat string `json:"lacpportrxstat,omitempty"` - Lacpportselectstate string `json:"lacpportselectstate,omitempty"` - Lractiveintf string `json:"lractiveintf,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VxlanIptunnelBinding struct { + Id int `json:"id,omitempty"` + Tunnel string `json:"tunnel,omitempty"` } -type Rnat6ip6binding struct { - Natip6 string `json:"natip6,omitempty"` - Td uint32 `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Name string `json:"name,omitempty"` +type NetprofileBinding struct { + Name string `json:"name,omitempty"` + NetprofileNatruleBinding []interface{} `json:"netprofile_natrule_binding,omitempty"` + NetprofileSrcportsetBinding []interface{} `json:"netprofile_srcportset_binding,omitempty"` +} + +type VxlanvlanmapVxlanBinding struct { + Name string `json:"name,omitempty"` + Vlan []string `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Vrid6binding struct { - Id int `json:"id,omitempty"` +type Netbridge struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` } -type Vxlanipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Id uint32 `json:"id,omitempty"` +type Vridparam struct { + Deadinterval int `json:"deadinterval,omitempty"` + Hellointerval int `json:"hellointerval,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sendtomaster string `json:"sendtomaster,omitempty"` } -type Vxlansrcipbinding struct { - Srcip string `json:"srcip,omitempty"` +type VxlanSrcipBinding struct { Id int `json:"id,omitempty"` + Srcip string `json:"srcip,omitempty"` } -type Vxlanvlanmap struct { - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type IpsetBinding struct { + IpsetNsip6Binding []interface{} `json:"ipset_nsip6_binding,omitempty"` + IpsetNsipBinding []interface{} `json:"ipset_nsip_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Ip6tunnel struct { - Name string `json:"name,omitempty"` - Remote string `json:"remote,omitempty"` - Local string `json:"local,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Remoteip string `json:"remoteip,omitempty"` - Type string `json:"type,omitempty"` - Encapip string `json:"encapip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nat64 struct { + Acl6name string `json:"acl6name,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Rsskeytype struct { - Rsstype string `json:"rsstype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Rnatsession struct { + Aclname string `json:"aclname,omitempty"` + Natip string `json:"natip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` } -type Bridgegroupip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td uint32 `json:"td,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Id uint32 `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` +type Vxlan struct { + Count float64 `json:"__count,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Id int `json:"id,omitempty"` + Innervlantagging string `json:"innervlantagging,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Port int `json:"port,omitempty"` + Protocol string `json:"protocol,omitempty"` + Td int `json:"td,omitempty"` + TypeField string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` +} + +type FisInterfaceBinding struct { + Ifnum string `json:"ifnum,omitempty"` + Name string `json:"name,omitempty"` + Ownernode int `json:"ownernode,omitempty"` } -type Vridparam struct { - Sendtomaster string `json:"sendtomaster,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Deadinterval int `json:"deadinterval,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VridChannelBinding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Nd6ravariablesonlinkipv6prefixbinding struct { - Ipv6prefix string `json:"ipv6prefix,omitempty"` - Vlan int `json:"vlan,omitempty"` +type VridBinding struct { + Id int `json:"id,omitempty"` + VridChannelBinding []interface{} `json:"vrid_channel_binding,omitempty"` + VridInterfaceBinding []interface{} `json:"vrid_interface_binding,omitempty"` + VridNsip6Binding []interface{} `json:"vrid_nsip6_binding,omitempty"` + VridNsipBinding []interface{} `json:"vrid_nsip_binding,omitempty"` + VridTrackinterfaceBinding []interface{} `json:"vrid_trackinterface_binding,omitempty"` } -type Bridgegroupvlanbinding struct { - Vlan int `json:"vlan,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Id int `json:"id,omitempty"` +type NetbridgeIptunnelBinding struct { + Name string `json:"name,omitempty"` + Tunnel string `json:"tunnel,omitempty"` } -type Rnatglobalauditsyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - All bool `json:"all,omitempty"` +type IpsetNsipBinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` } -type Vlanipbinding struct { +type VlanNsipBinding struct { + Id int `json:"id,omitempty"` Ipaddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Td uint32 `json:"td,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` - Id uint32 `json:"id,omitempty"` -} - -type Iptunnelparam struct { - Srcip string `json:"srcip,omitempty"` - Dropfrag string `json:"dropfrag,omitempty"` - Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` - Srciproundrobin string `json:"srciproundrobin,omitempty"` - Enablestrictrx string `json:"enablestrictrx,omitempty"` - Enablestricttx string `json:"enablestricttx,omitempty"` - Mac string `json:"mac,omitempty"` - Useclientsourceip string `json:"useclientsourceip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Mapdmr struct { - Name string `json:"name,omitempty"` - Bripv6prefix string `json:"bripv6prefix,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Td int `json:"td,omitempty"` } -type Netbridgeip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Name string `json:"name,omitempty"` +type LinksetInterfaceBinding struct { + Id string `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` } -type Vrid6trackinterfacebinding struct { - Trackifnum string `json:"trackifnum,omitempty"` +type VridTrackinterfaceBinding struct { Flags int `json:"flags,omitempty"` Id int `json:"id,omitempty"` + Trackifnum string `json:"trackifnum,omitempty"` +} + +type Vrid6Binding struct { + Id int `json:"id,omitempty"` + Vrid6ChannelBinding []interface{} `json:"vrid6_channel_binding,omitempty"` + Vrid6InterfaceBinding []interface{} `json:"vrid6_interface_binding,omitempty"` + Vrid6Nsip6Binding []interface{} `json:"vrid6_nsip6_binding,omitempty"` + Vrid6NsipBinding []interface{} `json:"vrid6_nsip_binding,omitempty"` + Vrid6TrackinterfaceBinding []interface{} `json:"vrid6_trackinterface_binding,omitempty"` } -type Mapdomain struct { - Name string `json:"name,omitempty"` - Mapdmrname string `json:"mapdmrname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NetbridgeNsipBinding struct { + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` } -type Arp struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td int `json:"td"` - Mac string `json:"mac,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Vtep string `json:"vtep,omitempty"` - Vlan int `json:"vlan,omitempty"` - Ownernode int `json:"ownernode"` - All bool `json:"all,omitempty"` - Nodeid int `json:"nodeid"` - Timeout string `json:"timeout,omitempty"` - State string `json:"state,omitempty"` - Flags string `json:"flags,omitempty"` - Type string `json:"type,omitempty"` - Channel string `json:"channel,omitempty"` - Controlplane string `json:"controlplane,omitempty"` +type Rsskeytype struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rsstype string `json:"rsstype,omitempty"` } -type Lacp struct { - Syspriority int `json:"syspriority,omitempty"` - Ownernode int `json:"ownernode"` - Devicename string `json:"devicename,omitempty"` - Mac string `json:"mac,omitempty"` - Flags string `json:"flags,omitempty"` - Lacpkey string `json:"lacpkey,omitempty"` - Clustersyspriority string `json:"clustersyspriority,omitempty"` - Clustermac string `json:"clustermac,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type MapbmrBmrv4networkBinding struct { + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` } -type Onlinkipv6prefix struct { - Ipv6prefix string `json:"ipv6prefix,omitempty"` - Onlinkprefix string `json:"onlinkprefix,omitempty"` - Autonomusprefix string `json:"autonomusprefix,omitempty"` - Depricateprefix string `json:"depricateprefix,omitempty"` - Decrementprefixlifetimes string `json:"decrementprefixlifetimes,omitempty"` - Prefixvalidelifetime int `json:"prefixvalidelifetime,omitempty"` - Prefixpreferredlifetime int `json:"prefixpreferredlifetime,omitempty"` - Prefixcurrvalidelft string `json:"prefixcurrvalidelft,omitempty"` - Prefixcurrpreferredlft string `json:"prefixcurrpreferredlft,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vlanchannelbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Tagged bool `json:"tagged,omitempty"` - Id int `json:"id,omitempty"` +type Rnat6Nsip6Binding struct { + Name string `json:"name,omitempty"` + Natip6 string `json:"natip6,omitempty"` Ownergroup string `json:"ownergroup,omitempty"` + Td int `json:"td,omitempty"` } -type Fisbinding struct { - Name string `json:"name,omitempty"` +type Route struct { + Adv bool `json:"adv,omitempty"` + Advbgp bool `json:"advbgp,omitempty"` + Advertise string `json:"advertise,omitempty"` + Advisis bool `json:"advisis,omitempty"` + Advospf bool `json:"advospf,omitempty"` + Advrip bool `json:"advrip,omitempty"` + Bgp bool `json:"bgp,omitempty"` + Cost int `json:"cost,omitempty"` + Cost1 int `json:"cost1,omitempty"` + Count float64 `json:"__count,omitempty"` + Data bool `json:"data,omitempty"` + Data0 bool `json:"data0,omitempty"` + Detail bool `json:"detail,omitempty"` + Dhcp bool `json:"dhcp,omitempty"` + Direct bool `json:"direct,omitempty"` + Distance int `json:"distance,omitempty"` + Dynamic bool `json:"dynamic,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Flags bool `json:"flags,omitempty"` + Gateway string `json:"gateway,omitempty"` + Gatewayname string `json:"gatewayname,omitempty"` + Isis bool `json:"isis,omitempty"` + Lbroute bool `json:"lbroute,omitempty"` + Mgmt bool `json:"mgmt,omitempty"` + Monitor string `json:"monitor,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Msr string `json:"msr,omitempty"` + Nat bool `json:"nat,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ospf bool `json:"ospf,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Permanent bool `json:"permanent,omitempty"` + Protocol []string `json:"protocol,omitempty"` + Retain int `json:"retain,omitempty"` + Rip bool `json:"rip,omitempty"` + Routeowners []string `json:"routeowners,omitempty"` + Routetype string `json:"routetype,omitempty"` + State int `json:"state,omitempty"` + Static bool `json:"Static,omitempty"` + Td int `json:"td,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Totalprobes int `json:"totalprobes,omitempty"` + Tunnel bool `json:"tunnel,omitempty"` + TypeField bool `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Weight int `json:"weight,omitempty"` } -type Ipsetipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` +type NetbridgeBinding struct { + Name string `json:"name,omitempty"` + NetbridgeIptunnelBinding []interface{} `json:"netbridge_iptunnel_binding,omitempty"` + NetbridgeNsip6Binding []interface{} `json:"netbridge_nsip6_binding,omitempty"` + NetbridgeNsipBinding []interface{} `json:"netbridge_nsip_binding,omitempty"` + NetbridgeVlanBinding []interface{} `json:"netbridge_vlan_binding,omitempty"` } -type Ipv6 struct { - Ralearning string `json:"ralearning,omitempty"` - Routerredirection string `json:"routerredirection,omitempty"` - Ndbasereachtime int `json:"ndbasereachtime,omitempty"` - Ndretransmissiontime int `json:"ndretransmissiontime,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Td int `json:"td"` - Dodad string `json:"dodad,omitempty"` - Usipnatprefix string `json:"usipnatprefix,omitempty"` - Basereachtime string `json:"basereachtime,omitempty"` - Reachtime string `json:"reachtime,omitempty"` - Ndreachtime string `json:"ndreachtime,omitempty"` - Retransmissiontime string `json:"retransmissiontime,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type LinksetChannelBinding struct { + Id string `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` } -type Rnatbinding struct { - Name string `json:"name,omitempty"` +type Ip6tunnel struct { + Count float64 `json:"__count,omitempty"` + Encapip string `json:"encapip,omitempty"` + Local string `json:"local,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Remote string `json:"remote,omitempty"` + Remoteip string `json:"remoteip,omitempty"` + TypeField int `json:"type,omitempty"` } -type Vxlaniptunnelbinding struct { - Id int `json:"id,omitempty"` - Tunnel string `json:"tunnel,omitempty"` +type L4param struct { + L2connmethod string `json:"l2connmethod,omitempty"` + L4switch string `json:"l4switch,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Rnatglobalbinding struct { +type Vxlanvlanmap struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vlanip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td uint32 `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Id uint32 `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` +type MapbmrBinding struct { + MapbmrBmrv4networkBinding []interface{} `json:"mapbmr_bmrv4network_binding,omitempty"` + Name string `json:"name,omitempty"` } -type Bridgegroupipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td uint32 `json:"td,omitempty"` - Netmask string `json:"netmask,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Id uint32 `json:"id,omitempty"` +type VridInterfaceBinding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Iptunnel struct { - Name string `json:"name,omitempty"` - Remote string `json:"remote,omitempty"` - Remotesubnetmask string `json:"remotesubnetmask,omitempty"` - Local string `json:"local,omitempty"` - Protocol string `json:"protocol,omitempty"` - Vnid int `json:"vnid,omitempty"` - Vlantagging string `json:"vlantagging,omitempty"` - Destport int `json:"destport,omitempty"` - Tosinherit string `json:"tosinherit,omitempty"` - Grepayload string `json:"grepayload,omitempty"` - Ipsecprofilename string `json:"ipsecprofilename,omitempty"` - Vlan int `json:"vlan,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Sysname string `json:"sysname,omitempty"` - Type string `json:"type,omitempty"` - Encapip string `json:"encapip,omitempty"` - Channel string `json:"channel,omitempty"` - Tunneltype string `json:"tunneltype,omitempty"` - Ipsectunnelstatus string `json:"ipsectunnelstatus,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Bridgetable struct { + Bridgeage int `json:"bridgeage,omitempty"` + Channel int `json:"channel,omitempty"` + Controlplane bool `json:"controlplane,omitempty"` + Count float64 `json:"__count,omitempty"` + Devicevlan int `json:"devicevlan,omitempty"` + Flags int `json:"flags,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Mac string `json:"mac,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + TypeField string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vni int `json:"vni,omitempty"` + Vtep string `json:"vtep,omitempty"` + Vxlan int `json:"vxlan,omitempty"` +} + +type VxlanvlanmapBinding struct { + Name string `json:"name,omitempty"` + VxlanvlanmapVxlanBinding []interface{} `json:"vxlanvlanmap_vxlan_binding,omitempty"` } -type Netbridgensip6binding struct { +type Vrid struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Effectivepriority int `json:"effectivepriority,omitempty"` + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Operationalownernode int `json:"operationalownernode,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Preemption string `json:"preemption,omitempty"` + Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + Priority int `json:"priority,omitempty"` + Sharing string `json:"sharing,omitempty"` + State int `json:"state,omitempty"` + Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + Tracking string `json:"tracking,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type NetbridgeNsip6Binding struct { Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` +} + +type Inat struct { + Connfailover string `json:"connfailover,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + Ftp string `json:"ftp,omitempty"` + Mode string `json:"mode,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Privateip string `json:"privateip,omitempty"` + Proxyip string `json:"proxyip,omitempty"` + Publicip string `json:"publicip,omitempty"` + Tcpproxy string `json:"tcpproxy,omitempty"` + Td int `json:"td,omitempty"` + Tftp string `json:"tftp,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` + Usip string `json:"usip,omitempty"` + Usnip string `json:"usnip,omitempty"` +} + +type RnatRetainsourceportsetBinding struct { + Name string `json:"name,omitempty"` + Retainsourceportrange string `json:"retainsourceportrange,omitempty"` +} + +type Vlan struct { + Aliasname string `json:"aliasname,omitempty"` + Count float64 `json:"__count,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` + Linklocalipv6addr string `json:"linklocalipv6addr,omitempty"` + Lsbitmap int `json:"lsbitmap,omitempty"` + Lstagbitmap int `json:"lstagbitmap,omitempty"` + Mtu int `json:"mtu,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Portbitmap int `json:"portbitmap,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Sdxvlan string `json:"sdxvlan,omitempty"` + Sharing string `json:"sharing,omitempty"` + Tagbitmap int `json:"tagbitmap,omitempty"` + Tagged bool `json:"tagged,omitempty"` + Tagifaces string `json:"tagifaces,omitempty"` + Vlantd int `json:"vlantd,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } type Portallocation struct { - Srcip string `json:"srcip,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Protocol int `json:"protocol,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Freeports string `json:"freeports,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Freeports int `json:"freeports,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Protocol int `json:"protocol,omitempty"` + Srcip string `json:"srcip,omitempty"` } -type Rnat struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Aclname string `json:"aclname,omitempty"` - Td int `json:"td"` - Ownergroup string `json:"ownergroup,omitempty"` - Name string `json:"name,omitempty"` - Redirectport int `json:"redirectport,omitempty"` - Natip string `json:"natip,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` - Connfailover string `json:"connfailover,omitempty"` - Newname string `json:"newname,omitempty"` +type Rnatparam struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Srcippersistency string `json:"srcippersistency,omitempty"` + Tcpproxy string `json:"tcpproxy,omitempty"` } -type Bridgegroup struct { - Id int `json:"id,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Flags string `json:"flags,omitempty"` - Portbitmap string `json:"portbitmap,omitempty"` - Tagbitmap string `json:"tagbitmap,omitempty"` - Ifaces string `json:"ifaces,omitempty"` - Tagifaces string `json:"tagifaces,omitempty"` - Rnat string `json:"rnat,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Vrid6Nsip6Binding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` } -type Vxlanvlanmapvxlanbinding struct { - Vxlan int `json:"vxlan,omitempty"` - Vlan []string `json:"vlan,omitempty"` - Name string `json:"name,omitempty"` +type VxlanNsip6Binding struct { + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` } -type Rnatsession struct { - Network string `json:"network,omitempty"` - Netmask string `json:"netmask,omitempty"` - Natip string `json:"natip,omitempty"` - Aclname string `json:"aclname,omitempty"` +type VlanBinding struct { + Id int `json:"id,omitempty"` + VlanChannelBinding []interface{} `json:"vlan_channel_binding,omitempty"` + VlanInterfaceBinding []interface{} `json:"vlan_interface_binding,omitempty"` + VlanLinksetBinding []interface{} `json:"vlan_linkset_binding,omitempty"` + VlanNsip6Binding []interface{} `json:"vlan_nsip6_binding,omitempty"` + VlanNsipBinding []interface{} `json:"vlan_nsip_binding,omitempty"` } -type Vlaninterfacebinding struct { - Ifnum string `json:"ifnum,omitempty"` - Tagged bool `json:"tagged,omitempty"` - Id int `json:"id,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` +type RnatBinding struct { + Name string `json:"name,omitempty"` + RnatNsipBinding []interface{} `json:"rnat_nsip_binding,omitempty"` + RnatRetainsourceportsetBinding []interface{} `json:"rnat_retainsourceportset_binding,omitempty"` } -type Vrid6nsipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type NetbridgeVlanBinding struct { + Name string `json:"name,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Vridbinding struct { - Id int `json:"id,omitempty"` +type Interface struct { + Actduplex string `json:"actduplex,omitempty"` + Actflowctl string `json:"actflowctl,omitempty"` + Actmedia string `json:"actmedia,omitempty"` + Actspeed string `json:"actspeed,omitempty"` + Actthroughput int `json:"actthroughput,omitempty"` + Actualmtu int `json:"actualmtu,omitempty"` + Actualringsize int `json:"actualringsize,omitempty"` + Autoneg string `json:"autoneg,omitempty"` + Autonegresult int `json:"autonegresult,omitempty"` + Backplane string `json:"backplane,omitempty"` + Bandwidthhigh int `json:"bandwidthhigh,omitempty"` + Bandwidthnormal int `json:"bandwidthnormal,omitempty"` + Bdgmacmoved int `json:"bdgmacmoved,omitempty"` + Bdgmuted int `json:"bdgmuted,omitempty"` + Cleartime int `json:"cleartime,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Devicename string `json:"devicename,omitempty"` + Downtime int `json:"downtime,omitempty"` + Duplex string `json:"duplex,omitempty"` + Fctls int `json:"fctls,omitempty"` + Flags int `json:"flags,omitempty"` + Flowctl string `json:"flowctl,omitempty"` + Haheartbeat string `json:"haheartbeat,omitempty"` + Hamonitor string `json:"hamonitor,omitempty"` + Hangdetect int `json:"hangdetect,omitempty"` + Hangreset int `json:"hangreset,omitempty"` + Hangs int `json:"hangs,omitempty"` + Id string `json:"id,omitempty"` + Ifalias string `json:"ifalias,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Indisc int `json:"indisc,omitempty"` + Intfstate int `json:"intfstate,omitempty"` + Intftype string `json:"intftype,omitempty"` + Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` + Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` + Lacpactordistributing string `json:"lacpactordistributing,omitempty"` + Lacpactorinsync string `json:"lacpactorinsync,omitempty"` + Lacpactormode string `json:"lacpactormode,omitempty"` + Lacpactorportno int `json:"lacpactorportno,omitempty"` + Lacpactorpriority int `json:"lacpactorpriority,omitempty"` + Lacpactortimeout string `json:"lacpactortimeout,omitempty"` + Lacpkey int `json:"lacpkey,omitempty"` + Lacpmode string `json:"lacpmode,omitempty"` + Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` + Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` + Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` + Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` + Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` + Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` + Lacppartnerkey int `json:"lacppartnerkey,omitempty"` + Lacppartnerportno int `json:"lacppartnerportno,omitempty"` + Lacppartnerpriority int `json:"lacppartnerpriority,omitempty"` + Lacppartnerstate string `json:"lacppartnerstate,omitempty"` + Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` + Lacppartnersystempriority int `json:"lacppartnersystempriority,omitempty"` + Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` + Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` + Lacpportrxstat string `json:"lacpportrxstat,omitempty"` + Lacpportselectstate string `json:"lacpportselectstate,omitempty"` + Lacppriority int `json:"lacppriority,omitempty"` + Lacptimeout string `json:"lacptimeout,omitempty"` + Lagtype string `json:"lagtype,omitempty"` + Linkredundancy string `json:"linkredundancy,omitempty"` + Linkstate int `json:"linkstate,omitempty"` + Lldpmode string `json:"lldpmode,omitempty"` + Lractiveintf int `json:"lractiveintf,omitempty"` + Lrsetpriority int `json:"lrsetpriority,omitempty"` + Mac string `json:"mac,omitempty"` + Mode string `json:"mode,omitempty"` + Mtu int `json:"mtu,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Outdisc int `json:"outdisc,omitempty"` + Reqduplex string `json:"reqduplex,omitempty"` + Reqflowcontrol string `json:"reqflowcontrol,omitempty"` + Reqmedia string `json:"reqmedia,omitempty"` + Reqspeed string `json:"reqspeed,omitempty"` + Reqthroughput int `json:"reqthroughput,omitempty"` + Ringsize int `json:"ringsize,omitempty"` + Ringtype string `json:"ringtype,omitempty"` + Rxbytes int `json:"rxbytes,omitempty"` + Rxdrops int `json:"rxdrops,omitempty"` + Rxerrors int `json:"rxerrors,omitempty"` + Rxpackets int `json:"rxpackets,omitempty"` + Rxstalls int `json:"rxstalls,omitempty"` + Slaveduplex int `json:"slaveduplex,omitempty"` + Slaveflowctl int `json:"slaveflowctl,omitempty"` + Slavemedia int `json:"slavemedia,omitempty"` + Slavespeed int `json:"slavespeed,omitempty"` + Slavestate int `json:"slavestate,omitempty"` + Slavetime int `json:"slavetime,omitempty"` + Speed string `json:"speed,omitempty"` + State string `json:"state,omitempty"` + Stsstalls int `json:"stsstalls,omitempty"` + Svmcmd int `json:"svmcmd,omitempty"` + Tagall string `json:"tagall,omitempty"` + Tagged int `json:"tagged,omitempty"` + Taggedany int `json:"taggedany,omitempty"` + Taggedautolearn int `json:"taggedautolearn,omitempty"` + Throughput int `json:"throughput,omitempty"` + Trunk string `json:"trunk,omitempty"` + Trunkallowedvlan []string `json:"trunkallowedvlan,omitempty"` + Trunkmode string `json:"trunkmode,omitempty"` + Txbytes int `json:"txbytes,omitempty"` + Txdrops int `json:"txdrops,omitempty"` + Txerrors int `json:"txerrors,omitempty"` + Txpackets int `json:"txpackets,omitempty"` + Txstalls int `json:"txstalls,omitempty"` + Unit int `json:"unit,omitempty"` + Uptime int `json:"uptime,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vmac string `json:"vmac,omitempty"` + Vmac6 string `json:"vmac6,omitempty"` } -type Vxlannsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Id int `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` +type Nd6 struct { + Channel int `json:"channel,omitempty"` + Controlplane bool `json:"controlplane,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Mac string `json:"mac,omitempty"` + Neighbor string `json:"neighbor,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + State string `json:"state,omitempty"` + Td int `json:"td,omitempty"` + Timeout int `json:"timeout,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vtep string `json:"vtep,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Bridgegroupnsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Td int `json:"td,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Id int `json:"id,omitempty"` - Netmask string `json:"netmask,omitempty"` +type Interfacepair struct { + Count float64 `json:"__count,omitempty"` + Id int `json:"id,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vridchannelbinding struct { - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type Mapbmr struct { + Count float64 `json:"__count,omitempty"` + Eabitlength int `json:"eabitlength,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Psidlength int `json:"psidlength,omitempty"` + Psidoffset int `json:"psidoffset,omitempty"` + Ruleipv6prefix string `json:"ruleipv6prefix,omitempty"` } -type Vxlannsipbinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Id int `json:"id,omitempty"` +type VxlanBinding struct { + Id int `json:"id,omitempty"` + VxlanIptunnelBinding []interface{} `json:"vxlan_iptunnel_binding,omitempty"` + VxlanNsip6Binding []interface{} `json:"vxlan_nsip6_binding,omitempty"` + VxlanNsipBinding []interface{} `json:"vxlan_nsip_binding,omitempty"` + VxlanSrcipBinding []interface{} `json:"vxlan_srcip_binding,omitempty"` } -type Channelinterfacebinding struct { - Ifnum []string `json:"ifnum,omitempty"` - Lamode string `json:"lamode,omitempty"` - Slavestate int `json:"slavestate,omitempty"` - Slavemedia int `json:"slavemedia,omitempty"` - Slavespeed int `json:"slavespeed,omitempty"` - Slaveduplex int `json:"slaveduplex,omitempty"` - Slaveflowctl int `json:"slaveflowctl,omitempty"` - Slavetime int `json:"slavetime,omitempty"` - Lractiveintf int `json:"lractiveintf,omitempty"` - Svmcmd int `json:"svmcmd,omitempty"` - Id string `json:"id,omitempty"` +type Fis struct { + Count float64 `json:"__count,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` } -type Netprofilesrcportsetbinding struct { - Srcportrange string `json:"srcportrange,omitempty"` - Name string `json:"name,omitempty"` +type Linkset struct { + Count float64 `json:"__count,omitempty"` + Id string `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Rnatparam struct { - Tcpproxy string `json:"tcpproxy,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type BridgegroupNsipBinding struct { + Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Rnat bool `json:"rnat,omitempty"` + Td int `json:"td,omitempty"` } -type Vridnsip6binding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type Onlinkipv6prefix struct { + Autonomusprefix string `json:"autonomusprefix,omitempty"` + Count float64 `json:"__count,omitempty"` + Decrementprefixlifetimes string `json:"decrementprefixlifetimes,omitempty"` + Depricateprefix string `json:"depricateprefix,omitempty"` + Ipv6prefix string `json:"ipv6prefix,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Onlinkprefix string `json:"onlinkprefix,omitempty"` + Prefixcurrpreferredlft int `json:"prefixcurrpreferredlft,omitempty"` + Prefixcurrvalidelft int `json:"prefixcurrvalidelft,omitempty"` + Prefixpreferredlifetime int `json:"prefixpreferredlifetime,omitempty"` + Prefixvalidelifetime int `json:"prefixvalidelifetime,omitempty"` +} + +type Vrid6NsipBinding struct { Flags int `json:"flags,omitempty"` Id int `json:"id,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` } -type Appalgparam struct { - Pptpgreidletimeout int `json:"pptpgreidletimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Ci struct { + Count float64 `json:"__count,omitempty"` + Ifaces string `json:"ifaces,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Ptp struct { - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Ipv6 struct { + Basereachtime int `json:"basereachtime,omitempty"` + Count float64 `json:"__count,omitempty"` + Dodad string `json:"dodad,omitempty"` + Natprefix string `json:"natprefix,omitempty"` + Ndbasereachtime int `json:"ndbasereachtime,omitempty"` + Ndreachtime int `json:"ndreachtime,omitempty"` + Ndretransmissiontime int `json:"ndretransmissiontime,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ralearning string `json:"ralearning,omitempty"` + Reachtime int `json:"reachtime,omitempty"` + Retransmissiontime int `json:"retransmissiontime,omitempty"` + Routerredirection string `json:"routerredirection,omitempty"` + Td int `json:"td,omitempty"` + Usipnatprefix string `json:"usipnatprefix,omitempty"` +} + +type LinksetBinding struct { + Id string `json:"id,omitempty"` + LinksetChannelBinding []interface{} `json:"linkset_channel_binding,omitempty"` + LinksetInterfaceBinding []interface{} `json:"linkset_interface_binding,omitempty"` +} + +type Vrid6InterfaceBinding struct { + Flags int `json:"flags,omitempty"` + Id int `json:"id,omitempty"` + Ifnum string `json:"ifnum,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Rnatipbinding struct { - Natip string `json:"natip,omitempty"` - Td uint32 `json:"td,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Name string `json:"name,omitempty"` +type RnatglobalBinding struct { + RnatglobalAuditsyslogpolicyBinding []interface{} `json:"rnatglobal_auditsyslogpolicy_binding,omitempty"` } -type Vridtrackinterfacebinding struct { - Trackifnum string `json:"trackifnum,omitempty"` - Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` +type FisChannelBinding struct { + Ifnum string `json:"ifnum,omitempty"` + Name string `json:"name,omitempty"` + Ownernode int `json:"ownernode,omitempty"` +} + +type MapdomainBinding struct { + MapdomainMapbmrBinding []interface{} `json:"mapdomain_mapbmr_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type MapdomainMapbmrBinding struct { + Mapbmrname string `json:"mapbmrname,omitempty"` + Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/ns.go b/nitrogo/models/ns.go index 4c91d6b..73eb53f 100644 --- a/nitrogo/models/ns.go +++ b/nitrogo/models/ns.go @@ -1,1790 +1,1817 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Nshmackey struct { - Name string `json:"name,omitempty"` - Digest string `json:"digest,omitempty"` - Keyvalue string `json:"keyvalue,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsconsoleloginprompt struct { - Promptstring string `json:"promptstring,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nscqaparam struct { - Harqretxdelay int `json:"harqretxdelay,omitempty"` - Net1label string `json:"net1label,omitempty"` - Minrttnet1 int `json:"minrttnet1,omitempty"` - Lr1coeflist string `json:"lr1coeflist,omitempty"` - Lr1probthresh float64 `json:"lr1probthresh,omitempty"` - Net1cclscale string `json:"net1cclscale,omitempty"` - Net1csqscale string `json:"net1csqscale,omitempty"` - Net1logcoef string `json:"net1logcoef,omitempty"` - Net2label string `json:"net2label,omitempty"` - Minrttnet2 int `json:"minrttnet2,omitempty"` - Lr2coeflist string `json:"lr2coeflist,omitempty"` - Lr2probthresh float64 `json:"lr2probthresh,omitempty"` - Net2cclscale string `json:"net2cclscale,omitempty"` - Net2csqscale string `json:"net2csqscale,omitempty"` - Net2logcoef string `json:"net2logcoef,omitempty"` - Net3label string `json:"net3label,omitempty"` - Minrttnet3 int `json:"minrttnet3,omitempty"` - Net3cclscale string `json:"net3cclscale,omitempty"` - Net3csqscale string `json:"net3csqscale,omitempty"` - Net3logcoef string `json:"net3logcoef,omitempty"` +// ns configuration structs +type Nspbr struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate int `json:"curstate,omitempty"` + Data bool `json:"data,omitempty"` + Destip bool `json:"destip,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipval string `json:"destipval,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Detail bool `json:"detail,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Hits int `json:"hits,omitempty"` + InterfaceField string `json:"Interface,omitempty"` + Iptunnel bool `json:"iptunnel,omitempty"` + Iptunnelname string `json:"iptunnelname,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Monitor string `json:"monitor,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Msr string `json:"msr,omitempty"` + Name string `json:"name,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nexthop bool `json:"nexthop,omitempty"` + Nexthopval string `json:"nexthopval,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Priority int `json:"priority,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Srcip bool `json:"srcip,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipval string `json:"srcipval,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + State string `json:"state,omitempty"` + Targettd int `json:"targettd,omitempty"` + Td int `json:"td,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Totalprobes int `json:"totalprobes,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` +} + +type NstrafficdomainVxlanBinding struct { + Td int `json:"td,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Nsicapprofile struct { - Name string `json:"name,omitempty"` - Preview string `json:"preview,omitempty"` - Previewlength int `json:"previewlength,omitempty"` - Uri string `json:"uri,omitempty"` - Hostheader string `json:"hostheader,omitempty"` - Useragent string `json:"useragent,omitempty"` - Mode string `json:"mode,omitempty"` - Queryparams string `json:"queryparams,omitempty"` - Connectionkeepalive string `json:"connectionkeepalive,omitempty"` - Allow204 string `json:"allow204,omitempty"` - Inserticapheaders string `json:"inserticapheaders,omitempty"` - Inserthttprequest string `json:"inserthttprequest,omitempty"` - Reqtimeout int `json:"reqtimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Logaction string `json:"logaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nspbrs struct { -} - -type Nssimpleacl struct { - Aclname string `json:"aclname,omitempty"` - Aclaction string `json:"aclaction,omitempty"` - Td int `json:"td,omitempty"` - Srcip string `json:"srcip,omitempty"` - Destport int `json:"destport,omitempty"` - Protocol string `json:"protocol,omitempty"` - Ttl int `json:"ttl,omitempty"` - Estsessions bool `json:"estsessions,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsweblogparam struct { - Buffersizemb int `json:"buffersizemb,omitempty"` - Customreqhdrs []string `json:"customreqhdrs,omitempty"` - Customrsphdrs []string `json:"customrsphdrs,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nspartition struct { + Count float64 `json:"__count,omitempty"` + Force bool `json:"force,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Maxmemlimit int `json:"maxmemlimit,omitempty"` + Minbandwidth int `json:"minbandwidth,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionid int `json:"partitionid,omitempty"` + Partitionmac string `json:"partitionmac,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Partitiontype string `json:"partitiontype,omitempty"` + Pmacinternal bool `json:"pmacinternal,omitempty"` + Save bool `json:"save,omitempty"` } -type Nsdiameter struct { - Identity string `json:"identity,omitempty"` - Realm string `json:"realm,omitempty"` - Serverclosepropagation string `json:"serverclosepropagation,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NsextensionBinding struct { + Name string `json:"name,omitempty"` + NsextensionExtensionfunctionBinding []interface{} `json:"nsextension_extensionfunction_binding,omitempty"` } -type Nsextensionbinding struct { - Name string `json:"name,omitempty"` +type Nslicense struct { + Aaa bool `json:"aaa,omitempty"` + Adaptivetcp bool `json:"adaptivetcp,omitempty"` + Agee bool `json:"agee,omitempty"` + Apigateway bool `json:"apigateway,omitempty"` + Appflow bool `json:"appflow,omitempty"` + Appflowica bool `json:"appflowica,omitempty"` + Appfw bool `json:"appfw,omitempty"` + Appqoe bool `json:"appqoe,omitempty"` + Bgp bool `json:"bgp,omitempty"` + Bot bool `json:"bot,omitempty"` + Cf bool `json:"cf,omitempty"` + Ch bool `json:"ch,omitempty"` + Cloudbridge bool `json:"cloudbridge,omitempty"` + Cloudbridgeappliance bool `json:"cloudbridgeappliance,omitempty"` + Cloudextenderappliance bool `json:"cloudextenderappliance,omitempty"` + Cloudsubscriptionimage string `json:"cloudsubscriptionimage,omitempty"` + Cluster bool `json:"cluster,omitempty"` + Cmp bool `json:"cmp,omitempty"` + Contentaccelerator bool `json:"contentaccelerator,omitempty"` + Cqa bool `json:"cqa,omitempty"` + Cr bool `json:"cr,omitempty"` + Cs bool `json:"cs,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Daystolasenforcement int `json:"daystolasenforcement,omitempty"` + Delta bool `json:"delta,omitempty"` + FIcaUsers int `json:"f_ica_users,omitempty"` + FSslvpnUsers int `json:"f_sslvpn_users,omitempty"` + Feo bool `json:"feo,omitempty"` + Forwardproxy bool `json:"forwardproxy,omitempty"` + Gslb bool `json:"gslb,omitempty"` + Gslbp bool `json:"gslbp,omitempty"` + Ic bool `json:"ic,omitempty"` + Ipv6pt bool `json:"ipv6pt,omitempty"` + Isenterpriselic bool `json:"isenterpriselic,omitempty"` + Isis bool `json:"isis,omitempty"` + Isplatinumlic bool `json:"isplatinumlic,omitempty"` + Issgwylic bool `json:"issgwylic,omitempty"` + Isstandardlic bool `json:"isstandardlic,omitempty"` + Isswglic bool `json:"isswglic,omitempty"` + Lb bool `json:"lb,omitempty"` + Licensingmode string `json:"licensingmode,omitempty"` + Lsn bool `json:"lsn,omitempty"` + Modelid int `json:"modelid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nsxn bool `json:"nsxn,omitempty"` + Ospf bool `json:"ospf,omitempty"` + Push bool `json:"push,omitempty"` + Rdpproxy bool `json:"rdpproxy,omitempty"` + Remotecontentinspection bool `json:"remotecontentinspection,omitempty"` + Rep bool `json:"rep,omitempty"` + Responder bool `json:"responder,omitempty"` + Rewrite bool `json:"rewrite,omitempty"` + Rip bool `json:"rip,omitempty"` + Routing bool `json:"routing,omitempty"` + Sp bool `json:"sp,omitempty"` + Ssl bool `json:"ssl,omitempty"` + Sslinterception bool `json:"sslinterception,omitempty"` + Sslvpn bool `json:"sslvpn,omitempty"` + Urlfiltering bool `json:"urlfiltering,omitempty"` + Videooptimization bool `json:"videooptimization,omitempty"` + Wl bool `json:"wl,omitempty"` } -type Nslicenseserver struct { - Licenseserverip string `json:"licenseserverip,omitempty"` - Servername string `json:"servername,omitempty"` - Port int `json:"port,omitempty"` - Forceupdateip bool `json:"forceupdateip,omitempty"` - Licensemode string `json:"licensemode,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Deviceprofilename string `json:"deviceprofilename,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Status string `json:"status,omitempty"` - Grace string `json:"grace,omitempty"` - Gptimeleft string `json:"gptimeleft,omitempty"` - Type string `json:"type,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nstestlicense struct { + Aaa bool `json:"aaa,omitempty"` + Adaptivetcp bool `json:"adaptivetcp,omitempty"` + Agee bool `json:"agee,omitempty"` + Apigateway bool `json:"apigateway,omitempty"` + Appflow bool `json:"appflow,omitempty"` + Appflowica bool `json:"appflowica,omitempty"` + Appfw bool `json:"appfw,omitempty"` + Appqoe bool `json:"appqoe,omitempty"` + Bgp bool `json:"bgp,omitempty"` + Bot bool `json:"bot,omitempty"` + Cf bool `json:"cf,omitempty"` + Ch bool `json:"ch,omitempty"` + Cloudbridge bool `json:"cloudbridge,omitempty"` + Cloudbridgeappliance bool `json:"cloudbridgeappliance,omitempty"` + Cloudextenderappliance bool `json:"cloudextenderappliance,omitempty"` + Cluster bool `json:"cluster,omitempty"` + Cmp bool `json:"cmp,omitempty"` + Contentaccelerator bool `json:"contentaccelerator,omitempty"` + Cqa bool `json:"cqa,omitempty"` + Cr bool `json:"cr,omitempty"` + Cs bool `json:"cs,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Delta bool `json:"delta,omitempty"` + FIcaUsers int `json:"f_ica_users,omitempty"` + FSslvpnUsers int `json:"f_sslvpn_users,omitempty"` + Feo bool `json:"feo,omitempty"` + Forwardproxy bool `json:"forwardproxy,omitempty"` + Gslb bool `json:"gslb,omitempty"` + Gslbp bool `json:"gslbp,omitempty"` + Ic bool `json:"ic,omitempty"` + Ipv6pt bool `json:"ipv6pt,omitempty"` + Isenterpriselic bool `json:"isenterpriselic,omitempty"` + Isis bool `json:"isis,omitempty"` + Isplatinumlic bool `json:"isplatinumlic,omitempty"` + Issgwylic bool `json:"issgwylic,omitempty"` + Isstandardlic bool `json:"isstandardlic,omitempty"` + Isswglic bool `json:"isswglic,omitempty"` + Lb bool `json:"lb,omitempty"` + Licensingmode string `json:"licensingmode,omitempty"` + Lsn bool `json:"lsn,omitempty"` + Modelid int `json:"modelid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nsxn bool `json:"nsxn,omitempty"` + Ospf bool `json:"ospf,omitempty"` + Push bool `json:"push,omitempty"` + Rdpproxy bool `json:"rdpproxy,omitempty"` + Remotecontentinspection bool `json:"remotecontentinspection,omitempty"` + Rep bool `json:"rep,omitempty"` + Responder bool `json:"responder,omitempty"` + Rewrite bool `json:"rewrite,omitempty"` + Rip bool `json:"rip,omitempty"` + Routing bool `json:"routing,omitempty"` + Sp bool `json:"sp,omitempty"` + Ssl bool `json:"ssl,omitempty"` + Sslinterception bool `json:"sslinterception,omitempty"` + Sslvpn bool `json:"sslvpn,omitempty"` + Urlfiltering bool `json:"urlfiltering,omitempty"` + Videooptimization bool `json:"videooptimization,omitempty"` + Wl bool `json:"wl,omitempty"` } -type Nslimitidentifiernslimitsessionsbinding struct { - Limitidentifier string `json:"limitidentifier,omitempty"` +type Nslicenseserverpool struct { + Cpxinstanceavailable int `json:"cpxinstanceavailable,omitempty"` + Cpxinstancetotal int `json:"cpxinstancetotal,omitempty"` + Enterprisebandwidthavailable int `json:"enterprisebandwidthavailable,omitempty"` + Enterprisebandwidthtotal int `json:"enterprisebandwidthtotal,omitempty"` + Enterprisecpuavailable int `json:"enterprisecpuavailable,omitempty"` + Enterprisecputotal int `json:"enterprisecputotal,omitempty"` + Getalllicenses bool `json:"getalllicenses,omitempty"` + Instanceavailable int `json:"instanceavailable,omitempty"` + Instancetotal int `json:"instancetotal,omitempty"` + Licensemode string `json:"licensemode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Platinumbandwidthavailable int `json:"platinumbandwidthavailable,omitempty"` + Platinumbandwidthtotal int `json:"platinumbandwidthtotal,omitempty"` + Platinumcpuavailable int `json:"platinumcpuavailable,omitempty"` + Platinumcputotal int `json:"platinumcputotal,omitempty"` + Standardbandwidthavailable int `json:"standardbandwidthavailable,omitempty"` + Standardbandwidthtotal int `json:"standardbandwidthtotal,omitempty"` + Standardcpuavailable int `json:"standardcpuavailable,omitempty"` + Standardcputotal int `json:"standardcputotal,omitempty"` + Vpx100000eavailable int `json:"vpx100000eavailable,omitempty"` + Vpx100000etotal int `json:"vpx100000etotal,omitempty"` + Vpx100000pavailable int `json:"vpx100000pavailable,omitempty"` + Vpx100000ptotal int `json:"vpx100000ptotal,omitempty"` + Vpx100000savailable int `json:"vpx100000savailable,omitempty"` + Vpx100000stotal int `json:"vpx100000stotal,omitempty"` + Vpx10000eavailable int `json:"vpx10000eavailable,omitempty"` + Vpx10000etotal int `json:"vpx10000etotal,omitempty"` + Vpx10000pavailable int `json:"vpx10000pavailable,omitempty"` + Vpx10000ptotal int `json:"vpx10000ptotal,omitempty"` + Vpx10000savailable int `json:"vpx10000savailable,omitempty"` + Vpx10000stotal int `json:"vpx10000stotal,omitempty"` + Vpx1000eavailable int `json:"vpx1000eavailable,omitempty"` + Vpx1000etotal int `json:"vpx1000etotal,omitempty"` + Vpx1000pavailable int `json:"vpx1000pavailable,omitempty"` + Vpx1000ptotal int `json:"vpx1000ptotal,omitempty"` + Vpx1000savailable int `json:"vpx1000savailable,omitempty"` + Vpx1000stotal int `json:"vpx1000stotal,omitempty"` + Vpx100eavailable int `json:"vpx100eavailable,omitempty"` + Vpx100etotal int `json:"vpx100etotal,omitempty"` + Vpx100pavailable int `json:"vpx100pavailable,omitempty"` + Vpx100ptotal int `json:"vpx100ptotal,omitempty"` + Vpx100savailable int `json:"vpx100savailable,omitempty"` + Vpx100stotal int `json:"vpx100stotal,omitempty"` + Vpx10eavailable int `json:"vpx10eavailable,omitempty"` + Vpx10etotal int `json:"vpx10etotal,omitempty"` + Vpx10pavailable int `json:"vpx10pavailable,omitempty"` + Vpx10ptotal int `json:"vpx10ptotal,omitempty"` + Vpx10savailable int `json:"vpx10savailable,omitempty"` + Vpx10stotal int `json:"vpx10stotal,omitempty"` + Vpx15000eavailable int `json:"vpx15000eavailable,omitempty"` + Vpx15000etotal int `json:"vpx15000etotal,omitempty"` + Vpx15000pavailable int `json:"vpx15000pavailable,omitempty"` + Vpx15000ptotal int `json:"vpx15000ptotal,omitempty"` + Vpx15000savailable int `json:"vpx15000savailable,omitempty"` + Vpx15000stotal int `json:"vpx15000stotal,omitempty"` + Vpx1pavailable int `json:"vpx1pavailable,omitempty"` + Vpx1ptotal int `json:"vpx1ptotal,omitempty"` + Vpx1savailable int `json:"vpx1savailable,omitempty"` + Vpx1stotal int `json:"vpx1stotal,omitempty"` + Vpx2000pavailable int `json:"vpx2000pavailable,omitempty"` + Vpx2000ptotal int `json:"vpx2000ptotal,omitempty"` + Vpx200eavailable int `json:"vpx200eavailable,omitempty"` + Vpx200etotal int `json:"vpx200etotal,omitempty"` + Vpx200pavailable int `json:"vpx200pavailable,omitempty"` + Vpx200ptotal int `json:"vpx200ptotal,omitempty"` + Vpx200savailable int `json:"vpx200savailable,omitempty"` + Vpx200stotal int `json:"vpx200stotal,omitempty"` + Vpx25000eavailable int `json:"vpx25000eavailable,omitempty"` + Vpx25000etotal int `json:"vpx25000etotal,omitempty"` + Vpx25000pavailable int `json:"vpx25000pavailable,omitempty"` + Vpx25000ptotal int `json:"vpx25000ptotal,omitempty"` + Vpx25000savailable int `json:"vpx25000savailable,omitempty"` + Vpx25000stotal int `json:"vpx25000stotal,omitempty"` + Vpx25eavailable int `json:"vpx25eavailable,omitempty"` + Vpx25etotal int `json:"vpx25etotal,omitempty"` + Vpx25pavailable int `json:"vpx25pavailable,omitempty"` + Vpx25ptotal int `json:"vpx25ptotal,omitempty"` + Vpx25savailable int `json:"vpx25savailable,omitempty"` + Vpx25stotal int `json:"vpx25stotal,omitempty"` + Vpx3000eavailable int `json:"vpx3000eavailable,omitempty"` + Vpx3000etotal int `json:"vpx3000etotal,omitempty"` + Vpx3000pavailable int `json:"vpx3000pavailable,omitempty"` + Vpx3000ptotal int `json:"vpx3000ptotal,omitempty"` + Vpx3000savailable int `json:"vpx3000savailable,omitempty"` + Vpx3000stotal int `json:"vpx3000stotal,omitempty"` + Vpx40000eavailable int `json:"vpx40000eavailable,omitempty"` + Vpx40000etotal int `json:"vpx40000etotal,omitempty"` + Vpx40000pavailable int `json:"vpx40000pavailable,omitempty"` + Vpx40000ptotal int `json:"vpx40000ptotal,omitempty"` + Vpx40000savailable int `json:"vpx40000savailable,omitempty"` + Vpx40000stotal int `json:"vpx40000stotal,omitempty"` + Vpx4000pavailable int `json:"vpx4000pavailable,omitempty"` + Vpx4000ptotal int `json:"vpx4000ptotal,omitempty"` + Vpx5000eavailable int `json:"vpx5000eavailable,omitempty"` + Vpx5000etotal int `json:"vpx5000etotal,omitempty"` + Vpx5000pavailable int `json:"vpx5000pavailable,omitempty"` + Vpx5000ptotal int `json:"vpx5000ptotal,omitempty"` + Vpx5000savailable int `json:"vpx5000savailable,omitempty"` + Vpx5000stotal int `json:"vpx5000stotal,omitempty"` + Vpx500eavailable int `json:"vpx500eavailable,omitempty"` + Vpx500etotal int `json:"vpx500etotal,omitempty"` + Vpx500pavailable int `json:"vpx500pavailable,omitempty"` + Vpx500ptotal int `json:"vpx500ptotal,omitempty"` + Vpx500savailable int `json:"vpx500savailable,omitempty"` + Vpx500stotal int `json:"vpx500stotal,omitempty"` + Vpx50eavailable int `json:"vpx50eavailable,omitempty"` + Vpx50etotal int `json:"vpx50etotal,omitempty"` + Vpx50pavailable int `json:"vpx50pavailable,omitempty"` + Vpx50ptotal int `json:"vpx50ptotal,omitempty"` + Vpx50savailable int `json:"vpx50savailable,omitempty"` + Vpx50stotal int `json:"vpx50stotal,omitempty"` + Vpx5pavailable int `json:"vpx5pavailable,omitempty"` + Vpx5ptotal int `json:"vpx5ptotal,omitempty"` + Vpx5savailable int `json:"vpx5savailable,omitempty"` + Vpx5stotal int `json:"vpx5stotal,omitempty"` + Vpx8000eavailable int `json:"vpx8000eavailable,omitempty"` + Vpx8000etotal int `json:"vpx8000etotal,omitempty"` + Vpx8000pavailable int `json:"vpx8000pavailable,omitempty"` + Vpx8000ptotal int `json:"vpx8000ptotal,omitempty"` + Vpx8000savailable int `json:"vpx8000savailable,omitempty"` + Vpx8000stotal int `json:"vpx8000stotal,omitempty"` } -type Nsrpcnode struct { - Ipaddress string `json:"ipaddress,omitempty"` - Password string `json:"password,omitempty"` - Srcip string `json:"srcip,omitempty"` - Secure string `json:"secure,omitempty"` - Validatecert string `json:"validatecert,omitempty"` +type Nsconfigview struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` } -type Nsspparams struct { - Basethreshold int `json:"basethreshold,omitempty"` - Throttle string `json:"throttle,omitempty"` - Table0 string `json:"table0,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NstimerBinding struct { + Name string `json:"name,omitempty"` + NstimerAutoscalepolicyBinding []interface{} `json:"nstimer_autoscalepolicy_binding,omitempty"` } -type Nsvariablevalues struct { - Name string `json:"name,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Variablekey string `json:"variablekey,omitempty"` - Variablevalue string `json:"variablevalue,omitempty"` - Variabledata string `json:"variabledata,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsdiameter struct { + Count float64 `json:"__count,omitempty"` + Identity string `json:"identity,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Realm string `json:"realm,omitempty"` + Serverclosepropagation string `json:"serverclosepropagation,omitempty"` } -type Nsappflowparam struct { - Templaterefresh int `json:"templaterefresh,omitempty"` - Udppmtu int `json:"udppmtu,omitempty"` - Httpurl string `json:"httpurl,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httpreferer string `json:"httpreferer,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httphost string `json:"httphost,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Clienttrafficonly string `json:"clienttrafficonly,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NstrafficdomainBridgegroupBinding struct { + Bridgegroup int `json:"bridgegroup,omitempty"` + Td int `json:"td,omitempty"` } -type Nsassignment struct { - Name string `json:"name,omitempty"` - Variable string `json:"variable,omitempty"` - Set string `json:"set,omitempty"` - Add string `json:"Add,omitempty"` - Sub string `json:"sub,omitempty"` - Append string `json:"append,omitempty"` - Clear bool `json:"clear,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` +type Nsrollbackcmd struct { + Filename string `json:"filename,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Outtype string `json:"outtype,omitempty"` } -type Nshttpparam struct { - Dropinvalreqs string `json:"dropinvalreqs,omitempty"` - Markhttp09inval string `json:"markhttp09inval,omitempty"` - Markconnreqinval string `json:"markconnreqinval,omitempty"` - Insnssrvrhdr string `json:"insnssrvrhdr,omitempty"` - Nssrvrhdr string `json:"nssrvrhdr,omitempty"` - Logerrresp string `json:"logerrresp,omitempty"` - Conmultiplex string `json:"conmultiplex,omitempty"` - Maxreusepool int `json:"maxreusepool"` - Http2serverside string `json:"http2serverside,omitempty"` - Ignoreconnectcodingscheme string `json:"ignoreconnectcodingscheme,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nstimerautoscalepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Vserver string `json:"vserver,omitempty"` - Samplesize int `json:"samplesize,omitempty"` - Threshold int `json:"threshold,omitempty"` - Name string `json:"name,omitempty"` -} - -type Nstrafficdomainvlanbinding struct { - Vlan int `json:"vlan,omitempty"` - Td int `json:"td,omitempty"` +type Nsvpxparam struct { + Cloudproductcode string `json:"cloudproductcode,omitempty"` + Count float64 `json:"__count,omitempty"` + Cpuyield string `json:"cpuyield,omitempty"` + Kvmvirtiomultiqueue string `json:"kvmvirtiomultiqueue,omitempty"` + Masterclockcpu1 string `json:"masterclockcpu1,omitempty"` + Memorystatus string `json:"memorystatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Technicalsupportpin string `json:"technicalsupportpin,omitempty"` + Vpxenvironment string `json:"vpxenvironment,omitempty"` + Vpxoemcode int `json:"vpxoemcode,omitempty"` } type Nslicenseproxyserver struct { - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Port int `json:"port,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsratecontrol struct { - Tcpthreshold int `json:"tcpthreshold"` - Udpthreshold int `json:"udpthreshold"` - Icmpthreshold int `json:"icmpthreshold"` - Tcprstthreshold int `json:"tcprstthreshold"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsservicefunction struct { - Servicefunctionname string `json:"servicefunctionname,omitempty"` - Ingressvlan int `json:"ingressvlan,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` } -type Nstimer struct { - Name string `json:"name,omitempty"` - Interval int `json:"interval,omitempty"` - Unit string `json:"unit,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NslimitidentifierNslimitsessionsBinding struct { + Limitidentifier string `json:"limitidentifier,omitempty"` } -type Nsversion struct { - Installedversion bool `json:"installedversion,omitempty"` - Version string `json:"version,omitempty"` - Mode string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nspartitionmac struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionmac string `json:"partitionmac,omitempty"` + Partitionname string `json:"partitionname,omitempty"` } -type Nscapacity struct { - Bandwidth int `json:"bandwidth,omitempty"` - Platform string `json:"platform,omitempty"` - Vcpu bool `json:"vcpu,omitempty"` - Edition string `json:"edition,omitempty"` - Unit string `json:"unit,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Actualbandwidth string `json:"actualbandwidth,omitempty"` - Vcpucount string `json:"vcpucount,omitempty"` - Maxvcpucount string `json:"maxvcpucount,omitempty"` - Maxbandwidth string `json:"maxbandwidth,omitempty"` - Minbandwidth string `json:"minbandwidth,omitempty"` - Instancecount string `json:"instancecount,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsservicepath struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Servicepathname string `json:"servicepathname,omitempty"` } -type Nslimitidentifierbinding struct { - Limitidentifier string `json:"limitidentifier,omitempty"` +type NspartitionBinding struct { + NspartitionBridgegroupBinding []interface{} `json:"nspartition_bridgegroup_binding,omitempty"` + NspartitionVlanBinding []interface{} `json:"nspartition_vlan_binding,omitempty"` + NspartitionVxlanBinding []interface{} `json:"nspartition_vxlan_binding,omitempty"` + Partitionname string `json:"partitionname,omitempty"` } -type Nsmode struct { - Mode []string `json:"mode,omitempty"` - Fr string `json:"fr,omitempty"` - L2 string `json:"l2,omitempty"` - Usip string `json:"usip,omitempty"` - Cka string `json:"cka,omitempty"` - Tcpb string `json:"tcpb,omitempty"` - Mbf string `json:"mbf,omitempty"` - Edge string `json:"edge,omitempty"` - Usnip string `json:"usnip,omitempty"` - L3 string `json:"l3,omitempty"` - Pmtud string `json:"pmtud,omitempty"` - Mediaclassification string `json:"mediaclassification,omitempty"` - Sradv string `json:"sradv,omitempty"` - Dradv string `json:"dradv,omitempty"` - Iradv string `json:"iradv,omitempty"` - Sradv6 string `json:"sradv6,omitempty"` - Dradv6 string `json:"dradv6,omitempty"` - Bridgebpdus string `json:"bridgebpdus,omitempty"` - Singleip string `json:"single_ip,omitempty"` - Ulfd string `json:"ulfd,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nspartitionbridgegroupbinding struct { +type NspartitionBridgegroupBinding struct { Bridgegroup int `json:"bridgegroup,omitempty"` Partitionname string `json:"partitionname,omitempty"` } -type Nspartitionvlanbinding struct { - Vlan int `json:"vlan,omitempty"` - Partitionname string `json:"partitionname,omitempty"` -} - -type Nspartitionmac struct { - Partitionmac string `json:"partitionmac,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsconnectiontable struct { + Adaptivetcpprofname string `json:"adaptivetcpprofname,omitempty"` + Advwnd int `json:"advwnd,omitempty"` + Burstratecontrol string `json:"burstratecontrol,omitempty"` + Bwestimate int `json:"bwestimate,omitempty"` + Channelidnnm int `json:"channelidnnm,omitempty"` + Congstate string `json:"congstate,omitempty"` + Connid int `json:"connid,omitempty"` + Connproperties []string `json:"connproperties,omitempty"` + Count float64 `json:"__count,omitempty"` + Cqabifavg int `json:"cqabifavg,omitempty"` + Cqaccl int `json:"cqaccl,omitempty"` + Cqacsq int `json:"cqacsq,omitempty"` + Cqaiai1mspct int `json:"cqaiai1mspct,omitempty"` + Cqaiai2mspct int `json:"cqaiai2mspct,omitempty"` + Cqaiaiavg int `json:"cqaiaiavg,omitempty"` + Cqaiaisamples int `json:"cqaiaisamples,omitempty"` + Cqaisiavg int `json:"cqaisiavg,omitempty"` + Cqaloaddelayavg int `json:"cqaloaddelayavg,omitempty"` + Cqanetclass string `json:"cqanetclass,omitempty"` + Cqanoisedelayavg int `json:"cqanoisedelayavg,omitempty"` + Cqarcvwndavg int `json:"cqarcvwndavg,omitempty"` + Cqarcvwndmin int `json:"cqarcvwndmin,omitempty"` + Cqaretxcong int `json:"cqaretxcong,omitempty"` + Cqaretxcorr int `json:"cqaretxcorr,omitempty"` + Cqaretxpackets int `json:"cqaretxpackets,omitempty"` + Cqarttavg int `json:"cqarttavg,omitempty"` + Cqarttmax int `json:"cqarttmax,omitempty"` + Cqarttmin int `json:"cqarttmin,omitempty"` + Cqasamples int `json:"cqasamples,omitempty"` + Cqathruputavg int `json:"cqathruputavg,omitempty"` + Creditsinbytes int `json:"creditsinbytes,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Entityname string `json:"entityname,omitempty"` + Filterexpression string `json:"filterexpression,omitempty"` + Filtername bool `json:"filtername,omitempty"` + Flavor string `json:"flavor,omitempty"` + Httpendseq int `json:"httpendseq,omitempty"` + Httprequest string `json:"httprequest,omitempty"` + Httpreqver string `json:"httpreqver,omitempty"` + Httprspcode int `json:"httprspcode,omitempty"` + Httpstate string `json:"httpstate,omitempty"` + Idletime int `json:"idletime,omitempty"` + Irs int `json:"irs,omitempty"` + Iss int `json:"iss,omitempty"` + Link bool `json:"link,omitempty"` + Linkburstratecontrol string `json:"linkburstratecontrol,omitempty"` + Linkbwestimate int `json:"linkbwestimate,omitempty"` + Linkcongstate string `json:"linkcongstate,omitempty"` + Linkconnid int `json:"linkconnid,omitempty"` + Linkcredits int `json:"linkcredits,omitempty"` + Linkdestip string `json:"linkdestip,omitempty"` + Linkdestport int `json:"linkdestport,omitempty"` + Linkentityname string `json:"linkentityname,omitempty"` + Linkflavor string `json:"linkflavor,omitempty"` + Linkidletime int `json:"linkidletime,omitempty"` + Linkmaxrcvbuf int `json:"linkmaxrcvbuf,omitempty"` + Linkmaxsndbuf int `json:"linkmaxsndbuf,omitempty"` + Linkname string `json:"linkname,omitempty"` + Linknsbretxq int `json:"linknsbretxq,omitempty"` + Linknsbtcpwaitq int `json:"linknsbtcpwaitq,omitempty"` + Linknswsvalue int `json:"linknswsvalue,omitempty"` + Linkoptionflag []string `json:"linkoptionflag,omitempty"` + Linkpeerwsvalue int `json:"linkpeerwsvalue,omitempty"` + Linkrateinbytes int `json:"linkrateinbytes,omitempty"` + Linkrateschedulerqueue int `json:"linkrateschedulerqueue,omitempty"` + Linkrealtimertt int `json:"linkrealtimertt,omitempty"` + Linkrttmin int `json:"linkrttmin,omitempty"` + Linkrxqsize int `json:"linkrxqsize,omitempty"` + Linksackblocks int `json:"linksackblocks,omitempty"` + Linkservicetype string `json:"linkservicetype,omitempty"` + Linksndbuf int `json:"linksndbuf,omitempty"` + Linksndrecoverle int `json:"linksndrecoverle,omitempty"` + Linksourceip string `json:"linksourceip,omitempty"` + Linksourceport int `json:"linksourceport,omitempty"` + Linkstate string `json:"linkstate,omitempty"` + Linktcpmode string `json:"linktcpmode,omitempty"` + Linktxqsize int `json:"linktxqsize,omitempty"` + Listen bool `json:"listen,omitempty"` + Maxack int `json:"maxack,omitempty"` + Maxrcvbuf int `json:"maxrcvbuf,omitempty"` + Maxsndbuf int `json:"maxsndbuf,omitempty"` + Msgversionnnm int `json:"msgversionnnm,omitempty"` + Mss int `json:"mss,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Nsbretxq int `json:"nsbretxq,omitempty"` + Nsbtcpwaitq int `json:"nsbtcpwaitq,omitempty"` + Nswsvalue int `json:"nswsvalue,omitempty"` + Optionflags []string `json:"optionflags,omitempty"` + Outoforderblocks int `json:"outoforderblocks,omitempty"` + Outoforderbytes int `json:"outoforderbytes,omitempty"` + Outoforderflushedcount int `json:"outoforderflushedcount,omitempty"` + Outoforderpkts int `json:"outoforderpkts,omitempty"` + Peerwsvalue int `json:"peerwsvalue,omitempty"` + Priority string `json:"priority,omitempty"` + Rateinbytes int `json:"rateinbytes,omitempty"` + Rateschedulerqueue int `json:"rateschedulerqueue,omitempty"` + Rcvnxt int `json:"rcvnxt,omitempty"` + Rcvwnd int `json:"rcvwnd,omitempty"` + Realtimertt int `json:"realtimertt,omitempty"` + Retxretrycnt int `json:"retxretrycnt,omitempty"` + Rttmin int `json:"rttmin,omitempty"` + Rttsmoothed int `json:"rttsmoothed,omitempty"` + Rttvariance int `json:"rttvariance,omitempty"` + Rxqsize int `json:"rxqsize,omitempty"` + Sackblocks int `json:"sackblocks,omitempty"` + Sndbuf int `json:"sndbuf,omitempty"` + Sndcwnd int `json:"sndcwnd,omitempty"` + Sndnxt int `json:"sndnxt,omitempty"` + Sndrecoverle int `json:"sndrecoverle,omitempty"` + Sndunack int `json:"sndunack,omitempty"` + Sourceip string `json:"sourceip,omitempty"` + Sourcenodeidnnm int `json:"sourcenodeidnnm,omitempty"` + Sourceport int `json:"sourceport,omitempty"` + State string `json:"state,omitempty"` + Svctype string `json:"svctype,omitempty"` + Targetnodeidnnm int `json:"targetnodeidnnm,omitempty"` + Tcpmode string `json:"tcpmode,omitempty"` + Td int `json:"td,omitempty"` + Trcount int `json:"trcount,omitempty"` + Txqsize int `json:"txqsize,omitempty"` } -type Nsservicepathnsservicefunctionbinding struct { - Servicefunction string `json:"servicefunction,omitempty"` +type NsservicepathNsservicefunctionBinding struct { Index int `json:"index,omitempty"` + Servicefunction string `json:"servicefunction,omitempty"` Servicepathname string `json:"servicepathname,omitempty"` } -type Nsconfig struct { - Force bool `json:"force,omitempty"` - Level string `json:"level,omitempty"` - Rbaconfig string `json:"rbaconfig,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Nsvlan int `json:"nsvlan,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Tagged string `json:"tagged,omitempty"` - Httpport []int `json:"httpport,omitempty"` - Maxconn int `json:"maxconn,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cookieversion string `json:"cookieversion,omitempty"` - Securecookie string `json:"securecookie,omitempty"` - Pmtumin int `json:"pmtumin,omitempty"` - Pmtutimeout int `json:"pmtutimeout,omitempty"` - Ftpportrange string `json:"ftpportrange,omitempty"` - Crportrange string `json:"crportrange,omitempty"` - Timezone string `json:"timezone,omitempty"` - Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` - Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` - Grantquotaspillover int `json:"grantquotaspillover,omitempty"` - Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` - Securemanagementtraffic string `json:"securemanagementtraffic,omitempty"` - Securemanagementtd int `json:"securemanagementtd,omitempty"` - All bool `json:"all,omitempty"` - Config1 string `json:"config1,omitempty"` - Config2 string `json:"config2,omitempty"` - Outtype string `json:"outtype,omitempty"` - Template bool `json:"template,omitempty"` - Ignoredevicespecific bool `json:"ignoredevicespecific,omitempty"` - Weakpassword bool `json:"weakpassword,omitempty"` - Changedpassword bool `json:"changedpassword,omitempty"` - Config string `json:"config,omitempty"` - Configfile string `json:"configfile,omitempty"` - Responsefile string `json:"responsefile,omitempty"` - Async bool `json:"Async,omitempty"` - Message string `json:"message,omitempty"` - Mappedip string `json:"mappedip,omitempty"` - Range string `json:"range,omitempty"` - Svmcmd string `json:"svmcmd,omitempty"` - Systemtype string `json:"systemtype,omitempty"` - Primaryip string `json:"primaryip,omitempty"` - Primaryip6 string `json:"primaryip6,omitempty"` - Flags string `json:"flags,omitempty"` - Lastconfigchangedtime string `json:"lastconfigchangedtime,omitempty"` - Lastconfigsavetime string `json:"lastconfigsavetime,omitempty"` - Currentsytemtime string `json:"currentsytemtime,omitempty"` - Systemtime string `json:"systemtime,omitempty"` - Configchanged string `json:"configchanged,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Response string `json:"response,omitempty"` - Id string `json:"id,omitempty"` -} - -type Nsencryptionparams struct { - Method string `json:"method,omitempty"` - Keyvalue string `json:"keyvalue,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsfeature struct { - Feature []string `json:"feature,omitempty"` - Wl string `json:"wl,omitempty"` - Sp string `json:"sp,omitempty"` - Lb string `json:"lb,omitempty"` - Cs string `json:"cs,omitempty"` - Cr string `json:"cr,omitempty"` - Cmp string `json:"cmp,omitempty"` - Ssl string `json:"ssl,omitempty"` - Gslb string `json:"gslb,omitempty"` - Cf string `json:"cf,omitempty"` - Ic string `json:"ic,omitempty"` - Sslvpn string `json:"sslvpn,omitempty"` - Aaa string `json:"aaa,omitempty"` - Ospf string `json:"ospf,omitempty"` - Rip string `json:"rip,omitempty"` - Bgp string `json:"bgp,omitempty"` - Rewrite string `json:"rewrite,omitempty"` - Ipv6pt string `json:"ipv6pt,omitempty"` - Appfw string `json:"appfw,omitempty"` - Responder string `json:"responder,omitempty"` - Push string `json:"push,omitempty"` - Appflow string `json:"appflow,omitempty"` - Cloudbridge string `json:"cloudbridge,omitempty"` - Isis string `json:"isis,omitempty"` - Ch string `json:"ch,omitempty"` - Appqoe string `json:"appqoe,omitempty"` - Contentaccelerator string `json:"contentaccelerator,omitempty"` - Feo string `json:"feo,omitempty"` - Lsn string `json:"lsn,omitempty"` - Rdpproxy string `json:"rdpproxy,omitempty"` - Rep string `json:"rep,omitempty"` - Videooptimization string `json:"videooptimization,omitempty"` - Forwardproxy string `json:"forwardproxy,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Adaptivetcp string `json:"adaptivetcp,omitempty"` - Cqa string `json:"cqa,omitempty"` - Ci string `json:"ci,omitempty"` - Bot string `json:"bot,omitempty"` - Apigateway string `json:"apigateway,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsip struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Type string `json:"type,omitempty"` - Arp string `json:"arp,omitempty"` - Icmp string `json:"icmp,omitempty"` - Vserver string `json:"vserver,omitempty"` - Telnet string `json:"telnet,omitempty"` - Ftp string `json:"ftp,omitempty"` - Gui string `json:"gui,omitempty"` - Ssh string `json:"ssh,omitempty"` - Snmp string `json:"snmp,omitempty"` - Mgmtaccess string `json:"mgmtaccess,omitempty"` - Restrictaccess string `json:"restrictaccess,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Decrementttl string `json:"decrementttl,omitempty"` - Ospf string `json:"ospf,omitempty"` - Bgp string `json:"bgp,omitempty"` - Rip string `json:"rip,omitempty"` - Hostroute string `json:"hostroute,omitempty"` - Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` - Networkroute string `json:"networkroute,omitempty"` - Tag int `json:"tag,omitempty"` - Hostrtgw string `json:"hostrtgw,omitempty"` - Metric int `json:"metric,omitempty"` - Vserverrhilevel string `json:"vserverrhilevel,omitempty"` - Ospflsatype string `json:"ospflsatype,omitempty"` - Ospfarea int `json:"ospfarea,omitempty"` - State string `json:"state,omitempty"` - Vrid int `json:"vrid,omitempty"` - Icmpresponse string `json:"icmpresponse,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Arpresponse string `json:"arpresponse,omitempty"` - Ownerdownresponse string `json:"ownerdownresponse,omitempty"` - Td int `json:"td,omitempty"` - Arpowner int `json:"arpowner,omitempty"` - Mptcpadvertise string `json:"mptcpadvertise,omitempty"` - Flags string `json:"flags,omitempty"` - Hostrtgwact string `json:"hostrtgwact,omitempty"` - Ospfareaval string `json:"ospfareaval,omitempty"` - Viprtadv2bsd string `json:"viprtadv2bsd,omitempty"` - Vipvsercount string `json:"vipvsercount,omitempty"` - Vipvserdowncount string `json:"vipvserdowncount,omitempty"` - Vipvsrvrrhiactivecount string `json:"vipvsrvrrhiactivecount,omitempty"` - Vipvsrvrrhiactiveupcount string `json:"vipvsrvrrhiactiveupcount,omitempty"` - Freeports string `json:"freeports,omitempty"` - Iptype string `json:"iptype,omitempty"` - Operationalarpowner string `json:"operationalarpowner,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nslimitselector struct { - Selectorname string `json:"selectorname,omitempty"` - Rule []string `json:"rule,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nstimeout struct { - Zombie int `json:"zombie,omitempty"` - Client int `json:"client"` - Server int `json:"server"` - Httpclient int `json:"httpclient"` - Httpserver int `json:"httpserver"` - Tcpclient int `json:"tcpclient"` - Tcpserver int `json:"tcpserver"` - Anyclient int `json:"anyclient"` - Anyserver int `json:"anyserver"` - Anytcpclient int `json:"anytcpclient"` - Anytcpserver int `json:"anytcpserver"` - Halfclose int `json:"halfclose,omitempty"` - Nontcpzombie int `json:"nontcpzombie,omitempty"` - Reducedfintimeout int `json:"reducedfintimeout,omitempty"` - Reducedrsttimeout int `json:"reducedrsttimeout"` - Newconnidletimeout int `json:"newconnidletimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nstimerbinding struct { - Name string `json:"name,omitempty"` +type Nsparam struct { + Advancedanalyticsstats string `json:"advancedanalyticsstats,omitempty"` + Aftpallowrandomsourceport string `json:"aftpallowrandomsourceport,omitempty"` + Autoscaleoption int `json:"autoscaleoption,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Cookieversion string `json:"cookieversion,omitempty"` + Crportrange string `json:"crportrange,omitempty"` + Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` + Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` + Ftpportrange string `json:"ftpportrange,omitempty"` + Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` + Grantquotaspillover int `json:"grantquotaspillover,omitempty"` + Httpport []interface{} `json:"httpport,omitempty"` + Icaports []interface{} `json:"icaports,omitempty"` + Internaluserlogin string `json:"internaluserlogin,omitempty"` + Ipttl int `json:"ipttl,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Mgmthttpport int `json:"mgmthttpport,omitempty"` + Mgmthttpsport int `json:"mgmthttpsport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pmtumin int `json:"pmtumin,omitempty"` + Pmtutimeout int `json:"pmtutimeout,omitempty"` + Proxyprotocol string `json:"proxyprotocol,omitempty"` + Securecookie string `json:"securecookie,omitempty"` + Secureicaports []interface{} `json:"secureicaports,omitempty"` + Servicepathingressvlan int `json:"servicepathingressvlan,omitempty"` + Tcpcip string `json:"tcpcip,omitempty"` + Timezone string `json:"timezone,omitempty"` + Useproxyport string `json:"useproxyport,omitempty"` +} + +type NsextensionExtensionfunctionBinding struct { + Activeextensionfunction int `json:"activeextensionfunction,omitempty"` + Extensionfuncdescription string `json:"extensionfuncdescription,omitempty"` + Extensionfunctionallparams []string `json:"extensionfunctionallparams,omitempty"` + Extensionfunctionallparamscount int `json:"extensionfunctionallparamscount,omitempty"` + Extensionfunctionargcount int `json:"extensionfunctionargcount,omitempty"` + Extensionfunctionargtype []string `json:"extensionfunctionargtype,omitempty"` + Extensionfunctionclasses []string `json:"extensionfunctionclasses,omitempty"` + Extensionfunctionclassescount int `json:"extensionfunctionclassescount,omitempty"` + Extensionfunctionclasstype string `json:"extensionfunctionclasstype,omitempty"` + Extensionfunctionlinenumber int `json:"extensionfunctionlinenumber,omitempty"` + Extensionfunctionname string `json:"extensionfunctionname,omitempty"` + Extensionfunctionreturntype string `json:"extensionfunctionreturntype,omitempty"` + Name string `json:"name,omitempty"` } -type Nsaptlicense struct { - Serialno string `json:"serialno,omitempty"` - Useproxy string `json:"useproxy,omitempty"` - Id string `json:"id,omitempty"` - Sessionid string `json:"sessionid,omitempty"` - Bindtype string `json:"bindtype,omitempty"` - Countavailable string `json:"countavailable,omitempty"` - Licensedir string `json:"licensedir,omitempty"` - Response string `json:"response,omitempty"` - Counttotal string `json:"counttotal,omitempty"` - Name string `json:"name,omitempty"` - Relevance string `json:"relevance,omitempty"` - Datepurchased string `json:"datepurchased,omitempty"` - Datesa string `json:"datesa,omitempty"` - Dateexp string `json:"dateexp,omitempty"` - Features string `json:"features,omitempty"` +type Nsversion struct { + Installedversion bool `json:"installedversion,omitempty"` + Mode int `json:"mode,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Version string `json:"version,omitempty"` } -type Nschannelparam struct { - Vfautorecover string `json:"vfautorecover,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nshttpparam struct { + Builtin []string `json:"builtin,omitempty"` + Conmultiplex string `json:"conmultiplex,omitempty"` + Dropinvalreqs string `json:"dropinvalreqs,omitempty"` + Feature string `json:"feature,omitempty"` + Http2serverside string `json:"http2serverside,omitempty"` + Ignoreconnectcodingscheme string `json:"ignoreconnectcodingscheme,omitempty"` + Insnssrvrhdr string `json:"insnssrvrhdr,omitempty"` + Logerrresp string `json:"logerrresp,omitempty"` + Markconnreqinval string `json:"markconnreqinval,omitempty"` + Markhttp09inval string `json:"markhttp09inval,omitempty"` + Maxreusepool int `json:"maxreusepool,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nssrvrhdr string `json:"nssrvrhdr,omitempty"` } type Nsip6 struct { - Ipv6address string `json:"ipv6address,omitempty"` - Scope string `json:"scope,omitempty"` - Type string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Nd string `json:"nd,omitempty"` - Icmp string `json:"icmp,omitempty"` - Vserver string `json:"vserver,omitempty"` - Telnet string `json:"telnet,omitempty"` - Ftp string `json:"ftp,omitempty"` - Gui string `json:"gui,omitempty"` - Ssh string `json:"ssh,omitempty"` - Snmp string `json:"snmp,omitempty"` - Mgmtaccess string `json:"mgmtaccess,omitempty"` - Restrictaccess string `json:"restrictaccess,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Decrementhoplimit string `json:"decrementhoplimit,omitempty"` - Hostroute string `json:"hostroute,omitempty"` - Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` - Networkroute string `json:"networkroute,omitempty"` - Tag int `json:"tag,omitempty"` - Ip6hostrtgw string `json:"ip6hostrtgw,omitempty"` - Metric int `json:"metric,omitempty"` - Vserverrhilevel string `json:"vserverrhilevel,omitempty"` - Ospf6lsatype string `json:"ospf6lsatype,omitempty"` - Ospfarea int `json:"ospfarea,omitempty"` - State string `json:"state,omitempty"` - Map string `json:"map,omitempty"` - Vrid6 int `json:"vrid6,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Ownerdownresponse string `json:"ownerdownresponse,omitempty"` - Td int `json:"td,omitempty"` - Ndowner int `json:"ndowner,omitempty"` - Mptcpadvertise string `json:"mptcpadvertise,omitempty"` - Icmpresponse string `json:"icmpresponse,omitempty"` - Iptype string `json:"iptype,omitempty"` - Curstate string `json:"curstate,omitempty"` - Viprtadv2bsd string `json:"viprtadv2bsd,omitempty"` - Vipvsercount string `json:"vipvsercount,omitempty"` - Vipvserdowncount string `json:"vipvserdowncount,omitempty"` - Systemtype string `json:"systemtype,omitempty"` - Operationalndowner string `json:"operationalndowner,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate string `json:"curstate,omitempty"` + Decrementhoplimit string `json:"decrementhoplimit,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Ftp string `json:"ftp,omitempty"` + Gui string `json:"gui,omitempty"` + Hostroute string `json:"hostroute,omitempty"` + Icmp string `json:"icmp,omitempty"` + Icmpresponse string `json:"icmpresponse,omitempty"` + Ip6hostrtgw string `json:"ip6hostrtgw,omitempty"` + Iptype []string `json:"iptype,omitempty"` + Ipv6address string `json:"ipv6address,omitempty"` + MapField string `json:"map,omitempty"` + Metric int `json:"metric,omitempty"` + Mgmtaccess string `json:"mgmtaccess,omitempty"` + Mptcpadvertise string `json:"mptcpadvertise,omitempty"` + Nd string `json:"nd,omitempty"` + Ndowner int `json:"ndowner,omitempty"` + Networkroute string `json:"networkroute,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Operationalndowner int `json:"operationalndowner,omitempty"` + Ospf6lsatype string `json:"ospf6lsatype,omitempty"` + Ospfarea int `json:"ospfarea,omitempty"` + Ownerdownresponse string `json:"ownerdownresponse,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Restrictaccess string `json:"restrictaccess,omitempty"` + Scope string `json:"scope,omitempty"` + Snmp string `json:"snmp,omitempty"` + Ssh string `json:"ssh,omitempty"` + State string `json:"state,omitempty"` + Systemtype string `json:"systemtype,omitempty"` + Tag int `json:"tag,omitempty"` + Td int `json:"td,omitempty"` + Telnet string `json:"telnet,omitempty"` + TypeField string `json:"type,omitempty"` + Viprtadv2bsd bool `json:"viprtadv2bsd,omitempty"` + Vipvsercount int `json:"vipvsercount,omitempty"` + Vipvserdowncount int `json:"vipvserdowncount,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vrid6 int `json:"vrid6,omitempty"` + Vserver string `json:"vserver,omitempty"` + Vserverrhilevel string `json:"vserverrhilevel,omitempty"` +} + +type NspartitionVxlanBinding struct { + Partitionname string `json:"partitionname,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Nsjob struct { - Id int `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` - Progress string `json:"progress,omitempty"` - Timeelapsed string `json:"timeelapsed,omitempty"` - Errorcode string `json:"errorcode,omitempty"` - Message string `json:"message,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsip struct { + Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` + Arp string `json:"arp,omitempty"` + Arpowner int `json:"arpowner,omitempty"` + Arpresponse string `json:"arpresponse,omitempty"` + Bgp string `json:"bgp,omitempty"` + Count float64 `json:"__count,omitempty"` + Decrementttl string `json:"decrementttl,omitempty"` + Dynamicrouting string `json:"dynamicrouting,omitempty"` + Flags int `json:"flags,omitempty"` + Freeports int `json:"freeports,omitempty"` + Ftp string `json:"ftp,omitempty"` + Gui string `json:"gui,omitempty"` + Hostroute string `json:"hostroute,omitempty"` + Hostrtgw string `json:"hostrtgw,omitempty"` + Hostrtgwact string `json:"hostrtgwact,omitempty"` + Icmp string `json:"icmp,omitempty"` + Icmpresponse string `json:"icmpresponse,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Iptype []string `json:"iptype,omitempty"` + Metric int `json:"metric,omitempty"` + Mgmtaccess string `json:"mgmtaccess,omitempty"` + Mptcpadvertise string `json:"mptcpadvertise,omitempty"` + Netmask string `json:"netmask,omitempty"` + Networkroute string `json:"networkroute,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Operationalarpowner int `json:"operationalarpowner,omitempty"` + Ospf string `json:"ospf,omitempty"` + Ospfarea int `json:"ospfarea,omitempty"` + Ospfareaval int `json:"ospfareaval,omitempty"` + Ospflsatype string `json:"ospflsatype,omitempty"` + Ownerdownresponse string `json:"ownerdownresponse,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Restrictaccess string `json:"restrictaccess,omitempty"` + Rip string `json:"rip,omitempty"` + Snmp string `json:"snmp,omitempty"` + Ssh string `json:"ssh,omitempty"` + State string `json:"state,omitempty"` + Tag int `json:"tag,omitempty"` + Td int `json:"td,omitempty"` + Telnet string `json:"telnet,omitempty"` + TypeField string `json:"type,omitempty"` + Viprtadv2bsd bool `json:"viprtadv2bsd,omitempty"` + Vipvsercount int `json:"vipvsercount,omitempty"` + Vipvserdowncount int `json:"vipvserdowncount,omitempty"` + Vipvsrvrrhiactivecount int `json:"vipvsrvrrhiactivecount,omitempty"` + Vipvsrvrrhiactiveupcount int `json:"vipvsrvrrhiactiveupcount,omitempty"` + Vrid int `json:"vrid,omitempty"` + Vserver string `json:"vserver,omitempty"` + Vserverrhilevel string `json:"vserverrhilevel,omitempty"` } -type Nslicense struct { - Wl string `json:"wl,omitempty"` - Sp string `json:"sp,omitempty"` - Lb string `json:"lb,omitempty"` - Cs string `json:"cs,omitempty"` - Cr string `json:"cr,omitempty"` - Cmp string `json:"cmp,omitempty"` - Delta string `json:"delta,omitempty"` - Ssl string `json:"ssl,omitempty"` - Gslb string `json:"gslb,omitempty"` - Gslbp string `json:"gslbp,omitempty"` - Routing string `json:"routing,omitempty"` - Cf string `json:"cf,omitempty"` - Contentaccelerator string `json:"contentaccelerator,omitempty"` - Ic string `json:"ic,omitempty"` - Sslvpn string `json:"sslvpn,omitempty"` - Fsslvpnusers string `json:"f_sslvpn_users,omitempty"` - Ficausers string `json:"f_ica_users,omitempty"` - Aaa string `json:"aaa,omitempty"` - Ospf string `json:"ospf,omitempty"` - Rip string `json:"rip,omitempty"` - Bgp string `json:"bgp,omitempty"` - Rewrite string `json:"rewrite,omitempty"` - Ipv6pt string `json:"ipv6pt,omitempty"` - Appfw string `json:"appfw,omitempty"` - Responder string `json:"responder,omitempty"` - Agee string `json:"agee,omitempty"` - Nsxn string `json:"nsxn,omitempty"` - Modelid string `json:"modelid,omitempty"` - Push string `json:"push,omitempty"` - Appflow string `json:"appflow,omitempty"` - Cloudbridge string `json:"cloudbridge,omitempty"` - Cloudbridgeappliance string `json:"cloudbridgeappliance,omitempty"` - Cloudextenderappliance string `json:"cloudextenderappliance,omitempty"` - Isis string `json:"isis,omitempty"` - Cluster string `json:"cluster,omitempty"` - Ch string `json:"ch,omitempty"` - Appqoe string `json:"appqoe,omitempty"` - Appflowica string `json:"appflowica,omitempty"` - Isstandardlic string `json:"isstandardlic,omitempty"` - Isenterpriselic string `json:"isenterpriselic,omitempty"` - Isplatinumlic string `json:"isplatinumlic,omitempty"` - Issgwylic string `json:"issgwylic,omitempty"` - Isswglic string `json:"isswglic,omitempty"` - Feo string `json:"feo,omitempty"` - Lsn string `json:"lsn,omitempty"` - Licensingmode string `json:"licensingmode,omitempty"` - Cloudsubscriptionimage string `json:"cloudsubscriptionimage,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Daystolasenforcement string `json:"daystolasenforcement,omitempty"` - Rdpproxy string `json:"rdpproxy,omitempty"` - Rep string `json:"rep,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Videooptimization string `json:"videooptimization,omitempty"` - Forwardproxy string `json:"forwardproxy,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Remotecontentinspection string `json:"remotecontentinspection,omitempty"` - Adaptivetcp string `json:"adaptivetcp,omitempty"` - Cqa string `json:"cqa,omitempty"` - Bot string `json:"bot,omitempty"` - Apigateway string `json:"apigateway,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsextension struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Detail string `json:"detail,omitempty"` + Functionhaltcount int `json:"functionhaltcount,omitempty"` + Functionhits int `json:"functionhits,omitempty"` + Functionundefhits int `json:"functionundefhits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Src string `json:"src,omitempty"` + Trace string `json:"trace,omitempty"` + Tracefunctions string `json:"tracefunctions,omitempty"` + Tracevariables string `json:"tracevariables,omitempty"` + TypeField string `json:"type,omitempty"` } -type Nslicenseactivationdata struct { - Filename string `json:"filename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Shutdown struct { } -type Nsmigration struct { - Dumpsession string `json:"dumpsession,omitempty"` - Migrationstatus string `json:"migrationstatus,omitempty"` - Migrationstarttime string `json:"migrationstarttime,omitempty"` - Migrationendtime string `json:"migrationendtime,omitempty"` - Migrationrollbackstarttime string `json:"migrationrollbackstarttime,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport string `json:"srcport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Timeout string `json:"timeout,omitempty"` - Migdfdsessionsallocated string `json:"migdfdsessionsallocated,omitempty"` - Migdfdsessionsactive string `json:"migdfdsessionsactive,omitempty"` - Migl4sessionsallocated string `json:"migl4sessionsallocated,omitempty"` - Migl4sessionsactive string `json:"migl4sessionsactive,omitempty"` - Migdfdsessionsallocatedrollback string `json:"migdfdsessionsallocatedrollback,omitempty"` - Migdfdsessionsactiverollback string `json:"migdfdsessionsactiverollback,omitempty"` - Migl4sessionsallocatedrollback string `json:"migl4sessionsallocatedrollback,omitempty"` - Migl4sessionsactiverollback string `json:"migl4sessionsactiverollback,omitempty"` - Mighastateflag string `json:"mighastateflag,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nscapacity struct { + Actualbandwidth int `json:"actualbandwidth,omitempty"` + Bandwidth int `json:"bandwidth,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Edition string `json:"edition,omitempty"` + Instancecount int `json:"instancecount,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Maxvcpucount int `json:"maxvcpucount,omitempty"` + Minbandwidth int `json:"minbandwidth,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Password string `json:"password,omitempty"` + Platform string `json:"platform,omitempty"` + Unit string `json:"unit,omitempty"` + Username string `json:"username,omitempty"` + Vcpu bool `json:"vcpu,omitempty"` + Vcpucount int `json:"vcpucount,omitempty"` } -type Nsservicepath struct { - Servicepathname string `json:"servicepathname,omitempty"` +type Nssavedconfig struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Textblob string `json:"textblob,omitempty"` } -type Nsacl6 struct { - Acl6name string `json:"acl6name,omitempty"` - Acl6action string `json:"acl6action,omitempty"` - Td int `json:"td,omitempty"` - Srcipv6 bool `json:"srcipv6,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipv6val string `json:"srcipv6val,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` - Destipv6 bool `json:"destipv6,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipv6val string `json:"destipv6val,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Ttl int `json:"ttl,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Interface string `json:"Interface,omitempty"` - Established bool `json:"established,omitempty"` - Icmptype int `json:"icmptype,omitempty"` - Icmpcode int `json:"icmpcode,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Dfdhash string `json:"dfdhash,omitempty"` - Dfdprefix int `json:"dfdprefix,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Stateful string `json:"stateful,omitempty"` - Logstate string `json:"logstate,omitempty"` - Ratelimit int `json:"ratelimit,omitempty"` - Aclaction string `json:"aclaction,omitempty"` - Newname string `json:"newname,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Hits string `json:"hits,omitempty"` - Aclassociate string `json:"aclassociate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsrpcnode struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Secure string `json:"secure,omitempty"` + Srcip string `json:"srcip,omitempty"` + Validatecert string `json:"validatecert,omitempty"` } -type Nsappflowcollector struct { - Name string `json:"name,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsassignment struct { + Add string `json:"Add,omitempty"` + Append string `json:"append,omitempty"` + Clear bool `json:"clear,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Set string `json:"set,omitempty"` + Sub string `json:"sub,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Variable string `json:"variable,omitempty"` } -type Nsconfigview struct { - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nstcpbufparam struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Memlimit int `json:"memlimit,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Size int `json:"size,omitempty"` } -type Nslaslicense struct { - Filename string `json:"filename,omitempty"` - Filelocation string `json:"filelocation,omitempty"` - Fixedbandwidth bool `json:"fixedbandwidth,omitempty"` - Status string `json:"status,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Renewalprev string `json:"renewalprev,omitempty"` - Renewalnext string `json:"renewalnext,omitempty"` - Renewalprevdate string `json:"renewalprevdate,omitempty"` - Renewalnextdate string `json:"renewalnextdate,omitempty"` +type Nsratecontrol struct { + Icmpthreshold int `json:"icmpthreshold,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tcprstthreshold int `json:"tcprstthreshold,omitempty"` + Tcpthreshold int `json:"tcpthreshold,omitempty"` + Udpthreshold int `json:"udpthreshold,omitempty"` } -type Nslicenseserverpool struct { - Getalllicenses bool `json:"getalllicenses,omitempty"` - Instancetotal string `json:"instancetotal,omitempty"` - Instanceavailable string `json:"instanceavailable,omitempty"` - Standardbandwidthtotal string `json:"standardbandwidthtotal,omitempty"` - Standardbandwidthavailable string `json:"standardbandwidthavailable,omitempty"` - Enterprisebandwidthtotal string `json:"enterprisebandwidthtotal,omitempty"` - Enterprisebandwidthavailable string `json:"enterprisebandwidthavailable,omitempty"` - Platinumbandwidthtotal string `json:"platinumbandwidthtotal,omitempty"` - Platinumbandwidthavailable string `json:"platinumbandwidthavailable,omitempty"` - Standardcputotal string `json:"standardcputotal,omitempty"` - Standardcpuavailable string `json:"standardcpuavailable,omitempty"` - Enterprisecputotal string `json:"enterprisecputotal,omitempty"` - Enterprisecpuavailable string `json:"enterprisecpuavailable,omitempty"` - Platinumcputotal string `json:"platinumcputotal,omitempty"` - Platinumcpuavailable string `json:"platinumcpuavailable,omitempty"` - Cpxinstancetotal string `json:"cpxinstancetotal,omitempty"` - Cpxinstanceavailable string `json:"cpxinstanceavailable,omitempty"` - Vpx1stotal string `json:"vpx1stotal,omitempty"` - Vpx1savailable string `json:"vpx1savailable,omitempty"` - Vpx1ptotal string `json:"vpx1ptotal,omitempty"` - Vpx1pavailable string `json:"vpx1pavailable,omitempty"` - Vpx5stotal string `json:"vpx5stotal,omitempty"` - Vpx5savailable string `json:"vpx5savailable,omitempty"` - Vpx5ptotal string `json:"vpx5ptotal,omitempty"` - Vpx5pavailable string `json:"vpx5pavailable,omitempty"` - Vpx10stotal string `json:"vpx10stotal,omitempty"` - Vpx10savailable string `json:"vpx10savailable,omitempty"` - Vpx10etotal string `json:"vpx10etotal,omitempty"` - Vpx10eavailable string `json:"vpx10eavailable,omitempty"` - Vpx10ptotal string `json:"vpx10ptotal,omitempty"` - Vpx10pavailable string `json:"vpx10pavailable,omitempty"` - Vpx25stotal string `json:"vpx25stotal,omitempty"` - Vpx25savailable string `json:"vpx25savailable,omitempty"` - Vpx25etotal string `json:"vpx25etotal,omitempty"` - Vpx25eavailable string `json:"vpx25eavailable,omitempty"` - Vpx25ptotal string `json:"vpx25ptotal,omitempty"` - Vpx25pavailable string `json:"vpx25pavailable,omitempty"` - Vpx50stotal string `json:"vpx50stotal,omitempty"` - Vpx50savailable string `json:"vpx50savailable,omitempty"` - Vpx50etotal string `json:"vpx50etotal,omitempty"` - Vpx50eavailable string `json:"vpx50eavailable,omitempty"` - Vpx50ptotal string `json:"vpx50ptotal,omitempty"` - Vpx50pavailable string `json:"vpx50pavailable,omitempty"` - Vpx100stotal string `json:"vpx100stotal,omitempty"` - Vpx100savailable string `json:"vpx100savailable,omitempty"` - Vpx100etotal string `json:"vpx100etotal,omitempty"` - Vpx100eavailable string `json:"vpx100eavailable,omitempty"` - Vpx100ptotal string `json:"vpx100ptotal,omitempty"` - Vpx100pavailable string `json:"vpx100pavailable,omitempty"` - Vpx200stotal string `json:"vpx200stotal,omitempty"` - Vpx200savailable string `json:"vpx200savailable,omitempty"` - Vpx200etotal string `json:"vpx200etotal,omitempty"` - Vpx200eavailable string `json:"vpx200eavailable,omitempty"` - Vpx200ptotal string `json:"vpx200ptotal,omitempty"` - Vpx200pavailable string `json:"vpx200pavailable,omitempty"` - Vpx500stotal string `json:"vpx500stotal,omitempty"` - Vpx500savailable string `json:"vpx500savailable,omitempty"` - Vpx500etotal string `json:"vpx500etotal,omitempty"` - Vpx500eavailable string `json:"vpx500eavailable,omitempty"` - Vpx500ptotal string `json:"vpx500ptotal,omitempty"` - Vpx500pavailable string `json:"vpx500pavailable,omitempty"` - Vpx1000stotal string `json:"vpx1000stotal,omitempty"` - Vpx1000savailable string `json:"vpx1000savailable,omitempty"` - Vpx1000etotal string `json:"vpx1000etotal,omitempty"` - Vpx1000eavailable string `json:"vpx1000eavailable,omitempty"` - Vpx1000ptotal string `json:"vpx1000ptotal,omitempty"` - Vpx1000pavailable string `json:"vpx1000pavailable,omitempty"` - Vpx2000ptotal string `json:"vpx2000ptotal,omitempty"` - Vpx2000pavailable string `json:"vpx2000pavailable,omitempty"` - Vpx3000stotal string `json:"vpx3000stotal,omitempty"` - Vpx3000savailable string `json:"vpx3000savailable,omitempty"` - Vpx3000etotal string `json:"vpx3000etotal,omitempty"` - Vpx3000eavailable string `json:"vpx3000eavailable,omitempty"` - Vpx3000ptotal string `json:"vpx3000ptotal,omitempty"` - Vpx3000pavailable string `json:"vpx3000pavailable,omitempty"` - Vpx4000ptotal string `json:"vpx4000ptotal,omitempty"` - Vpx4000pavailable string `json:"vpx4000pavailable,omitempty"` - Vpx5000stotal string `json:"vpx5000stotal,omitempty"` - Vpx5000savailable string `json:"vpx5000savailable,omitempty"` - Vpx5000etotal string `json:"vpx5000etotal,omitempty"` - Vpx5000eavailable string `json:"vpx5000eavailable,omitempty"` - Vpx5000ptotal string `json:"vpx5000ptotal,omitempty"` - Vpx5000pavailable string `json:"vpx5000pavailable,omitempty"` - Vpx8000stotal string `json:"vpx8000stotal,omitempty"` - Vpx8000savailable string `json:"vpx8000savailable,omitempty"` - Vpx8000etotal string `json:"vpx8000etotal,omitempty"` - Vpx8000eavailable string `json:"vpx8000eavailable,omitempty"` - Vpx8000ptotal string `json:"vpx8000ptotal,omitempty"` - Vpx8000pavailable string `json:"vpx8000pavailable,omitempty"` - Vpx10000stotal string `json:"vpx10000stotal,omitempty"` - Vpx10000savailable string `json:"vpx10000savailable,omitempty"` - Vpx10000etotal string `json:"vpx10000etotal,omitempty"` - Vpx10000eavailable string `json:"vpx10000eavailable,omitempty"` - Vpx10000ptotal string `json:"vpx10000ptotal,omitempty"` - Vpx10000pavailable string `json:"vpx10000pavailable,omitempty"` - Vpx15000stotal string `json:"vpx15000stotal,omitempty"` - Vpx15000savailable string `json:"vpx15000savailable,omitempty"` - Vpx15000etotal string `json:"vpx15000etotal,omitempty"` - Vpx15000eavailable string `json:"vpx15000eavailable,omitempty"` - Vpx15000ptotal string `json:"vpx15000ptotal,omitempty"` - Vpx15000pavailable string `json:"vpx15000pavailable,omitempty"` - Vpx25000stotal string `json:"vpx25000stotal,omitempty"` - Vpx25000savailable string `json:"vpx25000savailable,omitempty"` - Vpx25000etotal string `json:"vpx25000etotal,omitempty"` - Vpx25000eavailable string `json:"vpx25000eavailable,omitempty"` - Vpx25000ptotal string `json:"vpx25000ptotal,omitempty"` - Vpx25000pavailable string `json:"vpx25000pavailable,omitempty"` - Vpx40000stotal string `json:"vpx40000stotal,omitempty"` - Vpx40000savailable string `json:"vpx40000savailable,omitempty"` - Vpx40000etotal string `json:"vpx40000etotal,omitempty"` - Vpx40000eavailable string `json:"vpx40000eavailable,omitempty"` - Vpx40000ptotal string `json:"vpx40000ptotal,omitempty"` - Vpx40000pavailable string `json:"vpx40000pavailable,omitempty"` - Vpx100000stotal string `json:"vpx100000stotal,omitempty"` - Vpx100000savailable string `json:"vpx100000savailable,omitempty"` - Vpx100000etotal string `json:"vpx100000etotal,omitempty"` - Vpx100000eavailable string `json:"vpx100000eavailable,omitempty"` - Vpx100000ptotal string `json:"vpx100000ptotal,omitempty"` - Vpx100000pavailable string `json:"vpx100000pavailable,omitempty"` - Licensemode string `json:"licensemode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nslimitsessions struct { + Count float64 `json:"__count,omitempty"` + Detail bool `json:"detail,omitempty"` + Drop int `json:"drop,omitempty"` + Flag int `json:"flag,omitempty"` + Flags int `json:"flags,omitempty"` + Hits int `json:"hits,omitempty"` + Limitidentifier string `json:"limitidentifier,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Number []interface{} `json:"number,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Selectoripv61 string `json:"selectoripv61,omitempty"` + Selectoripv62 string `json:"selectoripv62,omitempty"` + Timeout int `json:"timeout,omitempty"` + Unit int `json:"unit,omitempty"` +} + +type NstrafficdomainVlanBinding struct { + Td int `json:"td,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Nslimitidentifierlimitsessionsbinding struct { - Limitidentifier string `json:"limitidentifier,omitempty"` +type Nsspparams struct { + Basethreshold int `json:"basethreshold,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Table0 []interface{} `json:"table0,omitempty"` + Throttle string `json:"throttle,omitempty"` } -type Nspartition struct { - Partitionname string `json:"partitionname,omitempty"` - Maxbandwidth int `json:"maxbandwidth"` - Minbandwidth int `json:"minbandwidth"` - Maxconn int `json:"maxconn"` - Maxmemlimit int `json:"maxmemlimit"` - Partitionmac string `json:"partitionmac,omitempty"` - Force bool `json:"force,omitempty"` - Save bool `json:"save,omitempty"` - Partitionid string `json:"partitionid,omitempty"` - Partitiontype string `json:"partitiontype,omitempty"` - Pmacinternal string `json:"pmacinternal,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsacls6 struct { + TypeField string `json:"type,omitempty"` } type Nsrunningconfig struct { - Withdefaults bool `json:"withdefaults,omitempty"` - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nshardware struct { - Hwdescription string `json:"hwdescription,omitempty"` - Sysid string `json:"sysid,omitempty"` - Manufactureday string `json:"manufactureday,omitempty"` - Manufacturemonth string `json:"manufacturemonth,omitempty"` - Manufactureyear string `json:"manufactureyear,omitempty"` - Cpufrequncy string `json:"cpufrequncy,omitempty"` - Hostid string `json:"hostid,omitempty"` - Host string `json:"host,omitempty"` - Serialno string `json:"serialno,omitempty"` - Encodedserialno string `json:"encodedserialno,omitempty"` - Netscaleruuid string `json:"netscaleruuid,omitempty"` - Bmcrevision string `json:"bmcrevision,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` + Withdefaults bool `json:"withdefaults,omitempty"` } -type Nshttpprofile struct { - Name string `json:"name,omitempty"` - Dropinvalreqs string `json:"dropinvalreqs,omitempty"` - Markhttp09inval string `json:"markhttp09inval,omitempty"` - Markconnreqinval string `json:"markconnreqinval,omitempty"` - Marktracereqinval string `json:"marktracereqinval,omitempty"` - Markrfc7230noncompliantinval string `json:"markrfc7230noncompliantinval,omitempty"` - Markhttpheaderextrawserror string `json:"markhttpheaderextrawserror,omitempty"` - Cmponpush string `json:"cmponpush,omitempty"` - Conmultiplex string `json:"conmultiplex,omitempty"` - Maxreusepool int `json:"maxreusepool,omitempty"` - Dropextracrlf string `json:"dropextracrlf,omitempty"` - Incomphdrdelay int `json:"incomphdrdelay,omitempty"` - Websocket string `json:"websocket,omitempty"` - Rtsptunnel string `json:"rtsptunnel,omitempty"` - Reqtimeout int `json:"reqtimeout,omitempty"` - Adpttimeout string `json:"adpttimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Dropextradata string `json:"dropextradata,omitempty"` - Weblog string `json:"weblog,omitempty"` - Clientiphdrexpr string `json:"clientiphdrexpr,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Persistentetag string `json:"persistentetag,omitempty"` - Http2 string `json:"http2,omitempty"` - Http2direct string `json:"http2direct,omitempty"` - Http2strictcipher string `json:"http2strictcipher,omitempty"` - Http2altsvcframe string `json:"http2altsvcframe,omitempty"` - Altsvc string `json:"altsvc,omitempty"` - Altsvcvalue string `json:"altsvcvalue,omitempty"` - Reusepooltimeout int `json:"reusepooltimeout,omitempty"` - Maxheaderlen int `json:"maxheaderlen,omitempty"` - Maxheaderfieldlen int `json:"maxheaderfieldlen,omitempty"` - Minreusepool int `json:"minreusepool,omitempty"` - Http2maxheaderlistsize int `json:"http2maxheaderlistsize,omitempty"` - Http2maxframesize int `json:"http2maxframesize,omitempty"` - Http2maxconcurrentstreams int `json:"http2maxconcurrentstreams,omitempty"` - Http2initialconnwindowsize int `json:"http2initialconnwindowsize,omitempty"` - Http2initialwindowsize int `json:"http2initialwindowsize,omitempty"` - Http2headertablesize int `json:"http2headertablesize,omitempty"` - Http2minseverconn int `json:"http2minseverconn,omitempty"` - Http2maxpingframespermin int `json:"http2maxpingframespermin,omitempty"` - Http2maxsettingsframespermin int `json:"http2maxsettingsframespermin,omitempty"` - Http2maxresetframespermin int `json:"http2maxresetframespermin,omitempty"` - Http2maxemptyframespermin int `json:"http2maxemptyframespermin,omitempty"` - Http2maxrxresetframespermin int `json:"http2maxrxresetframespermin,omitempty"` - Grpcholdlimit int `json:"grpcholdlimit,omitempty"` - Grpcholdtimeout int `json:"grpcholdtimeout,omitempty"` - Grpclengthdelimitation string `json:"grpclengthdelimitation,omitempty"` - Apdexcltresptimethreshold int `json:"apdexcltresptimethreshold,omitempty"` - Http3 string `json:"http3,omitempty"` - Http3maxheaderfieldsectionsize int `json:"http3maxheaderfieldsectionsize,omitempty"` - Http3maxheadertablesize int `json:"http3maxheadertablesize,omitempty"` - Http3maxheaderblockedstreams int `json:"http3maxheaderblockedstreams,omitempty"` - Http3webtransport string `json:"http3webtransport,omitempty"` - Http3minseverconn int `json:"http3minseverconn,omitempty"` - Httppipelinebuffsize int `json:"httppipelinebuffsize,omitempty"` - Allowonlywordcharactersandhyphen string `json:"allowonlywordcharactersandhyphen,omitempty"` - Hostheadervalidation string `json:"hostheadervalidation,omitempty"` - Maxduplicateheaderfields int `json:"maxduplicateheaderfields,omitempty"` - Passprotocolupgrade string `json:"passprotocolupgrade,omitempty"` - Http2extendedconnect string `json:"http2extendedconnect,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Builtin string `json:"builtin,omitempty"` - Apdexsvrresptimethreshold string `json:"apdexsvrresptimethreshold,omitempty"` - Dropinvalreqswarning string `json:"dropinvalreqswarning,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Reboot struct { + Warm bool `json:"warm,omitempty"` } -type Nslimitidentifier struct { - Limitidentifier string `json:"limitidentifier,omitempty"` - Threshold int `json:"threshold,omitempty"` - Timeslice int `json:"timeslice,omitempty"` - Mode string `json:"mode,omitempty"` - Limittype string `json:"limittype,omitempty"` - Selectorname string `json:"selectorname,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Trapsintimeslice int `json:"trapsintimeslice,omitempty"` - Ngname string `json:"ngname,omitempty"` - Hits string `json:"hits,omitempty"` - Drop string `json:"drop,omitempty"` - Rule string `json:"rule,omitempty"` - Time string `json:"time,omitempty"` - Total string `json:"total,omitempty"` - Trapscomputedintimeslice string `json:"trapscomputedintimeslice,omitempty"` - Computedtraptimeslice string `json:"computedtraptimeslice,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nstimer struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Interval int `json:"interval,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Unit string `json:"unit,omitempty"` } -type Nspbr6 struct { - Name string `json:"name,omitempty"` - Td int `json:"td,omitempty"` - Action string `json:"action,omitempty"` - Srcipv6 bool `json:"srcipv6,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipv6val string `json:"srcipv6val,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` - Destipv6 bool `json:"destipv6,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipv6val string `json:"destipv6val,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Interface string `json:"Interface,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Msr string `json:"msr,omitempty"` - Monitor string `json:"monitor,omitempty"` - Nexthop bool `json:"nexthop,omitempty"` - Nexthopval string `json:"nexthopval,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` - Nexthopvlan int `json:"nexthopvlan,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Detail bool `json:"detail,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Hits string `json:"hits,omitempty"` - Curstate string `json:"curstate,omitempty"` - Totalprobes string `json:"totalprobes,omitempty"` - Totalfailedprobes string `json:"totalfailedprobes,omitempty"` - Failedprobes string `json:"failedprobes,omitempty"` - Monstatcode string `json:"monstatcode,omitempty"` - Monstatparam1 string `json:"monstatparam1,omitempty"` - Monstatparam2 string `json:"monstatparam2,omitempty"` - Monstatparam3 string `json:"monstatparam3,omitempty"` - Data string `json:"data,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nscentralmanagementserver struct { + Activationcode string `json:"activationcode,omitempty"` + Adcpassword string `json:"adcpassword,omitempty"` + Adcusername string `json:"adcusername,omitempty"` + Admserviceconnectionstatus string `json:"admserviceconnectionstatus,omitempty"` + Admserviceenvironment string `json:"admserviceenvironment,omitempty"` + Count float64 `json:"__count,omitempty"` + Customerid string `json:"customerid,omitempty"` + Deviceprofilename string `json:"deviceprofilename,omitempty"` + Instanceid string `json:"instanceid,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Servername string `json:"servername,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` + Validatecert string `json:"validatecert,omitempty"` } -type Nssimpleacl6 struct { - Aclname string `json:"aclname,omitempty"` - Td int `json:"td,omitempty"` - Aclaction string `json:"aclaction,omitempty"` - Srcipv6 string `json:"srcipv6,omitempty"` - Destport int `json:"destport,omitempty"` - Protocol string `json:"protocol,omitempty"` - Ttl int `json:"ttl,omitempty"` - Estsessions bool `json:"estsessions,omitempty"` - Hits string `json:"hits,omitempty"` +type Nsencryptionparams struct { + Keyvalue string `json:"keyvalue,omitempty"` + Method string `json:"method,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } type Nssourceroutecachetable struct { - Sourceip string `json:"sourceip,omitempty"` - Sourcemac string `json:"sourcemac,omitempty"` - Vlan string `json:"vlan,omitempty"` - Interface string `json:"Interface,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + InterfaceField string `json:"Interface,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sourceip string `json:"sourceip,omitempty"` + Sourcemac string `json:"sourcemac,omitempty"` + Vlan int `json:"vlan,omitempty"` } type Nstimezone struct { - Value string `json:"value,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Value string `json:"value,omitempty"` } -type Nsconnectiontable struct { - Filterexpression string `json:"filterexpression,omitempty"` - Link bool `json:"link,omitempty"` - Filtername bool `json:"filtername,omitempty"` - Detail []string `json:"detail,omitempty"` - Listen bool `json:"listen,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Sourceip string `json:"sourceip,omitempty"` - Sourceport string `json:"sourceport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Svctype string `json:"svctype,omitempty"` - Idletime string `json:"idletime,omitempty"` - State string `json:"state,omitempty"` - Linksourceip string `json:"linksourceip,omitempty"` - Linksourceport string `json:"linksourceport,omitempty"` - Linkdestip string `json:"linkdestip,omitempty"` - Linkdestport string `json:"linkdestport,omitempty"` - Linkservicetype string `json:"linkservicetype,omitempty"` - Linkidletime string `json:"linkidletime,omitempty"` - Linkstate string `json:"linkstate,omitempty"` - Entityname string `json:"entityname,omitempty"` - Linkentityname string `json:"linkentityname,omitempty"` - Connid string `json:"connid,omitempty"` - Linkconnid string `json:"linkconnid,omitempty"` - Connproperties string `json:"connproperties,omitempty"` - Optionflags string `json:"optionflags,omitempty"` - Nswsvalue string `json:"nswsvalue,omitempty"` - Peerwsvalue string `json:"peerwsvalue,omitempty"` - Mss string `json:"mss,omitempty"` - Retxretrycnt string `json:"retxretrycnt,omitempty"` - Rcvwnd string `json:"rcvwnd,omitempty"` - Advwnd string `json:"advwnd,omitempty"` - Sndcwnd string `json:"sndcwnd,omitempty"` - Iss string `json:"iss,omitempty"` - Irs string `json:"irs,omitempty"` - Rcvnxt string `json:"rcvnxt,omitempty"` - Maxack string `json:"maxack,omitempty"` - Sndnxt string `json:"sndnxt,omitempty"` - Sndunack string `json:"sndunack,omitempty"` - Httpendseq string `json:"httpendseq,omitempty"` - Httpstate string `json:"httpstate,omitempty"` - Trcount string `json:"trcount,omitempty"` - Priority string `json:"priority,omitempty"` - Httpreqver string `json:"httpreqver,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Httprspcode string `json:"httprspcode,omitempty"` - Rttsmoothed string `json:"rttsmoothed,omitempty"` - Rttvariance string `json:"rttvariance,omitempty"` - Outoforderpkts string `json:"outoforderpkts,omitempty"` - Linkoptionflag string `json:"linkoptionflag,omitempty"` - Linknswsvalue string `json:"linknswsvalue,omitempty"` - Linkpeerwsvalue string `json:"linkpeerwsvalue,omitempty"` - Targetnodeidnnm string `json:"targetnodeidnnm,omitempty"` - Sourcenodeidnnm string `json:"sourcenodeidnnm,omitempty"` - Channelidnnm string `json:"channelidnnm,omitempty"` - Msgversionnnm string `json:"msgversionnnm,omitempty"` - Td string `json:"td,omitempty"` - Maxrcvbuf string `json:"maxrcvbuf,omitempty"` - Linkmaxrcvbuf string `json:"linkmaxrcvbuf,omitempty"` - Rxqsize string `json:"rxqsize,omitempty"` - Linkrxqsize string `json:"linkrxqsize,omitempty"` - Maxsndbuf string `json:"maxsndbuf,omitempty"` - Linkmaxsndbuf string `json:"linkmaxsndbuf,omitempty"` - Txqsize string `json:"txqsize,omitempty"` - Linktxqsize string `json:"linktxqsize,omitempty"` - Flavor string `json:"flavor,omitempty"` - Linkflavor string `json:"linkflavor,omitempty"` - Bwestimate string `json:"bwestimate,omitempty"` - Linkbwestimate string `json:"linkbwestimate,omitempty"` - Rttmin string `json:"rttmin,omitempty"` - Linkrttmin string `json:"linkrttmin,omitempty"` - Name string `json:"name,omitempty"` - Linkname string `json:"linkname,omitempty"` - Tcpmode string `json:"tcpmode,omitempty"` - Linktcpmode string `json:"linktcpmode,omitempty"` - Realtimertt string `json:"realtimertt,omitempty"` - Linkrealtimertt string `json:"linkrealtimertt,omitempty"` - Sndbuf string `json:"sndbuf,omitempty"` - Linksndbuf string `json:"linksndbuf,omitempty"` - Nsbtcpwaitq string `json:"nsbtcpwaitq,omitempty"` - Linknsbtcpwaitq string `json:"linknsbtcpwaitq,omitempty"` - Nsbretxq string `json:"nsbretxq,omitempty"` - Linknsbretxq string `json:"linknsbretxq,omitempty"` - Sackblocks string `json:"sackblocks,omitempty"` - Linksackblocks string `json:"linksackblocks,omitempty"` - Congstate string `json:"congstate,omitempty"` - Linkcongstate string `json:"linkcongstate,omitempty"` - Sndrecoverle string `json:"sndrecoverle,omitempty"` - Linksndrecoverle string `json:"linksndrecoverle,omitempty"` - Creditsinbytes string `json:"creditsinbytes,omitempty"` - Linkcredits string `json:"linkcredits,omitempty"` - Rateinbytes string `json:"rateinbytes,omitempty"` - Linkrateinbytes string `json:"linkrateinbytes,omitempty"` - Rateschedulerqueue string `json:"rateschedulerqueue,omitempty"` - Linkrateschedulerqueue string `json:"linkrateschedulerqueue,omitempty"` - Burstratecontrol string `json:"burstratecontrol,omitempty"` - Linkburstratecontrol string `json:"linkburstratecontrol,omitempty"` - Cqabifavg string `json:"cqabifavg,omitempty"` - Cqathruputavg string `json:"cqathruputavg,omitempty"` - Cqarcvwndavg string `json:"cqarcvwndavg,omitempty"` - Cqaiai1mspct string `json:"cqaiai1mspct,omitempty"` - Cqaiai2mspct string `json:"cqaiai2mspct,omitempty"` - Cqasamples string `json:"cqasamples,omitempty"` - Cqaiaisamples string `json:"cqaiaisamples,omitempty"` - Cqanetclass string `json:"cqanetclass,omitempty"` - Cqaccl string `json:"cqaccl,omitempty"` - Cqacsq string `json:"cqacsq,omitempty"` - Cqaiaiavg string `json:"cqaiaiavg,omitempty"` - Cqaisiavg string `json:"cqaisiavg,omitempty"` - Cqarcvwndmin string `json:"cqarcvwndmin,omitempty"` - Cqaretxcorr string `json:"cqaretxcorr,omitempty"` - Cqaretxcong string `json:"cqaretxcong,omitempty"` - Cqaretxpackets string `json:"cqaretxpackets,omitempty"` - Cqaloaddelayavg string `json:"cqaloaddelayavg,omitempty"` - Cqanoisedelayavg string `json:"cqanoisedelayavg,omitempty"` - Cqarttmax string `json:"cqarttmax,omitempty"` - Cqarttmin string `json:"cqarttmin,omitempty"` - Cqarttavg string `json:"cqarttavg,omitempty"` - Adaptivetcpprofname string `json:"adaptivetcpprofname,omitempty"` - Outoforderblocks string `json:"outoforderblocks,omitempty"` - Outoforderflushedcount string `json:"outoforderflushedcount,omitempty"` - Outoforderbytes string `json:"outoforderbytes,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsacl6 struct { + Acl6action string `json:"acl6action,omitempty"` + Acl6name string `json:"acl6name,omitempty"` + Aclaction string `json:"aclaction,omitempty"` + Aclassociate []string `json:"aclassociate,omitempty"` + Count float64 `json:"__count,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipv6 bool `json:"destipv6,omitempty"` + Destipv6val string `json:"destipv6val,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Dfdhash string `json:"dfdhash,omitempty"` + Dfdprefix int `json:"dfdprefix,omitempty"` + Established bool `json:"established,omitempty"` + Hits int `json:"hits,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + InterfaceField string `json:"Interface,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Logstate string `json:"logstate,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Priority int `json:"priority,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Ratelimit int `json:"ratelimit,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipv6 bool `json:"srcipv6,omitempty"` + Srcipv6val string `json:"srcipv6val,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + State string `json:"state,omitempty"` + Stateful string `json:"stateful,omitempty"` + Td int `json:"td,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` +} + +type Nsappflowparam struct { + Clienttrafficonly string `json:"clienttrafficonly,omitempty"` + Httpcookie string `json:"httpcookie,omitempty"` + Httphost string `json:"httphost,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Httpreferer string `json:"httpreferer,omitempty"` + Httpurl string `json:"httpurl,omitempty"` + Httpuseragent string `json:"httpuseragent,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Templaterefresh int `json:"templaterefresh,omitempty"` + Udppmtu int `json:"udppmtu,omitempty"` } -type Nsevents struct { - Eventno int `json:"eventno,omitempty"` - Time string `json:"time,omitempty"` - Eventcode string `json:"eventcode,omitempty"` - Devid string `json:"devid,omitempty"` - Devname string `json:"devname,omitempty"` - Text string `json:"text,omitempty"` - Data0 string `json:"data0,omitempty"` - Data1 string `json:"data1,omitempty"` - Data2 string `json:"data2,omitempty"` - Data3 string `json:"data3,omitempty"` +type Nsvariable struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Expires int `json:"expires,omitempty"` + Iffull string `json:"iffull,omitempty"` + Ifnovalue string `json:"ifnovalue,omitempty"` + Ifvaluetoobig string `json:"ifvaluetoobig,omitempty"` + Init string `json:"init,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Scope string `json:"scope,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type Nsconsoleloginprompt struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Promptstring string `json:"promptstring,omitempty"` } type Nshostname struct { - Hostname string `json:"hostname,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Hostname string `json:"hostname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` } -type Nslimitsessions struct { - Limitidentifier string `json:"limitidentifier,omitempty"` - Detail bool `json:"detail,omitempty"` - Timeout string `json:"timeout,omitempty"` - Hits string `json:"hits,omitempty"` - Drop string `json:"drop,omitempty"` - Number string `json:"number,omitempty"` - Name string `json:"name,omitempty"` - Unit string `json:"unit,omitempty"` - Flags string `json:"flags,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Maxbandwidth string `json:"maxbandwidth,omitempty"` - Selectoripv61 string `json:"selectoripv61,omitempty"` - Selectoripv62 string `json:"selectoripv62,omitempty"` - Flag string `json:"flag,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsjob struct { + Count float64 `json:"__count,omitempty"` + Errorcode int `json:"errorcode,omitempty"` + Id int `json:"id,omitempty"` + Message string `json:"message,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Progress string `json:"progress,omitempty"` + Response string `json:"response,omitempty"` + Status string `json:"status,omitempty"` + Timeelapsed int `json:"timeelapsed,omitempty"` } -type Nsmgmtparam struct { - Mgmthttpport int `json:"mgmthttpport,omitempty"` - Mgmthttpsport int `json:"mgmthttpsport,omitempty"` - Httpdmaxclients int `json:"httpdmaxclients,omitempty"` - Httpdmaxreqworkers int `json:"httpdmaxreqworkers,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsappflowcollector struct { + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Port int `json:"port,omitempty"` } -type Nssurgeq struct { - Name string `json:"name,omitempty"` - Servername string `json:"servername,omitempty"` - Port int `json:"port,omitempty"` +type Nslimitselector struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule []string `json:"rule,omitempty"` + Selectorname string `json:"selectorname,omitempty"` } -type Nstcpbufparam struct { - Size int `json:"size,omitempty"` - Memlimit int `json:"memlimit"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` +type Nstimeout struct { + Anyclient int `json:"anyclient,omitempty"` + Anyserver int `json:"anyserver,omitempty"` + Anytcpclient int `json:"anytcpclient,omitempty"` + Anytcpserver int `json:"anytcpserver,omitempty"` + Client int `json:"client,omitempty"` + Halfclose int `json:"halfclose,omitempty"` + Httpclient int `json:"httpclient,omitempty"` + Httpserver int `json:"httpserver,omitempty"` + Newconnidletimeout int `json:"newconnidletimeout,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nontcpzombie int `json:"nontcpzombie,omitempty"` + Reducedfintimeout int `json:"reducedfintimeout,omitempty"` + Reducedrsttimeout int `json:"reducedrsttimeout,omitempty"` + Server int `json:"server,omitempty"` + Tcpclient int `json:"tcpclient,omitempty"` + Tcpserver int `json:"tcpserver,omitempty"` + Zombie int `json:"zombie,omitempty"` } -type Nsxmlnamespace struct { - Prefix string `json:"prefix,omitempty"` - Namespace string `json:"Namespace,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nstcpparam struct { + Ackonpush string `json:"ackonpush,omitempty"` + Autosyncookietimeout int `json:"autosyncookietimeout,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Compacttcpoptionnoop string `json:"compacttcpoptionnoop,omitempty"` + Connflushifnomem string `json:"connflushifnomem,omitempty"` + Connflushthres int `json:"connflushthres,omitempty"` + Delayedack int `json:"delayedack,omitempty"` + Delinkclientserveronrst string `json:"delinkclientserveronrst,omitempty"` + Downstaterst string `json:"downstaterst,omitempty"` + Enhancedisngeneration string `json:"enhancedisngeneration,omitempty"` + Feature string `json:"feature,omitempty"` + Initialcwnd int `json:"initialcwnd,omitempty"` + Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` + Learnvsvrmss string `json:"learnvsvrmss,omitempty"` + Limitedpersist string `json:"limitedpersist,omitempty"` + Maxburst int `json:"maxburst,omitempty"` + Maxdynserverprobes int `json:"maxdynserverprobes,omitempty"` + Maxpktpermss int `json:"maxpktpermss,omitempty"` + Maxsynackretx int `json:"maxsynackretx,omitempty"` + Maxsynhold int `json:"maxsynhold,omitempty"` + Maxsynholdperprobe int `json:"maxsynholdperprobe,omitempty"` + Maxtimewaitconn int `json:"maxtimewaitconn,omitempty"` + Minrto int `json:"minrto,omitempty"` + Mptcpchecksum string `json:"mptcpchecksum,omitempty"` + Mptcpclosemptcpsessiononlastsfclose string `json:"mptcpclosemptcpsessiononlastsfclose,omitempty"` + Mptcpconcloseonpassivesf string `json:"mptcpconcloseonpassivesf,omitempty"` + Mptcpfastcloseoption string `json:"mptcpfastcloseoption,omitempty"` + Mptcpimmediatesfcloseonfin string `json:"mptcpimmediatesfcloseonfin,omitempty"` + Mptcpmaxpendingsf int `json:"mptcpmaxpendingsf,omitempty"` + Mptcpmaxsf int `json:"mptcpmaxsf,omitempty"` + Mptcppendingjointhreshold int `json:"mptcppendingjointhreshold,omitempty"` + Mptcpreliableaddaddr string `json:"mptcpreliableaddaddr,omitempty"` + Mptcprtostoswitchsf int `json:"mptcprtostoswitchsf,omitempty"` + Mptcpsendsfresetoption string `json:"mptcpsendsfresetoption,omitempty"` + Mptcpsfreplacetimeout int `json:"mptcpsfreplacetimeout,omitempty"` + Mptcpsftimeout int `json:"mptcpsftimeout,omitempty"` + Mptcpusebackupondss string `json:"mptcpusebackupondss,omitempty"` + Msslearndelay int `json:"msslearndelay,omitempty"` + Msslearninterval int `json:"msslearninterval,omitempty"` + Nagle string `json:"nagle,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oooqsize int `json:"oooqsize,omitempty"` + Pktperretx int `json:"pktperretx,omitempty"` + Recvbuffsize int `json:"recvbuffsize,omitempty"` + Rfc5961chlgacklimit int `json:"rfc5961chlgacklimit,omitempty"` + Sack string `json:"sack,omitempty"` + Sendresetreasoncode string `json:"sendresetreasoncode,omitempty"` + Slowstartincr int `json:"slowstartincr,omitempty"` + Synattackdetection string `json:"synattackdetection,omitempty"` + Synholdfastgiveup int `json:"synholdfastgiveup,omitempty"` + Tcpfastopencookietimeout int `json:"tcpfastopencookietimeout,omitempty"` + Tcpfintimeout int `json:"tcpfintimeout,omitempty"` + Tcpmaxretries int `json:"tcpmaxretries,omitempty"` + Ws string `json:"ws,omitempty"` + Wsval int `json:"wsval,omitempty"` } -type Nssavedconfig struct { - Textblob string `json:"textblob,omitempty"` +type Nsservicefunction struct { + Count float64 `json:"__count,omitempty"` + Ingressvlan int `json:"ingressvlan,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Servicefunctionname string `json:"servicefunctionname,omitempty"` +} + +type Nschannelparam struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Vfautorecover string `json:"vfautorecover,omitempty"` } -type Shutdown struct { +type Nsencryptionkey struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Iv string `json:"iv,omitempty"` + Keyvalue string `json:"keyvalue,omitempty"` + Method string `json:"method,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Padding string `json:"padding,omitempty"` } -type Nsacls6 struct { - Type string `json:"type,omitempty"` +type Nskeymanagerproxy struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Port int `json:"port,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` + Status int `json:"status,omitempty"` } -type Nsdhcpparams struct { - Dhcpclient string `json:"dhcpclient,omitempty"` - Saveroute string `json:"saveroute,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Hostrtgw string `json:"hostrtgw,omitempty"` - Running string `json:"running,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsicapprofile struct { + Allow204 string `json:"allow204,omitempty"` + Connectionkeepalive string `json:"connectionkeepalive,omitempty"` + Count float64 `json:"__count,omitempty"` + Hostheader string `json:"hostheader,omitempty"` + Inserthttprequest string `json:"inserthttprequest,omitempty"` + Inserticapheaders string `json:"inserticapheaders,omitempty"` + Inspecthttp2 string `json:"inspecthttp2,omitempty"` + Logaction string `json:"logaction,omitempty"` + Mode string `json:"mode,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preview string `json:"preview,omitempty"` + Previewlength int `json:"previewlength,omitempty"` + Queryparams string `json:"queryparams,omitempty"` + Reqtimeout int `json:"reqtimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Uri string `json:"uri,omitempty"` + Useragent string `json:"useragent,omitempty"` } -type Nsextensionextensionfunctionbinding struct { - Extensionfunctionname string `json:"extensionfunctionname,omitempty"` - Extensionfunctionlinenumber int `json:"extensionfunctionlinenumber,omitempty"` - Extensionfunctionclasstype string `json:"extensionfunctionclasstype,omitempty"` - Extensionfunctionreturntype string `json:"extensionfunctionreturntype,omitempty"` - Activeextensionfunction int `json:"activeextensionfunction,omitempty"` - Extensionfunctionargtype []string `json:"extensionfunctionargtype,omitempty"` - Extensionfuncdescription string `json:"extensionfuncdescription,omitempty"` - Extensionfunctionargcount int `json:"extensionfunctionargcount,omitempty"` - Extensionfunctionclasses []string `json:"extensionfunctionclasses,omitempty"` - Extensionfunctionclassescount int `json:"extensionfunctionclassescount,omitempty"` - Extensionfunctionallparams []string `json:"extensionfunctionallparams,omitempty"` - Extensionfunctionallparamscount int `json:"extensionfunctionallparamscount,omitempty"` - Name string `json:"name,omitempty"` +type Nssimpleacl struct { + Aclaction string `json:"aclaction,omitempty"` + Aclname string `json:"aclname,omitempty"` + Count float64 `json:"__count,omitempty"` + Destport int `json:"destport,omitempty"` + Estsessions bool `json:"estsessions,omitempty"` + Hits int `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocol string `json:"protocol,omitempty"` + Srcip string `json:"srcip,omitempty"` + Td int `json:"td,omitempty"` + Ttl int `json:"ttl,omitempty"` } -type Nsnextgenapi struct { - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsvariablevalues struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Variabledata string `json:"variabledata,omitempty"` + Variablekey string `json:"variablekey,omitempty"` + Variablevalue string `json:"variablevalue,omitempty"` } -type Nsparam struct { - Httpport []int `json:"httpport,omitempty"` - Maxconn int `json:"maxconn"` - Maxreq int `json:"maxreq"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cookieversion string `json:"cookieversion"` - Securecookie string `json:"securecookie,omitempty"` - Pmtumin int `json:"pmtumin,omitempty"` - Pmtutimeout int `json:"pmtutimeout,omitempty"` - Ftpportrange string `json:"ftpportrange,omitempty"` - Crportrange string `json:"crportrange,omitempty"` - Timezone string `json:"timezone,omitempty"` - Grantquotamaxclient int `json:"grantquotamaxclient"` - Exclusivequotamaxclient int `json:"exclusivequotamaxclient"` - Grantquotaspillover int `json:"grantquotaspillover,omitempty"` - Exclusivequotaspillover int `json:"exclusivequotaspillover"` - Useproxyport string `json:"useproxyport,omitempty"` - Internaluserlogin string `json:"internaluserlogin,omitempty"` - Aftpallowrandomsourceport string `json:"aftpallowrandomsourceport,omitempty"` - Icaports []int `json:"icaports,omitempty"` - Tcpcip string `json:"tcpcip,omitempty"` - Servicepathingressvlan int `json:"servicepathingressvlan,omitempty"` - Secureicaports []int `json:"secureicaports,omitempty"` - Mgmthttpport int `json:"mgmthttpport,omitempty"` - Mgmthttpsport int `json:"mgmthttpsport,omitempty"` - Proxyprotocol string `json:"proxyprotocol,omitempty"` - Advancedanalyticsstats string `json:"advancedanalyticsstats,omitempty"` - Ipttl int `json:"ipttl,omitempty"` - Autoscaleoption string `json:"autoscaleoption,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nspartitionbinding struct { - Partitionname string `json:"partitionname,omitempty"` +type Nspbrs struct { } -type Nspartitionvxlanbinding struct { - Vxlan int `json:"vxlan,omitempty"` - Partitionname string `json:"partitionname,omitempty"` +type Nsweblogparam struct { + Buffersizemb int `json:"buffersizemb,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Customreqhdrs []string `json:"customreqhdrs,omitempty"` + Customrsphdrs []string `json:"customrsphdrs,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Nspbr struct { - Name string `json:"name,omitempty"` - Action string `json:"action,omitempty"` - Td int `json:"td,omitempty"` - Srcip bool `json:"srcip,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipval string `json:"srcipval,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` - Destip bool `json:"destip,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipval string `json:"destipval,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Nexthop bool `json:"nexthop,omitempty"` - Nexthopval string `json:"nexthopval,omitempty"` - Iptunnel bool `json:"iptunnel,omitempty"` - Iptunnelname string `json:"iptunnelname,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` - Targettd int `json:"targettd,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Interface string `json:"Interface,omitempty"` - Priority int `json:"priority,omitempty"` - Msr string `json:"msr,omitempty"` - Monitor string `json:"monitor,omitempty"` - State string `json:"state,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Detail bool `json:"detail,omitempty"` - Hits string `json:"hits,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Curstate string `json:"curstate,omitempty"` - Totalprobes string `json:"totalprobes,omitempty"` - Totalfailedprobes string `json:"totalfailedprobes,omitempty"` - Failedprobes string `json:"failedprobes,omitempty"` - Monstatcode string `json:"monstatcode,omitempty"` - Monstatparam1 string `json:"monstatparam1,omitempty"` - Monstatparam2 string `json:"monstatparam2,omitempty"` - Monstatparam3 string `json:"monstatparam3,omitempty"` - Data string `json:"data,omitempty"` +type Nslicenseactivationdata struct { + Filename string `json:"filename,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Nsacl struct { - Aclname string `json:"aclname,omitempty"` - Aclaction string `json:"aclaction,omitempty"` - Td int `json:"td,omitempty"` - Srcip bool `json:"srcip,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipval string `json:"srcipval,omitempty"` - Srcipdataset string `json:"srcipdataset,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` - Srcportdataset string `json:"srcportdataset,omitempty"` - Destip bool `json:"destip,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipval string `json:"destipval,omitempty"` - Destipdataset string `json:"destipdataset,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Destportdataset string `json:"destportdataset,omitempty"` - Ttl int `json:"ttl,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Interface string `json:"Interface,omitempty"` - Established bool `json:"established,omitempty"` - Icmptype int `json:"icmptype,omitempty"` - Icmpcode int `json:"icmpcode,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Logstate string `json:"logstate,omitempty"` - Ratelimit int `json:"ratelimit,omitempty"` - Type string `json:"type,omitempty"` - Dfdhash string `json:"dfdhash,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Stateful string `json:"stateful,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Aclassociate string `json:"aclassociate,omitempty"` - Aclchildcount string `json:"aclchildcount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsevents struct { + Count float64 `json:"__count,omitempty"` + Data0 int `json:"data0,omitempty"` + Data1 int `json:"data1,omitempty"` + Data2 int `json:"data2,omitempty"` + Data3 int `json:"data3,omitempty"` + Devid int `json:"devid,omitempty"` + Devname string `json:"devname,omitempty"` + Eventcode int `json:"eventcode,omitempty"` + Eventno int `json:"eventno,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Text string `json:"text,omitempty"` + Time int `json:"time,omitempty"` } -type Nsacls struct { - Type string `json:"type,omitempty"` +type Nsmigration struct { + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Dumpsession string `json:"dumpsession,omitempty"` + Migdfdsessionsactive int `json:"migdfdsessionsactive,omitempty"` + Migdfdsessionsactiverollback int `json:"migdfdsessionsactiverollback,omitempty"` + Migdfdsessionsallocated int `json:"migdfdsessionsallocated,omitempty"` + Migdfdsessionsallocatedrollback int `json:"migdfdsessionsallocatedrollback,omitempty"` + Mighastateflag int `json:"mighastateflag,omitempty"` + Migl4sessionsactive int `json:"migl4sessionsactive,omitempty"` + Migl4sessionsactiverollback int `json:"migl4sessionsactiverollback,omitempty"` + Migl4sessionsallocated int `json:"migl4sessionsallocated,omitempty"` + Migl4sessionsallocatedrollback int `json:"migl4sessionsallocatedrollback,omitempty"` + Migrationendtime string `json:"migrationendtime,omitempty"` + Migrationrollbackstarttime string `json:"migrationrollbackstarttime,omitempty"` + Migrationstarttime string `json:"migrationstarttime,omitempty"` + Migrationstatus string `json:"migrationstatus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` + Timeout int `json:"timeout,omitempty"` } -type Nscentralmanagementserver struct { - Type string `json:"type,omitempty"` - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Activationcode string `json:"activationcode,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Servername string `json:"servername,omitempty"` - Validatecert string `json:"validatecert,omitempty"` - Deviceprofilename string `json:"deviceprofilename,omitempty"` - Adcusername string `json:"adcusername,omitempty"` - Adcpassword string `json:"adcpassword,omitempty"` - Instanceid string `json:"instanceid,omitempty"` - Customerid string `json:"customerid,omitempty"` - Admserviceenvironment string `json:"admserviceenvironment,omitempty"` - Admserviceconnectionstatus string `json:"admserviceconnectionstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nshmackey struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Digest string `json:"digest,omitempty"` + Keyvalue string `json:"keyvalue,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Nsdhcpip struct { +type Nspbr6 struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate int `json:"curstate,omitempty"` + Data bool `json:"data,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipv6 bool `json:"destipv6,omitempty"` + Destipv6val string `json:"destipv6val,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Detail bool `json:"detail,omitempty"` + Failedprobes int `json:"failedprobes,omitempty"` + Hits int `json:"hits,omitempty"` + InterfaceField string `json:"Interface,omitempty"` + Iptunnel string `json:"iptunnel,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Monitor string `json:"monitor,omitempty"` + Monstatcode int `json:"monstatcode,omitempty"` + Monstatparam1 int `json:"monstatparam1,omitempty"` + Monstatparam2 int `json:"monstatparam2,omitempty"` + Monstatparam3 int `json:"monstatparam3,omitempty"` + Msr string `json:"msr,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nexthop bool `json:"nexthop,omitempty"` + Nexthopval string `json:"nexthopval,omitempty"` + Nexthopvlan int `json:"nexthopvlan,omitempty"` + Ownergroup string `json:"ownergroup,omitempty"` + Priority int `json:"priority,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipv6 bool `json:"srcipv6,omitempty"` + Srcipv6val string `json:"srcipv6val,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + State string `json:"state,omitempty"` + Td int `json:"td,omitempty"` + Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + Totalprobes int `json:"totalprobes,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` + Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` } -type Nsrollbackcmd struct { - Filename string `json:"filename,omitempty"` - Outtype string `json:"outtype,omitempty"` +type Nsacls struct { + TypeField string `json:"type,omitempty"` +} + +type Nsdhcpparams struct { + Dhcpclient string `json:"dhcpclient,omitempty"` + Hostrtgw string `json:"hostrtgw,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Running bool `json:"running,omitempty"` + Saveroute string `json:"saveroute,omitempty"` } -type Nsservicepathbinding struct { - Servicepathname string `json:"servicepathname,omitempty"` +type Nssurgeq struct { + Name string `json:"name,omitempty"` + Port int `json:"port,omitempty"` + Servername string `json:"servername,omitempty"` } -type Nstcpparam struct { - Ws string `json:"ws,omitempty"` - Wsval int `json:"wsval"` - Sack string `json:"sack,omitempty"` - Learnvsvrmss string `json:"learnvsvrmss,omitempty"` - Maxburst int `json:"maxburst,omitempty"` - Initialcwnd int `json:"initialcwnd,omitempty"` - Recvbuffsize int `json:"recvbuffsize,omitempty"` - Delayedack int `json:"delayedack,omitempty"` - Downstaterst string `json:"downstaterst,omitempty"` - Nagle string `json:"nagle,omitempty"` - Limitedpersist string `json:"limitedpersist,omitempty"` - Oooqsize int `json:"oooqsize"` - Ackonpush string `json:"ackonpush,omitempty"` - Maxpktpermss int `json:"maxpktpermss"` - Pktperretx int `json:"pktperretx,omitempty"` - Minrto int `json:"minrto,omitempty"` - Slowstartincr int `json:"slowstartincr,omitempty"` - Maxdynserverprobes int `json:"maxdynserverprobes,omitempty"` - Synholdfastgiveup int `json:"synholdfastgiveup,omitempty"` - Maxsynholdperprobe int `json:"maxsynholdperprobe,omitempty"` - Maxsynhold int `json:"maxsynhold,omitempty"` - Msslearninterval int `json:"msslearninterval,omitempty"` - Msslearndelay int `json:"msslearndelay,omitempty"` - Maxtimewaitconn int `json:"maxtimewaitconn,omitempty"` - Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` - Maxsynackretx int `json:"maxsynackretx,omitempty"` - Synattackdetection string `json:"synattackdetection,omitempty"` - Connflushifnomem string `json:"connflushifnomem,omitempty"` - Connflushthres int `json:"connflushthres,omitempty"` - Mptcpconcloseonpassivesf string `json:"mptcpconcloseonpassivesf,omitempty"` - Mptcpchecksum string `json:"mptcpchecksum,omitempty"` - Mptcpsftimeout int `json:""` - Mptcpsfreplacetimeout int `json:"mptcpsfreplacetimeout"` - Mptcpmaxsf int `json:"mptcpmaxsf,omitempty"` - Mptcpmaxpendingsf int `json:"mptcpmaxpendingsf"` - Mptcppendingjointhreshold int `json:"mptcppendingjointhreshold"` - Mptcprtostoswitchsf int `json:"mptcprtostoswitchsf,omitempty"` - Mptcpusebackupondss string `json:"mptcpusebackupondss,omitempty"` - Tcpmaxretries int `json:"tcpmaxretries,omitempty"` - Mptcpimmediatesfcloseonfin string `json:"mptcpimmediatesfcloseonfin,omitempty"` - Mptcpclosemptcpsessiononlastsfclose string `json:"mptcpclosemptcpsessiononlastsfclose,omitempty"` - Mptcpsendsfresetoption string `json:"mptcpsendsfresetoption,omitempty"` - Mptcpfastcloseoption string `json:"mptcpfastcloseoption,omitempty"` - Mptcpreliableaddaddr string `json:"mptcpreliableaddaddr,omitempty"` - Tcpfastopencookietimeout int `json:"tcpfastopencookietimeout"` - Autosyncookietimeout int `json:"autosyncookietimeout,omitempty"` - Tcpfintimeout int `json:"tcpfintimeout,omitempty"` - Compacttcpoptionnoop string `json:"compacttcpoptionnoop,omitempty"` - Delinkclientserveronrst string `json:"delinkclientserveronrst,omitempty"` - Rfc5961chlgacklimit int `json:"rfc5961chlgacklimit,omitempty"` - Enhancedisngeneration string `json:"enhancedisngeneration,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsnextgenapi struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` } -type Nsvpxparam struct { - Masterclockcpu1 string `json:"masterclockcpu1,omitempty"` - Cpuyield string `json:"cpuyield,omitempty"` - Ownernode int `json:"ownernode"` - Kvmvirtiomultiqueue string `json:"kvmvirtiomultiqueue,omitempty"` - Vpxenvironment string `json:"vpxenvironment,omitempty"` - Memorystatus string `json:"memorystatus,omitempty"` - Cloudproductcode string `json:"cloudproductcode,omitempty"` - Vpxoemcode string `json:"vpxoemcode,omitempty"` - Technicalsupportpin string `json:"technicalsupportpin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsxmlnamespace struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Namespace string `json:"Namespace,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Prefix string `json:"prefix,omitempty"` } -type Nstcpprofile struct { - Name string `json:"name,omitempty"` - Ws string `json:"ws,omitempty"` - Sack string `json:"sack,omitempty"` - Wsval int `json:"wsval,omitempty"` - Nagle string `json:"nagle,omitempty"` - Ackonpush string `json:"ackonpush,omitempty"` - Mss int `json:"mss,omitempty"` - Maxburst int `json:"maxburst,omitempty"` - Initialcwnd int `json:"initialcwnd,omitempty"` - Delayedack int `json:"delayedack,omitempty"` - Oooqsize int `json:"oooqsize,omitempty"` - Maxpktpermss int `json:"maxpktpermss,omitempty"` - Pktperretx int `json:"pktperretx,omitempty"` - Minrto int `json:"minrto,omitempty"` - Slowstartincr int `json:"slowstartincr,omitempty"` - Buffersize int `json:"buffersize,omitempty"` - Syncookie string `json:"syncookie,omitempty"` - Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` - Flavor string `json:"flavor,omitempty"` - Dynamicreceivebuffering string `json:"dynamicreceivebuffering,omitempty"` - Ka string `json:"ka,omitempty"` - Kaconnidletime int `json:"kaconnidletime,omitempty"` - Kamaxprobes int `json:"kamaxprobes,omitempty"` - Kaprobeinterval int `json:"kaprobeinterval,omitempty"` - Sendbuffsize int `json:"sendbuffsize,omitempty"` - Mptcp string `json:"mptcp,omitempty"` - Establishclientconn string `json:"establishclientconn,omitempty"` - Tcpsegoffload string `json:"tcpsegoffload,omitempty"` - Rfc5961compliance string `json:"rfc5961compliance,omitempty"` - Rstwindowattenuate string `json:"rstwindowattenuate,omitempty"` - Rstmaxack string `json:"rstmaxack,omitempty"` - Spoofsyndrop string `json:"spoofsyndrop,omitempty"` - Ecn string `json:"ecn,omitempty"` - Mptcpdropdataonpreestsf string `json:"mptcpdropdataonpreestsf,omitempty"` - Mptcpfastopen string `json:"mptcpfastopen,omitempty"` - Mptcpsessiontimeout int `json:"mptcpsessiontimeout,omitempty"` - Timestamp string `json:"timestamp,omitempty"` - Dsack string `json:"dsack,omitempty"` - Ackaggregation string `json:"ackaggregation,omitempty"` - Frto string `json:"frto,omitempty"` - Maxcwnd int `json:"maxcwnd,omitempty"` - Fack string `json:"fack,omitempty"` - Tcpmode string `json:"tcpmode,omitempty"` - Tcpfastopen string `json:"tcpfastopen,omitempty"` - Hystart string `json:"hystart,omitempty"` - Dupackthresh int `json:"dupackthresh,omitempty"` - Burstratecontrol string `json:"burstratecontrol,omitempty"` - Tcprate int `json:"tcprate,omitempty"` - Rateqmax int `json:"rateqmax,omitempty"` - Drophalfclosedconnontimeout string `json:"drophalfclosedconnontimeout,omitempty"` - Dropestconnontimeout string `json:"dropestconnontimeout,omitempty"` - Applyadaptivetcp string `json:"applyadaptivetcp,omitempty"` - Tcpfastopencookiesize int `json:"tcpfastopencookiesize,omitempty"` - Taillossprobe string `json:"taillossprobe,omitempty"` - Clientiptcpoption string `json:"clientiptcpoption,omitempty"` - Clientiptcpoptionnumber int `json:"clientiptcpoptionnumber,omitempty"` - Mpcapablecbit string `json:"mpcapablecbit,omitempty"` - Sendclientportintcpoption string `json:"sendclientportintcpoption,omitempty"` - Slowstartthreshold int `json:"slowstartthreshold,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nstimerpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Vserver string `json:"vserver,omitempty"` - Samplesize uint32 `json:"samplesize,omitempty"` - Threshold uint32 `json:"threshold,omitempty"` - Name string `json:"name,omitempty"` +type Nsacl struct { + Aclaction string `json:"aclaction,omitempty"` + Aclassociate []string `json:"aclassociate,omitempty"` + Aclchildcount int `json:"aclchildcount,omitempty"` + Aclname string `json:"aclname,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip bool `json:"destip,omitempty"` + Destipdataset string `json:"destipdataset,omitempty"` + Destipop string `json:"destipop,omitempty"` + Destipval string `json:"destipval,omitempty"` + Destport bool `json:"destport,omitempty"` + Destportdataset string `json:"destportdataset,omitempty"` + Destportop string `json:"destportop,omitempty"` + Destportval string `json:"destportval,omitempty"` + Dfdhash string `json:"dfdhash,omitempty"` + Established bool `json:"established,omitempty"` + Hits int `json:"hits,omitempty"` + Icmpcode int `json:"icmpcode,omitempty"` + Icmptype int `json:"icmptype,omitempty"` + InterfaceField string `json:"Interface,omitempty"` + Kernelstate string `json:"kernelstate,omitempty"` + Logstate string `json:"logstate,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Priority int `json:"priority,omitempty"` + Protocol string `json:"protocol,omitempty"` + Protocolnumber int `json:"protocolnumber,omitempty"` + Ratelimit int `json:"ratelimit,omitempty"` + Srcip bool `json:"srcip,omitempty"` + Srcipdataset string `json:"srcipdataset,omitempty"` + Srcipop string `json:"srcipop,omitempty"` + Srcipval string `json:"srcipval,omitempty"` + Srcmac string `json:"srcmac,omitempty"` + Srcmacmask string `json:"srcmacmask,omitempty"` + Srcport bool `json:"srcport,omitempty"` + Srcportdataset string `json:"srcportdataset,omitempty"` + Srcportop string `json:"srcportop,omitempty"` + Srcportval string `json:"srcportval,omitempty"` + State string `json:"state,omitempty"` + Stateful string `json:"stateful,omitempty"` + Td int `json:"td,omitempty"` + Ttl int `json:"ttl,omitempty"` + TypeField string `json:"type,omitempty"` + Vlan int `json:"vlan,omitempty"` + Vxlan int `json:"vxlan,omitempty"` } -type Nstrafficdomainbridgegroupbinding struct { - Bridgegroup int `json:"bridgegroup,omitempty"` - Td int `json:"td,omitempty"` +type Nslicenseserver struct { + Count float64 `json:"__count,omitempty"` + Deviceprofilename string `json:"deviceprofilename,omitempty"` + Forceupdateip bool `json:"forceupdateip,omitempty"` + Gptimeleft int `json:"gptimeleft,omitempty"` + Grace int `json:"grace,omitempty"` + Licensemode string `json:"licensemode,omitempty"` + Licenseserverip string `json:"licenseserverip,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Password string `json:"password,omitempty"` + Port int `json:"port,omitempty"` + Servername string `json:"servername,omitempty"` + Status int `json:"status,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } -type Nsvariable struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Scope string `json:"scope,omitempty"` - Iffull string `json:"iffull,omitempty"` - Ifvaluetoobig string `json:"ifvaluetoobig,omitempty"` - Ifnovalue string `json:"ifnovalue,omitempty"` - Init string `json:"init,omitempty"` - Expires int `json:"expires,omitempty"` - Comment string `json:"comment,omitempty"` - Referencecount string `json:"referencecount,omitempty"` +type Nsmgmtparam struct { + Httpdmaxclients int `json:"httpdmaxclients,omitempty"` + Httpdmaxreqworkers int `json:"httpdmaxreqworkers,omitempty"` + Mgmthttpport int `json:"mgmthttpport,omitempty"` + Mgmthttpsport int `json:"mgmthttpsport,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Reboot struct { - Warm bool `json:"warm,omitempty"` +type Nsdhcpip struct { } -type Nsencryptionkey struct { - Name string `json:"name,omitempty"` - Method string `json:"method,omitempty"` - Keyvalue string `json:"keyvalue,omitempty"` - Padding string `json:"padding,omitempty"` - Iv string `json:"iv,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nstcpprofile struct { + Ackaggregation string `json:"ackaggregation,omitempty"` + Ackonpush string `json:"ackonpush,omitempty"` + Applyadaptivetcp string `json:"applyadaptivetcp,omitempty"` + Buffersize int `json:"buffersize,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Burstratecontrol string `json:"burstratecontrol,omitempty"` + Clientiptcpoption string `json:"clientiptcpoption,omitempty"` + Clientiptcpoptionnumber int `json:"clientiptcpoptionnumber,omitempty"` + Count float64 `json:"__count,omitempty"` + Delayedack int `json:"delayedack,omitempty"` + Dropestconnontimeout string `json:"dropestconnontimeout,omitempty"` + Drophalfclosedconnontimeout string `json:"drophalfclosedconnontimeout,omitempty"` + Dsack string `json:"dsack,omitempty"` + Dupackthresh int `json:"dupackthresh,omitempty"` + Dynamicreceivebuffering string `json:"dynamicreceivebuffering,omitempty"` + Ecn string `json:"ecn,omitempty"` + Establishclientconn string `json:"establishclientconn,omitempty"` + Fack string `json:"fack,omitempty"` + Feature string `json:"feature,omitempty"` + Flavor string `json:"flavor,omitempty"` + Frto string `json:"frto,omitempty"` + Hystart string `json:"hystart,omitempty"` + Initialcwnd int `json:"initialcwnd,omitempty"` + Ka string `json:"ka,omitempty"` + Kaconnidletime int `json:"kaconnidletime,omitempty"` + Kamaxprobes int `json:"kamaxprobes,omitempty"` + Kaprobeinterval int `json:"kaprobeinterval,omitempty"` + Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` + Maxburst int `json:"maxburst,omitempty"` + Maxcwnd int `json:"maxcwnd,omitempty"` + Maxpktpermss int `json:"maxpktpermss,omitempty"` + Minrto int `json:"minrto,omitempty"` + Mpcapablecbit string `json:"mpcapablecbit,omitempty"` + Mptcp string `json:"mptcp,omitempty"` + Mptcpdropdataonpreestsf string `json:"mptcpdropdataonpreestsf,omitempty"` + Mptcpfastopen string `json:"mptcpfastopen,omitempty"` + Mptcpsessiontimeout int `json:"mptcpsessiontimeout,omitempty"` + Mss int `json:"mss,omitempty"` + Nagle string `json:"nagle,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oooqsize int `json:"oooqsize,omitempty"` + Pktperretx int `json:"pktperretx,omitempty"` + Rateqmax int `json:"rateqmax,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Rfc5961compliance string `json:"rfc5961compliance,omitempty"` + Rstmaxack string `json:"rstmaxack,omitempty"` + Rstwindowattenuate string `json:"rstwindowattenuate,omitempty"` + Sack string `json:"sack,omitempty"` + Sendbuffsize int `json:"sendbuffsize,omitempty"` + Sendclientportintcpoption string `json:"sendclientportintcpoption,omitempty"` + Slowstartincr int `json:"slowstartincr,omitempty"` + Slowstartthreshold int `json:"slowstartthreshold,omitempty"` + Spoofsyndrop string `json:"spoofsyndrop,omitempty"` + Syncookie string `json:"syncookie,omitempty"` + Taillossprobe string `json:"taillossprobe,omitempty"` + Tcpfastopen string `json:"tcpfastopen,omitempty"` + Tcpfastopencookiesize int `json:"tcpfastopencookiesize,omitempty"` + Tcpmode string `json:"tcpmode,omitempty"` + Tcprate int `json:"tcprate,omitempty"` + Tcpsegoffload string `json:"tcpsegoffload,omitempty"` + Timestamp string `json:"timestamp,omitempty"` + Ws string `json:"ws,omitempty"` + Wsval int `json:"wsval,omitempty"` +} + +type NstrafficdomainBinding struct { + NstrafficdomainBridgegroupBinding []interface{} `json:"nstrafficdomain_bridgegroup_binding,omitempty"` + NstrafficdomainVlanBinding []interface{} `json:"nstrafficdomain_vlan_binding,omitempty"` + NstrafficdomainVxlanBinding []interface{} `json:"nstrafficdomain_vxlan_binding,omitempty"` + Td int `json:"td,omitempty"` +} + +type NstimerAutoscalepolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Samplesize int `json:"samplesize,omitempty"` + Threshold int `json:"threshold,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Nsextension struct { - Src string `json:"src,omitempty"` - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Trace string `json:"trace,omitempty"` - Tracefunctions string `json:"tracefunctions,omitempty"` - Tracevariables string `json:"tracevariables,omitempty"` - Detail string `json:"detail,omitempty"` - Type string `json:"type,omitempty"` - Functionhits string `json:"functionhits,omitempty"` - Functionundefhits string `json:"functionundefhits,omitempty"` - Functionhaltcount string `json:"functionhaltcount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsmode struct { + Bridgebpdus bool `json:"bridgebpdus,omitempty"` + Cka bool `json:"cka,omitempty"` + Dradv bool `json:"dradv,omitempty"` + Dradv6 bool `json:"dradv6,omitempty"` + Edge bool `json:"edge,omitempty"` + Fr bool `json:"fr,omitempty"` + Iradv bool `json:"iradv,omitempty"` + L2 bool `json:"l2,omitempty"` + L3 bool `json:"l3,omitempty"` + Mbf bool `json:"mbf,omitempty"` + Mediaclassification bool `json:"mediaclassification,omitempty"` + Mode []string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pmtud bool `json:"pmtud,omitempty"` + SingleIp bool `json:"single_ip,omitempty"` + Sradv bool `json:"sradv,omitempty"` + Sradv6 bool `json:"sradv6,omitempty"` + Tcpb bool `json:"tcpb,omitempty"` + Ulfd bool `json:"ulfd,omitempty"` + Usip bool `json:"usip,omitempty"` + Usnip bool `json:"usnip,omitempty"` } -type Nskeymanagerproxy struct { - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Port int `json:"port,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Status string `json:"status,omitempty"` +type Nssimpleacl6 struct { + Aclaction string `json:"aclaction,omitempty"` + Aclname string `json:"aclname,omitempty"` + Count float64 `json:"__count,omitempty"` + Destport int `json:"destport,omitempty"` + Estsessions bool `json:"estsessions,omitempty"` + Hits int `json:"hits,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocol string `json:"protocol,omitempty"` + Srcipv6 string `json:"srcipv6,omitempty"` + Td int `json:"td,omitempty"` + Ttl int `json:"ttl,omitempty"` +} + +type Nslaslicense struct { + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Filelocation string `json:"filelocation,omitempty"` + Filename string `json:"filename,omitempty"` + Fixedbandwidth bool `json:"fixedbandwidth,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Renewalnext int `json:"renewalnext,omitempty"` + Renewalnextdate string `json:"renewalnextdate,omitempty"` + Renewalprev int `json:"renewalprev,omitempty"` + Renewalprevdate string `json:"renewalprevdate,omitempty"` + Status string `json:"status,omitempty"` } -type Nsservicepathservicefunctionbinding struct { - Servicefunction string `json:"servicefunction,omitempty"` - Index uint32 `json:"index,omitempty"` - Servicepathname string `json:"servicepathname,omitempty"` +type Nsconfig struct { + All bool `json:"all,omitempty"` + Async bool `json:"Async,omitempty"` + Changedpassword bool `json:"changedpassword,omitempty"` + Cip string `json:"cip,omitempty"` + Cipheader string `json:"cipheader,omitempty"` + Config string `json:"config,omitempty"` + Config1 string `json:"config1,omitempty"` + Config2 string `json:"config2,omitempty"` + Configchanged bool `json:"configchanged,omitempty"` + Configfile string `json:"configfile,omitempty"` + Cookieversion string `json:"cookieversion,omitempty"` + Crportrange string `json:"crportrange,omitempty"` + Currentsytemtime string `json:"currentsytemtime,omitempty"` + Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` + Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` + Flags int `json:"flags,omitempty"` + Force bool `json:"force,omitempty"` + Ftpportrange string `json:"ftpportrange,omitempty"` + Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` + Grantquotaspillover int `json:"grantquotaspillover,omitempty"` + Httpport []interface{} `json:"httpport,omitempty"` + Id int `json:"id,omitempty"` + Ifnum []string `json:"ifnum,omitempty"` + Ignoredevicespecific bool `json:"ignoredevicespecific,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Lastconfigchangedtime string `json:"lastconfigchangedtime,omitempty"` + Lastconfigsavetime string `json:"lastconfigsavetime,omitempty"` + Level string `json:"level,omitempty"` + Mappedip string `json:"mappedip,omitempty"` + Maxconn int `json:"maxconn,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Message string `json:"message,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nsvlan int `json:"nsvlan,omitempty"` + Outtype string `json:"outtype,omitempty"` + Pmtumin int `json:"pmtumin,omitempty"` + Pmtutimeout int `json:"pmtutimeout,omitempty"` + Primaryip string `json:"primaryip,omitempty"` + Primaryip6 string `json:"primaryip6,omitempty"` + Range int `json:"range,omitempty"` + Rbaconfig string `json:"rbaconfig,omitempty"` + Response string `json:"response,omitempty"` + Responsefile string `json:"responsefile,omitempty"` + Securecookie string `json:"securecookie,omitempty"` + Securemanagementtd int `json:"securemanagementtd,omitempty"` + Securemanagementtraffic string `json:"securemanagementtraffic,omitempty"` + Svmcmd int `json:"svmcmd,omitempty"` + Systemtime int `json:"systemtime,omitempty"` + Systemtype string `json:"systemtype,omitempty"` + Tagged string `json:"tagged,omitempty"` + Template bool `json:"template,omitempty"` + Timezone string `json:"timezone,omitempty"` + Weakpassword bool `json:"weakpassword,omitempty"` } -type Nstestlicense struct { - Wl string `json:"wl,omitempty"` - Sp string `json:"sp,omitempty"` - Lb string `json:"lb,omitempty"` - Cs string `json:"cs,omitempty"` - Cr string `json:"cr,omitempty"` - Cmp string `json:"cmp,omitempty"` - Delta string `json:"delta,omitempty"` - Ssl string `json:"ssl,omitempty"` - Gslb string `json:"gslb,omitempty"` - Gslbp string `json:"gslbp,omitempty"` - Routing string `json:"routing,omitempty"` - Cf string `json:"cf,omitempty"` - Contentaccelerator string `json:"contentaccelerator,omitempty"` - Ic string `json:"ic,omitempty"` - Sslvpn string `json:"sslvpn,omitempty"` - Fsslvpnusers string `json:"f_sslvpn_users,omitempty"` - Ficausers string `json:"f_ica_users,omitempty"` - Aaa string `json:"aaa,omitempty"` - Ospf string `json:"ospf,omitempty"` - Rip string `json:"rip,omitempty"` - Bgp string `json:"bgp,omitempty"` - Rewrite string `json:"rewrite,omitempty"` - Ipv6pt string `json:"ipv6pt,omitempty"` - Appfw string `json:"appfw,omitempty"` - Responder string `json:"responder,omitempty"` - Agee string `json:"agee,omitempty"` - Nsxn string `json:"nsxn,omitempty"` - Modelid string `json:"modelid,omitempty"` - Push string `json:"push,omitempty"` - Appflow string `json:"appflow,omitempty"` - Cloudbridge string `json:"cloudbridge,omitempty"` - Cloudbridgeappliance string `json:"cloudbridgeappliance,omitempty"` - Cloudextenderappliance string `json:"cloudextenderappliance,omitempty"` - Isis string `json:"isis,omitempty"` - Cluster string `json:"cluster,omitempty"` - Ch string `json:"ch,omitempty"` - Appqoe string `json:"appqoe,omitempty"` - Appflowica string `json:"appflowica,omitempty"` - Isstandardlic string `json:"isstandardlic,omitempty"` - Isenterpriselic string `json:"isenterpriselic,omitempty"` - Isplatinumlic string `json:"isplatinumlic,omitempty"` - Issgwylic string `json:"issgwylic,omitempty"` - Isswglic string `json:"isswglic,omitempty"` - Feo string `json:"feo,omitempty"` - Lsn string `json:"lsn,omitempty"` - Licensingmode string `json:"licensingmode,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Rdpproxy string `json:"rdpproxy,omitempty"` - Rep string `json:"rep,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Videooptimization string `json:"videooptimization,omitempty"` - Forwardproxy string `json:"forwardproxy,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Remotecontentinspection string `json:"remotecontentinspection,omitempty"` - Adaptivetcp string `json:"adaptivetcp,omitempty"` - Cqa string `json:"cqa,omitempty"` - Bot string `json:"bot,omitempty"` - Apigateway string `json:"apigateway,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Nsaptlicense struct { + Bindtype string `json:"bindtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Countavailable string `json:"countavailable,omitempty"` + Counttotal string `json:"counttotal,omitempty"` + Dateexp string `json:"dateexp,omitempty"` + Datepurchased string `json:"datepurchased,omitempty"` + Datesa string `json:"datesa,omitempty"` + Features []string `json:"features,omitempty"` + Id string `json:"id,omitempty"` + Licensedir string `json:"licensedir,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Relevance string `json:"relevance,omitempty"` + Response string `json:"response,omitempty"` + Serialno string `json:"serialno,omitempty"` + Sessionid string `json:"sessionid,omitempty"` + Useproxy string `json:"useproxy,omitempty"` } -type Nstrafficdomainbinding struct { - Td int `json:"td,omitempty"` +type Nshttpprofile struct { + Adpttimeout string `json:"adpttimeout,omitempty"` + Allowonlywordcharactersandhyphen string `json:"allowonlywordcharactersandhyphen,omitempty"` + Altsvc string `json:"altsvc,omitempty"` + Altsvcvalue string `json:"altsvcvalue,omitempty"` + Apdexcltresptimethreshold int `json:"apdexcltresptimethreshold,omitempty"` + Apdexsvrresptimethreshold int `json:"apdexsvrresptimethreshold,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Clientiphdrexpr string `json:"clientiphdrexpr,omitempty"` + Cmponpush string `json:"cmponpush,omitempty"` + Conmultiplex string `json:"conmultiplex,omitempty"` + Count float64 `json:"__count,omitempty"` + Dropextracrlf string `json:"dropextracrlf,omitempty"` + Dropextradata string `json:"dropextradata,omitempty"` + Dropinvalreqs string `json:"dropinvalreqs,omitempty"` + Dropinvalreqswarning string `json:"dropinvalreqswarning,omitempty"` + Feature string `json:"feature,omitempty"` + Grpcholdlimit int `json:"grpcholdlimit,omitempty"` + Grpcholdtimeout int `json:"grpcholdtimeout,omitempty"` + Grpclengthdelimitation string `json:"grpclengthdelimitation,omitempty"` + Hostheadervalidation string `json:"hostheadervalidation,omitempty"` + Http2 string `json:"http2,omitempty"` + Http2altsvcframe string `json:"http2altsvcframe,omitempty"` + Http2direct string `json:"http2direct,omitempty"` + Http2extendedconnect string `json:"http2extendedconnect,omitempty"` + Http2headertablesize int `json:"http2headertablesize,omitempty"` + Http2initialconnwindowsize int `json:"http2initialconnwindowsize,omitempty"` + Http2initialwindowsize int `json:"http2initialwindowsize,omitempty"` + Http2maxconcurrentstreams int `json:"http2maxconcurrentstreams,omitempty"` + Http2maxemptyframespermin int `json:"http2maxemptyframespermin,omitempty"` + Http2maxframesize int `json:"http2maxframesize,omitempty"` + Http2maxheaderlistsize int `json:"http2maxheaderlistsize,omitempty"` + Http2maxpingframespermin int `json:"http2maxpingframespermin,omitempty"` + Http2maxresetframespermin int `json:"http2maxresetframespermin,omitempty"` + Http2maxrxresetframespermin int `json:"http2maxrxresetframespermin,omitempty"` + Http2maxsettingsframespermin int `json:"http2maxsettingsframespermin,omitempty"` + Http2minseverconn int `json:"http2minseverconn,omitempty"` + Http2strictcipher string `json:"http2strictcipher,omitempty"` + Http3 string `json:"http3,omitempty"` + Http3maxheaderblockedstreams int `json:"http3maxheaderblockedstreams,omitempty"` + Http3maxheaderfieldsectionsize int `json:"http3maxheaderfieldsectionsize,omitempty"` + Http3maxheadertablesize int `json:"http3maxheadertablesize,omitempty"` + Http3minseverconn int `json:"http3minseverconn,omitempty"` + Http3webtransport string `json:"http3webtransport,omitempty"` + Httppipelinebuffsize int `json:"httppipelinebuffsize,omitempty"` + Incomphdrdelay int `json:"incomphdrdelay,omitempty"` + Markconnreqinval string `json:"markconnreqinval,omitempty"` + Markhttp09inval string `json:"markhttp09inval,omitempty"` + Markhttpheaderextrawserror string `json:"markhttpheaderextrawserror,omitempty"` + Markrfc7230noncompliantinval string `json:"markrfc7230noncompliantinval,omitempty"` + Marktracereqinval string `json:"marktracereqinval,omitempty"` + Maxduplicateheaderfields int `json:"maxduplicateheaderfields,omitempty"` + Maxheaderfieldlen int `json:"maxheaderfieldlen,omitempty"` + Maxheaderlen int `json:"maxheaderlen,omitempty"` + Maxreq int `json:"maxreq,omitempty"` + Maxreusepool int `json:"maxreusepool,omitempty"` + Minreusepool int `json:"minreusepool,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passprotocolupgrade string `json:"passprotocolupgrade,omitempty"` + Persistentetag string `json:"persistentetag,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Reqtimeout int `json:"reqtimeout,omitempty"` + Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` + Reusepooltimeout int `json:"reusepooltimeout,omitempty"` + Rtsptunnel string `json:"rtsptunnel,omitempty"` + Weblog string `json:"weblog,omitempty"` + Websocket string `json:"websocket,omitempty"` +} + +type Nsfeature struct { + Aaa bool `json:"aaa,omitempty"` + Adaptivetcp bool `json:"adaptivetcp,omitempty"` + Apigateway bool `json:"apigateway,omitempty"` + Appflow bool `json:"appflow,omitempty"` + Appfw bool `json:"appfw,omitempty"` + Appqoe bool `json:"appqoe,omitempty"` + Bgp bool `json:"bgp,omitempty"` + Bot bool `json:"bot,omitempty"` + Cf bool `json:"cf,omitempty"` + Ch bool `json:"ch,omitempty"` + Ci bool `json:"ci,omitempty"` + Cloudbridge bool `json:"cloudbridge,omitempty"` + Cmp bool `json:"cmp,omitempty"` + Contentaccelerator bool `json:"contentaccelerator,omitempty"` + Cqa bool `json:"cqa,omitempty"` + Cr bool `json:"cr,omitempty"` + Cs bool `json:"cs,omitempty"` + Feature []string `json:"feature,omitempty"` + Feo bool `json:"feo,omitempty"` + Forwardproxy bool `json:"forwardproxy,omitempty"` + Gslb bool `json:"gslb,omitempty"` + Ic bool `json:"ic,omitempty"` + Ipv6pt bool `json:"ipv6pt,omitempty"` + Isis bool `json:"isis,omitempty"` + Lb bool `json:"lb,omitempty"` + Lsn bool `json:"lsn,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ospf bool `json:"ospf,omitempty"` + Push bool `json:"push,omitempty"` + Rdpproxy bool `json:"rdpproxy,omitempty"` + Rep bool `json:"rep,omitempty"` + Responder bool `json:"responder,omitempty"` + Rewrite bool `json:"rewrite,omitempty"` + Rip bool `json:"rip,omitempty"` + Sp bool `json:"sp,omitempty"` + Ssl bool `json:"ssl,omitempty"` + Sslinterception bool `json:"sslinterception,omitempty"` + Sslvpn bool `json:"sslvpn,omitempty"` + Videooptimization bool `json:"videooptimization,omitempty"` + Wl bool `json:"wl,omitempty"` +} + +type NsservicepathBinding struct { + NsservicepathNsservicefunctionBinding []interface{} `json:"nsservicepath_nsservicefunction_binding,omitempty"` + Servicepathname string `json:"servicepathname,omitempty"` } type Nslicenseparameters struct { - Alert1gracetimeout int `json:"alert1gracetimeout"` + Alert1gracetimeout int `json:"alert1gracetimeout,omitempty"` Alert2gracetimeout int `json:"alert2gracetimeout,omitempty"` - Licenseexpiryalerttime int `json:"licenseexpiryalerttime,omitempty"` Heartbeatinterval int `json:"heartbeatinterval,omitempty"` Inventoryrefreshinterval int `json:"inventoryrefreshinterval,omitempty"` + Licenseexpiryalerttime int `json:"licenseexpiryalerttime,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Nsmemrecovery struct { - Percentage int `json:"percentage,omitempty"` +type Nslimitidentifier struct { + Computedtraptimeslice int `json:"computedtraptimeslice,omitempty"` + Count float64 `json:"__count,omitempty"` + Drop int `json:"drop,omitempty"` + Hits int `json:"hits,omitempty"` + Limitidentifier string `json:"limitidentifier,omitempty"` + Limittype string `json:"limittype,omitempty"` + Maxbandwidth int `json:"maxbandwidth,omitempty"` + Mode string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Rule []string `json:"rule,omitempty"` + Selectorname string `json:"selectorname,omitempty"` + Threshold int `json:"threshold,omitempty"` + Time int `json:"time,omitempty"` + Timeslice int `json:"timeslice,omitempty"` + Total int `json:"total,omitempty"` + Trapscomputedintimeslice int `json:"trapscomputedintimeslice,omitempty"` + Trapsintimeslice int `json:"trapsintimeslice,omitempty"` } -type Nsstats struct { - Cleanuplevel string `json:"cleanuplevel,omitempty"` +type Nshardware struct { + Bmcrevision string `json:"bmcrevision,omitempty"` + Cpufrequncy int `json:"cpufrequncy,omitempty"` + Encodedserialno string `json:"encodedserialno,omitempty"` + Host string `json:"host,omitempty"` + Hostid int `json:"hostid,omitempty"` + Hwdescription string `json:"hwdescription,omitempty"` + Manufactureday int `json:"manufactureday,omitempty"` + Manufacturemonth int `json:"manufacturemonth,omitempty"` + Manufactureyear int `json:"manufactureyear,omitempty"` + Netscaleruuid string `json:"netscaleruuid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Serialno string `json:"serialno,omitempty"` + Sysid int `json:"sysid,omitempty"` } type Nstrafficdomain struct { - Td int `json:"td,omitempty"` - Aliasname string `json:"aliasname,omitempty"` - Vmac string `json:"vmac,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Aliasname string `json:"aliasname,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` + Td int `json:"td,omitempty"` + Vmac string `json:"vmac,omitempty"` } -type Nstrafficdomainvxlanbinding struct { - Vxlan int `json:"vxlan,omitempty"` - Td int `json:"td,omitempty"` +type NspartitionVlanBinding struct { + Partitionname string `json:"partitionname,omitempty"` + Vlan int `json:"vlan,omitempty"` +} + +type Nscqaparam struct { + Harqretxdelay int `json:"harqretxdelay,omitempty"` + Lr1coeflist string `json:"lr1coeflist,omitempty"` + Lr1probthresh float64 `json:"lr1probthresh,omitempty"` + Lr2coeflist string `json:"lr2coeflist,omitempty"` + Lr2probthresh float64 `json:"lr2probthresh,omitempty"` + Minrttnet1 int `json:"minrttnet1,omitempty"` + Minrttnet2 int `json:"minrttnet2,omitempty"` + Minrttnet3 int `json:"minrttnet3,omitempty"` + Net1cclscale string `json:"net1cclscale,omitempty"` + Net1csqscale string `json:"net1csqscale,omitempty"` + Net1label string `json:"net1label,omitempty"` + Net1logcoef string `json:"net1logcoef,omitempty"` + Net2cclscale string `json:"net2cclscale,omitempty"` + Net2csqscale string `json:"net2csqscale,omitempty"` + Net2label string `json:"net2label,omitempty"` + Net2logcoef string `json:"net2logcoef,omitempty"` + Net3cclscale string `json:"net3cclscale,omitempty"` + Net3csqscale string `json:"net3csqscale,omitempty"` + Net3label string `json:"net3label,omitempty"` + Net3logcoef string `json:"net3logcoef,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Nsstats struct { + Cleanuplevel string `json:"cleanuplevel,omitempty"` +} + +type NslimitidentifierBinding struct { + Limitidentifier string `json:"limitidentifier,omitempty"` + NslimitidentifierNslimitsessionsBinding []interface{} `json:"nslimitidentifier_nslimitsessions_binding,omitempty"` } diff --git a/nitrogo/models/ntp.go b/nitrogo/models/ntp.go index 6b7786d..023c450 100644 --- a/nitrogo/models/ntp.go +++ b/nitrogo/models/ntp.go @@ -1,34 +1,32 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Ntpparam struct { - Authentication string `json:"authentication,omitempty"` - Trustedkey []int `json:"trustedkey,omitempty"` - Autokeylogsec int `json:"autokeylogsec"` - Revokelogsec int `json:"revokelogsec"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// ntp configuration structs type Ntpserver struct { - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Minpoll int `json:"minpoll,omitempty"` - Maxpoll int `json:"maxpoll,omitempty"` - Autokey bool `json:"autokey,omitempty"` - Key int `json:"key,omitempty"` - Preferredntpserver string `json:"preferredntpserver,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Autokey bool `json:"autokey,omitempty"` + Count float64 `json:"__count,omitempty"` + Key int `json:"key,omitempty"` + Maxpoll int `json:"maxpoll,omitempty"` + Minpoll int `json:"minpoll,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Preferredntpserver string `json:"preferredntpserver,omitempty"` + Serverip string `json:"serverip,omitempty"` + Servername string `json:"servername,omitempty"` } -type Ntpstatus struct { - Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Ntpparam struct { + Authentication string `json:"authentication,omitempty"` + Autokeylogsec int `json:"autokeylogsec,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Revokelogsec int `json:"revokelogsec,omitempty"` + Trustedkey []interface{} `json:"trustedkey,omitempty"` } type Ntpsync struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` +} + +type Ntpstatus struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` } diff --git a/nitrogo/models/pcp.go b/nitrogo/models/pcp.go index 1f052e6..f692b45 100644 --- a/nitrogo/models/pcp.go +++ b/nitrogo/models/pcp.go @@ -1,41 +1,41 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Pcpprofile struct { - Name string `json:"name,omitempty"` - Mapping string `json:"mapping,omitempty"` - Peer string `json:"peer,omitempty"` - Minmaplife int `json:"minmaplife,omitempty"` - Maxmaplife int `json:"maxmaplife,omitempty"` - Announcemulticount int `json:"announcemulticount"` - Thirdparty string `json:"thirdparty,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// pcp configuration structs type Pcpserver struct { - Name string `json:"name,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Pcpprofile string `json:"pcpprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pcpprofile string `json:"pcpprofile,omitempty"` + Port int `json:"port,omitempty"` } type Pcpmap struct { - Nattype string `json:"nattype,omitempty"` - Pcpsrcip string `json:"pcpsrcip,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Pcpsrcport string `json:"pcpsrcport,omitempty"` - Pcpdstip string `json:"pcpdstip,omitempty"` - Pcpdstport string `json:"pcpdstport,omitempty"` - Pcpnatip string `json:"pcpnatip,omitempty"` - Pcpnatport string `json:"pcpnatport,omitempty"` - Pcpprotocol string `json:"pcpprotocol,omitempty"` - Pcpaddr string `json:"pcpaddr,omitempty"` - Pcpnounce string `json:"pcpnounce,omitempty"` - Pcprefcnt string `json:"pcprefcnt,omitempty"` - Pcplifetime string `json:"pcplifetime,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Nattype string `json:"nattype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pcpaddr int `json:"pcpaddr,omitempty"` + Pcpdstip string `json:"pcpdstip,omitempty"` + Pcpdstport int `json:"pcpdstport,omitempty"` + Pcplifetime int `json:"pcplifetime,omitempty"` + Pcpnatip string `json:"pcpnatip,omitempty"` + Pcpnatport int `json:"pcpnatport,omitempty"` + Pcpnounce int `json:"pcpnounce,omitempty"` + Pcpprotocol string `json:"pcpprotocol,omitempty"` + Pcprefcnt int `json:"pcprefcnt,omitempty"` + Pcpsrcip string `json:"pcpsrcip,omitempty"` + Pcpsrcport int `json:"pcpsrcport,omitempty"` + Subscrip string `json:"subscrip,omitempty"` +} + +type Pcpprofile struct { + Announcemulticount int `json:"announcemulticount,omitempty"` + Count float64 `json:"__count,omitempty"` + Mapping string `json:"mapping,omitempty"` + Maxmaplife int `json:"maxmaplife,omitempty"` + Minmaplife int `json:"minmaplife,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Peer string `json:"peer,omitempty"` + Thirdparty string `json:"thirdparty,omitempty"` } diff --git a/nitrogo/models/policy.go b/nitrogo/models/policy.go index 01172fb..73f606b 100644 --- a/nitrogo/models/policy.go +++ b/nitrogo/models/policy.go @@ -1,214 +1,224 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Policydataset struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Comment string `json:"comment,omitempty"` - Patsetfile string `json:"patsetfile,omitempty"` - Dynamic string `json:"dynamic,omitempty"` - Dynamiconly bool `json:"dynamiconly,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Policyhttpcallout struct { - Name string `json:"name,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Vserver string `json:"vserver,omitempty"` - Returntype string `json:"returntype,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Hostexpr string `json:"hostexpr,omitempty"` - Urlstemexpr string `json:"urlstemexpr,omitempty"` - Headers []string `json:"headers,omitempty"` - Parameters []string `json:"parameters,omitempty"` - Bodyexpr string `json:"bodyexpr,omitempty"` - Fullreqexpr string `json:"fullreqexpr,omitempty"` - Scheme string `json:"scheme,omitempty"` - Resultexpr string `json:"resultexpr,omitempty"` - Cacheforsecs int `json:"cacheforsecs,omitempty"` - Comment string `json:"comment,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Undefreason string `json:"undefreason,omitempty"` - Recursivecallout string `json:"recursivecallout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Policypatsetpatternbinding struct { - String string `json:"String,omitempty"` - Index int `json:"index,omitempty"` +// policy configuration structs +type PolicypatsetPatternBinding struct { + Builtin []string `json:"builtin,omitempty"` Charset string `json:"charset,omitempty"` Comment string `json:"comment,omitempty"` - Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` + Index int `json:"index,omitempty"` Name string `json:"name,omitempty"` + String string `json:"String,omitempty"` } -type Policypatsetfile struct { - Src string `json:"src,omitempty"` - Name string `json:"name,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Delimiter string `json:"delimiter,omitempty"` - Charset string `json:"charset,omitempty"` - Comment string `json:"comment,omitempty"` - Imported bool `json:"imported,omitempty"` - Totalpatterns string `json:"totalpatterns,omitempty"` - Boundpatterns string `json:"boundpatterns,omitempty"` - Patsetname string `json:"patsetname,omitempty"` - Bindstatuscode string `json:"bindstatuscode,omitempty"` - Bindstatus string `json:"bindstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type PolicystringmapBinding struct { + Name string `json:"name,omitempty"` + PolicystringmapPatternBinding []interface{} `json:"policystringmap_pattern_binding,omitempty"` } -type Policystringmappatternbinding struct { - Key string `json:"key,omitempty"` - Value string `json:"value,omitempty"` +type PolicydatasetBinding struct { + Name string `json:"name,omitempty"` + PolicydatasetValueBinding []interface{} `json:"policydataset_value_binding,omitempty"` +} + +type PolicystringmapPatternBinding struct { Comment string `json:"comment,omitempty"` + Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` } -type Policydatasetbinding struct { - Name string `json:"name,omitempty"` +type Policypatsetfile struct { + Bindstatus string `json:"bindstatus,omitempty"` + Bindstatuscode int `json:"bindstatuscode,omitempty"` + Boundpatterns int `json:"boundpatterns,omitempty"` + Charset string `json:"charset,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Delimiter string `json:"delimiter,omitempty"` + Imported bool `json:"imported,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Patsetname string `json:"patsetname,omitempty"` + Src string `json:"src,omitempty"` + Totalpatterns int `json:"totalpatterns,omitempty"` } -type Policyevaluation struct { - Expression string `json:"expression,omitempty"` - Action string `json:"action,omitempty"` - Type string `json:"type,omitempty"` - Input string `json:"input,omitempty"` - Pitmodifiedinputdata string `json:"pitmodifiedinputdata,omitempty"` - Pitboolresult string `json:"pitboolresult,omitempty"` - Pitnumresult string `json:"pitnumresult,omitempty"` - Pitdoubleresult string `json:"pitdoubleresult,omitempty"` - Pitulongresult string `json:"pitulongresult,omitempty"` - Pitrefresult string `json:"pitrefresult,omitempty"` - Pitoffsetresult string `json:"pitoffsetresult,omitempty"` - Pitoffsetresultlen string `json:"pitoffsetresultlen,omitempty"` - Istruncatedrefresult string `json:"istruncatedrefresult,omitempty"` - Pitboolevaltime string `json:"pitboolevaltime,omitempty"` - Pitnumevaltime string `json:"pitnumevaltime,omitempty"` - Pitdoubleevaltime string `json:"pitdoubleevaltime,omitempty"` - Pitulongevaltime string `json:"pitulongevaltime,omitempty"` - Pitrefevaltime string `json:"pitrefevaltime,omitempty"` - Pitoffsetevaltime string `json:"pitoffsetevaltime,omitempty"` - Pitactionevaltime string `json:"pitactionevaltime,omitempty"` - Pitoperationperformerarray string `json:"pitoperationperformerarray,omitempty"` - Pitoldoffsetarray string `json:"pitoldoffsetarray,omitempty"` - Pitnewoffsetarray string `json:"pitnewoffsetarray,omitempty"` - Pitoffsetlengtharray string `json:"pitoffsetlengtharray,omitempty"` - Pitoffsetnewlengtharray string `json:"pitoffsetnewlengtharray,omitempty"` - Pitboolerrorresult string `json:"pitboolerrorresult,omitempty"` - Pitnumerrorresult string `json:"pitnumerrorresult,omitempty"` - Pitdoubleerrorresult string `json:"pitdoubleerrorresult,omitempty"` - Pitulongerrorresult string `json:"pitulongerrorresult,omitempty"` - Pitreferrorresult string `json:"pitreferrorresult,omitempty"` - Pitoffseterrorresult string `json:"pitoffseterrorresult,omitempty"` - Pitactionerrorresult string `json:"pitactionerrorresult,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Policystringmap struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Policyexpression struct { - Name string `json:"name,omitempty"` - Value string `json:"value,omitempty"` - Comment string `json:"comment,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` - Type string `json:"type,omitempty"` - Hits string `json:"hits,omitempty"` - Pihits string `json:"pihits,omitempty"` - Type1 string `json:"type1,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type PolicypatsetBinding struct { + Name string `json:"name,omitempty"` + PolicypatsetPatternBinding []interface{} `json:"policypatset_pattern_binding,omitempty"` } -type Policyparam struct { - Timeout int `json:"timeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type PolicydatasetValueBinding struct { + Comment string `json:"comment,omitempty"` + Endrange string `json:"endrange,omitempty"` + Index int `json:"index,omitempty"` + Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` } -type Policypatset struct { - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` - Patsetfile string `json:"patsetfile,omitempty"` - Dynamic string `json:"dynamic,omitempty"` - Dynamiconly bool `json:"dynamiconly,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Policytracing struct { + Capturesslhandshakepolicies string `json:"capturesslhandshakepolicies,omitempty"` + Clientip string `json:"clientip,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Detail string `json:"detail,omitempty"` + Filterexpr string `json:"filterexpr,omitempty"` + Isresponse int `json:"isresponse,omitempty"` + Isundefpolicy int `json:"isundefpolicy,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Packetengineid int `json:"packetengineid,omitempty"` + Policynames []string `json:"policynames,omitempty"` + Policytracingmodule string `json:"policytracingmodule,omitempty"` + Policytracingrecordcount int `json:"policytracingrecordcount,omitempty"` + Protocoltype string `json:"protocoltype,omitempty"` + Srcport int `json:"srcport,omitempty"` + Transactionid string `json:"transactionid,omitempty"` + Transactiontime string `json:"transactiontime,omitempty"` + Url string `json:"url,omitempty"` } -type Policymap struct { - Mappolicyname string `json:"mappolicyname,omitempty"` - Sd string `json:"sd,omitempty"` - Su string `json:"su,omitempty"` - Td string `json:"td,omitempty"` - Tu string `json:"tu,omitempty"` - Targetname string `json:"targetname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Policyurlset struct { + Canaryurl string `json:"canaryurl,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Delimiter string `json:"delimiter,omitempty"` + Imported bool `json:"imported,omitempty"` + Interval int `json:"interval,omitempty"` + Matchedid int `json:"matchedid,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Patterncount int `json:"patterncount,omitempty"` + Privateset bool `json:"privateset,omitempty"` + Rowseparator string `json:"rowseparator,omitempty"` + Subdomainexactmatch bool `json:"subdomainexactmatch,omitempty"` + Url string `json:"url,omitempty"` } -type Policypatsetbinding struct { - Name string `json:"name,omitempty"` +type Policyevaluation struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Expression string `json:"expression,omitempty"` + Input string `json:"input,omitempty"` + Istruncatedrefresult bool `json:"istruncatedrefresult,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pitactionerrorresult string `json:"pitactionerrorresult,omitempty"` + Pitactionevaltime int `json:"pitactionevaltime,omitempty"` + Pitboolerrorresult string `json:"pitboolerrorresult,omitempty"` + Pitboolevaltime int `json:"pitboolevaltime,omitempty"` + Pitboolresult bool `json:"pitboolresult,omitempty"` + Pitdoubleerrorresult string `json:"pitdoubleerrorresult,omitempty"` + Pitdoubleevaltime int `json:"pitdoubleevaltime,omitempty"` + Pitdoubleresult float64 `json:"pitdoubleresult,omitempty"` + Pitmodifiedinputdata string `json:"pitmodifiedinputdata,omitempty"` + Pitnewoffsetarray []interface{} `json:"pitnewoffsetarray,omitempty"` + Pitnumerrorresult string `json:"pitnumerrorresult,omitempty"` + Pitnumevaltime int `json:"pitnumevaltime,omitempty"` + Pitnumresult int `json:"pitnumresult,omitempty"` + Pitoffseterrorresult string `json:"pitoffseterrorresult,omitempty"` + Pitoffsetevaltime int `json:"pitoffsetevaltime,omitempty"` + Pitoffsetlengtharray []interface{} `json:"pitoffsetlengtharray,omitempty"` + Pitoffsetnewlengtharray []interface{} `json:"pitoffsetnewlengtharray,omitempty"` + Pitoffsetresult int `json:"pitoffsetresult,omitempty"` + Pitoffsetresultlen int `json:"pitoffsetresultlen,omitempty"` + Pitoldoffsetarray []interface{} `json:"pitoldoffsetarray,omitempty"` + Pitoperationperformerarray []string `json:"pitoperationperformerarray,omitempty"` + Pitreferrorresult string `json:"pitreferrorresult,omitempty"` + Pitrefevaltime int `json:"pitrefevaltime,omitempty"` + Pitrefresult string `json:"pitrefresult,omitempty"` + Pitulongerrorresult string `json:"pitulongerrorresult,omitempty"` + Pitulongevaltime int `json:"pitulongevaltime,omitempty"` + Pitulongresult int `json:"pitulongresult,omitempty"` + TypeField string `json:"type,omitempty"` } -type Policystringmap struct { - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Policyhttpcallout struct { + Bodyexpr string `json:"bodyexpr,omitempty"` + Cacheforsecs int `json:"cacheforsecs,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Fullreqexpr string `json:"fullreqexpr,omitempty"` + Headers []string `json:"headers,omitempty"` + Hits int `json:"hits,omitempty"` + Hostexpr string `json:"hostexpr,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Parameters []string `json:"parameters,omitempty"` + Port int `json:"port,omitempty"` + Recursivecallout int `json:"recursivecallout,omitempty"` + Resultexpr string `json:"resultexpr,omitempty"` + Returntype string `json:"returntype,omitempty"` + Scheme string `json:"scheme,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Undefhits int `json:"undefhits,omitempty"` + Undefreason string `json:"undefreason,omitempty"` + Urlstemexpr string `json:"urlstemexpr,omitempty"` + Vserver string `json:"vserver,omitempty"` } -type Policytracing struct { - Filterexpr string `json:"filterexpr,omitempty"` - Protocoltype string `json:"protocoltype,omitempty"` - Capturesslhandshakepolicies string `json:"capturesslhandshakepolicies,omitempty"` - Transactionid string `json:"transactionid,omitempty"` - Detail string `json:"detail,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Packetengineid string `json:"packetengineid,omitempty"` - Clientip string `json:"clientip,omitempty"` - Destip string `json:"destip,omitempty"` - Srcport string `json:"srcport,omitempty"` - Destport string `json:"destport,omitempty"` - Transactiontime string `json:"transactiontime,omitempty"` - Policytracingmodule string `json:"policytracingmodule,omitempty"` - Url string `json:"url,omitempty"` - Policynames string `json:"policynames,omitempty"` - Isresponse string `json:"isresponse,omitempty"` - Isundefpolicy string `json:"isundefpolicy,omitempty"` - Policytracingrecordcount string `json:"policytracingrecordcount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Policydataset struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Dynamiconly bool `json:"dynamiconly,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Patsetfile string `json:"patsetfile,omitempty"` + TypeField string `json:"type,omitempty"` } -type Policyurlset struct { - Name string `json:"name,omitempty"` - Comment string `json:"comment,omitempty"` - Imported bool `json:"imported,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Delimiter string `json:"delimiter,omitempty"` - Rowseparator string `json:"rowseparator,omitempty"` - Url string `json:"url,omitempty"` - Interval int `json:"interval,omitempty"` - Privateset bool `json:"privateset,omitempty"` - Subdomainexactmatch bool `json:"subdomainexactmatch,omitempty"` - Matchedid int `json:"matchedid,omitempty"` - Canaryurl string `json:"canaryurl,omitempty"` - Patterncount string `json:"patterncount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Policydatasetvaluebinding struct { - Value string `json:"value,omitempty"` - Index int `json:"index,omitempty"` - Comment string `json:"comment,omitempty"` - Endrange string `json:"endrange,omitempty"` - Name string `json:"name,omitempty"` +type Policymap struct { + Count float64 `json:"__count,omitempty"` + Mappolicyname string `json:"mappolicyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sd string `json:"sd,omitempty"` + Su string `json:"su,omitempty"` + Targetname string `json:"targetname,omitempty"` + Td string `json:"td,omitempty"` + Tu string `json:"tu,omitempty"` +} + +type Policyexpression struct { + Builtin []string `json:"builtin,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pihits int `json:"pihits,omitempty"` + Type1 string `json:"type1,omitempty"` + TypeField string `json:"type,omitempty"` + Value string `json:"value,omitempty"` } -type Policystringmapbinding struct { - Name string `json:"name,omitempty"` +type Policypatset struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Dynamic string `json:"dynamic,omitempty"` + Dynamiconly bool `json:"dynamiconly,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Patsetfile string `json:"patsetfile,omitempty"` +} + +type Policyparam struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Timeout int `json:"timeout,omitempty"` } diff --git a/nitrogo/models/protocol.go b/nitrogo/models/protocol.go index bf8dccb..cc573a8 100644 --- a/nitrogo/models/protocol.go +++ b/nitrogo/models/protocol.go @@ -1,24 +1,21 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// protocol configuration structs type Protocolhttpband struct { - Reqbandsize int `json:"reqbandsize,omitempty"` - Respbandsize int `json:"respbandsize,omitempty"` - Type string `json:"type,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Bandrange string `json:"bandrange,omitempty"` - Numberofbands string `json:"numberofbands,omitempty"` - Totalbandsize string `json:"totalbandsize,omitempty"` - Avgbandsize string `json:"avgbandsize,omitempty"` - Avgbandsizenew string `json:"avgbandsizenew,omitempty"` - Banddata string `json:"banddata,omitempty"` - Banddatanew string `json:"banddatanew,omitempty"` - Accesscount string `json:"accesscount,omitempty"` - Accessratio string `json:"accessratio,omitempty"` - Accessrationew string `json:"accessrationew,omitempty"` - Totals string `json:"totals,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Accesscount []interface{} `json:"accesscount,omitempty"` + Accessratio []interface{} `json:"accessratio,omitempty"` + Accessrationew []interface{} `json:"accessrationew,omitempty"` + Avgbandsize []interface{} `json:"avgbandsize,omitempty"` + Avgbandsizenew []interface{} `json:"avgbandsizenew,omitempty"` + Banddata []interface{} `json:"banddata,omitempty"` + Banddatanew []interface{} `json:"banddatanew,omitempty"` + Bandrange int `json:"bandrange,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Numberofbands int `json:"numberofbands,omitempty"` + Reqbandsize int `json:"reqbandsize,omitempty"` + Respbandsize int `json:"respbandsize,omitempty"` + Totalbandsize []interface{} `json:"totalbandsize,omitempty"` + Totals []interface{} `json:"totals,omitempty"` + TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/quic.go b/nitrogo/models/quic.go index 66a755c..083804e 100644 --- a/nitrogo/models/quic.go +++ b/nitrogo/models/quic.go @@ -1,35 +1,33 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Quicprofile struct { - Name string `json:"name,omitempty"` - Ackdelayexponent int `json:"ackdelayexponent,omitempty"` - Activeconnectionidlimit int `json:"activeconnectionidlimit,omitempty"` - Activeconnectionmigration string `json:"activeconnectionmigration,omitempty"` - Congestionctrlalgorithm string `json:"congestionctrlalgorithm,omitempty"` - Initialmaxdata int `json:"initialmaxdata,omitempty"` - Initialmaxstreamdatabidilocal int `json:"initialmaxstreamdatabidilocal,omitempty"` - Initialmaxstreamdatabidiremote int `json:"initialmaxstreamdatabidiremote,omitempty"` - Initialmaxstreamdatauni int `json:"initialmaxstreamdatauni,omitempty"` - Initialmaxstreamsbidi int `json:"initialmaxstreamsbidi,omitempty"` - Initialmaxstreamsuni int `json:"initialmaxstreamsuni,omitempty"` - Maxackdelay int `json:"maxackdelay,omitempty"` - Maxidletimeout int `json:"maxidletimeout,omitempty"` - Maxudpdatagramsperburst int `json:"maxudpdatagramsperburst,omitempty"` - Maxudppayloadsize int `json:"maxudppayloadsize,omitempty"` - Newtokenvalidityperiod int `json:"newtokenvalidityperiod,omitempty"` - Retrytokenvalidityperiod int `json:"retrytokenvalidityperiod,omitempty"` - Statelessaddressvalidation string `json:"statelessaddressvalidation,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// quic configuration structs type Quicparam struct { - Quicsecrettimeout int `json:"quicsecrettimeout,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Quicsecrettimeout int `json:"quicsecrettimeout,omitempty"` +} + +type Quicprofile struct { + Ackdelayexponent int `json:"ackdelayexponent,omitempty"` + Activeconnectionidlimit int `json:"activeconnectionidlimit,omitempty"` + Activeconnectionmigration string `json:"activeconnectionmigration,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Congestionctrlalgorithm string `json:"congestionctrlalgorithm,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Initialmaxdata int `json:"initialmaxdata,omitempty"` + Initialmaxstreamdatabidilocal int `json:"initialmaxstreamdatabidilocal,omitempty"` + Initialmaxstreamdatabidiremote int `json:"initialmaxstreamdatabidiremote,omitempty"` + Initialmaxstreamdatauni int `json:"initialmaxstreamdatauni,omitempty"` + Initialmaxstreamsbidi int `json:"initialmaxstreamsbidi,omitempty"` + Initialmaxstreamsuni int `json:"initialmaxstreamsuni,omitempty"` + Maxackdelay int `json:"maxackdelay,omitempty"` + Maxidletimeout int `json:"maxidletimeout,omitempty"` + Maxudpdatagramsperburst int `json:"maxudpdatagramsperburst,omitempty"` + Maxudppayloadsize int `json:"maxudppayloadsize,omitempty"` + Name string `json:"name,omitempty"` + Newtokenvalidityperiod int `json:"newtokenvalidityperiod,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Retrytokenvalidityperiod int `json:"retrytokenvalidityperiod,omitempty"` + Statelessaddressvalidation string `json:"statelessaddressvalidation,omitempty"` } diff --git a/nitrogo/models/quicbridge.go b/nitrogo/models/quicbridge.go index 9faf6e1..f4a14c8 100644 --- a/nitrogo/models/quicbridge.go +++ b/nitrogo/models/quicbridge.go @@ -1,13 +1,11 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// quicbridge configuration structs type Quicbridgeprofile struct { - Name string `json:"name,omitempty"` - Routingalgorithm string `json:"routingalgorithm,omitempty"` - Serveridlength int `json:"serveridlength,omitempty"` - Refcnt string `json:"refcnt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Refcnt int `json:"refcnt,omitempty"` + Routingalgorithm string `json:"routingalgorithm,omitempty"` + Serveridlength int `json:"serveridlength,omitempty"` } diff --git a/nitrogo/models/rdp.go b/nitrogo/models/rdp.go index 5c6849d..66126ad 100644 --- a/nitrogo/models/rdp.go +++ b/nitrogo/models/rdp.go @@ -1,54 +1,54 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// rdp configuration structs type Rdpclientprofile struct { - Name string `json:"name,omitempty"` - Rdpurloverride string `json:"rdpurloverride,omitempty"` - Redirectclipboard string `json:"redirectclipboard,omitempty"` - Redirectdrives string `json:"redirectdrives,omitempty"` - Redirectprinters string `json:"redirectprinters,omitempty"` - Redirectcomports string `json:"redirectcomports,omitempty"` - Redirectpnpdevices string `json:"redirectpnpdevices,omitempty"` - Keyboardhook string `json:"keyboardhook,omitempty"` - Audiocapturemode string `json:"audiocapturemode,omitempty"` - Videoplaybackmode string `json:"videoplaybackmode,omitempty"` - Multimonitorsupport string `json:"multimonitorsupport,omitempty"` - Rdpcookievalidity int `json:"rdpcookievalidity,omitempty"` - Addusernameinrdpfile string `json:"addusernameinrdpfile,omitempty"` - Rdpfilename string `json:"rdpfilename,omitempty"` - Rdphost string `json:"rdphost,omitempty"` - Rdplistener string `json:"rdplistener,omitempty"` - Rdpcustomparams string `json:"rdpcustomparams,omitempty"` - Psk string `json:"psk,omitempty"` - Randomizerdpfilename string `json:"randomizerdpfilename,omitempty"` - Rdplinkattribute string `json:"rdplinkattribute,omitempty"` - Rdpvalidateclientip string `json:"rdpvalidateclientip,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Addusernameinrdpfile string `json:"addusernameinrdpfile,omitempty"` + Audiocapturemode string `json:"audiocapturemode,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Keyboardhook string `json:"keyboardhook,omitempty"` + Multimonitorsupport string `json:"multimonitorsupport,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Psk string `json:"psk,omitempty"` + Randomizerdpfilename string `json:"randomizerdpfilename,omitempty"` + Rdpcookievalidity int `json:"rdpcookievalidity,omitempty"` + Rdpcustomparams string `json:"rdpcustomparams,omitempty"` + Rdpfilename string `json:"rdpfilename,omitempty"` + Rdphost string `json:"rdphost,omitempty"` + Rdplinkattribute string `json:"rdplinkattribute,omitempty"` + Rdplistener string `json:"rdplistener,omitempty"` + Rdpurloverride string `json:"rdpurloverride,omitempty"` + Rdpvalidateclientip string `json:"rdpvalidateclientip,omitempty"` + Redirectclipboard string `json:"redirectclipboard,omitempty"` + Redirectcomports string `json:"redirectcomports,omitempty"` + Redirectdrives string `json:"redirectdrives,omitempty"` + Redirectpnpdevices string `json:"redirectpnpdevices,omitempty"` + Redirectprinters string `json:"redirectprinters,omitempty"` + Videoplaybackmode string `json:"videoplaybackmode,omitempty"` } -type Rdpconnections struct { - Username string `json:"username,omitempty"` - All bool `json:"all,omitempty"` - Endpointip string `json:"endpointip,omitempty"` - Endpointport string `json:"endpointport,omitempty"` - Targetip string `json:"targetip,omitempty"` - Targetport string `json:"targetport,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Rdpserverprofile struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Psk string `json:"psk,omitempty"` + Rdpip string `json:"rdpip,omitempty"` + Rdpport int `json:"rdpport,omitempty"` + Rdpredirection string `json:"rdpredirection,omitempty"` } -type Rdpserverprofile struct { - Name string `json:"name,omitempty"` - Rdpip string `json:"rdpip,omitempty"` - Rdpport int `json:"rdpport,omitempty"` - Psk string `json:"psk,omitempty"` - Rdpredirection string `json:"rdpredirection,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Rdpconnections struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Endpointip string `json:"endpointip,omitempty"` + Endpointport int `json:"endpointport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Peid int `json:"peid,omitempty"` + Targetip string `json:"targetip,omitempty"` + Targetport int `json:"targetport,omitempty"` + Username string `json:"username,omitempty"` } diff --git a/nitrogo/models/reputation.go b/nitrogo/models/reputation.go index af62c13..14e21b3 100644 --- a/nitrogo/models/reputation.go +++ b/nitrogo/models/reputation.go @@ -1,13 +1,10 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// reputation configuration structs type Reputationsettings struct { - Proxyserver string `json:"proxyserver,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Proxypassword string `json:"proxypassword,omitempty"` Proxyport int `json:"proxyport,omitempty"` + Proxyserver string `json:"proxyserver,omitempty"` Proxyusername string `json:"proxyusername,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/responder.go b/nitrogo/models/responder.go index b77460c..ef174d6 100644 --- a/nitrogo/models/responder.go +++ b/nitrogo/models/responder.go @@ -1,227 +1,183 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Responderglobalbinding struct { -} - -type Responderglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` +// responder configuration structs +type ResponderglobalResponderpolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Responderglobalresponderpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Responderpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type ResponderpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderpolicyresponderglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type ResponderpolicyResponderglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderpolicylabelresponderpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type ResponderpolicyResponderpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Target string `json:"target,omitempty"` - Htmlpage string `json:"htmlpage,omitempty"` - Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` - Comment string `json:"comment,omitempty"` - Responsestatuscode int `json:"responsestatuscode,omitempty"` - Reasonphrase string `json:"reasonphrase,omitempty"` - Headers []string `json:"headers,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Responderpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Appflowaction string `json:"appflowaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Responderpolicycrvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type ResponderpolicyCrvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderpolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type ResponderpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } type Responderhtmlpage struct { - Src string `json:"src,omitempty"` - Name string `json:"name,omitempty"` + Cacertfile string `json:"cacertfile,omitempty"` Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` - Cacertfile string `json:"cacertfile,omitempty"` Response string `json:"response,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Responderpolicybinding struct { - Name string `json:"name,omitempty"` +type Responderaction struct { + Builtin []string `json:"builtin,omitempty"` + Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Headers []string `json:"headers,omitempty"` + Hits int `json:"hits,omitempty"` + Htmlpage string `json:"htmlpage,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reasonphrase string `json:"reasonphrase,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Responsestatuscode int `json:"responsestatuscode,omitempty"` + Target string `json:"target,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Responderpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Responderpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type ResponderpolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Responderpolicyglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type ResponderpolicylabelResponderpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Responderpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type ResponderpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + ResponderpolicylabelPolicybindingBinding []interface{} `json:"responderpolicylabel_policybinding_binding,omitempty"` + ResponderpolicylabelResponderpolicyBinding []interface{} `json:"responderpolicylabel_responderpolicy_binding,omitempty"` } -type Responderpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type Responderpolicy struct { + Action string `json:"action,omitempty"` + Appflowaction string `json:"appflowaction,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Responderpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type ResponderpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type Responderparam struct { - Undefaction string `json:"undefaction,omitempty"` - Timeout int `json:"timeout,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Timeout int `json:"timeout,omitempty"` + Undefaction string `json:"undefaction,omitempty"` } -type Responderpolicyresponderpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Responderpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type ResponderpolicyBinding struct { + Name string `json:"name,omitempty"` + ResponderpolicyCrvserverBinding []interface{} `json:"responderpolicy_crvserver_binding,omitempty"` + ResponderpolicyCsvserverBinding []interface{} `json:"responderpolicy_csvserver_binding,omitempty"` + ResponderpolicyLbvserverBinding []interface{} `json:"responderpolicy_lbvserver_binding,omitempty"` + ResponderpolicyResponderglobalBinding []interface{} `json:"responderpolicy_responderglobal_binding,omitempty"` + ResponderpolicyResponderpolicylabelBinding []interface{} `json:"responderpolicy_responderpolicylabel_binding,omitempty"` + ResponderpolicyVpnvserverBinding []interface{} `json:"responderpolicy_vpnvserver_binding,omitempty"` } -type Responderpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ResponderglobalBinding struct { + ResponderglobalResponderpolicyBinding []interface{} `json:"responderglobal_responderpolicy_binding,omitempty"` } diff --git a/nitrogo/models/rewrite.go b/nitrogo/models/rewrite.go index a9dc357..1d63eb7 100644 --- a/nitrogo/models/rewrite.go +++ b/nitrogo/models/rewrite.go @@ -1,213 +1,168 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Rewritepolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +// rewrite configuration structs +type RewriteglobalBinding struct { + RewriteglobalRewritepolicyBinding []interface{} `json:"rewriteglobal_rewritepolicy_binding,omitempty"` } -type Rewritepolicyrewriteglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Rewritepolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type Rewriteaction struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Refinesearch string `json:"refinesearch,omitempty"` + Search string `json:"search,omitempty"` + Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` + Target string `json:"target,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type RewritepolicyVpnvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Rewritepolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type RewritepolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Rewriteparam struct { - Undefaction string `json:"undefaction,omitempty"` - Timeout int `json:"timeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Rewritepolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Description string `json:"description,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Rewritepolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Rewritepolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Rewritepolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type RewritepolicylabelRewritepolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Rewritepolicylabelpolicybindingbinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Rewritepolicyrewritepolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type RewritepolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + RewritepolicylabelPolicybindingBinding []interface{} `json:"rewritepolicylabel_policybinding_binding,omitempty"` + RewritepolicylabelRewritepolicyBinding []interface{} `json:"rewritepolicylabel_rewritepolicy_binding,omitempty"` +} + +type RewritepolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Rewritepolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Transform string `json:"transform,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` +type RewritepolicyRewriteglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Rewritepolicylabelrewritepolicybinding struct { - Policyname string `json:"policyname,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Rewriteaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Target string `json:"target,omitempty"` - Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` - Search string `json:"search,omitempty"` - Refinesearch string `json:"refinesearch,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Description string `json:"description,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type RewritepolicyBinding struct { + Name string `json:"name,omitempty"` + RewritepolicyCsvserverBinding []interface{} `json:"rewritepolicy_csvserver_binding,omitempty"` + RewritepolicyLbvserverBinding []interface{} `json:"rewritepolicy_lbvserver_binding,omitempty"` + RewritepolicyRewriteglobalBinding []interface{} `json:"rewritepolicy_rewriteglobal_binding,omitempty"` + RewritepolicyRewritepolicylabelBinding []interface{} `json:"rewritepolicy_rewritepolicylabel_binding,omitempty"` + RewritepolicyVpnvserverBinding []interface{} `json:"rewritepolicy_vpnvserver_binding,omitempty"` } -type Rewriteglobalbinding struct { -} - -type Rewriteglobalrewritepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type Rewriteparam struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Timeout int `json:"timeout,omitempty"` + Undefaction string `json:"undefaction,omitempty"` } -type Rewritepolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Rewritepolicylabel struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Priority int `json:"priority,omitempty"` + Transform string `json:"transform,omitempty"` +} + +type RewritepolicyRewritepolicylabelBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Rewritepolicyglobalbinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Rewritepolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Rewritepolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type RewriteglobalRewritepolicyBinding struct { + Flowtype int `json:"flowtype,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Rewriteglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type RewritepolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/router.go b/nitrogo/models/router.go index a7b1943..e353b3b 100644 --- a/nitrogo/models/router.go +++ b/nitrogo/models/router.go @@ -1,12 +1,10 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// router configuration structs type Routerdynamicrouting struct { - Commandstring string `json:"commandstring,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Output string `json:"output,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Commandstring string `json:"commandstring,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Output string `json:"output,omitempty"` } diff --git a/nitrogo/models/smpp.go b/nitrogo/models/smpp.go index 9caf4ab..6424f05 100644 --- a/nitrogo/models/smpp.go +++ b/nitrogo/models/smpp.go @@ -1,21 +1,19 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// smpp configuration structs type Smppparam struct { + Addrnpi int `json:"addrnpi,omitempty"` + Addrrange string `json:"addrrange,omitempty"` + Addrton int `json:"addrton,omitempty"` Clientmode string `json:"clientmode,omitempty"` Msgqueue string `json:"msgqueue,omitempty"` Msgqueuesize int `json:"msgqueuesize,omitempty"` - Addrton int `json:"addrton"` - Addrnpi int `json:"addrnpi"` - Addrrange string `json:"addrrange,omitempty"` Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } type Smppuser struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` } diff --git a/nitrogo/models/snmp.go b/nitrogo/models/snmp.go index 39cec76..5b508e7 100644 --- a/nitrogo/models/snmp.go +++ b/nitrogo/models/snmp.go @@ -1,137 +1,137 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Snmpview struct { - Name string `json:"name,omitempty"` - Subtree string `json:"subtree,omitempty"` - Type string `json:"type,omitempty"` - Storagetype string `json:"storagetype,omitempty"` - Status string `json:"status,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Snmpengineid struct { - Engineid string `json:"engineid,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Defaultengineid string `json:"defaultengineid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Snmpgroup struct { - Name string `json:"name,omitempty"` - Securitylevel string `json:"securitylevel,omitempty"` - Readviewname string `json:"readviewname,omitempty"` - Storagetype string `json:"storagetype,omitempty"` - Status string `json:"status,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - +// snmp configuration structs type Snmpmanager struct { - Ipaddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` - Ip string `json:"ip,omitempty"` - Domain string `json:"domain,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Domain string `json:"domain,omitempty"` + Domainresolveretry int `json:"domainresolveretry,omitempty"` + Ip string `json:"ip,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Snmpoid struct { - Entitytype string `json:"entitytype,omitempty"` - Name string `json:"name,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Snmpalarm struct { + Count float64 `json:"__count,omitempty"` + Logging string `json:"logging,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Normalvalue int `json:"normalvalue,omitempty"` + Severity string `json:"severity,omitempty"` + State string `json:"state,omitempty"` + Thresholdvalue int `json:"thresholdvalue,omitempty"` + Time int `json:"time,omitempty"` + Timeout int `json:"timeout,omitempty"` + Trapname string `json:"trapname,omitempty"` } type Snmpoption struct { + Customtrap string `json:"customtrap,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Partitionnameintrap string `json:"partitionnameintrap,omitempty"` + Severityinfointrap string `json:"severityinfointrap,omitempty"` Snmpset string `json:"snmpset,omitempty"` Snmptraplogging string `json:"snmptraplogging,omitempty"` - Partitionnameintrap string `json:"partitionnameintrap,omitempty"` Snmptraplogginglevel string `json:"snmptraplogginglevel,omitempty"` - Severityinfointrap string `json:"severityinfointrap,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Snmptrap struct { - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` - Version string `json:"version,omitempty"` - Td int `json:"td,omitempty"` - Destport int `json:"destport,omitempty"` - Communityname string `json:"communityname,omitempty"` - Srcip string `json:"srcip,omitempty"` - Severity string `json:"severity,omitempty"` - Allpartitions string `json:"allpartitions,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Snmpengineid struct { + Count float64 `json:"__count,omitempty"` + Defaultengineid string `json:"defaultengineid,omitempty"` + Engineid string `json:"engineid,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` } -type Snmptrapbinding struct { - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` - Version string `json:"version,omitempty"` - Td int `json:"td,omitempty"` +type Snmpmib struct { + Contact string `json:"contact,omitempty"` + Count float64 `json:"__count,omitempty"` + Customid string `json:"customid,omitempty"` + Location string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ownernode int `json:"ownernode,omitempty"` + Sysdesc string `json:"sysdesc,omitempty"` + Sysoid string `json:"sysoid,omitempty"` + Sysservices int `json:"sysservices,omitempty"` + Sysuptime int `json:"sysuptime,omitempty"` } -type Snmpuser struct { - Name string `json:"name,omitempty"` - Group string `json:"group,omitempty"` - Authtype string `json:"authtype,omitempty"` - Authpasswd string `json:"authpasswd,omitempty"` - Privtype string `json:"privtype,omitempty"` - Privpasswd string `json:"privpasswd,omitempty"` - Engineid string `json:"engineid,omitempty"` - Storagetype string `json:"storagetype,omitempty"` - Status string `json:"status,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Snmpcommunity struct { + Communityname string `json:"communityname,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Permissions string `json:"permissions,omitempty"` } -type Snmpalarm struct { - Trapname string `json:"trapname,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` - Normalvalue int `json:"normalvalue,omitempty"` - Time int `json:"time,omitempty"` - State string `json:"state,omitempty"` - Severity string `json:"severity,omitempty"` - Logging string `json:"logging,omitempty"` - Timeout string `json:"timeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SnmptrapBinding struct { + SnmptrapSnmpuserBinding []interface{} `json:"snmptrap_snmpuser_binding,omitempty"` + Td int `json:"td,omitempty"` + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Version string `json:"version,omitempty"` } -type Snmpcommunity struct { - Communityname string `json:"communityname,omitempty"` - Permissions string `json:"permissions,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Snmpuser struct { + Authpasswd string `json:"authpasswd,omitempty"` + Authtype string `json:"authtype,omitempty"` + Count float64 `json:"__count,omitempty"` + Engineid string `json:"engineid,omitempty"` + Group string `json:"group,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Privpasswd string `json:"privpasswd,omitempty"` + Privtype string `json:"privtype,omitempty"` + Status string `json:"status,omitempty"` + Storagetype string `json:"storagetype,omitempty"` } -type Snmpmib struct { - Contact string `json:"contact,omitempty"` - Name string `json:"name,omitempty"` - Location string `json:"location,omitempty"` - Customid string `json:"customid,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Sysdesc string `json:"sysdesc,omitempty"` - Sysuptime string `json:"sysuptime,omitempty"` - Sysservices string `json:"sysservices,omitempty"` - Sysoid string `json:"sysoid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Snmpgroup struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Readviewname string `json:"readviewname,omitempty"` + Securitylevel string `json:"securitylevel,omitempty"` + Status string `json:"status,omitempty"` + Storagetype string `json:"storagetype,omitempty"` } -type Snmptrapsnmpuserbinding struct { - Username string `json:"username,omitempty"` - Securitylevel string `json:"securitylevel,omitempty"` - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` - Td int `json:"td,omitempty"` - Version string `json:"version,omitempty"` +type Snmptrap struct { + Allpartitions string `json:"allpartitions,omitempty"` + Communityname string `json:"communityname,omitempty"` + Count float64 `json:"__count,omitempty"` + Destport int `json:"destport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Severity string `json:"severity,omitempty"` + Srcip string `json:"srcip,omitempty"` + Td int `json:"td,omitempty"` + Trapclass string `json:"trapclass,omitempty"` + Trapdestination string `json:"trapdestination,omitempty"` + Version string `json:"version,omitempty"` } -type Snmptrapuserbinding struct { - Username string `json:"username,omitempty"` +type SnmptrapSnmpuserBinding struct { Securitylevel string `json:"securitylevel,omitempty"` + Td int `json:"td,omitempty"` Trapclass string `json:"trapclass,omitempty"` Trapdestination string `json:"trapdestination,omitempty"` - Td uint32 `json:"td,omitempty"` + Username string `json:"username,omitempty"` Version string `json:"version,omitempty"` } + +type Snmpoid struct { + Count float64 `json:"__count,omitempty"` + Entitytype string `json:"entitytype,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Snmpoid string `json:"Snmpoid,omitempty"` +} + +type Snmpview struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Status string `json:"status,omitempty"` + Storagetype string `json:"storagetype,omitempty"` + Subtree string `json:"subtree,omitempty"` + TypeField string `json:"type,omitempty"` +} diff --git a/nitrogo/models/spillover.go b/nitrogo/models/spillover.go index 97cec69..0a891c7 100644 --- a/nitrogo/models/spillover.go +++ b/nitrogo/models/spillover.go @@ -1,71 +1,63 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Spilloverpolicyvserverbinding struct { +// spillover configuration structs +type SpilloverpolicyGslbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` -} - -type Spilloveraction struct { - Name string `json:"name,omitempty"` - Action string `json:"action,omitempty"` - Newname string `json:"newname,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` } type Spilloverpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Spilloverpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Spilloverpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type SpilloverpolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Spilloverpolicygslbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type SpilloverpolicyBinding struct { + Name string `json:"name,omitempty"` + SpilloverpolicyCsvserverBinding []interface{} `json:"spilloverpolicy_csvserver_binding,omitempty"` + SpilloverpolicyGslbvserverBinding []interface{} `json:"spilloverpolicy_gslbvserver_binding,omitempty"` + SpilloverpolicyLbvserverBinding []interface{} `json:"spilloverpolicy_lbvserver_binding,omitempty"` } -type Spilloverpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Spilloveraction struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type SpilloverpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/ssl.go b/nitrogo/models/ssl.go index dbe80c8..da9fd2d 100644 --- a/nitrogo/models/ssl.go +++ b/nitrogo/models/ssl.go @@ -1,1445 +1,1274 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Sslcacertbundle struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Bundlefile string `json:"bundlefile,omitempty"` - Servername string `json:"servername,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslcertificatechain struct { - Certkeyname string `json:"certkeyname,omitempty"` - Chainlinked string `json:"chainlinked,omitempty"` - Chainpossiblelinks string `json:"chainpossiblelinks,omitempty"` - Chainissuer string `json:"chainissuer,omitempty"` - Chaincomplete string `json:"chaincomplete,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslcertkeyocspresponderbinding struct { - Ocspresponder string `json:"ocspresponder,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ca bool `json:"ca,omitempty"` +// ssl configuration structs +type SslcertkeybundleIntermediatecertlinksBinding struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Issuer string `json:"issuer,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize int `json:"publickeysize,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Serial string `json:"serial,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Status string `json:"status,omitempty"` + Subject string `json:"subject,omitempty"` } -type Sslcipher struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Ciphgrpalias string `json:"ciphgrpalias,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslhpkekey struct { + Count float64 `json:"__count,omitempty"` + Dhkem string `json:"dhkem,omitempty"` + File string `json:"file,omitempty"` + Hpkekeyname string `json:"hpkekeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Sslpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type SslpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SslcipherBinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + SslcipherIndividualcipherBinding []interface{} `json:"sslcipher_individualcipher_binding,omitempty"` + SslcipherSslciphersuiteBinding []interface{} `json:"sslcipher_sslciphersuite_binding,omitempty"` + SslcipherSslprofileBinding []interface{} `json:"sslcipher_sslprofile_binding,omitempty"` } -type Sslpolicyservicebinding struct { +type SslpolicySslpolicylabelBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslcertkeysslprofilebinding struct { - Sslprofile string `json:"sslprofile,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ca bool `json:"ca,omitempty"` -} - -type Sslechconfig struct { - Echconfigname string `json:"echconfigname,omitempty"` - Echcipher string `json:"echcipher,omitempty"` - Hpkekeyname string `json:"hpkekeyname,omitempty"` - Echpublicname string `json:"echpublicname,omitempty"` - Echconfigid int `json:"echconfigid,omitempty"` - Version int `json:"version,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslocspresponder struct { - Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` - Cache string `json:"cache,omitempty"` - Cachetimeout int `json:"cachetimeout,omitempty"` - Batchingdepth int `json:"batchingdepth,omitempty"` - Batchingdelay int `json:"batchingdelay,omitempty"` - Resptimeout int `json:"resptimeout,omitempty"` - Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` - Respondercert string `json:"respondercert,omitempty"` - Trustresponder bool `json:"trustresponder,omitempty"` - Producedattimeskew int `json:"producedattimeskew,omitempty"` - Signingcert string `json:"signingcert,omitempty"` - Usenonce string `json:"usenonce,omitempty"` - Insertclientcert string `json:"insertclientcert,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Ocspaiarefcount string `json:"ocspaiarefcount,omitempty"` - Ocspipaddrstr string `json:"ocspipaddrstr,omitempty"` - Port string `json:"port,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslprofilesslcertkeybinding struct { - Sslicacertkey string `json:"sslicacertkey,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` -} - -type Sslprofilevserverbinding struct { - Servicename string `json:"servicename,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` +type SslvserverSslcertkeyBinding struct { + Ca bool `json:"ca,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslrsakey struct { - Keyfile string `json:"keyfile,omitempty"` - Bits int `json:"bits,omitempty"` - Exponent string `json:"exponent,omitempty"` - Keyform string `json:"keyform,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` - Aes256 bool `json:"aes256,omitempty"` - Password string `json:"password,omitempty"` - Pkcs8 bool `json:"pkcs8,omitempty"` +type SslcrlSerialnumberBinding struct { + Crlname string `json:"crlname,omitempty"` + Date string `json:"date,omitempty"` + Number string `json:"number,omitempty"` } -type Sslservice struct { - Servicename string `json:"servicename,omitempty"` - Dh string `json:"dh,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Dtls1 string `json:"dtls1,omitempty"` - Dtls12 string `json:"dtls12,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Serverauth string `json:"serverauth,omitempty"` - Commonname string `json:"commonname,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Dtlsprofilename string `json:"dtlsprofilename,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Service string `json:"service,omitempty"` - Skipcaname string `json:"skipcaname,omitempty"` - Dtlsflag string `json:"dtlsflag,omitempty"` - Quicflag string `json:"quicflag,omitempty"` - Skipcacertbundle string `json:"skipcacertbundle,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslciphersslciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type Sslfipskey struct { + Count float64 `json:"__count,omitempty"` + Curve string `json:"curve,omitempty"` + Exponent string `json:"exponent,omitempty"` + Fipskeyname string `json:"fipskeyname,omitempty"` + Inform string `json:"inform,omitempty"` + Iv string `json:"iv,omitempty"` + Key string `json:"key,omitempty"` + Keytype string `json:"keytype,omitempty"` + Modulus int `json:"modulus,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Size int `json:"size,omitempty"` + Wrapkeyname string `json:"wrapkeyname,omitempty"` +} + +type SslcipherSslprofileBinding struct { Ciphergroupname string `json:"ciphergroupname,omitempty"` Cipheroperation string `json:"cipheroperation,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` Ciphgrpals string `json:"ciphgrpals,omitempty"` -} - -type Ssldhfile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Ssldhparam struct { - Dhfile string `json:"dhfile,omitempty"` - Bits int `json:"bits,omitempty"` - Gen string `json:"gen,omitempty"` -} - -type Sslpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Type string `json:"type,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke string `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Flowtype string `json:"flowtype,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslprofilecertkeybinding struct { - Sslicacertkey string `json:"sslicacertkey,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` -} - -type Sslvserversslcipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` - Ciphername string `json:"ciphername,omitempty"` -} - -type Sslcrlbinding struct { - Crlname string `json:"crlname,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` } type Sslfipssimtarget struct { + Certfile string `json:"certfile,omitempty"` Keyvector string `json:"keyvector,omitempty"` Sourcesecret string `json:"sourcesecret,omitempty"` - Certfile string `json:"certfile,omitempty"` Targetsecret string `json:"targetsecret,omitempty"` } -type Sslglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type SslserviceSslpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Polinherit int `json:"polinherit,omitempty"` + Priority int `json:"priority,omitempty"` + Servicename string `json:"servicename,omitempty"` + TypeField string `json:"type,omitempty"` } -type Sslpkcs12 struct { - Outfile string `json:"outfile,omitempty"` - Import bool `json:"Import,omitempty"` - Pkcs12file string `json:"pkcs12file,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` - Aes256 bool `json:"aes256,omitempty"` - Export bool `json:"export,omitempty"` - Certfile string `json:"certfile,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Password string `json:"password,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` -} - -type Sslcertkeysslocspresponderbinding struct { - Ocspresponder string `json:"ocspresponder,omitempty"` - Priority int `json:"priority,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ca bool `json:"ca,omitempty"` +type SslprofileSslciphersuiteBinding struct { + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` } -type Sslcertkeybundlesslvserverbinding struct { - Servername string `json:"servername,omitempty"` - Certkeybundlename string `json:"certkeybundlename,omitempty"` +type SslpolicySslserviceBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslprofileecccurvebinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslvserverBinding struct { + SslvserverEcccurveBinding []interface{} `json:"sslvserver_ecccurve_binding,omitempty"` + SslvserverHashicorpBinding []interface{} `json:"sslvserver_hashicorp_binding,omitempty"` + SslvserverSslcacertbundleBinding []interface{} `json:"sslvserver_sslcacertbundle_binding,omitempty"` + SslvserverSslcertkeyBinding []interface{} `json:"sslvserver_sslcertkey_binding,omitempty"` + SslvserverSslcertkeybundleBinding []interface{} `json:"sslvserver_sslcertkeybundle_binding,omitempty"` + SslvserverSslcipherBinding []interface{} `json:"sslvserver_sslcipher_binding,omitempty"` + SslvserverSslciphersuiteBinding []interface{} `json:"sslvserver_sslciphersuite_binding,omitempty"` + SslvserverSslpolicyBinding []interface{} `json:"sslvserver_sslpolicy_binding,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslvserverhashicorpbinding struct { - Vault string `json:"vault,omitempty"` - Vservername string `json:"vservername,omitempty"` +type Sslecdsakey struct { + Aes256 bool `json:"aes256,omitempty"` + Curve string `json:"curve,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Password string `json:"password,omitempty"` + Pkcs8 bool `json:"pkcs8,omitempty"` } -type Sslcert struct { - Certfile string `json:"certfile,omitempty"` - Reqfile string `json:"reqfile,omitempty"` - Certtype string `json:"certtype,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` - Days int `json:"days,omitempty"` - Subjectaltname string `json:"subjectaltname,omitempty"` - Certform string `json:"certform,omitempty"` - Cacert string `json:"cacert,omitempty"` - Cacertform string `json:"cacertform,omitempty"` - Cakey string `json:"cakey,omitempty"` - Cakeyform string `json:"cakeyform,omitempty"` - Caserial string `json:"caserial,omitempty"` +type SslservicegroupSslcacertbundleBinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type Sslcertkeysslvserverbinding struct { - Servername string `json:"servername,omitempty"` - Data int `json:"data,omitempty"` - Version int `json:"version,omitempty"` - Certkey string `json:"certkey,omitempty"` - Vservername string `json:"vservername,omitempty"` - Vserver bool `json:"vserver,omitempty"` - Ca bool `json:"ca,omitempty"` +type Sslhsmkey struct { + Count float64 `json:"__count,omitempty"` + Hsmkeyname string `json:"hsmkeyname,omitempty"` + Hsmtype string `json:"hsmtype,omitempty"` + Key string `json:"key,omitempty"` + Keystore string `json:"keystore,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Serialnum string `json:"serialnum,omitempty"` + State string `json:"state,omitempty"` } -type Sslcipherservicebinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Service bool `json:"service,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicegroup bool `json:"servicegroup,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslcacertgroupBinding struct { + Cacertgroupname string `json:"cacertgroupname,omitempty"` + SslcacertgroupSslcertkeyBinding []interface{} `json:"sslcacertgroup_sslcertkey_binding,omitempty"` } -type Ssldtlsprofile struct { - Name string `json:"name,omitempty"` - Pmtudiscovery string `json:"pmtudiscovery,omitempty"` - Maxrecordsize int `json:"maxrecordsize,omitempty"` - Maxretrytime int `json:"maxretrytime,omitempty"` - Helloverifyrequest string `json:"helloverifyrequest,omitempty"` - Terminatesession string `json:"terminatesession,omitempty"` - Maxpacketsize int `json:"maxpacketsize,omitempty"` - Maxholdqlen int `json:"maxholdqlen,omitempty"` - Maxbadmacignorecount int `json:"maxbadmacignorecount,omitempty"` - Initialretrytimeout int `json:"initialretrytimeout,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslciphersuite struct { + Ciphername string `json:"ciphername,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Sslfipssimsource struct { - Targetsecret string `json:"targetsecret,omitempty"` - Sourcesecret string `json:"sourcesecret,omitempty"` - Certfile string `json:"certfile,omitempty"` +type SslcrlBinding struct { + Crlname string `json:"crlname,omitempty"` + SslcrlSerialnumberBinding []interface{} `json:"sslcrl_serialnumber_binding,omitempty"` } -type Sslhpkekey struct { - Hpkekeyname string `json:"hpkekeyname,omitempty"` - File string `json:"file,omitempty"` - Dhkem string `json:"dhkem,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SslpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + SslpolicylabelSslpolicyBinding []interface{} `json:"sslpolicylabel_sslpolicy_binding,omitempty"` } -type Sslpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type SslservicegroupBinding struct { + Servicegroupname string `json:"servicegroupname,omitempty"` + SslservicegroupEcccurveBinding []interface{} `json:"sslservicegroup_ecccurve_binding,omitempty"` + SslservicegroupSslcacertbundleBinding []interface{} `json:"sslservicegroup_sslcacertbundle_binding,omitempty"` + SslservicegroupSslcertkeyBinding []interface{} `json:"sslservicegroup_sslcertkey_binding,omitempty"` + SslservicegroupSslcipherBinding []interface{} `json:"sslservicegroup_sslcipher_binding,omitempty"` + SslservicegroupSslciphersuiteBinding []interface{} `json:"sslservicegroup_sslciphersuite_binding,omitempty"` } -type Sslvservercertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Cleartextport int32 `json:"cleartextport,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Vservername string `json:"vservername,omitempty"` +type Sslwrapkey struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Salt string `json:"salt,omitempty"` + Wrapkeyname string `json:"wrapkeyname,omitempty"` } -type Sslcertchainsslcertkeybinding struct { - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Islinked bool `json:"islinked,omitempty"` - Isca bool `json:"isca,omitempty"` - Addsubject bool `json:"addsubject,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` +type Sslocspresponder struct { + Batchingdelay int `json:"batchingdelay,omitempty"` + Batchingdepth int `json:"batchingdepth,omitempty"` + Cache string `json:"cache,omitempty"` + Cachetimeout int `json:"cachetimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Httpmethod string `json:"httpmethod,omitempty"` + Insertclientcert string `json:"insertclientcert,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ocspaiarefcount int `json:"ocspaiarefcount,omitempty"` + Ocspipaddrstr string `json:"ocspipaddrstr,omitempty"` + Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` + Port int `json:"port,omitempty"` + Producedattimeskew int `json:"producedattimeskew,omitempty"` + Respondercert string `json:"respondercert,omitempty"` + Resptimeout int `json:"resptimeout,omitempty"` + Signingcert string `json:"signingcert,omitempty"` + Trustresponder bool `json:"trustresponder,omitempty"` + Url string `json:"url,omitempty"` + Usenonce string `json:"usenonce,omitempty"` } -type Sslcacertbundlebinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` +type Sslcrl struct { + Basedn string `json:"basedn,omitempty"` + Binary string `json:"binary,omitempty"` + Binddn string `json:"binddn,omitempty"` + Cacert string `json:"cacert,omitempty"` + Cacertfile string `json:"cacertfile,omitempty"` + Cakeyfile string `json:"cakeyfile,omitempty"` + Count float64 `json:"__count,omitempty"` + Crlname string `json:"crlname,omitempty"` + Crlpath string `json:"crlpath,omitempty"` + Day int `json:"day,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Flags int `json:"flags,omitempty"` + Gencrl string `json:"gencrl,omitempty"` + Indexfile string `json:"indexfile,omitempty"` + Inform string `json:"inform,omitempty"` + Interval string `json:"interval,omitempty"` + Issuer string `json:"issuer,omitempty"` + Lastupdate string `json:"lastupdate,omitempty"` + Lastupdatetime int `json:"lastupdatetime,omitempty"` + Method string `json:"method,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextupdate string `json:"nextupdate,omitempty"` + Password string `json:"password,omitempty"` + Port int `json:"port,omitempty"` + Refresh string `json:"refresh,omitempty"` + Revoke string `json:"revoke,omitempty"` + Scope string `json:"scope,omitempty"` + Server string `json:"server,omitempty"` + Signaturealgo string `json:"signaturealgo,omitempty"` + Time string `json:"time,omitempty"` + Url string `json:"url,omitempty"` + Version int `json:"version,omitempty"` +} + +type SslcertkeybundleBinding struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` + SslcertkeybundleIntermediatecertlinksBinding []interface{} `json:"sslcertkeybundle_intermediatecertlinks_binding,omitempty"` + SslcertkeybundleSslvserverBinding []interface{} `json:"sslcertkeybundle_sslvserver_binding,omitempty"` +} + +type SslprofileSslcipherBinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` } -type Sslcrl struct { - Crlname string `json:"crlname,omitempty"` - Crlpath string `json:"crlpath,omitempty"` - Inform string `json:"inform,omitempty"` - Refresh string `json:"refresh,omitempty"` - Cacert string `json:"cacert,omitempty"` - Method string `json:"method,omitempty"` - Server string `json:"server,omitempty"` - Url string `json:"url,omitempty"` - Port int `json:"port,omitempty"` - Basedn string `json:"basedn,omitempty"` - Scope string `json:"scope,omitempty"` - Interval string `json:"interval,omitempty"` - Day int `json:"day,omitempty"` - Time string `json:"time,omitempty"` - Binddn string `json:"binddn,omitempty"` - Password string `json:"password,omitempty"` - Binary string `json:"binary,omitempty"` - Cacertfile string `json:"cacertfile,omitempty"` - Cakeyfile string `json:"cakeyfile,omitempty"` - Indexfile string `json:"indexfile,omitempty"` - Revoke string `json:"revoke,omitempty"` - Gencrl string `json:"gencrl,omitempty"` - Flags string `json:"flags,omitempty"` - Lastupdatetime string `json:"lastupdatetime,omitempty"` - Version string `json:"version,omitempty"` - Signaturealgo string `json:"signaturealgo,omitempty"` - Issuer string `json:"issuer,omitempty"` - Lastupdate string `json:"lastupdate,omitempty"` - Nextupdate string `json:"nextupdate,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslpolicyvserverbinding struct { +type SslpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslvserversslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Vservername string `json:"vservername,omitempty"` +type Sslpkcs8 struct { + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Password string `json:"password,omitempty"` + Pkcs8file string `json:"pkcs8file,omitempty"` } -type Sslcertfile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SslvserverSslcacertbundleBinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslprofilesslechconfigbinding struct { - Echconfigname string `json:"echconfigname,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslprofileBinding struct { + Name string `json:"name,omitempty"` + SslprofileEcccurveBinding []interface{} `json:"sslprofile_ecccurve_binding,omitempty"` + SslprofileSslcertkeyBinding []interface{} `json:"sslprofile_sslcertkey_binding,omitempty"` + SslprofileSslcipherBinding []interface{} `json:"sslprofile_sslcipher_binding,omitempty"` + SslprofileSslciphersuiteBinding []interface{} `json:"sslprofile_sslciphersuite_binding,omitempty"` + SslprofileSslechconfigBinding []interface{} `json:"sslprofile_sslechconfig_binding,omitempty"` + SslprofileSslvserverBinding []interface{} `json:"sslprofile_sslvserver_binding,omitempty"` } -type Sslserviceecccurvebinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Servicename string `json:"servicename,omitempty"` +type SslcertkeyServiceBinding struct { + Ca bool `json:"ca,omitempty"` + Certkey string `json:"certkey,omitempty"` + Data int `json:"data,omitempty"` + Service bool `json:"service,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Version int `json:"version,omitempty"` } -type Sslcertkeyprofilebinding struct { - Sslprofile string `json:"sslprofile,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ca bool `json:"ca,omitempty"` +type SslvserverEcccurveBinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslcertchaincertkeybinding struct { - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Islinked bool `json:"islinked,omitempty"` - Isca bool `json:"isca,omitempty"` - Addsubject bool `json:"addsubject,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` +type Sslcacertgroup struct { + Cacertgroupname string `json:"cacertgroupname,omitempty"` + Cacertgroupreferences int `json:"cacertgroupreferences,omitempty"` + Count float64 `json:"__count,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` } -type Sslcertkeycrldistributionbinding struct { - Issuer string `json:"issuer,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ca bool `json:"ca,omitempty"` +type SslserviceSslcipherBinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Cipherdefaulton int `json:"cipherdefaulton,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Servicename string `json:"servicename,omitempty"` } -type Sslhsmkey struct { - Hsmkeyname string `json:"hsmkeyname,omitempty"` - Hsmtype string `json:"hsmtype,omitempty"` - Key string `json:"key,omitempty"` - Serialnum string `json:"serialnum,omitempty"` - Password string `json:"password,omitempty"` - Keystore string `json:"keystore,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SslvserverSslcipherBinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslpolicysslservicebinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Ssldefaultprofile struct { } -type Sslservicegroup struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Serverauth string `json:"serverauth,omitempty"` - Commonname string `json:"commonname,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Dh string `json:"dh,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhcount string `json:"dhcount,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount string `json:"ersacount,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Cleartextport string `json:"cleartextport,omitempty"` - Servicename string `json:"servicename,omitempty"` - Ca string `json:"ca,omitempty"` - Snicert string `json:"snicert,omitempty"` - Quicflag string `json:"quicflag,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslcipherbinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` +type SslcertkeyCrldistributionBinding struct { + Ca bool `json:"ca,omitempty"` + Certkey string `json:"certkey,omitempty"` + Issuer string `json:"issuer,omitempty"` +} + +type Sslcacertbundle struct { + Bundlefile string `json:"bundlefile,omitempty"` + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Servername string `json:"servername,omitempty"` +} + +type Ssldtlsprofile struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Helloverifyrequest string `json:"helloverifyrequest,omitempty"` + Initialretrytimeout int `json:"initialretrytimeout,omitempty"` + Maxbadmacignorecount int `json:"maxbadmacignorecount,omitempty"` + Maxholdqlen int `json:"maxholdqlen,omitempty"` + Maxpacketsize int `json:"maxpacketsize,omitempty"` + Maxrecordsize int `json:"maxrecordsize,omitempty"` + Maxretrytime int `json:"maxretrytime,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pmtudiscovery string `json:"pmtudiscovery,omitempty"` + Terminatesession string `json:"terminatesession,omitempty"` } -type Sslpolicybinding struct { - Name string `json:"name,omitempty"` +type Sslcert struct { + Cacert string `json:"cacert,omitempty"` + Cacertform string `json:"cacertform,omitempty"` + Cakey string `json:"cakey,omitempty"` + Cakeyform string `json:"cakeyform,omitempty"` + Caserial string `json:"caserial,omitempty"` + Certfile string `json:"certfile,omitempty"` + Certform string `json:"certform,omitempty"` + Certtype string `json:"certtype,omitempty"` + Days int `json:"days,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` + Reqfile string `json:"reqfile,omitempty"` + Subjectaltname string `json:"subjectaltname,omitempty"` } -type Sslpolicyglobalbinding struct { +type SslpolicySslglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Sslrsakey struct { + Aes256 bool `json:"aes256,omitempty"` + Bits int `json:"bits,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Exponent string `json:"exponent,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Password string `json:"password,omitempty"` + Pkcs8 bool `json:"pkcs8,omitempty"` +} + +type SslserviceEcccurveBinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Servicename string `json:"servicename,omitempty"` } -type Sslservicecertkeybinding struct { +type SslserviceSslcertkeyBinding struct { + Ca bool `json:"ca,omitempty"` Certkeyname string `json:"certkeyname,omitempty"` - Cleartextport int32 `json:"cleartextport,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` Crlcheck string `json:"crlcheck,omitempty"` Ocspcheck string `json:"ocspcheck,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` Servicename string `json:"servicename,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Snicert bool `json:"snicert,omitempty"` } -type Sslservicesslpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Polinherit int `json:"polinherit,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Servicename string `json:"servicename,omitempty"` -} - -type Sslservicegroupsslcacertbundlebinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type Sslservicegroup struct { + Ca bool `json:"ca,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Commonname string `json:"commonname,omitempty"` + Count float64 `json:"__count,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Dh string `json:"dh,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Quicflag bool `json:"quicflag,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` + Servicename string `json:"servicename,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` +} + +type SslprofileSslvserverBinding struct { + Cipherpriority int `json:"cipherpriority,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Servicename string `json:"servicename,omitempty"` } -type Sslcacertgroup struct { - Cacertgroupname string `json:"cacertgroupname,omitempty"` - Cacertgroupreferences string `json:"cacertgroupreferences,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslcertlink struct { + Certkeyname string `json:"certkeyname,omitempty"` + Count float64 `json:"__count,omitempty"` + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Sslprofileciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` +type SslglobalSslpolicyBinding struct { + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Sslservicegroupecccurvebinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type Sslcrlfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Sslcertchain struct { - Certkeyname string `json:"certkeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SslcertchainSslcertkeyBinding struct { + Addsubject bool `json:"addsubject,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Isca bool `json:"isca,omitempty"` + Islinked bool `json:"islinked,omitempty"` + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` } type Sslparameter struct { - Quantumsize string `json:"quantumsize,omitempty"` Crlmemorysizemb int `json:"crlmemorysizemb,omitempty"` - Strictcachecks string `json:"strictcachecks,omitempty"` - Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` + Cryptodevdisablelimit int `json:"cryptodevdisablelimit,omitempty"` + Defaultprofile string `json:"defaultprofile,omitempty"` Denysslreneg string `json:"denysslreneg,omitempty"` + Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` + Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` + Heterogeneoussslhw string `json:"heterogeneoussslhw,omitempty"` + Hybridfipsmode string `json:"hybridfipsmode,omitempty"` + Insertcertspace string `json:"insertcertspace,omitempty"` Insertionencoding string `json:"insertionencoding,omitempty"` + Montls1112disable string `json:"montls1112disable,omitempty"` + Ndcppcompliancecertcheck string `json:"ndcppcompliancecertcheck,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Ocspcachesize int `json:"ocspcachesize,omitempty"` + Operationqueuelimit int `json:"operationqueuelimit,omitempty"` + Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` Pushflag int `json:"pushflag,omitempty"` - Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` + Quantumsize string `json:"quantumsize,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Sigdigesttype []string `json:"sigdigesttype,omitempty"` Snihttphostmatch string `json:"snihttphostmatch,omitempty"` - Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` - Cryptodevdisablelimit int `json:"cryptodevdisablelimit,omitempty"` - Undefactioncontrol string `json:"undefactioncontrol,omitempty"` - Undefactiondata string `json:"undefactiondata,omitempty"` - Defaultprofile string `json:"defaultprofile,omitempty"` Softwarecryptothreshold int `json:"softwarecryptothreshold,omitempty"` - Hybridfipsmode string `json:"hybridfipsmode,omitempty"` - Sigdigesttype []string `json:"sigdigesttype,omitempty"` Sslierrorcache string `json:"sslierrorcache,omitempty"` Sslimaxerrorcachemem int `json:"sslimaxerrorcachemem,omitempty"` - Insertcertspace string `json:"insertcertspace,omitempty"` - Ndcppcompliancecertcheck string `json:"ndcppcompliancecertcheck,omitempty"` - Heterogeneoussslhw string `json:"heterogeneoussslhw,omitempty"` - Operationqueuelimit int `json:"operationqueuelimit,omitempty"` + Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` + Strictcachecks string `json:"strictcachecks,omitempty"` Svctls1112disable string `json:"svctls1112disable,omitempty"` - Montls1112disable string `json:"montls1112disable,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Undefactioncontrol string `json:"undefactioncontrol,omitempty"` + Undefactiondata string `json:"undefactiondata,omitempty"` } -type Sslvserverbinding struct { - Vservername string `json:"vservername,omitempty"` +type Ssldhparam struct { + Bits int `json:"bits,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Gen string `json:"gen,omitempty"` } -type Sslfipskey struct { - Fipskeyname string `json:"fipskeyname,omitempty"` - Keytype string `json:"keytype,omitempty"` - Exponent string `json:"exponent,omitempty"` - Modulus int `json:"modulus,omitempty"` - Curve string `json:"curve,omitempty"` - Key string `json:"key,omitempty"` - Inform string `json:"inform,omitempty"` - Wrapkeyname string `json:"wrapkeyname,omitempty"` - Iv string `json:"iv,omitempty"` - Size string `json:"size,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Reqaction string `json:"reqaction,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Sslcertchainbinding struct { - Certkeyname string `json:"certkeyname,omitempty"` +type Sslcertbundle struct { + Count float64 `json:"__count,omitempty"` + Inuse string `json:"inuse,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Sslcertkeybinding struct { - Certkey string `json:"certkey,omitempty"` +type SslcertkeySslvserverBinding struct { + Ca bool `json:"ca,omitempty"` + Certkey string `json:"certkey,omitempty"` + Data int `json:"data,omitempty"` + Servername string `json:"servername,omitempty"` + Version int `json:"version,omitempty"` + Vserver bool `json:"vserver,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslpolicypolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type SslcertkeybundleSslvserverBinding struct { + Certkeybundlename string `json:"certkeybundlename,omitempty"` + Servername string `json:"servername,omitempty"` } -type Sslvserversslcacertbundlebinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SslservicegroupEcccurveBinding struct { + Ecccurvename string `json:"ecccurvename,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type Sslciphersslprofilebinding struct { - Sslprofile string `json:"sslprofile,omitempty"` - Description string `json:"description,omitempty"` - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslprofileSslcertkeyBinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Forgingcacertkey bool `json:"forgingcacertkey,omitempty"` + Name string `json:"name,omitempty"` + Sslicacertkey string `json:"sslicacertkey,omitempty"` } -type Sslprofilecipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type Sslcertfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Sslcertreq struct { - Reqfile string `json:"reqfile,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Subjectaltname string `json:"subjectaltname,omitempty"` - Fipskeyname string `json:"fipskeyname,omitempty"` - Keyform string `json:"keyform,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` - Countryname string `json:"countryname,omitempty"` - Statename string `json:"statename,omitempty"` - Organizationname string `json:"organizationname,omitempty"` - Organizationunitname string `json:"organizationunitname,omitempty"` - Localityname string `json:"localityname,omitempty"` - Commonname string `json:"commonname,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Challengepassword string `json:"challengepassword,omitempty"` - Companyname string `json:"companyname,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` +type SslcacertgroupSslcertkeyBinding struct { + Cacertgroupname string `json:"cacertgroupname,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` } -type Sslpolicysslvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type SslservicegroupSslcipherBinding struct { + Cipheraliasname string `json:"cipheraliasname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` + Servicegroupname string `json:"servicegroupname,omitempty"` } -type Sslcertlink struct { - Certkeyname string `json:"certkeyname,omitempty"` - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslcertkey struct { + Builtin []string `json:"builtin,omitempty"` + Bundle string `json:"bundle,omitempty"` + Cert string `json:"cert,omitempty"` + Certificatesource string `json:"certificatesource,omitempty"` + Certificatetype []string `json:"certificatetype,omitempty"` + Certkey string `json:"certkey,omitempty"` + Certkeydigest string `json:"certkeydigest,omitempty"` + Certkeystatus string `json:"certkeystatus,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Count float64 `json:"__count,omitempty"` + Data int `json:"data,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Deletecertkeyfilesonremoval string `json:"deletecertkeyfilesonremoval,omitempty"` + Deletefromdevice bool `json:"deletefromdevice,omitempty"` + Expirymonitor string `json:"expirymonitor,omitempty"` + Feature string `json:"feature,omitempty"` + Fipskey string `json:"fipskey,omitempty"` + Hsmkey string `json:"hsmkey,omitempty"` + Inform string `json:"inform,omitempty"` + Issuer string `json:"issuer,omitempty"` + Key string `json:"key,omitempty"` + Linkcertkeyname string `json:"linkcertkeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodomaincheck bool `json:"nodomaincheck,omitempty"` + Notificationperiod int `json:"notificationperiod,omitempty"` + Ocspresponsestatus string `json:"ocspresponsestatus,omitempty"` + Ocspstaplingcache bool `json:"ocspstaplingcache,omitempty"` + Passcrypt string `json:"passcrypt,omitempty"` + Passplain string `json:"passplain,omitempty"` + Password bool `json:"password,omitempty"` + Priority int `json:"priority,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize int `json:"publickeysize,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Serial string `json:"serial,omitempty"` + Servicename string `json:"servicename,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Status string `json:"status,omitempty"` + Subject string `json:"subject,omitempty"` + Version int `json:"version,omitempty"` +} + +type SslprofileSslechconfigBinding struct { + Cipherpriority int `json:"cipherpriority,omitempty"` + Echconfigname string `json:"echconfigname,omitempty"` + Name string `json:"name,omitempty"` } -type Sslcipherprofilebinding struct { - Sslprofile string `json:"sslprofile,omitempty"` +type SslserviceSslciphersuiteBinding struct { + Cipherdefaulton int `json:"cipherdefaulton,omitempty"` + Ciphername string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` + Servicename string `json:"servicename,omitempty"` } -type Sslcertkeybundleintermediatecertlinksbinding struct { - Subject string `json:"subject,omitempty"` - Serial string `json:"serial,omitempty"` - Issuer string `json:"issuer,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize int `json:"publickeysize,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Status string `json:"status,omitempty"` - Certkeybundlename string `json:"certkeybundlename,omitempty"` -} - -type Sslcipherindividualcipherbinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` -} - -type Sslglobalsslpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Ssllogprofile struct { - Name string `json:"name,omitempty"` - Ssllogclauth string `json:"ssllogclauth,omitempty"` - Ssllogclauthfailures string `json:"ssllogclauthfailures,omitempty"` - Sslloghs string `json:"sslloghs,omitempty"` - Sslloghsfailures string `json:"sslloghsfailures,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslservicesslcacertbundlebinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` - Servicename string `json:"servicename,omitempty"` -} - -type Sslservicegroupcipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` -} - -type Sslciphersuite struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslprofilebinding struct { - Name string `json:"name,omitempty"` -} - -type Sslservicegroupsslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` -} - -type Sslcacertgroupcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Cacertgroupname string `json:"cacertgroupname,omitempty"` +type Sslcertkeybundle struct { + Bundlefile string `json:"bundlefile,omitempty"` + Certkeybundlename string `json:"certkeybundlename,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passplain string `json:"passplain,omitempty"` } -type Sslcacertgroupsslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Cacertgroupname string `json:"cacertgroupname,omitempty"` +type SslcertchainBinding struct { + Certkeyname string `json:"certkeyname,omitempty"` + SslcertchainSslcertkeyBinding []interface{} `json:"sslcertchain_sslcertkey_binding,omitempty"` } -type Sslcertkeybundle struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - Bundlefile string `json:"bundlefile,omitempty"` - Passplain string `json:"passplain,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslcertificatechain struct { + Certkeyname string `json:"certkeyname,omitempty"` + Chaincomplete int `json:"chaincomplete,omitempty"` + Chainissuer string `json:"chainissuer,omitempty"` + Chainlinked []string `json:"chainlinked,omitempty"` + Chainpossiblelinks []string `json:"chainpossiblelinks,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Sslservicesslciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Cipherdefaulton int `json:"cipherdefaulton,omitempty"` - Servicename string `json:"servicename,omitempty"` +type SslprofileEcccurveBinding struct { + Cipherpriority int `json:"cipherpriority,omitempty"` + Ecccurvename string `json:"ecccurvename,omitempty"` + Name string `json:"name,omitempty"` } -type Sslvserverecccurvebinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Vservername string `json:"vservername,omitempty"` +type Sslservice struct { + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Commonname string `json:"commonname,omitempty"` + Count float64 `json:"__count,omitempty"` + Dh string `json:"dh,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Dtls1 string `json:"dtls1,omitempty"` + Dtls12 string `json:"dtls12,omitempty"` + Dtlsflag bool `json:"dtlsflag,omitempty"` + Dtlsprofilename string `json:"dtlsprofilename,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Quicflag bool `json:"quicflag,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Service int `json:"service,omitempty"` + Servicename string `json:"servicename,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` } -type Sslvserversslpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Type string `json:"type,omitempty"` - Polinherit int `json:"polinherit,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Vservername string `json:"vservername,omitempty"` +type Sslprofile struct { + Allowextendedmastersecret string `json:"allowextendedmastersecret,omitempty"` + Allowlegacykdf string `json:"allowlegacykdf,omitempty"` + Allowunknownsni string `json:"allowunknownsni,omitempty"` + Alpnprotocol string `json:"alpnprotocol,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientauthuseboundcachain string `json:"clientauthuseboundcachain,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Commonname string `json:"commonname,omitempty"` + Count float64 `json:"__count,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Defaultsni string `json:"defaultsni,omitempty"` + Denysslreneg string `json:"denysslreneg,omitempty"` + Dh string `json:"dh,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` + Dynamicclientcert string `json:"dynamicclientcert,omitempty"` + Encryptedclienthello string `json:"encryptedclienthello,omitempty"` + Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Feature string `json:"feature,omitempty"` + Hsts string `json:"hsts,omitempty"` + Includesubdomains string `json:"includesubdomains,omitempty"` + Insertionencoding string `json:"insertionencoding,omitempty"` + Invoke bool `json:"invoke,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Maxage int `json:"maxage,omitempty"` + Maxrenegrate int `json:"maxrenegrate,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Preload string `json:"preload,omitempty"` + Prevsessionkeylifetime int `json:"prevsessionkeylifetime,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` + Pushflag int `json:"pushflag,omitempty"` + Quantumsize string `json:"quantumsize,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Serverauth string `json:"serverauth,omitempty"` + Service int `json:"service,omitempty"` + Sessionkeylifetime int `json:"sessionkeylifetime,omitempty"` + Sessionticket string `json:"sessionticket,omitempty"` + Sessionticketkeydata string `json:"sessionticketkeydata,omitempty"` + Sessionticketkeyrefresh string `json:"sessionticketkeyrefresh,omitempty"` + Sessionticketlifetime int `json:"sessionticketlifetime,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Skipclientcertpolicycheck string `json:"skipclientcertpolicycheck,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Snienable string `json:"snienable,omitempty"` + Snihttphostmatch string `json:"snihttphostmatch,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Sslimaxsessperserver int `json:"sslimaxsessperserver,omitempty"` + Sslinterception string `json:"sslinterception,omitempty"` + Ssliocspcheck string `json:"ssliocspcheck,omitempty"` + Sslireneg string `json:"sslireneg,omitempty"` + Ssliverifyservercertforreuse string `json:"ssliverifyservercertforreuse,omitempty"` + Ssllogprofile string `json:"ssllogprofile,omitempty"` + Sslpfobjecttype int `json:"sslpfobjecttype,omitempty"` + Sslprofiletype string `json:"sslprofiletype,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` + Strictcachecks string `json:"strictcachecks,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` + Zerorttearlydata string `json:"zerorttearlydata,omitempty"` +} + +type Sslzerotouchparam struct { + Admconnectivitystatus string `json:"admconnectivitystatus,omitempty"` + Httpstatuscode string `json:"httpstatuscode,omitempty"` + Keyfilename string `json:"keyfilename,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nextrequesttime string `json:"nextrequesttime,omitempty"` + Ocspbatchingdelay int `json:"ocspbatchingdelay,omitempty"` + Ocspbatchingdepth int `json:"ocspbatchingdepth,omitempty"` + Ocspcachetimeout int `json:"ocspcachetimeout,omitempty"` + Ocsphttpmethod string `json:"ocsphttpmethod,omitempty"` + Ocspproducedattimeskew int `json:"ocspproducedattimeskew,omitempty"` + Ocspresptimeout int `json:"ocspresptimeout,omitempty"` + Ocsptrustresponder string `json:"ocsptrustresponder,omitempty"` + Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` + Ocspusenonce string `json:"ocspusenonce,omitempty"` + Passphrase string `json:"passphrase,omitempty"` + Remoteserverip string `json:"remoteserverip,omitempty"` + Requesttimestamp string `json:"requesttimestamp,omitempty"` + Requesttype string `json:"requesttype,omitempty"` + Zerotouch string `json:"zerotouch,omitempty"` +} + +type SslpolicyBinding struct { + Name string `json:"name,omitempty"` + SslpolicyCsvserverBinding []interface{} `json:"sslpolicy_csvserver_binding,omitempty"` + SslpolicyLbvserverBinding []interface{} `json:"sslpolicy_lbvserver_binding,omitempty"` + SslpolicySslglobalBinding []interface{} `json:"sslpolicy_sslglobal_binding,omitempty"` + SslpolicySslpolicylabelBinding []interface{} `json:"sslpolicy_sslpolicylabel_binding,omitempty"` + SslpolicySslserviceBinding []interface{} `json:"sslpolicy_sslservice_binding,omitempty"` + SslpolicySslvserverBinding []interface{} `json:"sslpolicy_sslvserver_binding,omitempty"` } -type Sslcertkeyvserverbinding struct { - Servername string `json:"servername,omitempty"` - Data uint32 `json:"data,omitempty"` - Version int32 `json:"version,omitempty"` - Certkey string `json:"certkey,omitempty"` - Vservername string `json:"vservername,omitempty"` - Vserver bool `json:"vserver,omitempty"` - Ca bool `json:"ca,omitempty"` +type Sslpkcs12 struct { + Aes256 bool `json:"aes256,omitempty"` + Certfile string `json:"certfile,omitempty"` + Des bool `json:"des,omitempty"` + Des3 bool `json:"des3,omitempty"` + Export bool `json:"export,omitempty"` + Import bool `json:"Import,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Outfile string `json:"outfile,omitempty"` + Password string `json:"password,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` + Pkcs12file string `json:"pkcs12file,omitempty"` } -type Sslpolicysslpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type SslpolicySslvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslcipherciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` +type SslcipherSslciphersuiteBinding struct { Ciphergroupname string `json:"ciphergroupname,omitempty"` - Description string `json:"description,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` + Ciphername string `json:"ciphername,omitempty"` Cipheroperation string `json:"cipheroperation,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` Ciphgrpals string `json:"ciphgrpals,omitempty"` + Description string `json:"description,omitempty"` } -type Ssldefaultprofile struct { -} - -type Sslservicegroupsslcipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` -} - -type Sslvserversslciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` -} - -type Sslcrlfile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslservicegroupbinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` +type Sslkeyfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Src string `json:"src,omitempty"` } -type Sslpolicylabelsslpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type SslpolicylabelSslpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslprofilesslciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` +type Ssldynamicclientcertcache struct { } -type Sslservicesslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Servicename string `json:"servicename,omitempty"` +type SslglobalBinding struct { + SslglobalSslpolicyBinding []interface{} `json:"sslglobal_sslpolicy_binding,omitempty"` } -type Sslvserversslcertkeybundlebinding struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - Snicertkeybundle bool `json:"snicertkeybundle,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SslserviceSslcacertbundleBinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Servicename string `json:"servicename,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` } -type Sslwrapkey struct { - Wrapkeyname string `json:"wrapkeyname,omitempty"` - Password string `json:"password,omitempty"` - Salt string `json:"salt,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SslcipherIndividualcipherBinding struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipheroperation string `json:"cipheroperation,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Ciphgrpals string `json:"ciphgrpals,omitempty"` + Description string `json:"description,omitempty"` } -type Sslcertkeybundlebinding struct { +type SslvserverSslcertkeybundleBinding struct { Certkeybundlename string `json:"certkeybundlename,omitempty"` + Snicertkeybundle bool `json:"snicertkeybundle,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslpkcs8 struct { - Pkcs8file string `json:"pkcs8file,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` - Password string `json:"password,omitempty"` +type SslcertkeySslocspresponderBinding struct { + Ca bool `json:"ca,omitempty"` + Certkey string `json:"certkey,omitempty"` + Ocspresponder string `json:"ocspresponder,omitempty"` + Priority int `json:"priority,omitempty"` } -type Sslpolicysslglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Ssldhfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` } -type Sslserviceciphersuitebinding struct { +type SslvserverSslciphersuiteBinding struct { Ciphername string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Servicename string `json:"servicename,omitempty"` -} - -type Sslcacertbundleintermediatecacertlistbinding struct { - Subject string `json:"subject,omitempty"` - Serial string `json:"serial,omitempty"` - Issuer string `json:"issuer,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize int `json:"publickeysize,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Status string `json:"status,omitempty"` - Cacertbundlename string `json:"cacertbundlename,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslcipherservicegroupbinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Service bool `json:"service,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicegroup bool `json:"servicegroup,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslvserverHashicorpBinding struct { + Vault string `json:"vault,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslvserver struct { - Vservername string `json:"vservername,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Dh string `json:"dh,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Dtls1 string `json:"dtls1,omitempty"` - Dtls12 string `json:"dtls12,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Dtlsprofilename string `json:"dtlsprofilename,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Hsts string `json:"hsts,omitempty"` - Maxage int `json:"maxage,omitempty"` - Includesubdomains string `json:"includesubdomains,omitempty"` - Preload string `json:"preload,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Zerorttearlydata string `json:"zerorttearlydata,omitempty"` - Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` - Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` - Defaultsni string `json:"defaultsni,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Service string `json:"service,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ca string `json:"ca,omitempty"` - Snicert string `json:"snicert,omitempty"` - Skipcaname string `json:"skipcaname,omitempty"` - Dtlsflag string `json:"dtlsflag,omitempty"` - Quicflag string `json:"quicflag,omitempty"` - Skipcacertbundle string `json:"skipcacertbundle,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslvservercipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type Sslfips struct { + Coresenabled int `json:"coresenabled,omitempty"` + Coresmax int `json:"coresmax,omitempty"` + Erasedata string `json:"erasedata,omitempty"` + Fipsfw string `json:"fipsfw,omitempty"` + Fipshwmajorversion int `json:"fipshwmajorversion,omitempty"` + Fipshwminorversion int `json:"fipshwminorversion,omitempty"` + Fipshwversionstring string `json:"fipshwversionstring,omitempty"` + Firmwarereleasedate string `json:"firmwarereleasedate,omitempty"` + Flag int `json:"flag,omitempty"` + Flashmemoryfree int `json:"flashmemoryfree,omitempty"` + Flashmemorytotal int `json:"flashmemorytotal,omitempty"` + Hsmlabel string `json:"hsmlabel,omitempty"` + Inithsm string `json:"inithsm,omitempty"` + Majorversion int `json:"majorversion,omitempty"` + Minorversion int `json:"minorversion,omitempty"` + Model string `json:"model,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Oldsopassword string `json:"oldsopassword,omitempty"` + Serial int `json:"serial,omitempty"` + Serialno string `json:"serialno,omitempty"` + Sopassword string `json:"sopassword,omitempty"` + Sramfree int `json:"sramfree,omitempty"` + Sramtotal int `json:"sramtotal,omitempty"` + State int `json:"state,omitempty"` + Status int `json:"status,omitempty"` + Userpassword string `json:"userpassword,omitempty"` } -type Sslcertkeyservicebinding struct { - Servicename string `json:"servicename,omitempty"` - Data int `json:"data,omitempty"` - Version int `json:"version,omitempty"` - Certkey string `json:"certkey,omitempty"` - Service bool `json:"service,omitempty"` +type Sslaction struct { + Builtin []string `json:"builtin,omitempty"` + Cacertgrpname string `json:"cacertgrpname,omitempty"` + Certfingerprintdigest string `json:"certfingerprintdigest,omitempty"` + Certfingerprintheader string `json:"certfingerprintheader,omitempty"` + Certhashheader string `json:"certhashheader,omitempty"` + Certheader string `json:"certheader,omitempty"` + Certissuerheader string `json:"certissuerheader,omitempty"` + Certnotafterheader string `json:"certnotafterheader,omitempty"` + Certnotbeforeheader string `json:"certnotbeforeheader,omitempty"` + Certserialheader string `json:"certserialheader,omitempty"` + Certsubjectheader string `json:"certsubjectheader,omitempty"` + Cipher string `json:"cipher,omitempty"` + Cipherheader string `json:"cipherheader,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Clientcertfingerprint string `json:"clientcertfingerprint,omitempty"` + Clientcerthash string `json:"clientcerthash,omitempty"` + Clientcertissuer string `json:"clientcertissuer,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Clientcertserialnumber string `json:"clientcertserialnumber,omitempty"` + Clientcertsubject string `json:"clientcertsubject,omitempty"` + Clientcertverification string `json:"clientcertverification,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Forward string `json:"forward,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ocspcache string `json:"ocspcache,omitempty"` + Ocspcertvalidation string `json:"ocspcertvalidation,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Owasupport string `json:"owasupport,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Sessionid string `json:"sessionid,omitempty"` + Sessionidheader string `json:"sessionidheader,omitempty"` + Ssllogprofile string `json:"ssllogprofile,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type SslservicegroupSslciphersuiteBinding struct { + Ciphername string `json:"ciphername,omitempty"` + Description string `json:"description,omitempty"` Servicegroupname string `json:"servicegroupname,omitempty"` - Ca bool `json:"ca,omitempty"` -} - -type Sslecdsakey struct { - Keyfile string `json:"keyfile,omitempty"` - Curve string `json:"curve,omitempty"` - Keyform string `json:"keyform,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` - Aes256 bool `json:"aes256,omitempty"` - Password string `json:"password,omitempty"` - Pkcs8 bool `json:"pkcs8,omitempty"` -} - -type Sslkeyfile struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Password string `json:"password,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslservicecipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Description string `json:"description,omitempty"` - Servicename string `json:"servicename,omitempty"` - Ciphername string `json:"ciphername,omitempty"` } -type Sslaction struct { - Name string `json:"name,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcertverification string `json:"clientcertverification,omitempty"` - Ssllogprofile string `json:"ssllogprofile,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Certheader string `json:"certheader,omitempty"` - Clientcertserialnumber string `json:"clientcertserialnumber,omitempty"` - Certserialheader string `json:"certserialheader,omitempty"` - Clientcertsubject string `json:"clientcertsubject,omitempty"` - Certsubjectheader string `json:"certsubjectheader,omitempty"` - Clientcerthash string `json:"clientcerthash,omitempty"` - Certhashheader string `json:"certhashheader,omitempty"` - Clientcertfingerprint string `json:"clientcertfingerprint,omitempty"` - Certfingerprintheader string `json:"certfingerprintheader,omitempty"` - Certfingerprintdigest string `json:"certfingerprintdigest,omitempty"` - Clientcertissuer string `json:"clientcertissuer,omitempty"` - Certissuerheader string `json:"certissuerheader,omitempty"` - Sessionid string `json:"sessionid,omitempty"` - Sessionidheader string `json:"sessionidheader,omitempty"` - Cipher string `json:"cipher,omitempty"` - Cipherheader string `json:"cipherheader,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Certnotbeforeheader string `json:"certnotbeforeheader,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Certnotafterheader string `json:"certnotafterheader,omitempty"` - Owasupport string `json:"owasupport,omitempty"` - Forward string `json:"forward,omitempty"` - Cacertgrpname string `json:"cacertgrpname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Ssllogprofile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ssllogclauth string `json:"ssllogclauth,omitempty"` + Ssllogclauthfailures string `json:"ssllogclauthfailures,omitempty"` + Sslloghs string `json:"sslloghs,omitempty"` + Sslloghsfailures string `json:"sslloghsfailures,omitempty"` } -type Sslglobalbinding struct { +type Sslfipssimsource struct { + Certfile string `json:"certfile,omitempty"` + Sourcesecret string `json:"sourcesecret,omitempty"` + Targetsecret string `json:"targetsecret,omitempty"` } -type Sslservicegroupcertkeybinding struct { +type SslservicegroupSslcertkeyBinding struct { + Ca bool `json:"ca,omitempty"` Certkeyname string `json:"certkeyname,omitempty"` Crlcheck string `json:"crlcheck,omitempty"` Ocspcheck string `json:"ocspcheck,omitempty"` - Ca bool `json:"ca,omitempty"` - Snicert bool `json:"snicert,omitempty"` Servicegroupname string `json:"servicegroupname,omitempty"` + Snicert bool `json:"snicert,omitempty"` } -type Sslpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Invoke bool `json:"invoke,omitempty"` -} - -type Sslservicesslcipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Description string `json:"description,omitempty"` - Cipherdefaulton int `json:"cipherdefaulton,omitempty"` - Servicename string `json:"servicename,omitempty"` - Ciphername string `json:"ciphername,omitempty"` -} - -type Sslservicegroupsslciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` -} - -type Sslvserverciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` -} - -type Sslcrlserialnumberbinding struct { - Number string `json:"number,omitempty"` - Date string `json:"date,omitempty"` - Crlname string `json:"crlname,omitempty"` +type Sslcertreq struct { + Challengepassword string `json:"challengepassword,omitempty"` + Commonname string `json:"commonname,omitempty"` + Companyname string `json:"companyname,omitempty"` + Countryname string `json:"countryname,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Fipskeyname string `json:"fipskeyname,omitempty"` + Keyfile string `json:"keyfile,omitempty"` + Keyform string `json:"keyform,omitempty"` + Localityname string `json:"localityname,omitempty"` + Organizationname string `json:"organizationname,omitempty"` + Organizationunitname string `json:"organizationunitname,omitempty"` + Pempassphrase string `json:"pempassphrase,omitempty"` + Reqfile string `json:"reqfile,omitempty"` + Statename string `json:"statename,omitempty"` + Subjectaltname string `json:"subjectaltname,omitempty"` } -type Sslpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type SslcacertbundleBinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + SslcacertbundleIntermediatecacertlistBinding []interface{} `json:"sslcacertbundle_intermediatecacertlist_binding,omitempty"` } -type Sslprofilesslcipherbinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type SslserviceBinding struct { + Servicename string `json:"servicename,omitempty"` + SslserviceEcccurveBinding []interface{} `json:"sslservice_ecccurve_binding,omitempty"` + SslserviceSslcacertbundleBinding []interface{} `json:"sslservice_sslcacertbundle_binding,omitempty"` + SslserviceSslcertkeyBinding []interface{} `json:"sslservice_sslcertkey_binding,omitempty"` + SslserviceSslcipherBinding []interface{} `json:"sslservice_sslcipher_binding,omitempty"` + SslserviceSslciphersuiteBinding []interface{} `json:"sslservice_sslciphersuite_binding,omitempty"` + SslserviceSslpolicyBinding []interface{} `json:"sslservice_sslpolicy_binding,omitempty"` } -type Sslcacertgroupbinding struct { - Cacertgroupname string `json:"cacertgroupname,omitempty"` +type Sslcipher struct { + Ciphergroupname string `json:"ciphergroupname,omitempty"` + Ciphername string `json:"ciphername,omitempty"` + Cipherpriority int `json:"cipherpriority,omitempty"` + Ciphgrpalias string `json:"ciphgrpalias,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` } -type Sslciphersslvserverbinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Vservername string `json:"vservername,omitempty"` - Vserver bool `json:"vserver,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type Sslcertchain struct { + Certkeyname string `json:"certkeyname,omitempty"` + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Sslprofile struct { - Name string `json:"name,omitempty"` - Sslprofiletype string `json:"sslprofiletype,omitempty"` - Ssllogprofile string `json:"ssllogprofile,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dh string `json:"dh,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Snienable string `json:"snienable,omitempty"` - Allowunknownsni string `json:"allowunknownsni,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Serverauth string `json:"serverauth,omitempty"` - Commonname string `json:"commonname,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Insertionencoding string `json:"insertionencoding,omitempty"` - Denysslreneg string `json:"denysslreneg,omitempty"` - Maxrenegrate int `json:"maxrenegrate,omitempty"` - Quantumsize string `json:"quantumsize,omitempty"` - Strictcachecks string `json:"strictcachecks,omitempty"` - Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` - Pushflag int `json:"pushflag,omitempty"` - Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` - Snihttphostmatch string `json:"snihttphostmatch,omitempty"` - Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` - Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` - Clientauthuseboundcachain string `json:"clientauthuseboundcachain,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Sslireneg string `json:"sslireneg,omitempty"` - Ssliocspcheck string `json:"ssliocspcheck,omitempty"` - Sslimaxsessperserver int `json:"sslimaxsessperserver,omitempty"` - Sessionticket string `json:"sessionticket,omitempty"` - Sessionticketlifetime int `json:"sessionticketlifetime,omitempty"` - Sessionticketkeyrefresh string `json:"sessionticketkeyrefresh,omitempty"` - Sessionticketkeydata string `json:"sessionticketkeydata,omitempty"` - Sessionkeylifetime int `json:"sessionkeylifetime,omitempty"` - Prevsessionkeylifetime int `json:"prevsessionkeylifetime,omitempty"` - Hsts string `json:"hsts,omitempty"` - Maxage int `json:"maxage,omitempty"` - Includesubdomains string `json:"includesubdomains,omitempty"` - Preload string `json:"preload,omitempty"` - Skipclientcertpolicycheck string `json:"skipclientcertpolicycheck,omitempty"` - Zerorttearlydata string `json:"zerorttearlydata,omitempty"` - Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` - Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` - Allowextendedmastersecret string `json:"allowextendedmastersecret,omitempty"` - Alpnprotocol string `json:"alpnprotocol,omitempty"` - Encryptedclienthello string `json:"encryptedclienthello,omitempty"` - Defaultsni string `json:"defaultsni,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Snicert string `json:"snicert,omitempty"` - Skipcaname string `json:"skipcaname,omitempty"` - Invoke string `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Service string `json:"service,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Sslpfobjecttype string `json:"sslpfobjecttype,omitempty"` - Ssliverifyservercertforreuse string `json:"ssliverifyservercertforreuse,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslprofilesslvserverbinding struct { - Servicename string `json:"servicename,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SslcertkeyBinding struct { + Certkey string `json:"certkey,omitempty"` + SslcertkeyCrldistributionBinding []interface{} `json:"sslcertkey_crldistribution_binding,omitempty"` + SslcertkeyServiceBinding []interface{} `json:"sslcertkey_service_binding,omitempty"` + SslcertkeySslocspresponderBinding []interface{} `json:"sslcertkey_sslocspresponder_binding,omitempty"` + SslcertkeySslprofileBinding []interface{} `json:"sslcertkey_sslprofile_binding,omitempty"` + SslcertkeySslvserverBinding []interface{} `json:"sslcertkey_sslvserver_binding,omitempty"` } -type Sslservicebinding struct { - Servicename string `json:"servicename,omitempty"` +type Sslpolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Flowtype int `json:"flowtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type SslcertkeySslprofileBinding struct { + Ca bool `json:"ca,omitempty"` + Certkey string `json:"certkey,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` } -type Sslvserverpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Type string `json:"type,omitempty"` - Polinherit uint32 `json:"polinherit,omitempty"` +type SslvserverSslpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Vservername string `json:"vservername,omitempty"` -} - -type Sslfips struct { - Inithsm string `json:"inithsm,omitempty"` - Sopassword string `json:"sopassword,omitempty"` - Oldsopassword string `json:"oldsopassword,omitempty"` - Userpassword string `json:"userpassword,omitempty"` - Hsmlabel string `json:"hsmlabel,omitempty"` - Fipsfw string `json:"fipsfw,omitempty"` - Erasedata string `json:"erasedata,omitempty"` - Serial string `json:"serial,omitempty"` - Majorversion string `json:"majorversion,omitempty"` - Minorversion string `json:"minorversion,omitempty"` - Fipshwmajorversion string `json:"fipshwmajorversion,omitempty"` - Fipshwminorversion string `json:"fipshwminorversion,omitempty"` - Fipshwversionstring string `json:"fipshwversionstring,omitempty"` - Flashmemorytotal string `json:"flashmemorytotal,omitempty"` - Flashmemoryfree string `json:"flashmemoryfree,omitempty"` - Sramtotal string `json:"sramtotal,omitempty"` - Sramfree string `json:"sramfree,omitempty"` - Status string `json:"status,omitempty"` - Flag string `json:"flag,omitempty"` - Serialno string `json:"serialno,omitempty"` - Model string `json:"model,omitempty"` - State string `json:"state,omitempty"` - Firmwarereleasedate string `json:"firmwarereleasedate,omitempty"` - Coresmax string `json:"coresmax,omitempty"` - Coresenabled string `json:"coresenabled,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslservicepolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Polinherit uint32 `json:"polinherit,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Servicename string `json:"servicename,omitempty"` + Policyname string `json:"policyname,omitempty"` + Polinherit int `json:"polinherit,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Sslcertbundle struct { - Name string `json:"name,omitempty"` - Src string `json:"src,omitempty"` - Inuse string `json:"inuse,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Sslechconfig struct { + Count float64 `json:"__count,omitempty"` + Echcipher string `json:"echcipher,omitempty"` + Echconfigid int `json:"echconfigid,omitempty"` + Echconfigname string `json:"echconfigname,omitempty"` + Echpublicname string `json:"echpublicname,omitempty"` + Hpkekeyname string `json:"hpkekeyname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Version int `json:"version,omitempty"` } -type Sslcertkey struct { - Certkey string `json:"certkey,omitempty"` - Cert string `json:"cert,omitempty"` - Key string `json:"key,omitempty"` - Password bool `json:"password,omitempty"` - Fipskey string `json:"fipskey,omitempty"` - Hsmkey string `json:"hsmkey,omitempty"` - Inform string `json:"inform,omitempty"` - Passplain string `json:"passplain,omitempty"` - Expirymonitor string `json:"expirymonitor,omitempty"` - Notificationperiod int `json:"notificationperiod,omitempty"` - Bundle string `json:"bundle,omitempty"` - Deletecertkeyfilesonremoval string `json:"deletecertkeyfilesonremoval,omitempty"` - Deletefromdevice bool `json:"deletefromdevice,omitempty"` - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Nodomaincheck bool `json:"nodomaincheck,omitempty"` - Ocspstaplingcache bool `json:"ocspstaplingcache,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Certificatetype string `json:"certificatetype,omitempty"` - Serial string `json:"serial,omitempty"` - Issuer string `json:"issuer,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Daystoexpiration string `json:"daystoexpiration,omitempty"` - Subject string `json:"subject,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize string `json:"publickeysize,omitempty"` - Version string `json:"version,omitempty"` - Priority string `json:"priority,omitempty"` - Status string `json:"status,omitempty"` - Passcrypt string `json:"passcrypt,omitempty"` - Data string `json:"data,omitempty"` - Servicename string `json:"servicename,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` - Ocspresponsestatus string `json:"ocspresponsestatus,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Certkeydigest string `json:"certkeydigest,omitempty"` - Certificatesource string `json:"certificatesource,omitempty"` - Certkeystatus string `json:"certkeystatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Sslciphervserverbinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Vservername string `json:"vservername,omitempty"` - Vserver bool `json:"vserver,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` - Cipherpriority uint32 `json:"cipherpriority,omitempty"` +type SslcacertbundleIntermediatecacertlistBinding struct { + Cacertbundlename string `json:"cacertbundlename,omitempty"` + Clientcertnotafter string `json:"clientcertnotafter,omitempty"` + Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + Daystoexpiration int `json:"daystoexpiration,omitempty"` + Issuer string `json:"issuer,omitempty"` + Publickey string `json:"publickey,omitempty"` + Publickeysize int `json:"publickeysize,omitempty"` + Sandns string `json:"sandns,omitempty"` + Sanipadd string `json:"sanipadd,omitempty"` + Serial string `json:"serial,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Status string `json:"status,omitempty"` + Subject string `json:"subject,omitempty"` } -type Sslservicegroupciphersuitebinding struct { - Ciphername string `json:"ciphername,omitempty"` - Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type Sslvserver struct { + Ca bool `json:"ca,omitempty"` + Cipherredirect string `json:"cipherredirect,omitempty"` + Cipherurl string `json:"cipherurl,omitempty"` + Cleartextport int `json:"cleartextport,omitempty"` + Clientauth string `json:"clientauth,omitempty"` + Clientcert string `json:"clientcert,omitempty"` + Count float64 `json:"__count,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` + Defaultsni string `json:"defaultsni,omitempty"` + Dh string `json:"dh,omitempty"` + Dhcount int `json:"dhcount,omitempty"` + Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` + Dhfile string `json:"dhfile,omitempty"` + Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` + Dtls1 string `json:"dtls1,omitempty"` + Dtls12 string `json:"dtls12,omitempty"` + Dtlsflag bool `json:"dtlsflag,omitempty"` + Dtlsprofilename string `json:"dtlsprofilename,omitempty"` + Ersa string `json:"ersa,omitempty"` + Ersacount int `json:"ersacount,omitempty"` + Hsts string `json:"hsts,omitempty"` + Includesubdomains string `json:"includesubdomains,omitempty"` + Maxage int `json:"maxage,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nonfipsciphers string `json:"nonfipsciphers,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Ocspstapling string `json:"ocspstapling,omitempty"` + Preload string `json:"preload,omitempty"` + Pushenctrigger string `json:"pushenctrigger,omitempty"` + Quicflag bool `json:"quicflag,omitempty"` + Redirectportrewrite string `json:"redirectportrewrite,omitempty"` + Sendclosenotify string `json:"sendclosenotify,omitempty"` + Service int `json:"service,omitempty"` + Sessreuse string `json:"sessreuse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` + Skipcaname bool `json:"skipcaname,omitempty"` + Snicert bool `json:"snicert,omitempty"` + Snienable string `json:"snienable,omitempty"` + Ssl2 string `json:"ssl2,omitempty"` + Ssl3 string `json:"ssl3,omitempty"` + Sslclientlogs string `json:"sslclientlogs,omitempty"` + Sslprofile string `json:"sslprofile,omitempty"` + Sslredirect string `json:"sslredirect,omitempty"` + Sslv2redirect string `json:"sslv2redirect,omitempty"` + Sslv2url string `json:"sslv2url,omitempty"` + Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` + Tls1 string `json:"tls1,omitempty"` + Tls11 string `json:"tls11,omitempty"` + Tls12 string `json:"tls12,omitempty"` + Tls13 string `json:"tls13,omitempty"` + Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` + Vservername string `json:"vservername,omitempty"` + Zerorttearlydata string `json:"zerorttearlydata,omitempty"` } diff --git a/nitrogo/models/stream.go b/nitrogo/models/stream.go index 2401ddc..a0b5b84 100644 --- a/nitrogo/models/stream.go +++ b/nitrogo/models/stream.go @@ -1,54 +1,51 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Streamidentifiersessionbinding struct { +// stream configuration structs +type Streamsession struct { Name string `json:"name,omitempty"` } -type Streamidentifierstreamsessionbinding struct { - Name string `json:"name,omitempty"` - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type Streamidentifier struct { + Acceptancethreshold string `json:"acceptancethreshold,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Breachthreshold int `json:"breachthreshold,omitempty"` + Count float64 `json:"__count,omitempty"` + Interval int `json:"interval,omitempty"` + Log string `json:"log,omitempty"` + Loginterval int `json:"loginterval,omitempty"` + Loglimit int `json:"loglimit,omitempty"` + Maxtransactionthreshold int `json:"maxtransactionthreshold,omitempty"` + Mintransactionthreshold int `json:"mintransactionthreshold,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule []string `json:"rule,omitempty"` + Samplecount int `json:"samplecount,omitempty"` + Selectorname string `json:"selectorname,omitempty"` + Snmptrap string `json:"snmptrap,omitempty"` + Sort string `json:"sort,omitempty"` + Trackackonlypackets string `json:"trackackonlypackets,omitempty"` + Tracktransactions string `json:"tracktransactions,omitempty"` } -type Streamselector struct { - Name string `json:"name,omitempty"` - Rule []string `json:"rule,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type StreamidentifierBinding struct { + Name string `json:"name,omitempty"` + StreamidentifierAnalyticsprofileBinding []interface{} `json:"streamidentifier_analyticsprofile_binding,omitempty"` + StreamidentifierStreamsessionBinding []interface{} `json:"streamidentifier_streamsession_binding,omitempty"` } -type Streamsession struct { - Name string `json:"name,omitempty"` +type StreamidentifierAnalyticsprofileBinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` } -type Streamidentifier struct { - Name string `json:"name,omitempty"` - Selectorname string `json:"selectorname,omitempty"` - Interval int `json:"interval,omitempty"` - Samplecount int `json:"samplecount,omitempty"` - Sort string `json:"sort,omitempty"` - Snmptrap string `json:"snmptrap,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Trackackonlypackets string `json:"trackackonlypackets,omitempty"` - Tracktransactions string `json:"tracktransactions,omitempty"` - Maxtransactionthreshold int `json:"maxtransactionthreshold,omitempty"` - Mintransactionthreshold int `json:"mintransactionthreshold,omitempty"` - Acceptancethreshold string `json:"acceptancethreshold,omitempty"` - Breachthreshold int `json:"breachthreshold,omitempty"` - Log string `json:"log,omitempty"` - Loginterval int `json:"loginterval,omitempty"` - Loglimit int `json:"loglimit,omitempty"` - Rule string `json:"rule,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Streamselector struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule []string `json:"rule,omitempty"` } -type Streamidentifieranalyticsprofilebinding struct { +type StreamidentifierStreamsessionBinding struct { Analyticsprofile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } - -type Streamidentifierbinding struct { - Name string `json:"name,omitempty"` -} diff --git a/nitrogo/models/subscriber.go b/nitrogo/models/subscriber.go index d8674c7..f8ed2fe 100644 --- a/nitrogo/models/subscriber.go +++ b/nitrogo/models/subscriber.go @@ -1,92 +1,91 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Subscribergxinterface struct { - Vserver string `json:"vserver,omitempty"` - Service string `json:"service,omitempty"` - Pcrfrealm string `json:"pcrfrealm,omitempty"` - Holdonsubscriberabsence string `json:"holdonsubscriberabsence,omitempty"` - Requesttimeout int `json:"requesttimeout,omitempty"` - Requestretryattempts int `json:"requestretryattempts,omitempty"` - Idlettl int `json:"idlettl,omitempty"` - Revalidationtimeout int `json:"revalidationtimeout,omitempty"` - Healthcheck string `json:"healthcheck,omitempty"` - Healthcheckttl int `json:"healthcheckttl,omitempty"` - Cerrequesttimeout int `json:"cerrequesttimeout,omitempty"` - Negativettl int `json:"negativettl,omitempty"` - Negativettllimitedsuccess string `json:"negativettllimitedsuccess,omitempty"` - Purgesdbongxfailure string `json:"purgesdbongxfailure,omitempty"` - Servicepathavp []int `json:"servicepathavp,omitempty"` - Servicepathvendorid int `json:"servicepathvendorid,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Identity string `json:"identity,omitempty"` - Realm string `json:"realm,omitempty"` - Status string `json:"status,omitempty"` - Servicepathinfomode string `json:"servicepathinfomode,omitempty"` - Gxreportingavp1 string `json:"gxreportingavp1,omitempty"` - Gxreportingavp1vendorid string `json:"gxreportingavp1vendorid,omitempty"` - Gxreportingavp1type string `json:"gxreportingavp1type,omitempty"` - Gxreportingavp2 string `json:"gxreportingavp2,omitempty"` - Gxreportingavp2vendorid string `json:"gxreportingavp2vendorid,omitempty"` - Gxreportingavp2type string `json:"gxreportingavp2type,omitempty"` - Gxreportingavp3 string `json:"gxreportingavp3,omitempty"` - Gxreportingavp3vendorid string `json:"gxreportingavp3vendorid,omitempty"` - Gxreportingavp3type string `json:"gxreportingavp3type,omitempty"` - Gxreportingavp4 string `json:"gxreportingavp4,omitempty"` - Gxreportingavp4vendorid string `json:"gxreportingavp4vendorid,omitempty"` - Gxreportingavp4type string `json:"gxreportingavp4type,omitempty"` - Gxreportingavp5 string `json:"gxreportingavp5,omitempty"` - Gxreportingavp5vendorid string `json:"gxreportingavp5vendorid,omitempty"` - Gxreportingavp5type string `json:"gxreportingavp5type,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// subscriber configuration structs +type Subscribersessions struct { + Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + Idlettl int `json:"idlettl,omitempty"` + Ip string `json:"ip,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Servicepath string `json:"servicepath,omitempty"` + Subscriberrules []string `json:"subscriberrules,omitempty"` + Subscriptionidtype string `json:"subscriptionidtype,omitempty"` + Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` + Ttl int `json:"ttl,omitempty"` + Vlan int `json:"vlan,omitempty"` } -type Subscriberparam struct { - Keytype string `json:"keytype,omitempty"` - Interfacetype string `json:"interfacetype,omitempty"` - Idlettl int `json:"idlettl,omitempty"` - Idleaction string `json:"idleaction,omitempty"` - Ipv6prefixlookuplist []int `json:"ipv6prefixlookuplist,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Subscribergxinterface struct { + Cerrequesttimeout int `json:"cerrequesttimeout,omitempty"` + Gxreportingavp1 []interface{} `json:"gxreportingavp1,omitempty"` + Gxreportingavp1type string `json:"gxreportingavp1type,omitempty"` + Gxreportingavp1vendorid int `json:"gxreportingavp1vendorid,omitempty"` + Gxreportingavp2 []interface{} `json:"gxreportingavp2,omitempty"` + Gxreportingavp2type string `json:"gxreportingavp2type,omitempty"` + Gxreportingavp2vendorid int `json:"gxreportingavp2vendorid,omitempty"` + Gxreportingavp3 []interface{} `json:"gxreportingavp3,omitempty"` + Gxreportingavp3type string `json:"gxreportingavp3type,omitempty"` + Gxreportingavp3vendorid int `json:"gxreportingavp3vendorid,omitempty"` + Gxreportingavp4 []interface{} `json:"gxreportingavp4,omitempty"` + Gxreportingavp4type string `json:"gxreportingavp4type,omitempty"` + Gxreportingavp4vendorid int `json:"gxreportingavp4vendorid,omitempty"` + Gxreportingavp5 []interface{} `json:"gxreportingavp5,omitempty"` + Gxreportingavp5type string `json:"gxreportingavp5type,omitempty"` + Gxreportingavp5vendorid int `json:"gxreportingavp5vendorid,omitempty"` + Healthcheck string `json:"healthcheck,omitempty"` + Healthcheckttl int `json:"healthcheckttl,omitempty"` + Holdonsubscriberabsence string `json:"holdonsubscriberabsence,omitempty"` + Identity string `json:"identity,omitempty"` + Idlettl int `json:"idlettl,omitempty"` + Negativettl int `json:"negativettl,omitempty"` + Negativettllimitedsuccess string `json:"negativettllimitedsuccess,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Pcrfrealm string `json:"pcrfrealm,omitempty"` + Purgesdbongxfailure string `json:"purgesdbongxfailure,omitempty"` + Realm string `json:"realm,omitempty"` + Requestretryattempts int `json:"requestretryattempts,omitempty"` + Requesttimeout int `json:"requesttimeout,omitempty"` + Revalidationtimeout int `json:"revalidationtimeout,omitempty"` + Service string `json:"service,omitempty"` + Servicepathavp []interface{} `json:"servicepathavp,omitempty"` + Servicepathinfomode string `json:"servicepathinfomode,omitempty"` + Servicepathvendorid int `json:"servicepathvendorid,omitempty"` + Status string `json:"status,omitempty"` + Svrstate string `json:"svrstate,omitempty"` + Vserver string `json:"vserver,omitempty"` } type Subscriberprofile struct { + Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` Ip string `json:"ip,omitempty"` - Vlan int `json:"vlan"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Servicepath string `json:"servicepath,omitempty"` Subscriberrules []string `json:"subscriberrules,omitempty"` Subscriptionidtype string `json:"subscriptionidtype,omitempty"` Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` - Servicepath string `json:"servicepath,omitempty"` - Flags string `json:"flags,omitempty"` - Ttl string `json:"ttl,omitempty"` - Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ttl int `json:"ttl,omitempty"` + Vlan int `json:"vlan,omitempty"` +} + +type Subscriberparam struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Idleaction string `json:"idleaction,omitempty"` + Idlettl int `json:"idlettl,omitempty"` + Interfacetype string `json:"interfacetype,omitempty"` + Ipv6prefixlookuplist []interface{} `json:"ipv6prefixlookuplist,omitempty"` + Keytype string `json:"keytype,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } type Subscriberradiusinterface struct { Listeningservice string `json:"listeningservice,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Radiusinterimasstart string `json:"radiusinterimasstart,omitempty"` Svrstate string `json:"svrstate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Subscribersessions struct { - Ip string `json:"ip,omitempty"` - Vlan int `json:"vlan,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Subscriptionidtype string `json:"subscriptionidtype,omitempty"` - Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` - Subscriberrules string `json:"subscriberrules,omitempty"` - Flags string `json:"flags,omitempty"` - Ttl string `json:"ttl,omitempty"` - Idlettl string `json:"idlettl,omitempty"` - Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` - Servicepath string `json:"servicepath,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/system.go b/nitrogo/models/system.go index 12b99b8..7615593 100644 --- a/nitrogo/models/system.go +++ b/nitrogo/models/system.go @@ -1,9 +1,320 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2025 - package models +// system configuration structs +type SystemglobalAuthenticationldappolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SystemuserSystemcmdpolicyBinding struct { + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Username string `json:"username,omitempty"` +} + +type SystemglobalAuditsyslogpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Systemhwerror struct { + Diskcheck bool `json:"diskcheck,omitempty"` + Hwerrorcount int `json:"hwerrorcount,omitempty"` + Response string `json:"response,omitempty"` +} + +type Systemparameter struct { + Allowdefaultpartition string `json:"allowdefaultpartition,omitempty"` + Basicauth string `json:"basicauth,omitempty"` + Cliloglevel string `json:"cliloglevel,omitempty"` + Daystoexpire int `json:"daystoexpire,omitempty"` + Doppler string `json:"doppler,omitempty"` + Fipsusermode string `json:"fipsusermode,omitempty"` + Forcepasswordchange string `json:"forcepasswordchange,omitempty"` + Googleanalytics string `json:"googleanalytics,omitempty"` + Localauth string `json:"localauth,omitempty"` + Maxclient int `json:"maxclient,omitempty"` + Maxsessionperuser int `json:"maxsessionperuser,omitempty"` + Minpasswordlen int `json:"minpasswordlen,omitempty"` + Natpcbforceflushlimit int `json:"natpcbforceflushlimit,omitempty"` + Natpcbrstontimeout string `json:"natpcbrstontimeout,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passwordhistorycontrol string `json:"passwordhistorycontrol,omitempty"` + Promptstring string `json:"promptstring,omitempty"` + Pwdhistorycount int `json:"pwdhistorycount,omitempty"` + Rbaonresponse string `json:"rbaonresponse,omitempty"` + Reauthonauthparamchange string `json:"reauthonauthparamchange,omitempty"` + Removesensitivefiles string `json:"removesensitivefiles,omitempty"` + Restrictedtimeout string `json:"restrictedtimeout,omitempty"` + Strongpassword string `json:"strongpassword,omitempty"` + Timeout int `json:"timeout,omitempty"` + Totalauthtimeout int `json:"totalauthtimeout,omitempty"` + Wafprotection []string `json:"wafprotection,omitempty"` + Warnpriorndays int `json:"warnpriorndays,omitempty"` +} + +type SystemgroupSystemcmdpolicyBinding struct { + Groupname string `json:"groupname,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SystemglobalAuthenticationlocalpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Systemadmuserinfo struct { + Username string `json:"username,omitempty"` +} + +type Systemsession struct { + All bool `json:"all,omitempty"` + Clientipaddress string `json:"clientipaddress,omitempty"` + Clienttype string `json:"clienttype,omitempty"` + Count float64 `json:"__count,omitempty"` + Currentconn bool `json:"currentconn,omitempty"` + Expirytime int `json:"expirytime,omitempty"` + Lastactivitytime string `json:"lastactivitytime,omitempty"` + Lastactivitytimelocal string `json:"lastactivitytimelocal,omitempty"` + Logintime string `json:"logintime,omitempty"` + Logintimelocal string `json:"logintimelocal,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numofconnections int `json:"numofconnections,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Sid int `json:"sid,omitempty"` + Username string `json:"username,omitempty"` +} + +type Systemautorestorefeature struct { +} + +type SystemglobalBinding struct { + SystemglobalAuditnslogpolicyBinding []interface{} `json:"systemglobal_auditnslogpolicy_binding,omitempty"` + SystemglobalAuditsyslogpolicyBinding []interface{} `json:"systemglobal_auditsyslogpolicy_binding,omitempty"` + SystemglobalAuthenticationldappolicyBinding []interface{} `json:"systemglobal_authenticationldappolicy_binding,omitempty"` + SystemglobalAuthenticationlocalpolicyBinding []interface{} `json:"systemglobal_authenticationlocalpolicy_binding,omitempty"` + SystemglobalAuthenticationpolicyBinding []interface{} `json:"systemglobal_authenticationpolicy_binding,omitempty"` + SystemglobalAuthenticationradiuspolicyBinding []interface{} `json:"systemglobal_authenticationradiuspolicy_binding,omitempty"` + SystemglobalAuthenticationtacacspolicyBinding []interface{} `json:"systemglobal_authenticationtacacspolicy_binding,omitempty"` +} + +type Systemkek struct { + Level string `json:"level,omitempty"` +} + +type Systemcpuparam struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Pemode string `json:"pemode,omitempty"` +} + +type Systemrestorepoint struct { + Backupfilename string `json:"backupfilename,omitempty"` + Count float64 `json:"__count,omitempty"` + Createdby string `json:"createdby,omitempty"` + Creationtime string `json:"creationtime,omitempty"` + Filename string `json:"filename,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Techsuprtname string `json:"techsuprtname,omitempty"` + Version string `json:"version,omitempty"` +} + +type SystemglobalAuditnslogpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type Systemgroup struct { + Allowedmanagementinterface []string `json:"allowedmanagementinterface,omitempty"` + Count float64 `json:"__count,omitempty"` + Daystoexpire int `json:"daystoexpire,omitempty"` + Groupname string `json:"groupname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Promptstring string `json:"promptstring,omitempty"` + Timeout int `json:"timeout,omitempty"` + Warnpriorndays int `json:"warnpriorndays,omitempty"` +} + +type SystemglobalAuthenticationradiuspolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SystemgroupSystemuserBinding struct { + Groupname string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` +} + +type SystemglobalAuthenticationtacacspolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SystemuserSystemgroupBinding struct { + Groupname string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` +} + +type Systemfipsstatus struct { + Fipsstatus string `json:"fipsstatus,omitempty"` + Intelhwcryptographicacceleratorversion string `json:"intelhwcryptographicacceleratorversion,omitempty"` + Netscalercontrolplanecryptographiclibraryversion string `json:"netscalercontrolplanecryptographiclibraryversion,omitempty"` + Netscalercrytographicmoduleversion string `json:"netscalercrytographicmoduleversion,omitempty"` + Netscalerdataplanecryptographiclibraryversion string `json:"netscalerdataplanecryptographiclibraryversion,omitempty"` + Netscalerjitterentropysourceversion string `json:"netscalerjitterentropysourceversion,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type Systemextramgmtcpu struct { + Configuredstate string `json:"configuredstate,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` +} + +type Systemsignedexereport struct { + Message string `json:"message,omitempty"` +} + +type Systemnsbtracing struct { + Configuredstate string `json:"configuredstate,omitempty"` + Effectivestate string `json:"effectivestate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` +} + +type Systemcmdpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Cmdspec string `json:"cmdspec,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Policyname string `json:"policyname,omitempty"` +} + +type SystemgroupNspartitionBinding struct { + Groupname string `json:"groupname,omitempty"` + Partitionname string `json:"partitionname,omitempty"` +} + +type SystemglobalAuthenticationpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Nextfactor string `json:"nextfactor,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type SystemgroupBinding struct { + Groupname string `json:"groupname,omitempty"` + SystemgroupNspartitionBinding []interface{} `json:"systemgroup_nspartition_binding,omitempty"` + SystemgroupSystemcmdpolicyBinding []interface{} `json:"systemgroup_systemcmdpolicy_binding,omitempty"` + SystemgroupSystemuserBinding []interface{} `json:"systemgroup_systemuser_binding,omitempty"` +} + +type Systembackup struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Createdby string `json:"createdby,omitempty"` + Creationtime string `json:"creationtime,omitempty"` + Filename string `json:"filename,omitempty"` + Includekernel string `json:"includekernel,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Level string `json:"level,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Size int `json:"size,omitempty"` + Skipbackup bool `json:"skipbackup,omitempty"` + Uselocaltimezone bool `json:"uselocaltimezone,omitempty"` + Version string `json:"version,omitempty"` +} + +type Systemsshkey struct { + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Src string `json:"src,omitempty"` + Sshkeytype string `json:"sshkeytype,omitempty"` +} + +type Systemuser struct { + Allowedmanagementinterface []string `json:"allowedmanagementinterface,omitempty"` + Allowedmanagementinterfacekind string `json:"allowedmanagementinterfacekind,omitempty"` + Count float64 `json:"__count,omitempty"` + Daystoexpirekind string `json:"daystoexpirekind,omitempty"` + Encrypted bool `json:"encrypted,omitempty"` + Externalauth string `json:"externalauth,omitempty"` + Hashmethod string `json:"hashmethod,omitempty"` + Lastpwdchangetimestamp int `json:"lastpwdchangetimestamp,omitempty"` + Logging string `json:"logging,omitempty"` + Maxsession int `json:"maxsession,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Promptinheritedfrom string `json:"promptinheritedfrom,omitempty"` + Promptstring string `json:"promptstring,omitempty"` + Timeout int `json:"timeout,omitempty"` + Timeoutkind string `json:"timeoutkind,omitempty"` + Username string `json:"username,omitempty"` +} + +type SystemuserBinding struct { + SystemuserNspartitionBinding []interface{} `json:"systemuser_nspartition_binding,omitempty"` + SystemuserSystemcmdpolicyBinding []interface{} `json:"systemuser_systemcmdpolicy_binding,omitempty"` + SystemuserSystemgroupBinding []interface{} `json:"systemuser_systemgroup_binding,omitempty"` + Username string `json:"username,omitempty"` +} + +type Systemfile struct { + Count float64 `json:"__count,omitempty"` + Fileaccesstime string `json:"fileaccesstime,omitempty"` + Filecontent string `json:"filecontent,omitempty"` + Fileencoding string `json:"fileencoding,omitempty"` + Filelocation string `json:"filelocation,omitempty"` + Filemode []string `json:"filemode,omitempty"` + Filemodifiedtime string `json:"filemodifiedtime,omitempty"` + Filename string `json:"filename,omitempty"` + Filesize int `json:"filesize,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type SystemuserNspartitionBinding struct { + Partitionname string `json:"partitionname,omitempty"` + Username string `json:"username,omitempty"` +} + type SystemStatus struct { AddiMgmtCPUUsagePcnt float64 `json:"addimgmtcpuusagepcnt,omitempty"` AuxTemp0 int `json:"auxtemp0,omitempty"` diff --git a/nitrogo/models/tm.go b/nitrogo/models/tm.go index 5df2c71..7cf6aaa 100644 --- a/nitrogo/models/tm.go +++ b/nitrogo/models/tm.go @@ -1,338 +1,278 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Tmsessionpolicyauthenticationvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Tmsessionpolicybinding struct { - Name string `json:"name,omitempty"` +// tm configuration structs +type Tmformssoaction struct { + Actionurl string `json:"actionurl,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Namevaluepair string `json:"namevaluepair,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nvtype string `json:"nvtype,omitempty"` + Passwdfield string `json:"passwdfield,omitempty"` + Responsesize int `json:"responsesize,omitempty"` + Ssosuccessrule string `json:"ssosuccessrule,omitempty"` + Submitmethod string `json:"submitmethod,omitempty"` + Userfield string `json:"userfield,omitempty"` } -type Tmtrafficpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type TmtrafficpolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmglobalauditsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Tmglobalnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Tmtrafficpolicy struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Tmglobaltrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` - Type string `json:"type,omitempty"` +type TmglobalTmtrafficpolicyBinding struct { + Bindpolicytype int `json:"bindpolicytype,omitempty"` Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Tmsessionaction struct { - Name string `json:"name,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Ssodomain string `json:"ssodomain,omitempty"` - Httponlycookie string `json:"httponlycookie,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Persistentcookie string `json:"persistentcookie,omitempty"` - Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` - Homepage string `json:"homepage,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Tmtrafficaction struct { - Name string `json:"name,omitempty"` - Apptimeout int `json:"apptimeout,omitempty"` - Sso string `json:"sso,omitempty"` - Formssoaction string `json:"formssoaction,omitempty"` - Persistentcookie string `json:"persistentcookie,omitempty"` - Initiatelogout string `json:"initiatelogout,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Forcedtimeout string `json:"forcedtimeout,omitempty"` - Forcedtimeoutval int `json:"forcedtimeoutval,omitempty"` - Userexpression string `json:"userexpression,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Tmtrafficpolicytmglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Tmformssoaction struct { - Name string `json:"name,omitempty"` - Actionurl string `json:"actionurl,omitempty"` - Userfield string `json:"userfield,omitempty"` - Passwdfield string `json:"passwdfield,omitempty"` - Ssosuccessrule string `json:"ssosuccessrule,omitempty"` - Namevaluepair string `json:"namevaluepair,omitempty"` - Responsesize int `json:"responsesize,omitempty"` - Nvtype string `json:"nvtype,omitempty"` - Submitmethod string `json:"submitmethod,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Tmglobalsyslogpolicybinding struct { Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Tmsessionpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type TmglobalBinding struct { + TmglobalAuditnslogpolicyBinding []interface{} `json:"tmglobal_auditnslogpolicy_binding,omitempty"` + TmglobalAuditsyslogpolicyBinding []interface{} `json:"tmglobal_auditsyslogpolicy_binding,omitempty"` + TmglobalTmsessionpolicyBinding []interface{} `json:"tmglobal_tmsessionpolicy_binding,omitempty"` + TmglobalTmtrafficpolicyBinding []interface{} `json:"tmglobal_tmtrafficpolicy_binding,omitempty"` } -type Tmsessionpolicytmglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type TmtrafficpolicyBinding struct { + Name string `json:"name,omitempty"` + TmtrafficpolicyCsvserverBinding []interface{} `json:"tmtrafficpolicy_csvserver_binding,omitempty"` + TmtrafficpolicyLbvserverBinding []interface{} `json:"tmtrafficpolicy_lbvserver_binding,omitempty"` + TmtrafficpolicyTmglobalBinding []interface{} `json:"tmtrafficpolicy_tmglobal_binding,omitempty"` } type Tmsessionpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Hits string `json:"hits,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Feature string `json:"feature,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Tmsessionpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type TmtrafficpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Tmsessionpolicyuserbinding struct { Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmtrafficpolicyvserverbinding struct { +type TmsessionpolicyTmglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` -} - -type Tmglobalauditnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Priority int `json:"priority,omitempty"` } type Tmsessionparameter struct { - Sesstimeout int `json:"sesstimeout,omitempty"` Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Ssodomain string `json:"ssodomain,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + Homepage string `json:"homepage,omitempty"` Httponlycookie string `json:"httponlycookie,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` Persistentcookie string `json:"persistentcookie,omitempty"` Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` - Homepage string `json:"homepage,omitempty"` - Name string `json:"name,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Ssodomain string `json:"ssodomain,omitempty"` Tmsessionpolicybindtype string `json:"tmsessionpolicybindtype,omitempty"` - Tmsessionpolicycount string `json:"tmsessionpolicycount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Tmsessionpolicycount int `json:"tmsessionpolicycount,omitempty"` } -type Tmtrafficpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Tmtrafficpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type TmglobalAuditnslogpolicyBinding struct { + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmglobaltmsessionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Tmtrafficaction struct { + Apptimeout int `json:"apptimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Forcedtimeout string `json:"forcedtimeout,omitempty"` + Forcedtimeoutval int `json:"forcedtimeoutval,omitempty"` + Formssoaction string `json:"formssoaction,omitempty"` + Initiatelogout string `json:"initiatelogout,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Persistentcookie string `json:"persistentcookie,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Sso string `json:"sso,omitempty"` + Userexpression string `json:"userexpression,omitempty"` } -type Tmsamlssoprofile struct { - Name string `json:"name,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Audience string `json:"audience,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type TmsessionpolicyBinding struct { + Name string `json:"name,omitempty"` + TmsessionpolicyAaagroupBinding []interface{} `json:"tmsessionpolicy_aaagroup_binding,omitempty"` + TmsessionpolicyAaauserBinding []interface{} `json:"tmsessionpolicy_aaauser_binding,omitempty"` + TmsessionpolicyAuthenticationvserverBinding []interface{} `json:"tmsessionpolicy_authenticationvserver_binding,omitempty"` + TmsessionpolicyTmglobalBinding []interface{} `json:"tmsessionpolicy_tmglobal_binding,omitempty"` } -type Tmsessionpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type TmsessionpolicyAaagroupBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmglobalbinding struct { +type TmtrafficpolicyTmglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmglobalsessionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpolicytype uint32 `json:"bindpolicytype,omitempty"` +type TmglobalTmsessionpolicyBinding struct { + Bindpolicytype int `json:"bindpolicytype,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmsessionpolicygroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type TmglobalAuditsyslogpolicyBinding struct { + Bindpolicytype int `json:"bindpolicytype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmtrafficpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Tmsamlssoprofile struct { + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Audience string `json:"audience,omitempty"` + Count float64 `json:"__count,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Name string `json:"name,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Skewtime int `json:"skewtime,omitempty"` } -type Tmglobaltmtrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Type string `json:"type,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Tmsessionaction struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Feature string `json:"feature,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httponlycookie string `json:"httponlycookie,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Persistentcookie string `json:"persistentcookie,omitempty"` + Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Ssodomain string `json:"ssodomain,omitempty"` } -type Tmsessionpolicyvserverbinding struct { +type TmsessionpolicyAuthenticationvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tmtrafficpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type TmsessionpolicyAaauserBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/transform.go b/nitrogo/models/transform.go index 42afe28..f58709c 100644 --- a/nitrogo/models/transform.go +++ b/nitrogo/models/transform.go @@ -1,234 +1,175 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Transformglobalbinding struct { -} - -type Transformpolicytransformglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +// transform configuration structs +type TransformpolicyCsvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Transformpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type TransformprofileBinding struct { + Name string `json:"name,omitempty"` + TransformprofileTransformactionBinding []interface{} `json:"transformprofile_transformaction_binding,omitempty"` } -type Transformpolicylabelpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` +type TransformpolicyBinding struct { + Name string `json:"name,omitempty"` + TransformpolicyCsvserverBinding []interface{} `json:"transformpolicy_csvserver_binding,omitempty"` + TransformpolicyLbvserverBinding []interface{} `json:"transformpolicy_lbvserver_binding,omitempty"` + TransformpolicyTransformglobalBinding []interface{} `json:"transformpolicy_transformglobal_binding,omitempty"` + TransformpolicyTransformpolicylabelBinding []interface{} `json:"transformpolicy_transformpolicylabel_binding,omitempty"` } -type Transformpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Transformpolicylabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type TransformpolicyTransformpolicylabelBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Transformpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` +type TransformpolicylabelTransformpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Transformpolicylabeltransformpolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Transformglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Flowtype uint32 `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` +type Transformpolicy struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Rule string `json:"rule,omitempty"` } -type Transformglobaltransformpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Numpol int `json:"numpol,omitempty"` +type Transformprofile struct { + Additionalreqheaderslist string `json:"additionalreqheaderslist,omitempty"` + Additionalrespheaderslist string `json:"additionalrespheaderslist,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Onlytransformabsurlinbody string `json:"onlytransformabsurlinbody,omitempty"` + Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` + Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` + Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` + Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type TransformglobalTransformpolicyBinding struct { Flowtype int `json:"flowtype,omitempty"` Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Transformpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Transformpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Transformpolicypolicylabelbinding struct { +type TransformpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Transformpolicytransformpolicylabelbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` Name string `json:"name,omitempty"` -} - -type Transformpolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Transformprofileactionbinding struct { - Actionname string `json:"actionname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Profilename string `json:"profilename,omitempty"` - Requrlfrom string `json:"requrlfrom,omitempty"` - Requrlinto string `json:"requrlinto,omitempty"` - Resurlfrom string `json:"resurlfrom,omitempty"` - Resurlinto string `json:"resurlinto,omitempty"` - Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` - Cookiedomaininto string `json:"cookiedomaininto,omitempty"` - Actioncomment string `json:"actioncomment,omitempty"` - Name string `json:"name,omitempty"` } type Transformaction struct { - Name string `json:"name,omitempty"` - Profilename string `json:"profilename,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Requrlfrom string `json:"requrlfrom,omitempty"` - Requrlinto string `json:"requrlinto,omitempty"` - Resurlfrom string `json:"resurlfrom,omitempty"` - Resurlinto string `json:"resurlinto,omitempty"` - Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` - Cookiedomaininto string `json:"cookiedomaininto,omitempty"` - Comment string `json:"comment,omitempty"` - Continuematching string `json:"continuematching,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Transformpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Profilename string `json:"profilename,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Comment string `json:"comment,omitempty"` + Continuematching string `json:"continuematching,omitempty"` + Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` + Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` + Profilename string `json:"profilename,omitempty"` + Requrlfrom string `json:"requrlfrom,omitempty"` + Requrlinto string `json:"requrlinto,omitempty"` + Resurlfrom string `json:"resurlfrom,omitempty"` + Resurlinto string `json:"resurlinto,omitempty"` + State string `json:"state,omitempty"` } -type Transformpolicybinding struct { - Name string `json:"name,omitempty"` +type TransformpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + TransformpolicylabelPolicybindingBinding []interface{} `json:"transformpolicylabel_policybinding_binding,omitempty"` + TransformpolicylabelTransformpolicyBinding []interface{} `json:"transformpolicylabel_transformpolicy_binding,omitempty"` } -type Transformpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` +type TransformglobalBinding struct { + TransformglobalTransformpolicyBinding []interface{} `json:"transformglobal_transformpolicy_binding,omitempty"` } -type Transformprofile struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Onlytransformabsurlinbody string `json:"onlytransformabsurlinbody,omitempty"` - Comment string `json:"comment,omitempty"` - Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` - Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` - Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` - Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` - Additionalreqheaderslist string `json:"additionalreqheaderslist,omitempty"` - Additionalrespheaderslist string `json:"additionalrespheaderslist,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Transformprofilebinding struct { - Name string `json:"name,omitempty"` -} - -type Transformprofiletransformactionbinding struct { +type TransformprofileTransformactionBinding struct { + Actioncomment string `json:"actioncomment,omitempty"` Actionname string `json:"actionname,omitempty"` + Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` + Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` Profilename string `json:"profilename,omitempty"` Requrlfrom string `json:"requrlfrom,omitempty"` Requrlinto string `json:"requrlinto,omitempty"` Resurlfrom string `json:"resurlfrom,omitempty"` Resurlinto string `json:"resurlinto,omitempty"` - Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` - Cookiedomaininto string `json:"cookiedomaininto,omitempty"` - Actioncomment string `json:"actioncomment,omitempty"` - Name string `json:"name,omitempty"` + State string `json:"state,omitempty"` +} + +type TransformpolicylabelPolicybindingBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type TransformpolicyTransformglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/tunnel.go b/nitrogo/models/tunnel.go index a452fc3..3b86cca 100644 --- a/nitrogo/models/tunnel.go +++ b/nitrogo/models/tunnel.go @@ -1,76 +1,55 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Tunnelglobaltrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Type string `json:"type,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policytype string `json:"policytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - -type Tunnelglobaltunneltrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Type string `json:"type,omitempty"` - Numpol int `json:"numpol,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policytype string `json:"policytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` -} - +// tunnel configuration structs type Tunneltrafficpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Txbytes string `json:"txbytes,omitempty"` - Rxbytes string `json:"rxbytes,omitempty"` - Clientttlb string `json:"clientttlb,omitempty"` - Clienttransactions string `json:"clienttransactions,omitempty"` - Serverttlb string `json:"serverttlb,omitempty"` - Servertransactions string `json:"servertransactions,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Clienttransactions int `json:"clienttransactions,omitempty"` + Clientttlb int `json:"clientttlb,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Rxbytes int `json:"rxbytes,omitempty"` + Servertransactions int `json:"servertransactions,omitempty"` + Serverttlb int `json:"serverttlb,omitempty"` + Txbytes int `json:"txbytes,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Tunneltrafficpolicybinding struct { - Name string `json:"name,omitempty"` +type TunnelglobalBinding struct { + TunnelglobalTunneltrafficpolicyBinding []interface{} `json:"tunnelglobal_tunneltrafficpolicy_binding,omitempty"` } -type Tunneltrafficpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` +type TunneltrafficpolicyBinding struct { + Name string `json:"name,omitempty"` + TunneltrafficpolicyTunnelglobalBinding []interface{} `json:"tunneltrafficpolicy_tunnelglobal_binding,omitempty"` } -type Tunneltrafficpolicytunnelglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type TunneltrafficpolicyTunnelglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Tunnelglobalbinding struct { +type TunnelglobalTunneltrafficpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Policytype string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/ulfd.go b/nitrogo/models/ulfd.go index 0764f3c..6bce1ef 100644 --- a/nitrogo/models/ulfd.go +++ b/nitrogo/models/ulfd.go @@ -1,11 +1,9 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models +// ulfd configuration structs type Ulfdserver struct { - Loggerip string `json:"loggerip,omitempty"` - State string `json:"state,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Count float64 `json:"__count,omitempty"` + Loggerip string `json:"loggerip,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` } diff --git a/nitrogo/models/user.go b/nitrogo/models/user.go index 0433738..e9c4bd9 100644 --- a/nitrogo/models/user.go +++ b/nitrogo/models/user.go @@ -1,31 +1,30 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Userprotocol struct { - Name string `json:"name,omitempty"` - Transport string `json:"transport,omitempty"` - Extension string `json:"extension,omitempty"` - Comment string `json:"comment,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +// user configuration structs +type Uservserver struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Curstate string `json:"curstate,omitempty"` + Defaultlb string `json:"defaultlb,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Params string `json:"Params,omitempty"` + Port int `json:"port,omitempty"` + State string `json:"state,omitempty"` + Statechangetimemsec int `json:"statechangetimemsec,omitempty"` + Statechangetimesec string `json:"statechangetimesec,omitempty"` + Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + Userprotocol string `json:"userprotocol,omitempty"` + Value string `json:"value,omitempty"` } -type Uservserver struct { - Name string `json:"name,omitempty"` - Userprotocol string `json:"userprotocol,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Port int `json:"port,omitempty"` - Defaultlb string `json:"defaultlb,omitempty"` - Params string `json:"Params,omitempty"` - Comment string `json:"comment,omitempty"` - State string `json:"state,omitempty"` - Curstate string `json:"curstate,omitempty"` - Value string `json:"value,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Statechangetimemsec string `json:"statechangetimemsec,omitempty"` - Tickssincelaststatechange string `json:"tickssincelaststatechange,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type Userprotocol struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Extension string `json:"extension,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Transport string `json:"transport,omitempty"` } diff --git a/nitrogo/models/utility.go b/nitrogo/models/utility.go index 90bdfd9..e649f7c 100644 --- a/nitrogo/models/utility.go +++ b/nitrogo/models/utility.go @@ -1,142 +1,139 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Ping6 struct { - B int `json:"b,omitempty"` - C int `json:"c,omitempty"` - I int `json:"i,omitempty"` - I_ string `json:"I,omitempty"` - M bool `json:"m,omitempty"` - N bool `json:"n,omitempty"` - P string `json:"p,omitempty"` - Q bool `json:"q,omitempty"` - S int `json:"s,omitempty"` - V int `json:"V,omitempty"` - S_ string `json:"S,omitempty"` - T int `json:"T,omitempty"` - T_ int `json:"t,omitempty"` - HostName string `json:"hostName,omitempty"` - Response string `json:"response,omitempty"` -} - +// utility configuration structs type Raid struct { Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Techsupport struct { - Scope string `json:"scope,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Upload bool `json:"upload,omitempty"` - Proxy string `json:"proxy,omitempty"` - Casenumber string `json:"casenumber,omitempty"` - File string `json:"file,omitempty"` - Description string `json:"description,omitempty"` - Authtoken string `json:"authtoken,omitempty"` - Time string `json:"time,omitempty"` - Adss bool `json:"adss,omitempty"` - Nodes []int `json:"nodes,omitempty"` - Response string `json:"response,omitempty"` - Servername string `json:"servername,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Traceroute struct { - S bool `json:"S,omitempty"` - N bool `json:"n,omitempty"` - R bool `json:"r,omitempty"` - V bool `json:"v,omitempty"` - M int `json:"M,omitempty"` - M_ int `json:"m,omitempty"` - P string `json:"P,omitempty"` - P_ int `json:"p,omitempty"` - Q int `json:"q,omitempty"` - S_ string `json:"s,omitempty"` - T int `json:"T,omitempty"` - T_ int `json:"t,omitempty"` - W int `json:"w,omitempty"` - Host string `json:"host,omitempty"` - Packetlen int `json:"packetlen,omitempty"` - Response string `json:"response,omitempty"` +type Install struct { + A bool `json:"a,omitempty"` + Async bool `json:"Async,omitempty"` + Enhancedupgrade bool `json:"enhancedupgrade,omitempty"` + Id int `json:"id,omitempty"` + L bool `json:"l,omitempty"` + Resizeswapvar bool `json:"resizeswapvar,omitempty"` + Url string `json:"url,omitempty"` + Y bool `json:"y,omitempty"` } type Traceroute6 struct { - N bool `json:"n,omitempty"` + Host string `json:"host,omitempty"` I bool `json:"I,omitempty"` - R bool `json:"r,omitempty"` - V bool `json:"v,omitempty"` M int `json:"m,omitempty"` + N bool `json:"n,omitempty"` P int `json:"p,omitempty"` + Packetlen int `json:"packetlen,omitempty"` Q int `json:"q,omitempty"` + R bool `json:"r,omitempty"` + Response string `json:"response,omitempty"` S string `json:"s,omitempty"` T int `json:"T,omitempty"` + V bool `json:"v,omitempty"` W int `json:"w,omitempty"` +} + +type Ping struct { + C int `json:"c,omitempty"` + HostName string `json:"hostName,omitempty"` + I string `json:"I,omitempty"` + I1 int `json:"i,omitempty"` + N bool `json:"n,omitempty"` + P string `json:"p,omitempty"` + Q bool `json:"q,omitempty"` + Response string `json:"response,omitempty"` + S string `json:"S,omitempty"` + S1 int `json:"s,omitempty"` + T int `json:"T,omitempty"` + T1 int `json:"t,omitempty"` +} + +type Techsupport struct { + Adss bool `json:"adss,omitempty"` + Authtoken string `json:"authtoken,omitempty"` + Casenumber string `json:"casenumber,omitempty"` + Description string `json:"description,omitempty"` + File string `json:"file,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodes []interface{} `json:"nodes,omitempty"` + Partitionname string `json:"partitionname,omitempty"` + Proxy string `json:"proxy,omitempty"` + Response string `json:"response,omitempty"` + Scope string `json:"scope,omitempty"` + Servername string `json:"servername,omitempty"` + Time string `json:"time,omitempty"` + Upload bool `json:"upload,omitempty"` +} + +type Traceroute struct { Host string `json:"host,omitempty"` + M int `json:"M,omitempty"` + M1 int `json:"m,omitempty"` + N bool `json:"n,omitempty"` + P string `json:"P,omitempty"` + P1 int `json:"p,omitempty"` Packetlen int `json:"packetlen,omitempty"` + Q int `json:"q,omitempty"` + R bool `json:"r,omitempty"` Response string `json:"response,omitempty"` + S bool `json:"S,omitempty"` + S1 string `json:"s,omitempty"` + T int `json:"T,omitempty"` + T1 int `json:"t,omitempty"` + V bool `json:"v,omitempty"` + W int `json:"w,omitempty"` } type Callhome struct { - Nodeid int `json:"nodeid,omitempty"` - Mode string `json:"mode,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Hbcustominterval int `json:"hbcustominterval,omitempty"` - Proxymode string `json:"proxymode,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Proxyauthservice string `json:"proxyauthservice,omitempty"` - Port int `json:"port,omitempty"` - Sslcardfirstfailure string `json:"sslcardfirstfailure,omitempty"` - Sslcardlatestfailure string `json:"sslcardlatestfailure,omitempty"` - Powfirstfail string `json:"powfirstfail,omitempty"` - Powlatestfailure string `json:"powlatestfailure,omitempty"` - Hddfirstfail string `json:"hddfirstfail,omitempty"` - Hddlatestfailure string `json:"hddlatestfailure,omitempty"` - Flashfirstfail string `json:"flashfirstfail,omitempty"` - Flashlatestfailure string `json:"flashlatestfailure,omitempty"` - Rlfirsthighdrop string `json:"rlfirsthighdrop,omitempty"` - Rllatesthighdrop string `json:"rllatesthighdrop,omitempty"` - Restartlatestfail string `json:"restartlatestfail,omitempty"` - Memthrefirstanomaly string `json:"memthrefirstanomaly,omitempty"` - Memthrelatestanomaly string `json:"memthrelatestanomaly,omitempty"` - Callhomestatus string `json:"callhomestatus,omitempty"` - Anomalydetection string `json:"anomalydetection,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Anomalydetection string `json:"anomalydetection,omitempty"` + Callhomestatus []string `json:"callhomestatus,omitempty"` + Emailaddress string `json:"emailaddress,omitempty"` + Flashfirstfail string `json:"flashfirstfail,omitempty"` + Flashlatestfailure string `json:"flashlatestfailure,omitempty"` + Hbcustominterval int `json:"hbcustominterval,omitempty"` + Hddfirstfail string `json:"hddfirstfail,omitempty"` + Hddlatestfailure string `json:"hddlatestfailure,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Memthrefirstanomaly string `json:"memthrefirstanomaly,omitempty"` + Memthrelatestanomaly string `json:"memthrelatestanomaly,omitempty"` + Mode string `json:"mode,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Port int `json:"port,omitempty"` + Powfirstfail string `json:"powfirstfail,omitempty"` + Powlatestfailure string `json:"powlatestfailure,omitempty"` + Proxyauthservice string `json:"proxyauthservice,omitempty"` + Proxymode string `json:"proxymode,omitempty"` + Restartlatestfail string `json:"restartlatestfail,omitempty"` + Rlfirsthighdrop string `json:"rlfirsthighdrop,omitempty"` + Rllatesthighdrop string `json:"rllatesthighdrop,omitempty"` + Sslcardfirstfailure string `json:"sslcardfirstfailure,omitempty"` + Sslcardlatestfailure string `json:"sslcardlatestfailure,omitempty"` } type Filesystemencryption struct { + Effectivestate string `json:"effectivestate,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` Ntimes0flash int `json:"ntimes0flash,omitempty"` Ntimes0var int `json:"ntimes0var,omitempty"` Passphrase string `json:"passphrase,omitempty"` - Nodeid int `json:"nodeid,omitempty"` Supportedstate string `json:"supportedstate,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Install struct { - Url string `json:"url,omitempty"` - Y bool `json:"y,omitempty"` - L bool `json:"l,omitempty"` - A bool `json:"a,omitempty"` - Enhancedupgrade bool `json:"enhancedupgrade,omitempty"` - Resizeswapvar bool `json:"resizeswapvar,omitempty"` - Async bool `json:"Async,omitempty"` - Id string `json:"id,omitempty"` } -type Ping struct { +type Ping6 struct { + B int `json:"b,omitempty"` C int `json:"c,omitempty"` - I int `json:"i,omitempty"` - I_ string `json:"I,omitempty"` + HostName string `json:"hostName,omitempty"` + I string `json:"I,omitempty"` + I1 int `json:"i,omitempty"` + M bool `json:"m,omitempty"` N bool `json:"n,omitempty"` P string `json:"p,omitempty"` Q bool `json:"q,omitempty"` - S int `json:"s,omitempty"` - S_ string `json:"S,omitempty"` - T int `json:"T,omitempty"` - T_ int `json:"t,omitempty"` - HostName string `json:"hostName,omitempty"` Response string `json:"response,omitempty"` + S string `json:"S,omitempty"` + S1 int `json:"s,omitempty"` + T int `json:"T,omitempty"` + T1 int `json:"t,omitempty"` + V int `json:"V,omitempty"` } diff --git a/nitrogo/models/videooptimization.go b/nitrogo/models/videooptimization.go index a3c82fc..75dc302 100644 --- a/nitrogo/models/videooptimization.go +++ b/nitrogo/models/videooptimization.go @@ -1,305 +1,234 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Videooptimizationglobaldetectionbinding struct { +// videooptimization configuration structs +type VideooptimizationglobalpacingBinding struct { + VideooptimizationglobalpacingVideooptimizationpacingpolicyBinding []interface{} `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding,omitempty"` } -type Videooptimizationpacingpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Videooptimizationpacingpolicyvideooptimizationglobalpacingbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type Videooptimizationparameter struct { + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Quicpacingrate int `json:"quicpacingrate,omitempty"` + Randomsamplingpercentage float64 `json:"randomsamplingpercentage,omitempty"` } -type Videooptimizationglobaldetectiondetectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` +type VideooptimizationpacingpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + VideooptimizationpacingpolicylabelPolicybindingBinding []interface{} `json:"videooptimizationpacingpolicylabel_policybinding_binding,omitempty"` + VideooptimizationpacingpolicylabelVideooptimizationpacingpolicyBinding []interface{} `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding,omitempty"` } -type Videooptimizationglobalpacingbinding struct { +type Videooptimizationpacingaction struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rate int `json:"rate,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Videooptimizationglobalpacingpacingpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol uint32 `json:"numpol,omitempty"` +type Videooptimizationdetectionpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type VideooptimizationglobaldetectionVideooptimizationdetectionpolicyBinding struct { Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationdetectionpolicyglobaldetectionbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` -} - -type Videooptimizationpacingpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationdetectionpolicylabelbinding struct { - Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationpacingpolicylabelpolicybindingbinding struct { + Numpol int `json:"numpol,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` + TypeField string `json:"type,omitempty"` } -type Videooptimizationdetectionpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type VideooptimizationdetectionpolicyLbvserverBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Videooptimizationpacingpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Videooptimizationpacingpolicyglobalpacingbinding struct { +type VideooptimizationpacingpolicyLbvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Videooptimizationdetectionpolicylabelpolicybindingbinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` +type Videooptimizationpacingpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type VideooptimizationdetectionpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationglobaldetectionvideooptimizationdetectionpolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Videooptimizationpacingpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` +type VideooptimizationdetectionpolicyBinding struct { + Name string `json:"name,omitempty"` + VideooptimizationdetectionpolicyLbvserverBinding []interface{} `json:"videooptimizationdetectionpolicy_lbvserver_binding,omitempty"` + VideooptimizationdetectionpolicyVideooptimizationglobaldetectionBinding []interface{} `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding,omitempty"` +} + +type VideooptimizationglobalpacingVideooptimizationpacingpolicyBinding struct { + Globalbindtype string `json:"globalbindtype,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } -type Videooptimizationparameter struct { - Randomsamplingpercentage float64 `json:"randomsamplingpercentage,omitempty"` - Quicpacingrate int `json:"quicpacingrate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VideooptimizationpacingpolicyBinding struct { + Name string `json:"name,omitempty"` + VideooptimizationpacingpolicyLbvserverBinding []interface{} `json:"videooptimizationpacingpolicy_lbvserver_binding,omitempty"` + VideooptimizationpacingpolicyVideooptimizationglobalpacingBinding []interface{} `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding,omitempty"` } -type Videooptimizationdetectionpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` +type VideooptimizationdetectionpolicylabelBinding struct { + Labelname string `json:"labelname,omitempty"` + VideooptimizationdetectionpolicylabelPolicybindingBinding []interface{} `json:"videooptimizationdetectionpolicylabel_policybinding_binding,omitempty"` + VideooptimizationdetectionpolicylabelVideooptimizationdetectionpolicyBinding []interface{} `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding,omitempty"` } -type Videooptimizationdetectionpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VideooptimizationglobaldetectionBinding struct { + VideooptimizationglobaldetectionVideooptimizationdetectionpolicyBinding []interface{} `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding,omitempty"` } -type Videooptimizationdetectionpolicylabeldetectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type VideooptimizationpacingpolicylabelPolicybindingBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationglobalpacingvideooptimizationpacingpolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` - Type string `json:"type,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Labelname string `json:"labelname,omitempty"` } -type Videooptimizationpacingpolicylabelpacingpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type VideooptimizationdetectionpolicylabelVideooptimizationdetectionpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationpacingpolicylabelvideooptimizationpacingpolicybinding struct { + Labeltype string `json:"labeltype,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` } type Videooptimizationdetectionaction struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Videooptimizationdetectionpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Videooptimizationdetectionpolicylabelvideooptimizationdetectionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Referencecount int `json:"referencecount,omitempty"` + TypeField string `json:"type,omitempty"` + Undefhits int `json:"undefhits,omitempty"` +} + +type VideooptimizationpacingpolicyVideooptimizationglobalpacingBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` -} - -type Videooptimizationpacingaction struct { - Name string `json:"name,omitempty"` - Rate int `json:"rate,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Referencecount string `json:"referencecount,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Videooptimizationpacingpolicylabel struct { - Labelname string `json:"labelname,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Comment string `json:"comment,omitempty"` - Newname string `json:"newname,omitempty"` - Numpol string `json:"numpol,omitempty"` - Hits string `json:"hits,omitempty"` - Priority string `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Labeltype string `json:"labeltype,omitempty"` - Invokelabelname string `json:"invoke_labelname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Videooptimizationpacingpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` +type VideooptimizationpacingpolicylabelVideooptimizationpacingpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` Labelname string `json:"labelname,omitempty"` - Name string `json:"name,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } type Videooptimizationdetectionpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Videooptimizationdetectionpolicyvideooptimizationglobaldetectionbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type Videooptimizationpacingpolicylabel struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelname string `json:"invoke_labelname,omitempty"` + Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Numpol int `json:"numpol,omitempty"` + Policylabeltype string `json:"policylabeltype,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type VideooptimizationdetectionpolicyVideooptimizationglobaldetectionBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labeltype string `json:"labeltype,omitempty"` Labelname string `json:"labelname,omitempty"` + Labeltype string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/vpn.go b/nitrogo/models/vpn.go index 4ef141f..bcd1eb1 100644 --- a/nitrogo/models/vpn.go +++ b/nitrogo/models/vpn.go @@ -1,1819 +1,1441 @@ -// Derived from Citrix ADC Nitro Go SDK (https://github.com/netscaler/adc-nitro-go) -// Originally licensed under the Apache License, Version 2.0 -// Modifications by Adam Crawford, 2026 - package models -type Vpnglobalauthenticationtacacspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobaleulabinding struct { - Eula string `json:"eula,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +// vpn configuration structs +type VpnclientlessaccesspolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnglobalportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` +type VpnglobalAuditnslogpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnglobalstaserverbinding struct { - Staserver string `json:"staserver,omitempty"` - Staauthid string `json:"staauthid,omitempty"` - Stastate string `json:"stastate,omitempty"` - Staaddresstype string `json:"staaddresstype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Vpnicadtlsconnection struct { + Channelnumber int `json:"channelnumber,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Domain string `json:"domain,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Peid int `json:"peid,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` + Username string `json:"username,omitempty"` } -type Vpnglobalurlpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type Vpnstoreinfo struct { + Count float64 `json:"__count,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Storeapisupport string `json:"storeapisupport,omitempty"` + Storelist string `json:"storelist,omitempty"` + Storeserverissf string `json:"storeserverissf,omitempty"` + Storeserverstatus string `json:"storeserverstatus,omitempty"` + Storestatus string `json:"storestatus,omitempty"` + Url string `json:"url,omitempty"` } -type Vpnglobaltrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` +type VpnglobalIntranetipBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` } -type Vpnportaltheme struct { - Name string `json:"name,omitempty"` - Basetheme string `json:"basetheme,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnurlpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnsessionpolicybinding struct { - Name string `json:"name,omitempty"` +type VpnurlpolicyAaauserBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnvserversamlidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Vpneula struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vpnvservervpnepaprofilebinding struct { - Epaprofile string `json:"epaprofile,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` +type VpnsessionpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnvservervpnurlbinding struct { - Urlname string `json:"urlname,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type VpnsessionpolicyBinding struct { + Name string `json:"name,omitempty"` + VpnsessionpolicyAaagroupBinding []interface{} `json:"vpnsessionpolicy_aaagroup_binding,omitempty"` + VpnsessionpolicyAaauserBinding []interface{} `json:"vpnsessionpolicy_aaauser_binding,omitempty"` + VpnsessionpolicyVpnglobalBinding []interface{} `json:"vpnsessionpolicy_vpnglobal_binding,omitempty"` + VpnsessionpolicyVpnvserverBinding []interface{} `json:"vpnsessionpolicy_vpnvserver_binding,omitempty"` } -type Vpnglobalappfwpolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type VpnvserverCspolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` } -type Vpnglobalnslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnvserverAuditsyslogpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobalsamlpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnglobalsessionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnglobalVpnclientlessaccesspolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Globalbindtype string `json:"globalbindtype,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` + TypeField string `json:"type,omitempty"` } -type Vpnsessionpolicygroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserverauthenticationcertpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalSecureprivateaccessurlBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` } -type Vpnvserverprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` +type VpnvserverAppcontrollerBinding struct { + Acttype int `json:"acttype,omitempty"` + Appcontroller string `json:"appcontroller,omitempty"` + Name string `json:"name,omitempty"` } -type Vpngloballocalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnglobalVpnsecureprivateaccessprofileBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` } -type Vpnsessionpolicyvserverbinding struct { +type VpnurlpolicyAaagroupBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpntrafficpolicygroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnglobalAuthenticationcertpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpntrafficpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnvserverAnalyticsprofileBinding struct { + Analyticsprofile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` } -type Vpnvserverintranetipbinding struct { - Intranetip string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Map string `json:"map,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type Vpnintranetapplication struct { + Clientapplication []string `json:"clientapplication,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport string `json:"destport,omitempty"` + Hostname string `json:"hostname,omitempty"` + Interception string `json:"interception,omitempty"` + Intranetapplication string `json:"intranetapplication,omitempty"` + Ipaddress string `json:"ipaddress,omitempty"` + Iprange string `json:"iprange,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Protocol string `json:"protocol,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` } -type Vpnvserverldappolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` +type VpnglobalVpntrafficpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnvservervpnintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type Vpnurlaction struct { + Actualurl string `json:"actualurl,omitempty"` + Applicationtype string `json:"applicationtype,omitempty"` + Clientlessaccess string `json:"clientlessaccess,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Iconurl string `json:"iconurl,omitempty"` + Linkname string `json:"linkname,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Ssotype string `json:"ssotype,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Vpnglobalintranetip6binding struct { - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Vpnpcoipconnection struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Peid int `json:"peid,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` + Username string `json:"username,omitempty"` +} + +type VpnvserverVpneulaBinding struct { + Acttype int `json:"acttype,omitempty"` + Eula string `json:"eula,omitempty"` + Name string `json:"name,omitempty"` } -type Vpnvservercertpolicybinding struct { +type VpnvserverAuthenticationnegotiatepolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvservervpnnexthopserverbinding struct { - Nexthopserver string `json:"nexthopserver,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type Vpnsfconfig struct { + Count float64 `json:"__count,omitempty"` + Filename string `json:"filename,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Vserver []string `json:"vserver,omitempty"` } -type Vpnclientlessaccesspolicybinding struct { - Name string `json:"name,omitempty"` +type Vpnportaltheme struct { + Basetheme string `json:"basetheme,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +} + +type VpntrafficpolicyVpnvserverBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnglobalauthenticationpolicybinding struct { +type VpnglobalAuthenticationldappolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +} + +type VpnglobalVpneulaBinding struct { + Eula string `json:"eula,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpnpcoipconnection struct { - Username string `json:"username,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - All bool `json:"all,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport string `json:"srcport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnurlpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpnparameter struct { + Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` + Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` + Allowedlogingroups string `json:"allowedlogingroups,omitempty"` + Allprotocolproxy string `json:"allprotocolproxy,omitempty"` + Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` + Apptokentimeout int `json:"apptokentimeout,omitempty"` + Authorizationgroup string `json:"authorizationgroup,omitempty"` + Autoproxyurl string `json:"autoproxyurl,omitempty"` + Backendcertvalidation string `json:"backendcertvalidation,omitempty"` + Backenddtls12 string `json:"backenddtls12,omitempty"` + Backendserversni string `json:"backendserversni,omitempty"` + Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` + Clientchoices string `json:"clientchoices,omitempty"` + Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` + Clientconfiguration []string `json:"clientconfiguration,omitempty"` + Clientdebug string `json:"clientdebug,omitempty"` + Clientidletimeout int `json:"clientidletimeout,omitempty"` + Clientidletimeoutwarning int `json:"clientidletimeoutwarning,omitempty"` + Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` + Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` + Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` + Clientoptions []string `json:"clientoptions,omitempty"` + Clientsecurity string `json:"clientsecurity,omitempty"` + Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` + Clientsecuritylog string `json:"clientsecuritylog,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Clientversions string `json:"clientversions,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Emailhome string `json:"emailhome,omitempty"` + Encryptcsecexp string `json:"encryptcsecexp,omitempty"` + Epaclienttype string `json:"epaclienttype,omitempty"` + Forcecleanup []string `json:"forcecleanup,omitempty"` + Forcedtimeout int `json:"forcedtimeout,omitempty"` + Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` + Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` + Ftpproxy string `json:"ftpproxy,omitempty"` + Gopherproxy string `json:"gopherproxy,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httpport []interface{} `json:"httpport,omitempty"` + Httpproxy string `json:"httpproxy,omitempty"` + Httptrackconnproxy string `json:"httptrackconnproxy,omitempty"` + Icaproxy string `json:"icaproxy,omitempty"` + Icasessiontimeout string `json:"icasessiontimeout,omitempty"` + Icauseraccounting string `json:"icauseraccounting,omitempty"` + Iconwithreceiver string `json:"iconwithreceiver,omitempty"` + Iipdnssuffix string `json:"iipdnssuffix,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Killconnections string `json:"killconnections,omitempty"` + Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` + Locallanaccess string `json:"locallanaccess,omitempty"` + Loginscript string `json:"loginscript,omitempty"` + Logoutscript string `json:"logoutscript,omitempty"` + Macpluginupgrade string `json:"macpluginupgrade,omitempty"` + Maxiipperuser int `json:"maxiipperuser,omitempty"` + Mdxtokentimeout int `json:"mdxtokentimeout,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ntdomain string `json:"ntdomain,omitempty"` + Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + Proxy string `json:"proxy,omitempty"` + Proxyexception string `json:"proxyexception,omitempty"` + Proxylocalbypass string `json:"proxylocalbypass,omitempty"` + Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` + Rfc1918 string `json:"rfc1918,omitempty"` + Samesite string `json:"samesite,omitempty"` + Securebrowse string `json:"securebrowse,omitempty"` + Secureprivateaccess string `json:"secureprivateaccess,omitempty"` + Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Smartgroup string `json:"smartgroup,omitempty"` + Socksproxy string `json:"socksproxy,omitempty"` + Splitdns string `json:"splitdns,omitempty"` + Splittunnel string `json:"splittunnel,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Sslproxy string `json:"sslproxy,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Storefronturl string `json:"storefronturl,omitempty"` + Transparentinterception string `json:"transparentinterception,omitempty"` + Uitheme string `json:"uitheme,omitempty"` + Useiip string `json:"useiip,omitempty"` + Usemip string `json:"usemip,omitempty"` + Userdomains string `json:"userdomains,omitempty"` + Vpnsessionpolicybindtype string `json:"vpnsessionpolicybindtype,omitempty"` + Vpnsessionpolicycount int `json:"vpnsessionpolicycount,omitempty"` + Wihome string `json:"wihome,omitempty"` + Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` + Windowsautologon string `json:"windowsautologon,omitempty"` + Windowsclienttype string `json:"windowsclienttype,omitempty"` + Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` + Winsip string `json:"winsip,omitempty"` + Wiportalmode string `json:"wiportalmode,omitempty"` } -type Vpnvserverappfwpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type Vpnclientlessaccessprofile struct { + Builtin []string `json:"builtin,omitempty"` + Clientconsumedcookies string `json:"clientconsumedcookies,omitempty"` + Count float64 `json:"__count,omitempty"` + Cssrewritepolicylabel string `json:"cssrewritepolicylabel,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Javascriptrewritepolicylabel string `json:"javascriptrewritepolicylabel,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Regexforfindingcustomurls string `json:"regexforfindingcustomurls,omitempty"` + Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` + Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` + Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` + Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` + Reqhdrrewritepolicylabel string `json:"reqhdrrewritepolicylabel,omitempty"` + Requirepersistentcookie string `json:"requirepersistentcookie,omitempty"` + Reshdrrewritepolicylabel string `json:"reshdrrewritepolicylabel,omitempty"` + Urlrewritepolicylabel string `json:"urlrewritepolicylabel,omitempty"` + Xcomponentrewritepolicylabel string `json:"xcomponentrewritepolicylabel,omitempty"` + Xmlrewritepolicylabel string `json:"xmlrewritepolicylabel,omitempty"` +} + +type Vpnsamlssoprofile struct { + Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + Attribute1 string `json:"attribute1,omitempty"` + Attribute10 string `json:"attribute10,omitempty"` + Attribute10expr string `json:"attribute10expr,omitempty"` + Attribute10format string `json:"attribute10format,omitempty"` + Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute11 string `json:"attribute11,omitempty"` + Attribute11expr string `json:"attribute11expr,omitempty"` + Attribute11format string `json:"attribute11format,omitempty"` + Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute12 string `json:"attribute12,omitempty"` + Attribute12expr string `json:"attribute12expr,omitempty"` + Attribute12format string `json:"attribute12format,omitempty"` + Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute13 string `json:"attribute13,omitempty"` + Attribute13expr string `json:"attribute13expr,omitempty"` + Attribute13format string `json:"attribute13format,omitempty"` + Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute14 string `json:"attribute14,omitempty"` + Attribute14expr string `json:"attribute14expr,omitempty"` + Attribute14format string `json:"attribute14format,omitempty"` + Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute15 string `json:"attribute15,omitempty"` + Attribute15expr string `json:"attribute15expr,omitempty"` + Attribute15format string `json:"attribute15format,omitempty"` + Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute16 string `json:"attribute16,omitempty"` + Attribute16expr string `json:"attribute16expr,omitempty"` + Attribute16format string `json:"attribute16format,omitempty"` + Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` + Attribute1expr string `json:"attribute1expr,omitempty"` + Attribute1format string `json:"attribute1format,omitempty"` + Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute2 string `json:"attribute2,omitempty"` + Attribute2expr string `json:"attribute2expr,omitempty"` + Attribute2format string `json:"attribute2format,omitempty"` + Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute3 string `json:"attribute3,omitempty"` + Attribute3expr string `json:"attribute3expr,omitempty"` + Attribute3format string `json:"attribute3format,omitempty"` + Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute4 string `json:"attribute4,omitempty"` + Attribute4expr string `json:"attribute4expr,omitempty"` + Attribute4format string `json:"attribute4format,omitempty"` + Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute5 string `json:"attribute5,omitempty"` + Attribute5expr string `json:"attribute5expr,omitempty"` + Attribute5format string `json:"attribute5format,omitempty"` + Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute6 string `json:"attribute6,omitempty"` + Attribute6expr string `json:"attribute6expr,omitempty"` + Attribute6format string `json:"attribute6format,omitempty"` + Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute7 string `json:"attribute7,omitempty"` + Attribute7expr string `json:"attribute7expr,omitempty"` + Attribute7format string `json:"attribute7format,omitempty"` + Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute8 string `json:"attribute8,omitempty"` + Attribute8expr string `json:"attribute8expr,omitempty"` + Attribute8format string `json:"attribute8format,omitempty"` + Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute9 string `json:"attribute9,omitempty"` + Attribute9expr string `json:"attribute9expr,omitempty"` + Attribute9format string `json:"attribute9format,omitempty"` + Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Audience string `json:"audience,omitempty"` + Count float64 `json:"__count,omitempty"` + Digestmethod string `json:"digestmethod,omitempty"` + Encryptassertion string `json:"encryptassertion,omitempty"` + Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + Name string `json:"name,omitempty"` + Nameidexpr string `json:"nameidexpr,omitempty"` + Nameidformat string `json:"nameidformat,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Relaystaterule string `json:"relaystaterule,omitempty"` + Samlissuername string `json:"samlissuername,omitempty"` + Samlsigningcertname string `json:"samlsigningcertname,omitempty"` + Samlspcertname string `json:"samlspcertname,omitempty"` + Sendpassword string `json:"sendpassword,omitempty"` + Signassertion string `json:"signassertion,omitempty"` + Signaturealg string `json:"signaturealg,omitempty"` + Signatureservice string `json:"signatureservice,omitempty"` + Skewtime int `json:"skewtime,omitempty"` +} + +type VpnvserverAuditnslogpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnurlpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnglobalVpnsessionpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnvserver struct { - Name string `json:"name,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Range int `json:"range,omitempty"` - Port int `json:"port,omitempty"` - Ipset string `json:"ipset,omitempty"` - State string `json:"state,omitempty"` - Authentication string `json:"authentication,omitempty"` - Doublehop string `json:"doublehop,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Icaonly string `json:"icaonly,omitempty"` - Icaproxysessionmigration string `json:"icaproxysessionmigration,omitempty"` - Dtls string `json:"dtls,omitempty"` - Loginonce string `json:"loginonce,omitempty"` - Advancedepa string `json:"advancedepa,omitempty"` - Devicecert string `json:"devicecert,omitempty"` - Certkeynames string `json:"certkeynames,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Comment string `json:"comment,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Rhistate string `json:"rhistate,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Cginfrahomepageredirect string `json:"cginfrahomepageredirect,omitempty"` - Secureprivateaccess string `json:"secureprivateaccess,omitempty"` - Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Deploymenttype string `json:"deploymenttype,omitempty"` - Rdpserverprofilename string `json:"rdpserverprofilename,omitempty"` - Windowsepapluginupgrade string `json:"windowsepapluginupgrade,omitempty"` - Linuxepapluginupgrade string `json:"linuxepapluginupgrade,omitempty"` - Macepapluginupgrade string `json:"macepapluginupgrade,omitempty"` - Logoutonsmartcardremoval string `json:"logoutonsmartcardremoval,omitempty"` - Userdomains string `json:"userdomains,omitempty"` - Authnprofile string `json:"authnprofile,omitempty"` - Vserverfqdn string `json:"vserverfqdn,omitempty"` - Pcoipvserverprofilename string `json:"pcoipvserverprofilename,omitempty"` - Samesite string `json:"samesite,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Newname string `json:"newname,omitempty"` - Ip string `json:"ip,omitempty"` - Value string `json:"value,omitempty"` - Type string `json:"type,omitempty"` - Curstate string `json:"curstate,omitempty"` - Status string `json:"status,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Redirect string `json:"redirect,omitempty"` - Precedence string `json:"precedence,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Curaaausers string `json:"curaaausers,omitempty"` - Curtotalusers string `json:"curtotalusers,omitempty"` - Domain string `json:"domain,omitempty"` - Rule string `json:"rule,omitempty"` - Servicename string `json:"servicename,omitempty"` - Weight string `json:"weight,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Clttimeout string `json:"clttimeout,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sothreshold string `json:"sothreshold,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout string `json:"sopersistencetimeout,omitempty"` - Usemip string `json:"usemip,omitempty"` - Map string `json:"map,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Secondary string `json:"secondary,omitempty"` - Groupextraction string `json:"groupextraction,omitempty"` - Epaprofileoptional string `json:"epaprofileoptional,omitempty"` - Ngname string `json:"ngname,omitempty"` - Csvserver string `json:"csvserver,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Response string `json:"response,omitempty"` -} - -type Vpnvserverauthenticationdfapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Vpnpcoipvserverprofile struct { + Count float64 `json:"__count,omitempty"` + Logindomain string `json:"logindomain,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Udpport int `json:"udpport,omitempty"` } -type Vpnclientlessaccesspolicyvserverbinding struct { +type VpnsessionpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnglobalintranetipbinding struct { - Intranetip string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnvserverIntranetip6Binding struct { + Acttype int `json:"acttype,omitempty"` + Intranetip6 string `json:"intranetip6,omitempty"` + Name string `json:"name,omitempty"` + Numaddr int `json:"numaddr,omitempty"` } -type Vpnvserverauditsyslogpolicybinding struct { +type VpnvserverFeopolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvservervpnportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnclientlessaccessprofile struct { - Profilename string `json:"profilename,omitempty"` - Urlrewritepolicylabel string `json:"urlrewritepolicylabel,omitempty"` - Javascriptrewritepolicylabel string `json:"javascriptrewritepolicylabel,omitempty"` - Reqhdrrewritepolicylabel string `json:"reqhdrrewritepolicylabel,omitempty"` - Reshdrrewritepolicylabel string `json:"reshdrrewritepolicylabel,omitempty"` - Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` - Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` - Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` - Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` - Regexforfindingcustomurls string `json:"regexforfindingcustomurls,omitempty"` - Clientconsumedcookies string `json:"clientconsumedcookies,omitempty"` - Requirepersistentcookie string `json:"requirepersistentcookie,omitempty"` - Cssrewritepolicylabel string `json:"cssrewritepolicylabel,omitempty"` - Xmlrewritepolicylabel string `json:"xmlrewritepolicylabel,omitempty"` - Xcomponentrewritepolicylabel string `json:"xcomponentrewritepolicylabel,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Description string `json:"description,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpngloballdappolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnvserverauthenticationwebauthpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverbinding struct { - Name string `json:"name,omitempty"` -} - -type Vpnvserverloginschemapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnglobalvpnportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnalwaysonprofile struct { - Name string `json:"name,omitempty"` - Networkaccessonvpnfailure string `json:"networkaccessonvpnfailure,omitempty"` - Clientcontrol string `json:"clientcontrol,omitempty"` - Locationbasedvpn string `json:"locationbasedvpn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnglobalclientlessaccesspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnglobalvpnsessionpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnurlaction struct { - Name string `json:"name,omitempty"` - Linkname string `json:"linkname,omitempty"` - Actualurl string `json:"actualurl,omitempty"` - Vservername string `json:"vservername,omitempty"` - Clientlessaccess string `json:"clientlessaccess,omitempty"` - Comment string `json:"comment,omitempty"` - Iconurl string `json:"iconurl,omitempty"` - Ssotype string `json:"ssotype,omitempty"` - Applicationtype string `json:"applicationtype,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnvserverrewritepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnglobalAuditsyslogpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnglobalauthenticationlocalpolicybinding struct { Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobalbinding struct { -} - -type Vpnintranetapplication struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Protocol string `json:"protocol,omitempty"` - Destip string `json:"destip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Iprange string `json:"iprange,omitempty"` - Hostname string `json:"hostname,omitempty"` - Clientapplication []string `json:"clientapplication,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Destport string `json:"destport,omitempty"` - Interception string `json:"interception,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnparameter struct { - Httpport []int `json:"httpport,omitempty"` - Winsip string `json:"winsip,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Splitdns string `json:"splitdns,omitempty"` - Icauseraccounting string `json:"icauseraccounting,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Clientsecurity string `json:"clientsecurity,omitempty"` - Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` - Clientsecuritylog string `json:"clientsecuritylog,omitempty"` - Smartgroup string `json:"smartgroup,omitempty"` - Splittunnel string `json:"splittunnel,omitempty"` - Locallanaccess string `json:"locallanaccess,omitempty"` - Rfc1918 string `json:"rfc1918,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Killconnections string `json:"killconnections,omitempty"` - Transparentinterception string `json:"transparentinterception,omitempty"` - Windowsclienttype string `json:"windowsclienttype,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Authorizationgroup string `json:"authorizationgroup,omitempty"` - Clientidletimeout int `json:"clientidletimeout,omitempty"` - Proxy string `json:"proxy,omitempty"` - Allprotocolproxy string `json:"allprotocolproxy,omitempty"` - Httpproxy string `json:"httpproxy,omitempty"` - Ftpproxy string `json:"ftpproxy,omitempty"` - Socksproxy string `json:"socksproxy,omitempty"` - Gopherproxy string `json:"gopherproxy,omitempty"` - Sslproxy string `json:"sslproxy,omitempty"` - Proxyexception string `json:"proxyexception,omitempty"` - Proxylocalbypass string `json:"proxylocalbypass,omitempty"` - Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` - Forcecleanup []string `json:"forcecleanup,omitempty"` - Clientoptions []string `json:"clientoptions,omitempty"` - Clientconfiguration []string `json:"clientconfiguration,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Windowsautologon string `json:"windowsautologon,omitempty"` - Usemip string `json:"usemip,omitempty"` - Useiip string `json:"useiip,omitempty"` - Clientdebug string `json:"clientdebug,omitempty"` - Loginscript string `json:"loginscript,omitempty"` - Logoutscript string `json:"logoutscript,omitempty"` - Homepage string `json:"homepage,omitempty"` - Icaproxy string `json:"icaproxy,omitempty"` - Wihome string `json:"wihome,omitempty"` - Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` - Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` - Wiportalmode string `json:"wiportalmode,omitempty"` - Clientchoices string `json:"clientchoices,omitempty"` - Epaclienttype string `json:"epaclienttype,omitempty"` - Iipdnssuffix string `json:"iipdnssuffix,omitempty"` - Forcedtimeout int `json:"forcedtimeout,omitempty"` - Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` - Ntdomain string `json:"ntdomain,omitempty"` - Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` - Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` - Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` - Emailhome string `json:"emailhome,omitempty"` - Allowedlogingroups string `json:"allowedlogingroups,omitempty"` - Encryptcsecexp string `json:"encryptcsecexp,omitempty"` - Apptokentimeout int `json:"apptokentimeout,omitempty"` - Mdxtokentimeout int `json:"mdxtokentimeout,omitempty"` - Uitheme string `json:"uitheme,omitempty"` - Securebrowse string `json:"securebrowse,omitempty"` - Storefronturl string `json:"storefronturl,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Clientversions string `json:"clientversions,omitempty"` - Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` - Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` - Macpluginupgrade string `json:"macpluginupgrade,omitempty"` - Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` - Iconwithreceiver string `json:"iconwithreceiver,omitempty"` - Userdomains string `json:"userdomains,omitempty"` - Icasessiontimeout string `json:"icasessiontimeout,omitempty"` - Httptrackconnproxy string `json:"httptrackconnproxy,omitempty"` - Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` - Autoproxyurl string `json:"autoproxyurl,omitempty"` - Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` - Pcoipprofilename string `json:"pcoipprofilename,omitempty"` - Backendserversni string `json:"backendserversni,omitempty"` - Backendcertvalidation string `json:"backendcertvalidation,omitempty"` - Secureprivateaccess string `json:"secureprivateaccess,omitempty"` - Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` - Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Samesite string `json:"samesite,omitempty"` - Maxiipperuser int `json:"maxiipperuser,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Backenddtls12 string `json:"backenddtls12,omitempty"` - Name string `json:"name,omitempty"` - Clientidletimeoutwarning string `json:"clientidletimeoutwarning,omitempty"` - Vpnsessionpolicybindtype string `json:"vpnsessionpolicybindtype,omitempty"` - Vpnsessionpolicycount string `json:"vpnsessionpolicycount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnvserverauthenticationnegotiatepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverauthenticationradiuspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverclientlessaccesspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnvservernslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnclientlessaccesspolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnformssoaction struct { - Name string `json:"name,omitempty"` - Actionurl string `json:"actionurl,omitempty"` - Userfield string `json:"userfield,omitempty"` - Passwdfield string `json:"passwdfield,omitempty"` - Ssosuccessrule string `json:"ssosuccessrule,omitempty"` - Namevaluepair string `json:"namevaluepair,omitempty"` - Responsesize int `json:"responsesize,omitempty"` - Nvtype string `json:"nvtype,omitempty"` - Submitmethod string `json:"submitmethod,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnnexthopserver struct { - Name string `json:"name,omitempty"` - Nexthopip string `json:"nexthopip,omitempty"` - Nexthopfqdn string `json:"nexthopfqdn,omitempty"` - Resaddresstype string `json:"resaddresstype,omitempty"` - Nexthopport int `json:"nexthopport,omitempty"` - Secure string `json:"secure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpntrafficpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpntrafficpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnurlpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserverappflowpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnvservericapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnglobalsslcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` - Cacert string `json:"cacert,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobalsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnvserverlocalpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvservervpneulabinding struct { - Eula string `json:"eula,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnpcoipvserverprofile struct { - Name string `json:"name,omitempty"` - Logindomain string `json:"logindomain,omitempty"` - Udpport int `json:"udpport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnvservernexthopserverbinding struct { - Nexthopserver string `json:"nexthopserver,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserverstaserverbinding struct { - Staserver string `json:"staserver,omitempty"` - Staauthid string `json:"staauthid,omitempty"` - Stastate string `json:"stastate,omitempty"` - Acttype int `json:"acttype,omitempty"` - Staaddresstype string `json:"staaddresstype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserversyslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverintranetip6binding struct { - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvservernegotiatepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverurlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvserverwebauthpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnsessionpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpntrafficpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpntrafficpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserverauditnslogpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverVpnsessionpolicyBinding struct { Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvservercachepolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnvserversharefileserverbinding struct { - Sharefile string `json:"sharefile,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnurlpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Comment string `json:"comment,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Builtin string `json:"builtin,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnurlpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Vpnvserverappcontrollerbinding struct { - Appcontroller string `json:"appcontroller,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnglobalcertkeybinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` - Cacert string `json:"cacert,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobalvpntrafficpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpntrafficaction struct { - Name string `json:"name,omitempty"` - Qual string `json:"qual,omitempty"` - Apptimeout int `json:"apptimeout,omitempty"` - Sso string `json:"sso,omitempty"` - Hdx string `json:"hdx,omitempty"` - Formssoaction string `json:"formssoaction,omitempty"` - Fta string `json:"fta,omitempty"` - Wanscaler string `json:"wanscaler,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Proxy string `json:"proxy,omitempty"` - Userexpression string `json:"userexpression,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpntrafficpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvserverintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnicaconnection struct { - Username string `json:"username,omitempty"` - Transproto string `json:"transproto,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - All bool `json:"all,omitempty"` - Domain string `json:"domain,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport string `json:"srcport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnvserverauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` } -type Vpnvservertrafficpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` +type VpnvserverVpnurlBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Urlname string `json:"urlname,omitempty"` +} + +type VpnvserverVpnurlpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnglobalauthenticationradiuspolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type VpnvserverAuthenticationwebauthpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpntrafficpolicyuserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpnclientlessaccesspolicy struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Isdefault bool `json:"isdefault,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Profilename string `json:"profilename,omitempty"` + Rule string `json:"rule,omitempty"` + Undefaction string `json:"undefaction,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Vpnvserverauthenticationloginschemapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverAaapreauthenticationpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvserverportalthemebinding struct { - Portaltheme string `json:"portaltheme,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type VpntrafficpolicyBinding struct { + Name string `json:"name,omitempty"` + VpntrafficpolicyAaagroupBinding []interface{} `json:"vpntrafficpolicy_aaagroup_binding,omitempty"` + VpntrafficpolicyAaauserBinding []interface{} `json:"vpntrafficpolicy_aaauser_binding,omitempty"` + VpntrafficpolicyVpnglobalBinding []interface{} `json:"vpntrafficpolicy_vpnglobal_binding,omitempty"` + VpntrafficpolicyVpnvserverBinding []interface{} `json:"vpntrafficpolicy_vpnvserver_binding,omitempty"` } -type Vpnglobalcertpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnvserverAuthenticationsamlidppolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnvserverauthenticationlocalpolicybinding struct { + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnglobalvpnintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type Vpnnexthopserver struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nexthopfqdn string `json:"nexthopfqdn,omitempty"` + Nexthopip string `json:"nexthopip,omitempty"` + Nexthopport int `json:"nexthopport,omitempty"` + Resaddresstype string `json:"resaddresstype,omitempty"` + Secure string `json:"secure,omitempty"` } -type Vpnclientlessaccesspolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Profilename string `json:"profilename,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Hits string `json:"hits,omitempty"` - Undefhits string `json:"undefhits,omitempty"` - Description string `json:"description,omitempty"` - Isdefault string `json:"isdefault,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnclientlessaccesspolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpnurlpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Logaction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` + Undefhits int `json:"undefhits,omitempty"` } -type Vpnurlpolicygroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnglobalVpnurlpolicyBinding struct { + Builtin []string `json:"builtin,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnurlpolicyuserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpnsessionpolicy struct { + Action string `json:"action,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Vpnvserverepaprofilebinding struct { - Epaprofile string `json:"epaprofile,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` +type Vpnurl struct { + Actualurl string `json:"actualurl,omitempty"` + Appjson string `json:"appjson,omitempty"` + Applicationtype string `json:"applicationtype,omitempty"` + Clientlessaccess string `json:"clientlessaccess,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Iconurl string `json:"iconurl,omitempty"` + Linkname string `json:"linkname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Ssotype string `json:"ssotype,omitempty"` + Urlname string `json:"urlname,omitempty"` + Vservername string `json:"vservername,omitempty"` } -type Vpnvservertacacspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalAuthenticationpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnicadtlsconnection struct { - Username string `json:"username,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Domain string `json:"domain,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport string `json:"srcport,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` - Channelnumber string `json:"channelnumber,omitempty"` - Peid string `json:"peid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnvserveraaapreauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverAuthenticationtacacspolicyBinding struct { Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvserverdfapolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalVpnnexthopserverBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Nexthopserver string `json:"nexthopserver,omitempty"` } -type Vpnvserverpreauthenticationpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` +type VpnvserverIcapolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvservervpnclientlessaccesspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverAuthenticationcertpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Acttype int `json:"acttype,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` } -type Vpnvservervpntrafficpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverAuthenticationsamlpolicyBinding struct { Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnclientlessaccesspolicyglobalbinding struct { +type VpnurlpolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type VpntrafficpolicyAaagroupBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy int32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnglobaldomainbinding struct { - Intranetdomain string `json:"intranetdomain,omitempty"` +type VpnvserverCachepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnglobalvpnnexthopserverbinding struct { - Nexthopserver string `json:"nexthopserver,omitempty"` +type VpnglobalVpnportalthemeBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Portaltheme string `json:"portaltheme,omitempty"` } -type Vpnsessionaction struct { - Name string `json:"name,omitempty"` - Useraccounting string `json:"useraccounting,omitempty"` - Httpport []int `json:"httpport,omitempty"` - Winsip string `json:"winsip,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Splitdns string `json:"splitdns,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Clientsecurity string `json:"clientsecurity,omitempty"` - Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` - Clientsecuritylog string `json:"clientsecuritylog,omitempty"` - Splittunnel string `json:"splittunnel,omitempty"` - Locallanaccess string `json:"locallanaccess,omitempty"` - Rfc1918 string `json:"rfc1918,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Killconnections string `json:"killconnections,omitempty"` - Transparentinterception string `json:"transparentinterception,omitempty"` - Windowsclienttype string `json:"windowsclienttype,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Authorizationgroup string `json:"authorizationgroup,omitempty"` - Smartgroup string `json:"smartgroup,omitempty"` - Clientidletimeout int `json:"clientidletimeout,omitempty"` - Proxy string `json:"proxy,omitempty"` - Allprotocolproxy string `json:"allprotocolproxy,omitempty"` - Httpproxy string `json:"httpproxy,omitempty"` - Ftpproxy string `json:"ftpproxy,omitempty"` - Socksproxy string `json:"socksproxy,omitempty"` - Gopherproxy string `json:"gopherproxy,omitempty"` - Sslproxy string `json:"sslproxy,omitempty"` - Proxyexception string `json:"proxyexception,omitempty"` - Proxylocalbypass string `json:"proxylocalbypass,omitempty"` - Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` - Forcecleanup []string `json:"forcecleanup,omitempty"` - Clientoptions string `json:"clientoptions,omitempty"` - Clientconfiguration []string `json:"clientconfiguration,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Windowsautologon string `json:"windowsautologon,omitempty"` - Usemip string `json:"usemip,omitempty"` - Useiip string `json:"useiip,omitempty"` - Clientdebug string `json:"clientdebug,omitempty"` - Loginscript string `json:"loginscript,omitempty"` - Logoutscript string `json:"logoutscript,omitempty"` - Homepage string `json:"homepage,omitempty"` - Icaproxy string `json:"icaproxy,omitempty"` - Wihome string `json:"wihome,omitempty"` - Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` - Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` - Wiportalmode string `json:"wiportalmode,omitempty"` - Clientchoices string `json:"clientchoices,omitempty"` - Epaclienttype string `json:"epaclienttype,omitempty"` - Iipdnssuffix string `json:"iipdnssuffix,omitempty"` - Forcedtimeout int `json:"forcedtimeout,omitempty"` - Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` - Ntdomain string `json:"ntdomain,omitempty"` - Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` - Emailhome string `json:"emailhome,omitempty"` - Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` - Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` - Allowedlogingroups string `json:"allowedlogingroups,omitempty"` - Securebrowse string `json:"securebrowse,omitempty"` - Storefronturl string `json:"storefronturl,omitempty"` - Sfgatewayauthtype string `json:"sfgatewayauthtype,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` - Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` - Macpluginupgrade string `json:"macpluginupgrade,omitempty"` - Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` - Iconwithreceiver string `json:"iconwithreceiver,omitempty"` - Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` - Autoproxyurl string `json:"autoproxyurl,omitempty"` - Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` - Pcoipprofilename string `json:"pcoipprofilename,omitempty"` - Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Clientidletimeoutwarning string `json:"clientidletimeoutwarning,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnsessionpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnvserverSharefileserverBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Sharefile string `json:"sharefile,omitempty"` } -type Vpnsessionpolicyuserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnglobalAuthenticationsamlpolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnurlpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpntrafficpolicy struct { + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Expressiontype string `json:"expressiontype,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Rule string `json:"rule,omitempty"` } -type Vpnvserverauthenticationtacacspolicybinding struct { +type VpnvserverAuthenticationloginschemapolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnglobalauthenticationnegotiatepolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type VpnvserverVpntrafficpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpnglobalauthenticationsamlpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnsessionpolicyAaauserBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnglobalradiuspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnvserverVpnintranetapplicationBinding struct { + Acttype int `json:"acttype,omitempty"` + Intranetapplication string `json:"intranetapplication,omitempty"` + Name string `json:"name,omitempty"` } -type Vpnvservervpnsessionpolicybinding struct { +type VpnvserverAppflowpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnglobalauthenticationcertpolicybinding struct { +type VpnglobalAuthenticationradiuspolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +} + +type VpnclientlessaccesspolicyVpnglobalBinding struct { + Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type VpnglobalAuthenticationlocalpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Policyname string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnsfconfig struct { - Vserver []string `json:"vserver,omitempty"` - Filename string `json:"filename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnglobalVpnurlBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Urlname string `json:"urlname,omitempty"` } -type Vpnurlpolicyaaagroupbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnsessionpolicyAaagroupBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type VpnvserverBinding struct { + Name string `json:"name,omitempty"` + VpnvserverAaapreauthenticationpolicyBinding []interface{} `json:"vpnvserver_aaapreauthenticationpolicy_binding,omitempty"` + VpnvserverAnalyticsprofileBinding []interface{} `json:"vpnvserver_analyticsprofile_binding,omitempty"` + VpnvserverAppcontrollerBinding []interface{} `json:"vpnvserver_appcontroller_binding,omitempty"` + VpnvserverAppflowpolicyBinding []interface{} `json:"vpnvserver_appflowpolicy_binding,omitempty"` + VpnvserverAppfwpolicyBinding []interface{} `json:"vpnvserver_appfwpolicy_binding,omitempty"` + VpnvserverAuditnslogpolicyBinding []interface{} `json:"vpnvserver_auditnslogpolicy_binding,omitempty"` + VpnvserverAuditsyslogpolicyBinding []interface{} `json:"vpnvserver_auditsyslogpolicy_binding,omitempty"` + VpnvserverAuthenticationcertpolicyBinding []interface{} `json:"vpnvserver_authenticationcertpolicy_binding,omitempty"` + VpnvserverAuthenticationdfapolicyBinding []interface{} `json:"vpnvserver_authenticationdfapolicy_binding,omitempty"` + VpnvserverAuthenticationldappolicyBinding []interface{} `json:"vpnvserver_authenticationldappolicy_binding,omitempty"` + VpnvserverAuthenticationlocalpolicyBinding []interface{} `json:"vpnvserver_authenticationlocalpolicy_binding,omitempty"` + VpnvserverAuthenticationloginschemapolicyBinding []interface{} `json:"vpnvserver_authenticationloginschemapolicy_binding,omitempty"` + VpnvserverAuthenticationnegotiatepolicyBinding []interface{} `json:"vpnvserver_authenticationnegotiatepolicy_binding,omitempty"` + VpnvserverAuthenticationoauthidppolicyBinding []interface{} `json:"vpnvserver_authenticationoauthidppolicy_binding,omitempty"` + VpnvserverAuthenticationpolicyBinding []interface{} `json:"vpnvserver_authenticationpolicy_binding,omitempty"` + VpnvserverAuthenticationradiuspolicyBinding []interface{} `json:"vpnvserver_authenticationradiuspolicy_binding,omitempty"` + VpnvserverAuthenticationsamlidppolicyBinding []interface{} `json:"vpnvserver_authenticationsamlidppolicy_binding,omitempty"` + VpnvserverAuthenticationsamlpolicyBinding []interface{} `json:"vpnvserver_authenticationsamlpolicy_binding,omitempty"` + VpnvserverAuthenticationtacacspolicyBinding []interface{} `json:"vpnvserver_authenticationtacacspolicy_binding,omitempty"` + VpnvserverAuthenticationwebauthpolicyBinding []interface{} `json:"vpnvserver_authenticationwebauthpolicy_binding,omitempty"` + VpnvserverCachepolicyBinding []interface{} `json:"vpnvserver_cachepolicy_binding,omitempty"` + VpnvserverCspolicyBinding []interface{} `json:"vpnvserver_cspolicy_binding,omitempty"` + VpnvserverFeopolicyBinding []interface{} `json:"vpnvserver_feopolicy_binding,omitempty"` + VpnvserverIcapolicyBinding []interface{} `json:"vpnvserver_icapolicy_binding,omitempty"` + VpnvserverIntranetip6Binding []interface{} `json:"vpnvserver_intranetip6_binding,omitempty"` + VpnvserverIntranetipBinding []interface{} `json:"vpnvserver_intranetip_binding,omitempty"` + VpnvserverResponderpolicyBinding []interface{} `json:"vpnvserver_responderpolicy_binding,omitempty"` + VpnvserverRewritepolicyBinding []interface{} `json:"vpnvserver_rewritepolicy_binding,omitempty"` + VpnvserverSecureprivateaccessurlBinding []interface{} `json:"vpnvserver_secureprivateaccessurl_binding,omitempty"` + VpnvserverSharefileserverBinding []interface{} `json:"vpnvserver_sharefileserver_binding,omitempty"` + VpnvserverStaserverBinding []interface{} `json:"vpnvserver_staserver_binding,omitempty"` + VpnvserverVpnclientlessaccesspolicyBinding []interface{} `json:"vpnvserver_vpnclientlessaccesspolicy_binding,omitempty"` + VpnvserverVpnepaprofileBinding []interface{} `json:"vpnvserver_vpnepaprofile_binding,omitempty"` + VpnvserverVpneulaBinding []interface{} `json:"vpnvserver_vpneula_binding,omitempty"` + VpnvserverVpnintranetapplicationBinding []interface{} `json:"vpnvserver_vpnintranetapplication_binding,omitempty"` + VpnvserverVpnnexthopserverBinding []interface{} `json:"vpnvserver_vpnnexthopserver_binding,omitempty"` + VpnvserverVpnportalthemeBinding []interface{} `json:"vpnvserver_vpnportaltheme_binding,omitempty"` + VpnvserverVpnsecureprivateaccessprofileBinding []interface{} `json:"vpnvserver_vpnsecureprivateaccessprofile_binding,omitempty"` + VpnvserverVpnsessionpolicyBinding []interface{} `json:"vpnvserver_vpnsessionpolicy_binding,omitempty"` + VpnvserverVpntrafficpolicyBinding []interface{} `json:"vpnvserver_vpntrafficpolicy_binding,omitempty"` + VpnvserverVpnurlBinding []interface{} `json:"vpnvserver_vpnurl_binding,omitempty"` + VpnvserverVpnurlpolicyBinding []interface{} `json:"vpnvserver_vpnurlpolicy_binding,omitempty"` +} + +type Vpnsessionaction struct { + Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` + Allowedlogingroups string `json:"allowedlogingroups,omitempty"` + Allprotocolproxy string `json:"allprotocolproxy,omitempty"` + Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` + Authorizationgroup string `json:"authorizationgroup,omitempty"` + Autoproxyurl string `json:"autoproxyurl,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` + Clientchoices string `json:"clientchoices,omitempty"` + Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` + Clientconfiguration []string `json:"clientconfiguration,omitempty"` + Clientdebug string `json:"clientdebug,omitempty"` + Clientidletimeout int `json:"clientidletimeout,omitempty"` + Clientidletimeoutwarning int `json:"clientidletimeoutwarning,omitempty"` + Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` + Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` + Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` + Clientoptions string `json:"clientoptions,omitempty"` + Clientsecurity string `json:"clientsecurity,omitempty"` + Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` + Clientsecuritylog string `json:"clientsecuritylog,omitempty"` + Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + Count float64 `json:"__count,omitempty"` + Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + Dnsvservername string `json:"dnsvservername,omitempty"` + Emailhome string `json:"emailhome,omitempty"` + Epaclienttype string `json:"epaclienttype,omitempty"` + Feature string `json:"feature,omitempty"` + Forcecleanup []string `json:"forcecleanup,omitempty"` + Forcedtimeout int `json:"forcedtimeout,omitempty"` + Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` + Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` + Ftpproxy string `json:"ftpproxy,omitempty"` + Gopherproxy string `json:"gopherproxy,omitempty"` + Homepage string `json:"homepage,omitempty"` + Httpport []interface{} `json:"httpport,omitempty"` + Httpproxy string `json:"httpproxy,omitempty"` + Icaproxy string `json:"icaproxy,omitempty"` + Iconwithreceiver string `json:"iconwithreceiver,omitempty"` + Iipdnssuffix string `json:"iipdnssuffix,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Killconnections string `json:"killconnections,omitempty"` + Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` + Locallanaccess string `json:"locallanaccess,omitempty"` + Loginscript string `json:"loginscript,omitempty"` + Logoutscript string `json:"logoutscript,omitempty"` + Macpluginupgrade string `json:"macpluginupgrade,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ntdomain string `json:"ntdomain,omitempty"` + Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + Proxy string `json:"proxy,omitempty"` + Proxyexception string `json:"proxyexception,omitempty"` + Proxylocalbypass string `json:"proxylocalbypass,omitempty"` + Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` + Rfc1918 string `json:"rfc1918,omitempty"` + Securebrowse string `json:"securebrowse,omitempty"` + Sesstimeout int `json:"sesstimeout,omitempty"` + Sfgatewayauthtype string `json:"sfgatewayauthtype,omitempty"` + Smartgroup string `json:"smartgroup,omitempty"` + Socksproxy string `json:"socksproxy,omitempty"` + Splitdns string `json:"splitdns,omitempty"` + Splittunnel string `json:"splittunnel,omitempty"` + Spoofiip string `json:"spoofiip,omitempty"` + Sslproxy string `json:"sslproxy,omitempty"` + Sso string `json:"sso,omitempty"` + Ssocredential string `json:"ssocredential,omitempty"` + Storefronturl string `json:"storefronturl,omitempty"` + Transparentinterception string `json:"transparentinterception,omitempty"` + Useiip string `json:"useiip,omitempty"` + Usemip string `json:"usemip,omitempty"` + Useraccounting string `json:"useraccounting,omitempty"` + Wihome string `json:"wihome,omitempty"` + Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` + Windowsautologon string `json:"windowsautologon,omitempty"` + Windowsclienttype string `json:"windowsclienttype,omitempty"` + Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` + Winsip string `json:"winsip,omitempty"` + Wiportalmode string `json:"wiportalmode,omitempty"` +} + +type VpnvserverAuthenticationldappolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` +} + +type Vpntrafficaction struct { + Apptimeout int `json:"apptimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + Formssoaction string `json:"formssoaction,omitempty"` + Fta string `json:"fta,omitempty"` + Hdx string `json:"hdx,omitempty"` + Kcdaccount string `json:"kcdaccount,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Passwdexpression string `json:"passwdexpression,omitempty"` + Proxy string `json:"proxy,omitempty"` + Qual string `json:"qual,omitempty"` + Samlssoprofile string `json:"samlssoprofile,omitempty"` + Sso string `json:"sso,omitempty"` + Userexpression string `json:"userexpression,omitempty"` + Wanscaler string `json:"wanscaler,omitempty"` +} + +type VpnvserverVpnsecureprivateaccessprofileBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` +} + +type VpnvserverVpnepaprofileBinding struct { + Acttype int `json:"acttype,omitempty"` + Epaprofile string `json:"epaprofile,omitempty"` + Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` + Name string `json:"name,omitempty"` } -type Vpnvserversecureprivateaccessurlbinding struct { - Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` +type Vpnformssoaction struct { + Actionurl string `json:"actionurl,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Namevaluepair string `json:"namevaluepair,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nvtype string `json:"nvtype,omitempty"` + Passwdfield string `json:"passwdfield,omitempty"` + Responsesize int `json:"responsesize,omitempty"` + Ssosuccessrule string `json:"ssosuccessrule,omitempty"` + Submitmethod string `json:"submitmethod,omitempty"` + Userfield string `json:"userfield,omitempty"` +} + +type VpnvserverAuthenticationradiuspolicyBinding struct { Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnpcoipprofile struct { - Name string `json:"name,omitempty"` - Conserverurl string `json:"conserverurl,omitempty"` - Icvverification string `json:"icvverification,omitempty"` - Sessionidletimeout int `json:"sessionidletimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnsamlssoprofile struct { - Name string `json:"name,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Audience string `json:"audience,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Attribute1 string `json:"attribute1,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnvserverAuthenticationlocalpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnurl struct { - Urlname string `json:"urlname,omitempty"` - Linkname string `json:"linkname,omitempty"` - Actualurl string `json:"actualurl,omitempty"` - Vservername string `json:"vservername,omitempty"` - Clientlessaccess string `json:"clientlessaccess,omitempty"` - Comment string `json:"comment,omitempty"` - Iconurl string `json:"iconurl,omitempty"` - Ssotype string `json:"ssotype,omitempty"` - Applicationtype string `json:"applicationtype,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Appjson string `json:"appjson,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Vpnsessionpolicyvpnvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type VpntrafficpolicyVpnglobalBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpntrafficpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type VpnurlpolicyBinding struct { + Name string `json:"name,omitempty"` + VpnurlpolicyAaagroupBinding []interface{} `json:"vpnurlpolicy_aaagroup_binding,omitempty"` + VpnurlpolicyAaauserBinding []interface{} `json:"vpnurlpolicy_aaauser_binding,omitempty"` + VpnurlpolicyVpnglobalBinding []interface{} `json:"vpnurlpolicy_vpnglobal_binding,omitempty"` + VpnurlpolicyVpnvserverBinding []interface{} `json:"vpnurlpolicy_vpnvserver_binding,omitempty"` } -type Vpnvserverfeopolicybinding struct { - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnvserverResponderpolicyBinding struct { Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` } -type Vpnvserversessionpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` +type VpnvserverSecureprivateaccessurlBinding struct { + Acttype int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` } -type Vpnvserverurlbinding struct { - Urlname string `json:"urlname,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` +type VpnvserverAuthenticationpolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnglobalappcontrollerbinding struct { +type VpnglobalBinding struct { + VpnglobalAppcontrollerBinding []interface{} `json:"vpnglobal_appcontroller_binding,omitempty"` + VpnglobalAppfwpolicyBinding []interface{} `json:"vpnglobal_appfwpolicy_binding,omitempty"` + VpnglobalAuditnslogpolicyBinding []interface{} `json:"vpnglobal_auditnslogpolicy_binding,omitempty"` + VpnglobalAuditsyslogpolicyBinding []interface{} `json:"vpnglobal_auditsyslogpolicy_binding,omitempty"` + VpnglobalAuthenticationcertpolicyBinding []interface{} `json:"vpnglobal_authenticationcertpolicy_binding,omitempty"` + VpnglobalAuthenticationldappolicyBinding []interface{} `json:"vpnglobal_authenticationldappolicy_binding,omitempty"` + VpnglobalAuthenticationlocalpolicyBinding []interface{} `json:"vpnglobal_authenticationlocalpolicy_binding,omitempty"` + VpnglobalAuthenticationnegotiatepolicyBinding []interface{} `json:"vpnglobal_authenticationnegotiatepolicy_binding,omitempty"` + VpnglobalAuthenticationpolicyBinding []interface{} `json:"vpnglobal_authenticationpolicy_binding,omitempty"` + VpnglobalAuthenticationradiuspolicyBinding []interface{} `json:"vpnglobal_authenticationradiuspolicy_binding,omitempty"` + VpnglobalAuthenticationsamlpolicyBinding []interface{} `json:"vpnglobal_authenticationsamlpolicy_binding,omitempty"` + VpnglobalAuthenticationtacacspolicyBinding []interface{} `json:"vpnglobal_authenticationtacacspolicy_binding,omitempty"` + VpnglobalGslbdomainBinding []interface{} `json:"vpnglobal_gslbdomain_binding,omitempty"` + VpnglobalIntranetip6Binding []interface{} `json:"vpnglobal_intranetip6_binding,omitempty"` + VpnglobalIntranetipBinding []interface{} `json:"vpnglobal_intranetip_binding,omitempty"` + VpnglobalSecureprivateaccessurlBinding []interface{} `json:"vpnglobal_secureprivateaccessurl_binding,omitempty"` + VpnglobalSharefileserverBinding []interface{} `json:"vpnglobal_sharefileserver_binding,omitempty"` + VpnglobalSslcertkeyBinding []interface{} `json:"vpnglobal_sslcertkey_binding,omitempty"` + VpnglobalStaserverBinding []interface{} `json:"vpnglobal_staserver_binding,omitempty"` + VpnglobalVpnclientlessaccesspolicyBinding []interface{} `json:"vpnglobal_vpnclientlessaccesspolicy_binding,omitempty"` + VpnglobalVpneulaBinding []interface{} `json:"vpnglobal_vpneula_binding,omitempty"` + VpnglobalVpnintranetapplicationBinding []interface{} `json:"vpnglobal_vpnintranetapplication_binding,omitempty"` + VpnglobalVpnnexthopserverBinding []interface{} `json:"vpnglobal_vpnnexthopserver_binding,omitempty"` + VpnglobalVpnportalthemeBinding []interface{} `json:"vpnglobal_vpnportaltheme_binding,omitempty"` + VpnglobalVpnsecureprivateaccessprofileBinding []interface{} `json:"vpnglobal_vpnsecureprivateaccessprofile_binding,omitempty"` + VpnglobalVpnsessionpolicyBinding []interface{} `json:"vpnglobal_vpnsessionpolicy_binding,omitempty"` + VpnglobalVpntrafficpolicyBinding []interface{} `json:"vpnglobal_vpntrafficpolicy_binding,omitempty"` + VpnglobalVpnurlBinding []interface{} `json:"vpnglobal_vpnurl_binding,omitempty"` + VpnglobalVpnurlpolicyBinding []interface{} `json:"vpnglobal_vpnurlpolicy_binding,omitempty"` +} + +type VpnglobalAppcontrollerBinding struct { Appcontroller string `json:"appcontroller,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpnglobalsecureprivateaccessurlbinding struct { - Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` +type VpnvserverAuthenticationdfapolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } -type Vpnglobalvpnurlpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type Vpnpcoipprofile struct { + Conserverurl string `json:"conserverurl,omitempty"` + Count float64 `json:"__count,omitempty"` + Icvverification string `json:"icvverification,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Sessionidletimeout int `json:"sessionidletimeout,omitempty"` } -type Vpnsessionpolicy struct { - Name string `json:"name,omitempty"` - Rule string `json:"rule,omitempty"` - Action string `json:"action,omitempty"` - Builtin string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` - Hits string `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnglobalSharefileserverBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Sharefile string `json:"sharefile,omitempty"` } -type Vpnsessionpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` +type VpntrafficpolicyAaauserBinding struct { Activepolicy int `json:"activepolicy,omitempty"` + Boundto string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } -type Vpnvserveroauthidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type Vpnalwaysonprofile struct { + Clientcontrol string `json:"clientcontrol,omitempty"` + Count float64 `json:"__count,omitempty"` + Locationbasedvpn string `json:"locationbasedvpn,omitempty"` + Name string `json:"name,omitempty"` + Networkaccessonvpnfailure string `json:"networkaccessonvpnfailure,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vpnvserverradiuspolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` +type VpnvserverVpnnexthopserverBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Nexthopserver string `json:"nexthopserver,omitempty"` } -type Vpnvserversamlpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalAppfwpolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnglobalauditnslogpolicybinding struct { + Groupextraction bool `json:"groupextraction,omitempty"` Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpnglobalintranetapplicationbinding struct { - Intranetapplication string `json:"intranetapplication,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnvserverStaserverBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Staaddresstype string `json:"staaddresstype,omitempty"` + Staauthid string `json:"staauthid,omitempty"` + Staserver string `json:"staserver,omitempty"` + Stastate string `json:"stastate,omitempty"` } -type Vpnglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalVpnintranetapplicationBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Intranetapplication string `json:"intranetapplication,omitempty"` } -type Vpnglobalurlbinding struct { - Urlname string `json:"urlname,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VpnvserverIntranetipBinding struct { + Acttype int `json:"acttype,omitempty"` + Intranetip string `json:"intranetip,omitempty"` + MapField string `json:"map,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` } -type Vpnstoreinfo struct { - Url string `json:"url,omitempty"` - Storeserverstatus string `json:"storeserverstatus,omitempty"` - Storeserverissf string `json:"storeserverissf,omitempty"` - Storeapisupport string `json:"storeapisupport,omitempty"` - Storelist string `json:"storelist,omitempty"` - Storestatus string `json:"storestatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnclientlessaccesspolicyBinding struct { + Name string `json:"name,omitempty"` + VpnclientlessaccesspolicyVpnglobalBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnglobal_binding,omitempty"` + VpnclientlessaccesspolicyVpnvserverBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnvserver_binding,omitempty"` } -type Vpnvserverresponderpolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnglobalAuthenticationnegotiatepolicyBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` -} - -type Vpnvservervpnurlpolicybinding struct { - Policy string `json:"policy,omitempty"` + Policyname string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Acttype int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnepaprofile struct { - Name string `json:"name,omitempty"` - Filename string `json:"filename,omitempty"` - Data string `json:"data,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vpnglobalnegotiatepolicybinding struct { +type VpnglobalAuthenticationtacacspolicyBinding struct { + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` + Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } -type Vpnglobalnexthopserverbinding struct { - Nexthopserver string `json:"nexthopserver,omitempty"` +type VpnglobalIntranetip6Binding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Intranetip6 string `json:"intranetip6,omitempty"` + Numaddr int `json:"numaddr,omitempty"` } -type Vpnglobaltacacspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority uint32 `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type Vpnvserver struct { + Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` + Advancedepa string `json:"advancedepa,omitempty"` + Appflowlog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + Authnprofile string `json:"authnprofile,omitempty"` + Backupvserver string `json:"backupvserver,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Cachetype string `json:"cachetype,omitempty"` + Cachevserver string `json:"cachevserver,omitempty"` + Certkeynames string `json:"certkeynames,omitempty"` + Cginfrahomepageredirect string `json:"cginfrahomepageredirect,omitempty"` + Clttimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Csvserver string `json:"csvserver,omitempty"` + Curaaausers int `json:"curaaausers,omitempty"` + Curstate string `json:"curstate,omitempty"` + Curtotalusers int `json:"curtotalusers,omitempty"` + Deploymenttype string `json:"deploymenttype,omitempty"` + Devicecert string `json:"devicecert,omitempty"` + Deviceposture string `json:"deviceposture,omitempty"` + Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + Domain string `json:"domain,omitempty"` + Doublehop string `json:"doublehop,omitempty"` + Downstateflush string `json:"downstateflush,omitempty"` + Dtls string `json:"dtls,omitempty"` + Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` + Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Httpprofilename string `json:"httpprofilename,omitempty"` + Icaonly string `json:"icaonly,omitempty"` + Icaproxysessionmigration string `json:"icaproxysessionmigration,omitempty"` + Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + Ip string `json:"ip,omitempty"` + Ipset string `json:"ipset,omitempty"` + Ipv46 string `json:"ipv46,omitempty"` + L2conn string `json:"l2conn,omitempty"` + Linuxepapluginupgrade string `json:"linuxepapluginupgrade,omitempty"` + Listenpolicy string `json:"listenpolicy,omitempty"` + Listenpriority int `json:"listenpriority,omitempty"` + Loginonce string `json:"loginonce,omitempty"` + Logoutonsmartcardremoval string `json:"logoutonsmartcardremoval,omitempty"` + Macepapluginupgrade string `json:"macepapluginupgrade,omitempty"` + MapField string `json:"map,omitempty"` + Maxaaausers int `json:"maxaaausers,omitempty"` + Maxloginattempts int `json:"maxloginattempts,omitempty"` + Name string `json:"name,omitempty"` + Netprofile string `json:"netprofile,omitempty"` + Newname string `json:"newname,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Ngname string `json:"ngname,omitempty"` + Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + Pcoipvserverprofilename string `json:"pcoipvserverprofilename,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + Quicprofilename string `json:"quicprofilename,omitempty"` + Range int `json:"range,omitempty"` + Rdpserverprofilename string `json:"rdpserverprofilename,omitempty"` + Redirect string `json:"redirect,omitempty"` + Redirecturl string `json:"redirecturl,omitempty"` + Response string `json:"response,omitempty"` + Rhistate string `json:"rhistate,omitempty"` + Rule string `json:"rule,omitempty"` + Samesite string `json:"samesite,omitempty"` + Secondary bool `json:"secondary,omitempty"` + Secureprivateaccess string `json:"secureprivateaccess,omitempty"` + Servicename string `json:"servicename,omitempty"` + Servicetype string `json:"servicetype,omitempty"` + Somethod string `json:"somethod,omitempty"` + Sopersistence string `json:"sopersistence,omitempty"` + Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` + Sothreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + Status int `json:"status,omitempty"` + Tcpprofilename string `json:"tcpprofilename,omitempty"` + TypeField string `json:"type,omitempty"` + Usemip string `json:"usemip,omitempty"` + Userdomains string `json:"userdomains,omitempty"` + Value string `json:"value,omitempty"` + Vserverfqdn string `json:"vserverfqdn,omitempty"` + Weight int `json:"weight,omitempty"` + Windowsepapluginupgrade string `json:"windowsepapluginupgrade,omitempty"` +} + +type VpnglobalSslcertkeyBinding struct { + Cacert string `json:"cacert,omitempty"` + Certkeyname string `json:"certkeyname,omitempty"` + Crlcheck string `json:"crlcheck,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Ocspcheck string `json:"ocspcheck,omitempty"` + Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` } -type Vpnglobalvpneulabinding struct { - Eula string `json:"eula,omitempty"` +type VpnvserverAppfwpolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnsessionpolicyaaauserbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnvservercspolicybinding struct { + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvservereulabinding struct { - Eula string `json:"eula,omitempty"` - Acttype uint32 `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` -} - -type Vpnglobalsharefileserverbinding struct { - Sharefile string `json:"sharefile,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnglobalvpnclientlessaccesspolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Type string `json:"type,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` } -type Vpnglobalvpnurlbinding struct { - Urlname string `json:"urlname,omitempty"` +type Vpnicaconnection struct { + All bool `json:"all,omitempty"` + Count float64 `json:"__count,omitempty"` + Destip string `json:"destip,omitempty"` + Destport int `json:"destport,omitempty"` + Domain string `json:"domain,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Nodeid int `json:"nodeid,omitempty"` + Peid int `json:"peid,omitempty"` + Productname string `json:"productname,omitempty"` + Srcip string `json:"srcip,omitempty"` + Srcport int `json:"srcport,omitempty"` + Tenantname string `json:"tenantname,omitempty"` + Transproto string `json:"transproto,omitempty"` + Username string `json:"username,omitempty"` +} + +type VpnvserverRewritepolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpntrafficpolicybinding struct { - Name string `json:"name,omitempty"` -} - -type Vpnvserverauthenticationldappolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverauthenticationoauthidppolicybinding struct { Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` } -type Vpnvserverauthenticationsamlidppolicybinding struct { - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` +type VpnvserverAuthenticationoauthidppolicyBinding struct { + Bindpoint string `json:"bindpoint,omitempty"` Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - Secondary bool `json:"secondary,omitempty"` Groupextraction bool `json:"groupextraction,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` -} - -type Vpnvserverauthenticationsamlpolicybinding struct { + Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` - Acttype int `json:"acttype,omitempty"` Secondary bool `json:"secondary,omitempty"` - Name string `json:"name,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +} + +type VpnglobalStaserverBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + Staaddresstype string `json:"staaddresstype,omitempty"` + Staauthid string `json:"staauthid,omitempty"` + Staserver string `json:"staserver,omitempty"` + Stastate string `json:"stastate,omitempty"` } -type Vpnurlpolicyvpnglobalbinding struct { - Boundto string `json:"boundto,omitempty"` - Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` - Name string `json:"name,omitempty"` +type Vpnsecureprivateaccessprofile struct { + Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` + Chromeenterprisepremiummode string `json:"chromeenterprisepremiummode,omitempty"` + Clouddeployment string `json:"clouddeployment,omitempty"` + Count float64 `json:"__count,omitempty"` + Customerid string `json:"customerid,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Url string `json:"url,omitempty"` } -type Vpnvserveranalyticsprofilebinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` +type Vpnepaprofile struct { + Count float64 `json:"__count,omitempty"` + Data string `json:"data,omitempty"` + Filename string `json:"filename,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` } -type Vpneula struct { - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type VpnvserverVpnportalthemeBinding struct { + Acttype int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + Portaltheme string `json:"portaltheme,omitempty"` } -type Vpnglobalauditsyslogpolicybinding struct { - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VpnglobalDomainBinding struct { Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Intranetdomain string `json:"intranetdomain,omitempty"` } -type Vpnglobalauthenticationldappolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type VpnvserverVpnclientlessaccesspolicyBinding struct { + Acttype int `json:"acttype,omitempty"` + Bindpoint string `json:"bindpoint,omitempty"` + Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + Groupextraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` } diff --git a/nitrogo/models/wasm.go b/nitrogo/models/wasm.go new file mode 100644 index 0000000..c7e1f2a --- /dev/null +++ b/nitrogo/models/wasm.go @@ -0,0 +1,10 @@ +package models + +// wasm configuration structs +type Wasmmodule struct { + Count float64 `json:"__count,omitempty"` + Modulefile string `json:"modulefile,omitempty"` + Name string `json:"name,omitempty"` + Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + Signaturefile string `json:"signaturefile,omitempty"` +} From d51fb962629a9d15ce0ca15f93ac711c9674a1df Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sun, 15 Feb 2026 14:42:18 -0600 Subject: [PATCH 06/10] remove old license. --- LICENSES/Apache License 2.0 | 176 ------------------------------------ README.md | 2 - 2 files changed, 178 deletions(-) delete mode 100644 LICENSES/Apache License 2.0 diff --git a/LICENSES/Apache License 2.0 b/LICENSES/Apache License 2.0 deleted file mode 100644 index d9a10c0..0000000 --- a/LICENSES/Apache License 2.0 +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 6b53f00..7e061b3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ Citrix NetScaler ADC Go client Still in development - -Struct defintions largely come from the official Citrix [adc-nitro-go](https://github.com/netscaler/adc-nitro-go) package with modifactions such that API responses can actually be unmarshalled into them. \ No newline at end of file From fd7fc649ce2c6fe1eff0a21ee83a1c7f3f41fb60 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sun, 15 Feb 2026 14:58:41 -0600 Subject: [PATCH 07/10] casing changes. --- nitrogo/models/aaa.go | 598 +++++++++++++++++++++--------------------- 1 file changed, 299 insertions(+), 299 deletions(-) diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go index 8c11baf..c1ba997 100644 --- a/nitrogo/models/aaa.go +++ b/nitrogo/models/aaa.go @@ -1,498 +1,498 @@ package models // aaa configuration structs -type AaagroupVpnurlpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupVPNURLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaagroupVpnsessionpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupVPNSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaagroupVpnurlBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` - Urlname string `json:"urlname,omitempty"` +type AAAGroupVPNURLBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + URLName string `json:"urlname,omitempty"` } -type Aaakcdaccount struct { - Cacert string `json:"cacert,omitempty"` +type AAAKCDAccount struct { + CACert string `json:"cacert,omitempty"` Count float64 `json:"__count,omitempty"` - Delegateduser string `json:"delegateduser,omitempty"` - Enterpriserealm string `json:"enterpriserealm,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Kcdpassword string `json:"kcdpassword,omitempty"` - Kcdspn string `json:"kcdspn,omitempty"` - Keytab string `json:"keytab,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + DelegatedUser string `json:"delegateduser,omitempty"` + EnterpriseRealm string `json:"enterpriserealm,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KCDPassword string `json:"kcdpassword,omitempty"` + KCDSPN string `json:"kcdspn,omitempty"` + KeyTab string `json:"keytab,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Principle string `json:"principle,omitempty"` - Realmstr string `json:"realmstr,omitempty"` - Saltexpression string `json:"saltexpression,omitempty"` - Servicespn string `json:"servicespn,omitempty"` - Usercert string `json:"usercert,omitempty"` - Userrealm string `json:"userrealm,omitempty"` + RealmStr string `json:"realmstr,omitempty"` + SaltExpression string `json:"saltexpression,omitempty"` + ServiceSPN string `json:"servicespn,omitempty"` + UserCert string `json:"usercert,omitempty"` + UserRealm string `json:"userrealm,omitempty"` } -type AaagroupAuditnslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupAuditNSLogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaaglobalBinding struct { - AaaglobalAaapreauthenticationpolicyBinding []interface{} `json:"aaaglobal_aaapreauthenticationpolicy_binding,omitempty"` - AaaglobalAuthenticationnegotiateactionBinding []interface{} `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` +type AAAGlobalBinding struct { + AAAGlobalAAAPreAuthenticationPolicyBinding []interface{} `json:"aaaglobal_aaapreauthenticationpolicy_binding,omitempty"` + AAAGlobalAuthenticationNegotiateActionBinding []interface{} `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` } -type AaagroupVpnintranetapplicationBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` - Intranetapplication string `json:"intranetapplication,omitempty"` +type AAAGroupVPNIntranetApplicationBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` } -type AaauserVpntrafficpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserVPNTrafficPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AaauserAuditsyslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserAuditSyslogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type Aaassoprofile struct { +type AAASSOProfile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` } -type Aaapreauthenticationparameter struct { +type AAAPreAuthenticationParameter struct { Builtin []string `json:"builtin,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` + DeleteFiles string `json:"deletefiles,omitempty"` Feature string `json:"feature,omitempty"` - Killprocess string `json:"killprocess,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preauthenticationaction string `json:"preauthenticationaction,omitempty"` + KillProcess string `json:"killprocess,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AaauserAuthorizationpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserAuthorizationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AaauserIntranetipBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetip string `json:"intranetip,omitempty"` +type AAAUserIntranetIPBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` Netmask string `json:"netmask,omitempty"` Username string `json:"username,omitempty"` } -type AaagroupIntranetipBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` - Intranetip string `json:"intranetip,omitempty"` +type AAAGroupIntranetIPBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` Netmask string `json:"netmask,omitempty"` } -type AaagroupVpntrafficpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupVPNTrafficPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaagroupVpnsecureprivateaccessprofileBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` - Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` +type AAAGroupVPNSecurePrivateAccessProfileBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` } -type AaagroupAuditsyslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupAuditSyslogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaauserVpnurlpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserVPNURLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AaauserVpnurlBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Urlname string `json:"urlname,omitempty"` +type AAAUserVPNURLBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + URLName string `json:"urlname,omitempty"` Username string `json:"username,omitempty"` } -type AaagroupIntranetip6Binding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` +type AAAGroupIntranetIP6Binding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } -type AaagroupAaauserBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupAAAUserBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Username string `json:"username,omitempty"` } -type AaapreauthenticationpolicyBinding struct { - AaapreauthenticationpolicyAaaglobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` - AaapreauthenticationpolicyVpnvserverBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` +type AAAPreAuthenticationPolicyBinding struct { + AAAPreAuthenticationPolicyAAAGlobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` + AAAPreAuthenticationPolicyVPNVServerBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Aaacertparams struct { - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Twofactor string `json:"twofactor,omitempty"` - Usernamefield string `json:"usernamefield,omitempty"` +type AAACertParams struct { + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + GroupNameField string `json:"groupnamefield,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TwoFactor string `json:"twofactor,omitempty"` + UserNameField string `json:"usernamefield,omitempty"` } -type AaauserVpnsessionpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserVPNSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type Aaaotpparameter struct { +type AAAOTPParameter struct { Encryption string `json:"encryption,omitempty"` - Maxotpdevices int `json:"maxotpdevices,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + MaxOTPDevices int `json:"maxotpdevices,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Aaaradiusparams struct { +type AAARADIUSParams struct { Accounting string `json:"accounting,omitempty"` Authentication string `json:"authentication,omitempty"` - Authservretry int `json:"authservretry,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` + AuthServRetry int `json:"authservretry,omitempty"` + AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` - Callingstationid string `json:"callingstationid,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + CallingStationID string `json:"callingstationid,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` - Groupauthname string `json:"groupauthname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Ipattributetype int `json:"ipattributetype,omitempty"` - Ipvendorid int `json:"ipvendorid,omitempty"` - Messageauthenticator string `json:"messageauthenticator,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passencoding string `json:"passencoding,omitempty"` - Pwdattributetype int `json:"pwdattributetype,omitempty"` - Pwdvendorid int `json:"pwdvendorid,omitempty"` - Radattributetype int `json:"radattributetype,omitempty"` - Radgroupseparator string `json:"radgroupseparator,omitempty"` - Radgroupsprefix string `json:"radgroupsprefix,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radnasip string `json:"radnasip,omitempty"` - Radvendorid int `json:"radvendorid,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` -} - -type AaapreauthenticationpolicyAaaglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + GroupAuthName string `json:"groupauthname,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPAttributeType int `json:"ipattributetype,omitempty"` + IPVendorID int `json:"ipvendorid,omitempty"` + MessageAuthenticator string `json:"messageauthenticator,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PassEncoding string `json:"passencoding,omitempty"` + PwdAttributeType int `json:"pwdattributetype,omitempty"` + PwdVendorID int `json:"pwdvendorid,omitempty"` + RadAttributeType int `json:"radattributetype,omitempty"` + RadGroupSeparator string `json:"radgroupseparator,omitempty"` + RadGroupsPrefix string `json:"radgroupsprefix,omitempty"` + RadKey string `json:"radkey,omitempty"` + RadNASID string `json:"radnasid,omitempty"` + RadNASIP string `json:"radnasip,omitempty"` + RadVendorID int `json:"radvendorid,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + TunnelEndpointClientIP string `json:"tunnelendpointclientip,omitempty"` +} + +type AAAPreAuthenticationPolicyAAAGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AaaglobalAuthenticationnegotiateactionBinding struct { - Windowsprofile string `json:"windowsprofile,omitempty"` +type AAAGlobalAuthenticationNegotiateActionBinding struct { + WindowsProfile string `json:"windowsprofile,omitempty"` } -type AaaglobalAaapreauthenticationpolicyBinding struct { - Bindpolicytype int `json:"bindpolicytype,omitempty"` +type AAAGlobalAAAPreAuthenticationPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` Builtin []string `json:"builtin,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` } -type AaagroupAuthorizationpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupAuthorizationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AaauserVpnintranetapplicationBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetapplication string `json:"intranetapplication,omitempty"` +type AAAUserVPNIntranetApplicationBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` Username string `json:"username,omitempty"` } -type Aaaparameter struct { - Aaadloglevel string `json:"aaadloglevel,omitempty"` - Aaadnatip string `json:"aaadnatip,omitempty"` - Aaasessionloglevel string `json:"aaasessionloglevel,omitempty"` - Apitokencache string `json:"apitokencache,omitempty"` +type AAAParameter struct { + AAADLogLevel string `json:"aaadloglevel,omitempty"` + AAADNATIP string `json:"aaadnatip,omitempty"` + AAASessionLogLevel string `json:"aaasessionloglevel,omitempty"` + APITokenCache string `json:"apitokencache,omitempty"` Builtin []string `json:"builtin,omitempty"` - Classicendpoints string `json:"classicendpoints,omitempty"` - Defaultauthtype string `json:"defaultauthtype,omitempty"` - Defaultcspheader string `json:"defaultcspheader,omitempty"` - Dynaddr string `json:"dynaddr,omitempty"` - Enableenhancedauthfeedback string `json:"enableenhancedauthfeedback,omitempty"` - Enablesessionstickiness string `json:"enablesessionstickiness,omitempty"` - Enablestaticpagecaching string `json:"enablestaticpagecaching,omitempty"` - Enhancedepa string `json:"enhancedepa,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` + ClassicEndpoints string `json:"classicendpoints,omitempty"` + DefaultAuthType string `json:"defaultauthtype,omitempty"` + DefaultCSPHeader string `json:"defaultcspheader,omitempty"` + DynAddr string `json:"dynaddr,omitempty"` + EnableEnhancedAuthFeedback string `json:"enableenhancedauthfeedback,omitempty"` + EnableSessionStickiness string `json:"enablesessionstickiness,omitempty"` + EnableStaticPageCaching string `json:"enablestaticpagecaching,omitempty"` + EnhancedEPA string `json:"enhancedepa,omitempty"` + FailedLoginTimeout int `json:"failedlogintimeout,omitempty"` Feature string `json:"feature,omitempty"` - Ftmode string `json:"ftmode,omitempty"` - Httponlycookie string `json:"httponlycookie,omitempty"` - Loginencryption string `json:"loginencryption,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Maxkbquestions int `json:"maxkbquestions,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` - Maxsamldeflatesize int `json:"maxsamldeflatesize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Persistentloginattempts string `json:"persistentloginattempts,omitempty"` - Pwdexpirynotificationdays int `json:"pwdexpirynotificationdays,omitempty"` - Samesite string `json:"samesite,omitempty"` - Securityinsights string `json:"securityinsights,omitempty"` - Tokenintrospectioninterval int `json:"tokenintrospectioninterval,omitempty"` - Wafprotection []string `json:"wafprotection,omitempty"` - Webviewendpoints string `json:"webviewendpoints,omitempty"` -} - -type AaauserVpnsecureprivateaccessprofileBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` + FTMode string `json:"ftmode,omitempty"` + HTTPOnlyCookie string `json:"httponlycookie,omitempty"` + LoginEncryption string `json:"loginencryption,omitempty"` + MaxAAAUsers int `json:"maxaaausers,omitempty"` + MaxKBQuestions int `json:"maxkbquestions,omitempty"` + MaxLoginAttempts int `json:"maxloginattempts,omitempty"` + MaxSAMLDeflateSize int `json:"maxsamldeflatesize,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PersistentLoginAttempts string `json:"persistentloginattempts,omitempty"` + PwdExpiryNotificationDays int `json:"pwdexpirynotificationdays,omitempty"` + SameSite string `json:"samesite,omitempty"` + SecurityInsights string `json:"securityinsights,omitempty"` + TokenIntrospectionInterval int `json:"tokenintrospectioninterval,omitempty"` + WAFProtection []string `json:"wafprotection,omitempty"` + WebViewEndpoints string `json:"webviewendpoints,omitempty"` +} + +type AAAUserVPNSecurePrivateAccessProfileBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` Username string `json:"username,omitempty"` } -type AaauserAuditnslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserAuditNSLogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AaauserBinding struct { - AaauserAaagroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` - AaauserAuditnslogpolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` - AaauserAuditsyslogpolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` - AaauserAuthorizationpolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` - AaauserIntranetip6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` - AaauserIntranetipBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` - AaauserTmsessionpolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` - AaauserVpnintranetapplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` - AaauserVpnsecureprivateaccessprofileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` - AaauserVpnsessionpolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` - AaauserVpntrafficpolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` - AaauserVpnurlBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` - AaauserVpnurlpolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` +type AAAUserBinding struct { + AAAUserAAAGroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` + AAAUserAuditNSLogPolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` + AAAUserAuditSyslogPolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` + AAAUserAuthorizationPolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` + AAAUserIntranetIP6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` + AAAUserIntranetIPBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` + AAAUserTMSessionPolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` + AAAUserVPNIntranetApplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` + AAAUserVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAUserVPNSessionPolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` + AAAUserVPNTrafficPolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` + AAAUserVPNURLBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` + AAAUserVPNURLPolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` Username string `json:"username,omitempty"` } -type AaagroupTmsessionpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAGroupTMSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Aaapreauthenticationpolicy struct { +type AAAPreAuthenticationPolicy struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type Aaatacacsparams struct { +type AAATACACSParams struct { Accounting string `json:"accounting,omitempty"` - Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + AuditFailedCmds string `json:"auditfailedcmds,omitempty"` Authorization string `json:"authorization,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` + AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Tacacssecret string `json:"tacacssecret,omitempty"` + GroupAttrName string `json:"groupattrname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + TACACSSecret string `json:"tacacssecret,omitempty"` } -type Aaagroup struct { +type AAAGroup struct { Count float64 `json:"__count,omitempty"` - Groupname string `json:"groupname,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + GroupName string `json:"groupname,omitempty"` + LoggedIn bool `json:"loggedin,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Weight int `json:"weight,omitempty"` } -type AaauserTmsessionpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AAAUserTMSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AaagroupBinding struct { - AaagroupAaauserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` - AaagroupAuditnslogpolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` - AaagroupAuditsyslogpolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` - AaagroupAuthorizationpolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` - AaagroupIntranetip6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` - AaagroupIntranetipBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` - AaagroupTmsessionpolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` - AaagroupVpnintranetapplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` - AaagroupVpnsecureprivateaccessprofileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` - AaagroupVpnsessionpolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` - AaagroupVpntrafficpolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` - AaagroupVpnurlBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` - AaagroupVpnurlpolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` - Groupname string `json:"groupname,omitempty"` -} - -type Aaasession struct { +type AAAGroupBinding struct { + AAAGroupAAAUserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` + AAAGroupAuditNSLogPolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` + AAAGroupAuditSyslogPolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` + AAAGroupAuthorizationPolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` + AAAGroupIntranetIP6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` + AAAGroupIntranetIPBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` + AAAGroupTMSessionPolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` + AAAGroupVPNIntranetApplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` + AAAGroupVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAGroupVPNSessionPolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` + AAAGroupVPNTrafficPolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` + AAAGroupVPNURLBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` + AAAGroupVPNURLPolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` + GroupName string `json:"groupname,omitempty"` +} + +type AAASession struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Groupname string `json:"groupname,omitempty"` - Iip string `json:"iip,omitempty"` - Intranetip string `json:"intranetip,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + GroupName string `json:"groupname,omitempty"` + IIP string `json:"iip,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Peid int `json:"peid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PEID int `json:"peid,omitempty"` Port int `json:"port,omitempty"` - Privateip string `json:"privateip,omitempty"` - Privateport int `json:"privateport,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Sessionkey string `json:"sessionkey,omitempty"` + PrivateIP string `json:"privateip,omitempty"` + PrivatePort int `json:"privateport,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + SessionKey string `json:"sessionkey,omitempty"` Username string `json:"username,omitempty"` } -type Aaapreauthenticationaction struct { +type AAAPreAuthenticationAction struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultepagroup string `json:"defaultepagroup,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` + DefaultEPAGroup string `json:"defaultepagroup,omitempty"` + DeleteFiles string `json:"deletefiles,omitempty"` Feature string `json:"feature,omitempty"` - Killprocess string `json:"killprocess,omitempty"` + KillProcess string `json:"killprocess,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preauthenticationaction string `json:"preauthenticationaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` } -type AaauserAaagroupBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupname string `json:"groupname,omitempty"` +type AAAUserAAAGroupBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Username string `json:"username,omitempty"` } -type Aaaldapparams struct { - Authtimeout int `json:"authtimeout,omitempty"` +type AAALDAPParams struct { + AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Groupauthname string `json:"groupauthname,omitempty"` - Groupnameidentifier string `json:"groupnameidentifier,omitempty"` - Groupsearchattribute string `json:"groupsearchattribute,omitempty"` - Groupsearchfilter string `json:"groupsearchfilter,omitempty"` - Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` - Ldapbase string `json:"ldapbase,omitempty"` - Ldapbinddn string `json:"ldapbinddn,omitempty"` - Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` - Ldaploginname string `json:"ldaploginname,omitempty"` - Maxnestinglevel int `json:"maxnestinglevel,omitempty"` - Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passwdchange string `json:"passwdchange,omitempty"` - Searchfilter string `json:"searchfilter,omitempty"` - Sectype string `json:"sectype,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Ssonameattribute string `json:"ssonameattribute,omitempty"` - Subattributename string `json:"subattributename,omitempty"` - Svrtype string `json:"svrtype,omitempty"` -} - -type Aaauser struct { + GroupAttrName string `json:"groupattrname,omitempty"` + GroupAuthName string `json:"groupauthname,omitempty"` + GroupNameIdentifier string `json:"groupnameidentifier,omitempty"` + GroupSearchAttribute string `json:"groupsearchattribute,omitempty"` + GroupSearchFilter string `json:"groupsearchfilter,omitempty"` + GroupSearchSubAttribute string `json:"groupsearchsubattribute,omitempty"` + LDAPBase string `json:"ldapbase,omitempty"` + LDAPBindDN string `json:"ldapbinddn,omitempty"` + LDAPBindDNPassword string `json:"ldapbinddnpassword,omitempty"` + LDAPLoginName string `json:"ldaploginname,omitempty"` + MaxNestingLevel int `json:"maxnestinglevel,omitempty"` + NestedGroupExtraction string `json:"nestedgroupextraction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PasswdChange string `json:"passwdchange,omitempty"` + SearchFilter string `json:"searchfilter,omitempty"` + SecType string `json:"sectype,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSONameAttribute string `json:"ssonameattribute,omitempty"` + SubAttributeName string `json:"subattributename,omitempty"` + SvrType string `json:"svrtype,omitempty"` +} + +type AAAUser struct { Count float64 `json:"__count,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + LoggedIn bool `json:"loggedin,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` } -type AaauserIntranetip6Binding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` +type AAAUserIntranetIP6Binding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` Username string `json:"username,omitempty"` } -type AaapreauthenticationpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AAAPreAuthenticationPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } From ced1aa1820fa3bb5053d18bed46fb432118ae542 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sun, 15 Feb 2026 15:04:48 -0600 Subject: [PATCH 08/10] Sort structs. --- nitrogo/models/aaa.go | 568 +++++++++++++++++++++--------------------- 1 file changed, 284 insertions(+), 284 deletions(-) diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go index c1ba997..d675865 100644 --- a/nitrogo/models/aaa.go +++ b/nitrogo/models/aaa.go @@ -1,56 +1,23 @@ package models // aaa configuration structs -type AAAGroupVPNURLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AAAGroupVPNSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AAAGroupVPNURLBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - URLName string `json:"urlname,omitempty"` +type AAACertParams struct { + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + GroupNameField string `json:"groupnamefield,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TwoFactor string `json:"twofactor,omitempty"` + UserNameField string `json:"usernamefield,omitempty"` } -type AAAKCDAccount struct { - CACert string `json:"cacert,omitempty"` - Count float64 `json:"__count,omitempty"` - DelegatedUser string `json:"delegateduser,omitempty"` - EnterpriseRealm string `json:"enterpriserealm,omitempty"` - KCDAccount string `json:"kcdaccount,omitempty"` - KCDPassword string `json:"kcdpassword,omitempty"` - KCDSPN string `json:"kcdspn,omitempty"` - KeyTab string `json:"keytab,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Principle string `json:"principle,omitempty"` - RealmStr string `json:"realmstr,omitempty"` - SaltExpression string `json:"saltexpression,omitempty"` - ServiceSPN string `json:"servicespn,omitempty"` - UserCert string `json:"usercert,omitempty"` - UserRealm string `json:"userrealm,omitempty"` +type AAAGlobalAAAPreAuthenticationPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` } -type AAAGroupAuditNSLogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` +type AAAGlobalAuthenticationNegotiateActionBinding struct { + WindowsProfile string `json:"windowsprofile,omitempty"` } type AAAGlobalBinding struct { @@ -58,63 +25,69 @@ type AAAGlobalBinding struct { AAAGlobalAuthenticationNegotiateActionBinding []interface{} `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` } -type AAAGroupVPNIntranetApplicationBinding struct { - ActType int `json:"acttype,omitempty"` +type AAAGroup struct { + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + LoggedIn bool `json:"loggedin,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Weight int `json:"weight,omitempty"` +} + +type AAAGroupAAAUserBinding struct { GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` GroupName string `json:"groupname,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` + Username string `json:"username,omitempty"` } -type AAAUserVPNTrafficPolicyBinding struct { +type AAAGroupAuditNSLogPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` } -type AAAUserAuditSyslogPolicyBinding struct { +type AAAGroupAuditSyslogPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAASSOProfile struct { - Count float64 `json:"__count,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Password string `json:"password,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAPreAuthenticationParameter struct { - Builtin []string `json:"builtin,omitempty"` - DeleteFiles string `json:"deletefiles,omitempty"` - Feature string `json:"feature,omitempty"` - KillProcess string `json:"killprocess,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` - Rule string `json:"rule,omitempty"` } -type AAAUserAuthorizationPolicyBinding struct { +type AAAGroupAuthorizationPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` } -type AAAUserIntranetIPBinding struct { +type AAAGroupBinding struct { + AAAGroupAAAUserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` + AAAGroupAuditNSLogPolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` + AAAGroupAuditSyslogPolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` + AAAGroupAuthorizationPolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` + AAAGroupIntranetIP6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` + AAAGroupIntranetIPBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` + AAAGroupTMSessionPolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` + AAAGroupVPNIntranetApplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` + AAAGroupVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAGroupVPNSessionPolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` + AAAGroupVPNTrafficPolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` + AAAGroupVPNURLBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` + AAAGroupVPNURLPolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` + GroupName string `json:"groupname,omitempty"` +} + +type AAAGroupIntranetIP6Binding struct { GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetIP string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Username string `json:"username,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } type AAAGroupIntranetIPBinding struct { @@ -124,7 +97,7 @@ type AAAGroupIntranetIPBinding struct { Netmask string `json:"netmask,omitempty"` } -type AAAGroupVPNTrafficPolicyBinding struct { +type AAAGroupTMSessionPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` GroupName string `json:"groupname,omitempty"` @@ -133,6 +106,13 @@ type AAAGroupVPNTrafficPolicyBinding struct { TypeField string `json:"type,omitempty"` } +type AAAGroupVPNIntranetApplicationBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` +} + type AAAGroupVPNSecurePrivateAccessProfileBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` @@ -140,7 +120,7 @@ type AAAGroupVPNSecurePrivateAccessProfileBinding struct { SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` } -type AAAGroupAuditSyslogPolicyBinding struct { +type AAAGroupVPNSessionPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` GroupName string `json:"groupname,omitempty"` @@ -149,126 +129,81 @@ type AAAGroupAuditSyslogPolicyBinding struct { TypeField string `json:"type,omitempty"` } -type AAAUserVPNURLPolicyBinding struct { +type AAAGroupVPNTrafficPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` } -type AAAUserVPNURLBinding struct { +type AAAGroupVPNURLBinding struct { ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - URLName string `json:"urlname,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAGroupIntranetIP6Binding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - IntranetIP6 string `json:"intranetip6,omitempty"` - NumAddr int `json:"numaddr,omitempty"` -} - -type AAAGroupAAAUserBinding struct { GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` GroupName string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAPreAuthenticationPolicyBinding struct { - AAAPreAuthenticationPolicyAAAGlobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` - AAAPreAuthenticationPolicyVPNVServerBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` -} - -type AAACertParams struct { - DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` - GroupNameField string `json:"groupnamefield,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - TwoFactor string `json:"twofactor,omitempty"` - UserNameField string `json:"usernamefield,omitempty"` + URLName string `json:"urlname,omitempty"` } -type AAAUserVPNSessionPolicyBinding struct { +type AAAGroupVPNURLPolicyBinding struct { ActType int `json:"acttype,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` } -type AAAOTPParameter struct { - Encryption string `json:"encryption,omitempty"` - MaxOTPDevices int `json:"maxotpdevices,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +type AAAKCDAccount struct { + CACert string `json:"cacert,omitempty"` + Count float64 `json:"__count,omitempty"` + DelegatedUser string `json:"delegateduser,omitempty"` + EnterpriseRealm string `json:"enterpriserealm,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KCDPassword string `json:"kcdpassword,omitempty"` + KCDSPN string `json:"kcdspn,omitempty"` + KeyTab string `json:"keytab,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Principle string `json:"principle,omitempty"` + RealmStr string `json:"realmstr,omitempty"` + SaltExpression string `json:"saltexpression,omitempty"` + ServiceSPN string `json:"servicespn,omitempty"` + UserCert string `json:"usercert,omitempty"` + UserRealm string `json:"userrealm,omitempty"` } -type AAARADIUSParams struct { - Accounting string `json:"accounting,omitempty"` - Authentication string `json:"authentication,omitempty"` - AuthServRetry int `json:"authservretry,omitempty"` +type AAALDAPParams struct { AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` - CallingStationID string `json:"callingstationid,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` + GroupAttrName string `json:"groupattrname,omitempty"` GroupAuthName string `json:"groupauthname,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - IPAttributeType int `json:"ipattributetype,omitempty"` - IPVendorID int `json:"ipvendorid,omitempty"` - MessageAuthenticator string `json:"messageauthenticator,omitempty"` + GroupNameIdentifier string `json:"groupnameidentifier,omitempty"` + GroupSearchAttribute string `json:"groupsearchattribute,omitempty"` + GroupSearchFilter string `json:"groupsearchfilter,omitempty"` + GroupSearchSubAttribute string `json:"groupsearchsubattribute,omitempty"` + LDAPBase string `json:"ldapbase,omitempty"` + LDAPBindDN string `json:"ldapbinddn,omitempty"` + LDAPBindDNPassword string `json:"ldapbinddnpassword,omitempty"` + LDAPLoginName string `json:"ldaploginname,omitempty"` + MaxNestingLevel int `json:"maxnestinglevel,omitempty"` + NestedGroupExtraction string `json:"nestedgroupextraction,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PassEncoding string `json:"passencoding,omitempty"` - PwdAttributeType int `json:"pwdattributetype,omitempty"` - PwdVendorID int `json:"pwdvendorid,omitempty"` - RadAttributeType int `json:"radattributetype,omitempty"` - RadGroupSeparator string `json:"radgroupseparator,omitempty"` - RadGroupsPrefix string `json:"radgroupsprefix,omitempty"` - RadKey string `json:"radkey,omitempty"` - RadNASID string `json:"radnasid,omitempty"` - RadNASIP string `json:"radnasip,omitempty"` - RadVendorID int `json:"radvendorid,omitempty"` + PasswdChange string `json:"passwdchange,omitempty"` + SearchFilter string `json:"searchfilter,omitempty"` + SecType string `json:"sectype,omitempty"` ServerIP string `json:"serverip,omitempty"` ServerPort int `json:"serverport,omitempty"` - TunnelEndpointClientIP string `json:"tunnelendpointclientip,omitempty"` -} - -type AAAPreAuthenticationPolicyAAAGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AAAGlobalAuthenticationNegotiateActionBinding struct { - WindowsProfile string `json:"windowsprofile,omitempty"` + SSONameAttribute string `json:"ssonameattribute,omitempty"` + SubAttributeName string `json:"subattributename,omitempty"` + SvrType string `json:"svrtype,omitempty"` } -type AAAGlobalAAAPreAuthenticationPolicyBinding struct { - BindPolicyType int `json:"bindpolicytype,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AAAGroupAuthorizationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AAAUserVPNIntranetApplicationBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` - Username string `json:"username,omitempty"` +type AAAOTPParameter struct { + Encryption string `json:"encryption,omitempty"` + MaxOTPDevices int `json:"maxotpdevices,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } type AAAParameter struct { @@ -304,46 +239,26 @@ type AAAParameter struct { WebViewEndpoints string `json:"webviewendpoints,omitempty"` } -type AAAUserVPNSecurePrivateAccessProfileBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAUserAuditNSLogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAUserBinding struct { - AAAUserAAAGroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` - AAAUserAuditNSLogPolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` - AAAUserAuditSyslogPolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` - AAAUserAuthorizationPolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` - AAAUserIntranetIP6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` - AAAUserIntranetIPBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` - AAAUserTMSessionPolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` - AAAUserVPNIntranetApplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` - AAAUserVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` - AAAUserVPNSessionPolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` - AAAUserVPNTrafficPolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` - AAAUserVPNURLBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` - AAAUserVPNURLPolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` - Username string `json:"username,omitempty"` +type AAAPreAuthenticationAction struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + DefaultEPAGroup string `json:"defaultepagroup,omitempty"` + DeleteFiles string `json:"deletefiles,omitempty"` + Feature string `json:"feature,omitempty"` + KillProcess string `json:"killprocess,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` } -type AAAGroupTMSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` +type AAAPreAuthenticationParameter struct { + Builtin []string `json:"builtin,omitempty"` + DeleteFiles string `json:"deletefiles,omitempty"` + Feature string `json:"feature,omitempty"` + KillProcess string `json:"killprocess,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` + Rule string `json:"rule,omitempty"` } type AAAPreAuthenticationPolicy struct { @@ -357,53 +272,54 @@ type AAAPreAuthenticationPolicy struct { Rule string `json:"rule,omitempty"` } -type AAATACACSParams struct { +type AAAPreAuthenticationPolicyAAAGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AAAPreAuthenticationPolicyBinding struct { + AAAPreAuthenticationPolicyAAAGlobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` + AAAPreAuthenticationPolicyVPNVServerBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AAAPreAuthenticationPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AAARADIUSParams struct { Accounting string `json:"accounting,omitempty"` - AuditFailedCmds string `json:"auditfailedcmds,omitempty"` - Authorization string `json:"authorization,omitempty"` + Authentication string `json:"authentication,omitempty"` + AuthServRetry int `json:"authservretry,omitempty"` AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` + CallingStationID string `json:"callingstationid,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` - GroupAttrName string `json:"groupattrname,omitempty"` + GroupAuthName string `json:"groupauthname,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPAttributeType int `json:"ipattributetype,omitempty"` + IPVendorID int `json:"ipvendorid,omitempty"` + MessageAuthenticator string `json:"messageauthenticator,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PassEncoding string `json:"passencoding,omitempty"` + PwdAttributeType int `json:"pwdattributetype,omitempty"` + PwdVendorID int `json:"pwdvendorid,omitempty"` + RadAttributeType int `json:"radattributetype,omitempty"` + RadGroupSeparator string `json:"radgroupseparator,omitempty"` + RadGroupsPrefix string `json:"radgroupsprefix,omitempty"` + RadKey string `json:"radkey,omitempty"` + RadNASID string `json:"radnasid,omitempty"` + RadNASIP string `json:"radnasip,omitempty"` + RadVendorID int `json:"radvendorid,omitempty"` ServerIP string `json:"serverip,omitempty"` ServerPort int `json:"serverport,omitempty"` - TACACSSecret string `json:"tacacssecret,omitempty"` -} - -type AAAGroup struct { - Count float64 `json:"__count,omitempty"` - GroupName string `json:"groupname,omitempty"` - LoggedIn bool `json:"loggedin,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Weight int `json:"weight,omitempty"` -} - -type AAAUserTMSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` -} - -type AAAGroupBinding struct { - AAAGroupAAAUserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` - AAAGroupAuditNSLogPolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` - AAAGroupAuditSyslogPolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` - AAAGroupAuthorizationPolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` - AAAGroupIntranetIP6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` - AAAGroupIntranetIPBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` - AAAGroupTMSessionPolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` - AAAGroupVPNIntranetApplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` - AAAGroupVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` - AAAGroupVPNSessionPolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` - AAAGroupVPNTrafficPolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` - AAAGroupVPNURLBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` - AAAGroupVPNURLPolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` - GroupName string `json:"groupname,omitempty"` + TunnelEndpointClientIP string `json:"tunnelendpointclientip,omitempty"` } type AAASession struct { @@ -429,50 +345,27 @@ type AAASession struct { Username string `json:"username,omitempty"` } -type AAAPreAuthenticationAction struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - DefaultEPAGroup string `json:"defaultepagroup,omitempty"` - DeleteFiles string `json:"deletefiles,omitempty"` - Feature string `json:"feature,omitempty"` - KillProcess string `json:"killprocess,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PreAuthenticationAction string `json:"preauthenticationaction,omitempty"` -} - -type AAAUserAAAGroupBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` +type AAASSOProfile struct { + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` } -type AAALDAPParams struct { +type AAATACACSParams struct { + Accounting string `json:"accounting,omitempty"` + AuditFailedCmds string `json:"auditfailedcmds,omitempty"` + Authorization string `json:"authorization,omitempty"` AuthTimeout int `json:"authtimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` GroupAttrName string `json:"groupattrname,omitempty"` - GroupAuthName string `json:"groupauthname,omitempty"` - GroupNameIdentifier string `json:"groupnameidentifier,omitempty"` - GroupSearchAttribute string `json:"groupsearchattribute,omitempty"` - GroupSearchFilter string `json:"groupsearchfilter,omitempty"` - GroupSearchSubAttribute string `json:"groupsearchsubattribute,omitempty"` - LDAPBase string `json:"ldapbase,omitempty"` - LDAPBindDN string `json:"ldapbinddn,omitempty"` - LDAPBindDNPassword string `json:"ldapbinddnpassword,omitempty"` - LDAPLoginName string `json:"ldaploginname,omitempty"` - MaxNestingLevel int `json:"maxnestinglevel,omitempty"` - NestedGroupExtraction string `json:"nestedgroupextraction,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PasswdChange string `json:"passwdchange,omitempty"` - SearchFilter string `json:"searchfilter,omitempty"` - SecType string `json:"sectype,omitempty"` ServerIP string `json:"serverip,omitempty"` ServerPort int `json:"serverport,omitempty"` - SSONameAttribute string `json:"ssonameattribute,omitempty"` - SubAttributeName string `json:"subattributename,omitempty"` - SvrType string `json:"svrtype,omitempty"` + TACACSSecret string `json:"tacacssecret,omitempty"` } type AAAUser struct { @@ -483,6 +376,56 @@ type AAAUser struct { Username string `json:"username,omitempty"` } +type AAAUserAAAGroupBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserAuditNSLogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserAuditSyslogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserAuthorizationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserBinding struct { + AAAUserAAAGroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` + AAAUserAuditNSLogPolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` + AAAUserAuditSyslogPolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` + AAAUserAuthorizationPolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` + AAAUserIntranetIP6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` + AAAUserIntranetIPBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` + AAAUserTMSessionPolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` + AAAUserVPNIntranetApplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` + AAAUserVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAUserVPNSessionPolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` + AAAUserVPNTrafficPolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` + AAAUserVPNURLBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` + AAAUserVPNURLPolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` + Username string `json:"username,omitempty"` +} + type AAAUserIntranetIP6Binding struct { GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` IntranetIP6 string `json:"intranetip6,omitempty"` @@ -490,9 +433,66 @@ type AAAUserIntranetIP6Binding struct { Username string `json:"username,omitempty"` } -type AAAPreAuthenticationPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` +type AAAUserIntranetIPBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserTMSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNIntranetApplicationBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNSecurePrivateAccessProfileBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNTrafficPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNURLBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + URLName string `json:"urlname,omitempty"` + Username string `json:"username,omitempty"` +} + +type AAAUserVPNURLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } From dbe3727dba1ac2f505bf7fcbf3eaaa24ac556bd4 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Sun, 22 Feb 2026 22:08:48 -0600 Subject: [PATCH 09/10] structs. --- nitrogo/models/aaa.go | 2 +- nitrogo/models/adm.go | 8 +- nitrogo/models/analytics.go | 86 +- nitrogo/models/api.go | 40 +- nitrogo/models/app.go | 6 +- nitrogo/models/appflow.go | 302 +-- nitrogo/models/appfw.go | 2324 +++++++++++------------ nitrogo/models/appqoe.go | 64 +- nitrogo/models/audit.go | 448 ++--- nitrogo/models/authentication.go | 1554 +++++++-------- nitrogo/models/authorization.go | 84 +- nitrogo/models/autoscale.go | 42 +- nitrogo/models/azure.go | 22 +- nitrogo/models/basic.go | 716 +++---- nitrogo/models/bfd.go | 40 +- nitrogo/models/bot.go | 330 ++-- nitrogo/models/cache.go | 430 ++--- nitrogo/models/cloud.go | 100 +- nitrogo/models/cloudtunnel.go | 32 +- nitrogo/models/cluster.go | 260 +-- nitrogo/models/cmp.go | 210 +-- nitrogo/models/contentinspection.go | 220 +-- nitrogo/models/cr.go | 390 ++-- nitrogo/models/cs.go | 646 +++---- nitrogo/models/db.go | 20 +- nitrogo/models/dns.go | 604 +++--- nitrogo/models/dos.go | 6 +- nitrogo/models/dps.go | 8 +- nitrogo/models/endpoint.go | 12 +- nitrogo/models/feo.go | 132 +- nitrogo/models/filter.go | 80 +- nitrogo/models/gslb.go | 808 ++++---- nitrogo/models/ha.go | 118 +- nitrogo/models/ica.go | 150 +- nitrogo/models/ipsec.go | 52 +- nitrogo/models/ipsecalg.go | 32 +- nitrogo/models/kafka.go | 20 +- nitrogo/models/lb.go | 1278 ++++++------- nitrogo/models/lldp.go | 70 +- nitrogo/models/lsn.go | 570 +++--- nitrogo/models/metrics.go | 92 +- nitrogo/models/network.go | 1618 ++++++++-------- nitrogo/models/ns.go | 2698 +++++++++++++-------------- nitrogo/models/ntp.go | 34 +- nitrogo/models/pcp.go | 50 +- nitrogo/models/policy.go | 238 +-- nitrogo/models/pq.go | 18 +- nitrogo/models/protocol.go | 30 +- nitrogo/models/quic.go | 46 +- nitrogo/models/quicbridge.go | 10 +- nitrogo/models/rdp.go | 70 +- nitrogo/models/reputation.go | 12 +- nitrogo/models/responder.go | 200 +- nitrogo/models/rewrite.go | 180 +- nitrogo/models/router.go | 8 +- nitrogo/models/sc.go | 16 +- nitrogo/models/smpp.go | 20 +- nitrogo/models/snmp.go | 146 +- nitrogo/models/spillover.go | 58 +- nitrogo/models/ssl.go | 1790 +++++++++--------- nitrogo/models/stream.go | 48 +- nitrogo/models/subscriber.go | 138 +- nitrogo/models/system.go | 397 ++-- nitrogo/models/tm.go | 338 ++-- nitrogo/models/transform.go | 202 +- nitrogo/models/tunnel.go | 54 +- nitrogo/models/ulfd.go | 6 +- nitrogo/models/urlfiltering.go | 40 +- nitrogo/models/user.go | 24 +- nitrogo/models/utility.go | 88 +- nitrogo/models/videooptimization.go | 248 +-- nitrogo/models/vpn.go | 1792 +++++++++--------- nitrogo/models/wasm.go | 8 +- 73 files changed, 11514 insertions(+), 11519 deletions(-) diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go index d675865..01bbe1b 100644 --- a/nitrogo/models/aaa.go +++ b/nitrogo/models/aaa.go @@ -6,7 +6,7 @@ type AAACertParams struct { GroupNameField string `json:"groupnamefield,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` TwoFactor string `json:"twofactor,omitempty"` - UserNameField string `json:"usernamefield,omitempty"` + UsernameField string `json:"usernamefield,omitempty"` } type AAAGlobalAAAPreAuthenticationPolicyBinding struct { diff --git a/nitrogo/models/adm.go b/nitrogo/models/adm.go index 74d3c73..111afd2 100644 --- a/nitrogo/models/adm.go +++ b/nitrogo/models/adm.go @@ -1,8 +1,8 @@ package models // adm configuration structs -type Admparameter struct { - Admserviceconnect string `json:"admserviceconnect,omitempty"` - Lowtouchonboard string `json:"lowtouchonboard,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ADMParameter struct { + ADMServiceConnect string `json:"admserviceconnect,omitempty"` + LowTouchOnBoard string `json:"lowtouchonboard,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/analytics.go b/nitrogo/models/analytics.go index f44fc6d..072f5ee 100644 --- a/nitrogo/models/analytics.go +++ b/nitrogo/models/analytics.go @@ -1,57 +1,57 @@ package models // analytics configuration structs -type AnalyticsglobalAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type AnalyticsGlobalAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` } -type AnalyticsglobalBinding struct { - AnalyticsglobalAnalyticsprofileBinding []interface{} `json:"analyticsglobal_analyticsprofile_binding,omitempty"` +type AnalyticsGlobalBinding struct { + AnalyticsGlobalAnalyticsProfileBinding []interface{} `json:"analyticsglobal_analyticsprofile_binding,omitempty"` } -type Analyticsprofile struct { - Allhttpheaders string `json:"allhttpheaders,omitempty"` - Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` - Analyticsendpointcontenttype string `json:"analyticsendpointcontenttype,omitempty"` - Analyticsendpointmetadata string `json:"analyticsendpointmetadata,omitempty"` - Analyticsendpointurl string `json:"analyticsendpointurl,omitempty"` - Auditlogs string `json:"auditlogs,omitempty"` +type AnalyticsProfile struct { + AllHTTPHeaders string `json:"allhttpheaders,omitempty"` + AnalyticsAuthToken string `json:"analyticsauthtoken,omitempty"` + AnalyticsEndpointContentType string `json:"analyticsendpointcontenttype,omitempty"` + AnalyticsEndpointMetadata string `json:"analyticsendpointmetadata,omitempty"` + AnalyticsEndpointURL string `json:"analyticsendpointurl,omitempty"` + AuditLogs string `json:"auditlogs,omitempty"` Collectors string `json:"collectors,omitempty"` Count float64 `json:"__count,omitempty"` - Cqareporting string `json:"cqareporting,omitempty"` - Dataformatfile string `json:"dataformatfile,omitempty"` + CQAReporting string `json:"cqareporting,omitempty"` + DataFormatFile string `json:"dataformatfile,omitempty"` Events string `json:"events,omitempty"` - Grpcstatus string `json:"grpcstatus,omitempty"` - Httpauthentication string `json:"httpauthentication,omitempty"` - Httpclientsidemeasurements string `json:"httpclientsidemeasurements,omitempty"` - Httpcontenttype string `json:"httpcontenttype,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httpcustomheaders []string `json:"httpcustomheaders,omitempty"` - Httpdomainname string `json:"httpdomainname,omitempty"` - Httphost string `json:"httphost,omitempty"` - Httplocation string `json:"httplocation,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httppagetracking string `json:"httppagetracking,omitempty"` - Httpreferer string `json:"httpreferer,omitempty"` - Httpsetcookie string `json:"httpsetcookie,omitempty"` - Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` - Httpurl string `json:"httpurl,omitempty"` - Httpurlquery string `json:"httpurlquery,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Httpvia string `json:"httpvia,omitempty"` - Httpxforwardedforheader string `json:"httpxforwardedforheader,omitempty"` - Integratedcache string `json:"integratedcache,omitempty"` - Managementlog []string `json:"managementlog,omitempty"` + GRPCStatus string `json:"grpcstatus,omitempty"` + HTTPAuthentication string `json:"httpauthentication,omitempty"` + HTTPClientSideMeasurements string `json:"httpclientsidemeasurements,omitempty"` + HTTPContentType string `json:"httpcontenttype,omitempty"` + HTTPCookie string `json:"httpcookie,omitempty"` + HTTPCustomHeaders []string `json:"httpcustomheaders,omitempty"` + HTTPDomainName string `json:"httpdomainname,omitempty"` + HTTPHost string `json:"httphost,omitempty"` + HTTPLocation string `json:"httplocation,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + HTTPPageTracking string `json:"httppagetracking,omitempty"` + HTTPReferer string `json:"httpreferer,omitempty"` + HTTPSetCookie string `json:"httpsetcookie,omitempty"` + HTTPSetCookie2 string `json:"httpsetcookie2,omitempty"` + HTTPURL string `json:"httpurl,omitempty"` + HTTPURLQuery string `json:"httpurlquery,omitempty"` + HTTPUserAgent string `json:"httpuseragent,omitempty"` + HTTPVia string `json:"httpvia,omitempty"` + HTTPXForwardedForHeader string `json:"httpxforwardedforheader,omitempty"` + IntegratedCache string `json:"integratedcache,omitempty"` + ManagementLog []string `json:"managementlog,omitempty"` Metrics string `json:"metrics,omitempty"` - Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` + MetricsExportFrequency int `json:"metricsexportfrequency,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Outputmode string `json:"outputmode,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Schemafile string `json:"schemafile,omitempty"` - Servemode string `json:"servemode,omitempty"` - Tcpburstreporting string `json:"tcpburstreporting,omitempty"` - Topn string `json:"topn,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OutputMode string `json:"outputmode,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + SchemaFile string `json:"schemafile,omitempty"` + ServeMode string `json:"servemode,omitempty"` + TCPBurstReporting string `json:"tcpburstreporting,omitempty"` + TopN string `json:"topn,omitempty"` TypeField string `json:"type,omitempty"` - Urlcategory string `json:"urlcategory,omitempty"` + URLCategory string `json:"urlcategory,omitempty"` } diff --git a/nitrogo/models/api.go b/nitrogo/models/api.go index e80f145..a364cf0 100644 --- a/nitrogo/models/api.go +++ b/nitrogo/models/api.go @@ -1,53 +1,53 @@ package models // api configuration structs -type Apispecfile struct { +type APISpecFile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` Src string `json:"src,omitempty"` } -type ApiprofileApispecBinding struct { - Apispec string `json:"apispec,omitempty"` +type APIProfileAPISpecBinding struct { + APISpec string `json:"apispec,omitempty"` Name string `json:"name,omitempty"` } -type Apispec struct { +type APISpec struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Encrypted bool `json:"encrypted,omitempty"` File string `json:"file,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nsappversion string `json:"nsappversion,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSAppVersion string `json:"nsappversion,omitempty"` Ready string `json:"ready,omitempty"` - Skipvalidation string `json:"skipvalidation,omitempty"` + SkipValidation string `json:"skipvalidation,omitempty"` TypeField string `json:"type,omitempty"` } -type ApispecSpecendpointBinding struct { - Apiname string `json:"apiname,omitempty"` - Apiservice string `json:"apiservice,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httpurlpath string `json:"httpurlpath,omitempty"` +type APISpecSpecEndpointBinding struct { + APIName string `json:"apiname,omitempty"` + APIService string `json:"apiservice,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + HTTPURLPath string `json:"httpurlpath,omitempty"` Name string `json:"name,omitempty"` } -type Apiprofile struct { - Apivisibility string `json:"apivisibility,omitempty"` +type APIProfile struct { + APIVisibility string `json:"apivisibility,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type ApiprofileBinding struct { - ApiprofileApispecBinding []interface{} `json:"apiprofile_apispec_binding,omitempty"` +type APIProfileBinding struct { + APIProfileAPISpecBinding []interface{} `json:"apiprofile_apispec_binding,omitempty"` Name string `json:"name,omitempty"` } -type ApispecBinding struct { - ApispecSpecendpointBinding []interface{} `json:"apispec_specendpoint_binding,omitempty"` +type APISpecBinding struct { + APISpecSpecEndpointBinding []interface{} `json:"apispec_specendpoint_binding,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/app.go b/nitrogo/models/app.go index 6ea6a8a..a0ed202 100644 --- a/nitrogo/models/app.go +++ b/nitrogo/models/app.go @@ -2,7 +2,7 @@ package models // app configuration structs type Application struct { - Appname string `json:"appname,omitempty"` - Apptemplatefilename string `json:"apptemplatefilename,omitempty"` - Deploymentfilename string `json:"deploymentfilename,omitempty"` + AppName string `json:"appname,omitempty"` + AppTemplateFileName string `json:"apptemplatefilename,omitempty"` + DeploymentFileName string `json:"deploymentfilename,omitempty"` } diff --git a/nitrogo/models/appflow.go b/nitrogo/models/appflow.go index 8cc2fcb..6875a76 100644 --- a/nitrogo/models/appflow.go +++ b/nitrogo/models/appflow.go @@ -1,191 +1,191 @@ package models // appflow configuration structs -type Appflowparam struct { - Aaausername string `json:"aaausername,omitempty"` - Analyticsauthtoken string `json:"analyticsauthtoken,omitempty"` - Appnamerefresh int `json:"appnamerefresh,omitempty"` - Auditlogs string `json:"auditlogs,omitempty"` +type AppFlowParam struct { + AAAUsername string `json:"aaausername,omitempty"` + AnalyticsAuthToken string `json:"analyticsauthtoken,omitempty"` + AppNameRefresh int `json:"appnamerefresh,omitempty"` + AuditLogs string `json:"auditlogs,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cacheinsight string `json:"cacheinsight,omitempty"` - Clienttrafficonly string `json:"clienttrafficonly,omitempty"` - Connectionchaining string `json:"connectionchaining,omitempty"` - Cqareporting string `json:"cqareporting,omitempty"` - Distributedtracing string `json:"distributedtracing,omitempty"` - Disttracingsamplingrate int `json:"disttracingsamplingrate,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` + CacheInsight string `json:"cacheinsight,omitempty"` + ClientTrafficOnly string `json:"clienttrafficonly,omitempty"` + ConnectionChaining string `json:"connectionchaining,omitempty"` + CQAReporting string `json:"cqareporting,omitempty"` + DistributedTracing string `json:"distributedtracing,omitempty"` + DistTracingSamplingRate int `json:"disttracingsamplingrate,omitempty"` + EmailAddress string `json:"emailaddress,omitempty"` Events string `json:"events,omitempty"` Feature string `json:"feature,omitempty"` - Flowrecordinterval int `json:"flowrecordinterval,omitempty"` - Gxsessionreporting string `json:"gxsessionreporting,omitempty"` - Httpauthorization string `json:"httpauthorization,omitempty"` - Httpcontenttype string `json:"httpcontenttype,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httpdomain string `json:"httpdomain,omitempty"` - Httphost string `json:"httphost,omitempty"` - Httplocation string `json:"httplocation,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httpquerywithurl string `json:"httpquerywithurl,omitempty"` - Httpreferer string `json:"httpreferer,omitempty"` - Httpsetcookie string `json:"httpsetcookie,omitempty"` - Httpsetcookie2 string `json:"httpsetcookie2,omitempty"` - Httpurl string `json:"httpurl,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Httpvia string `json:"httpvia,omitempty"` - Httpxforwardedfor string `json:"httpxforwardedfor,omitempty"` - Identifiername string `json:"identifiername,omitempty"` - Identifiersessionname string `json:"identifiersessionname,omitempty"` - Logstreamovernsip string `json:"logstreamovernsip,omitempty"` - Lsnlogging string `json:"lsnlogging,omitempty"` + FlowRecordInterval int `json:"flowrecordinterval,omitempty"` + GXSessionReporting string `json:"gxsessionreporting,omitempty"` + HTTPAuthorization string `json:"httpauthorization,omitempty"` + HTTPContentType string `json:"httpcontenttype,omitempty"` + HTTPCookie string `json:"httpcookie,omitempty"` + HTTPDomain string `json:"httpdomain,omitempty"` + HTTPHost string `json:"httphost,omitempty"` + HTTPLocation string `json:"httplocation,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + HTTPQueryWithURL string `json:"httpquerywithurl,omitempty"` + HTTPReferer string `json:"httpreferer,omitempty"` + HTTPSetCookie string `json:"httpsetcookie,omitempty"` + HTTPSetCookie2 string `json:"httpsetcookie2,omitempty"` + HTTPURL string `json:"httpurl,omitempty"` + HTTPUserAgent string `json:"httpuseragent,omitempty"` + HTTPVia string `json:"httpvia,omitempty"` + HTTPXForwardedFor string `json:"httpxforwardedfor,omitempty"` + IdentifierName string `json:"identifiername,omitempty"` + IdentifierSessionName string `json:"identifiersessionname,omitempty"` + LogStreamOverNSIP string `json:"logstreamovernsip,omitempty"` + LSNLogging string `json:"lsnlogging,omitempty"` Metrics string `json:"metrics,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Observationdomainid int `json:"observationdomainid,omitempty"` - Observationdomainname string `json:"observationdomainname,omitempty"` - Observationpointid int `json:"observationpointid,omitempty"` - Securityinsightrecordinterval int `json:"securityinsightrecordinterval,omitempty"` - Securityinsighttraffic string `json:"securityinsighttraffic,omitempty"` - Skipcacheredirectionhttptransaction string `json:"skipcacheredirectionhttptransaction,omitempty"` - Subscriberawareness string `json:"subscriberawareness,omitempty"` - Subscriberidobfuscation string `json:"subscriberidobfuscation,omitempty"` - Subscriberidobfuscationalgo string `json:"subscriberidobfuscationalgo,omitempty"` - Tcpattackcounterinterval int `json:"tcpattackcounterinterval,omitempty"` - Tcpburstreporting string `json:"tcpburstreporting,omitempty"` - Tcpburstreportingthreshold int `json:"tcpburstreportingthreshold,omitempty"` - Templaterefresh int `json:"templaterefresh,omitempty"` - Timeseriesovernsip string `json:"timeseriesovernsip,omitempty"` - Udppmtu int `json:"udppmtu,omitempty"` - Urlcategory string `json:"urlcategory,omitempty"` - Usagerecordinterval int `json:"usagerecordinterval,omitempty"` - Videoinsight string `json:"videoinsight,omitempty"` - Websaasappusagereporting string `json:"websaasappusagereporting,omitempty"` -} - -type AppflowglobalBinding struct { - AppflowglobalAppflowpolicyBinding []interface{} `json:"appflowglobal_appflowpolicy_binding,omitempty"` -} - -type AppflowpolicyAppflowglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ObservationDomainID int `json:"observationdomainid,omitempty"` + ObservationDomainName string `json:"observationdomainname,omitempty"` + ObservationPointID int `json:"observationpointid,omitempty"` + SecurityInsightRecordInterval int `json:"securityinsightrecordinterval,omitempty"` + SecurityInsightTraffic string `json:"securityinsighttraffic,omitempty"` + SkipCacheRedirectionHTTPTransaction string `json:"skipcacheredirectionhttptransaction,omitempty"` + SubscriberAwareness string `json:"subscriberawareness,omitempty"` + SubscriberIDObfuscation string `json:"subscriberidobfuscation,omitempty"` + SubscriberIDObfuscationAlgo string `json:"subscriberidobfuscationalgo,omitempty"` + TCPAttackCounterInterval int `json:"tcpattackcounterinterval,omitempty"` + TCPBurstReporting string `json:"tcpburstreporting,omitempty"` + TCPBurstReportingThreshold int `json:"tcpburstreportingthreshold,omitempty"` + TemplateRefresh int `json:"templaterefresh,omitempty"` + TimeSeriesOverNSIP string `json:"timeseriesovernsip,omitempty"` + UDPPMTU int `json:"udppmtu,omitempty"` + URLCategory string `json:"urlcategory,omitempty"` + UsageRecordInterval int `json:"usagerecordinterval,omitempty"` + VideoInsight string `json:"videoinsight,omitempty"` + WebSaaSAppUsageReporting string `json:"websaasappusagereporting,omitempty"` +} + +type AppFlowGlobalBinding struct { + AppFlowGlobalAppFlowPolicyBinding []interface{} `json:"appflowglobal_appflowpolicy_binding,omitempty"` +} + +type AppFlowPolicyAppFlowGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Appflowpolicylabel struct { +type AppFlowPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AppflowpolicylabelBinding struct { - AppflowpolicylabelAppflowpolicyBinding []interface{} `json:"appflowpolicylabel_appflowpolicy_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AppFlowPolicyLabelBinding struct { + AppFlowPolicyLabelAppFlowPolicyBinding []interface{} `json:"appflowpolicylabel_appflowpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type AppflowpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AppFlowPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AppflowglobalAppflowpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AppFlowGlobalAppFlowPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type AppflowpolicyAppflowpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AppFlowPolicyAppFlowPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AppflowactionBinding struct { - AppflowactionAnalyticsprofileBinding []interface{} `json:"appflowaction_analyticsprofile_binding,omitempty"` +type AppFlowActionBinding struct { + AppFlowActionAnalyticsProfileBinding []interface{} `json:"appflowaction_analyticsprofile_binding,omitempty"` Name string `json:"name,omitempty"` } -type AppflowpolicylabelAppflowpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AppFlowPolicyLabelAppFlowPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AppflowpolicyBinding struct { - AppflowpolicyAppflowglobalBinding []interface{} `json:"appflowpolicy_appflowglobal_binding,omitempty"` - AppflowpolicyAppflowpolicylabelBinding []interface{} `json:"appflowpolicy_appflowpolicylabel_binding,omitempty"` - AppflowpolicyCsvserverBinding []interface{} `json:"appflowpolicy_csvserver_binding,omitempty"` - AppflowpolicyLbvserverBinding []interface{} `json:"appflowpolicy_lbvserver_binding,omitempty"` - AppflowpolicyVpnvserverBinding []interface{} `json:"appflowpolicy_vpnvserver_binding,omitempty"` +type AppFlowPolicyBinding struct { + AppFlowPolicyAppFlowGlobalBinding []interface{} `json:"appflowpolicy_appflowglobal_binding,omitempty"` + AppFlowPolicyAppFlowPolicyLabelBinding []interface{} `json:"appflowpolicy_appflowpolicylabel_binding,omitempty"` + AppFlowPolicyCSVServerBinding []interface{} `json:"appflowpolicy_csvserver_binding,omitempty"` + AppFlowPolicyLBVServerBinding []interface{} `json:"appflowpolicy_lbvserver_binding,omitempty"` + AppFlowPolicyVPNVServerBinding []interface{} `json:"appflowpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AppflowpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AppFlowPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Appflowaction struct { - Botinsight string `json:"botinsight,omitempty"` - Ciinsight string `json:"ciinsight,omitempty"` - Clientsidemeasurements string `json:"clientsidemeasurements,omitempty"` +type AppFlowAction struct { + BotInsight string `json:"botinsight,omitempty"` + CIInsight string `json:"ciinsight,omitempty"` + ClientSideMeasurements string `json:"clientsidemeasurements,omitempty"` Collectors []string `json:"collectors,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Distributionalgorithm string `json:"distributionalgorithm,omitempty"` + DistributionAlgorithm string `json:"distributionalgorithm,omitempty"` Hits int `json:"hits,omitempty"` - Metricslog bool `json:"metricslog,omitempty"` + MetricsLog bool `json:"metricslog,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pagetracking string `json:"pagetracking,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Securityinsight string `json:"securityinsight,omitempty"` - Transactionlog string `json:"transactionlog,omitempty"` - Videoanalytics string `json:"videoanalytics,omitempty"` - Webinsight string `json:"webinsight,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PageTracking string `json:"pagetracking,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + SecurityInsight string `json:"securityinsight,omitempty"` + TransactionLog string `json:"transactionlog,omitempty"` + VideoAnalytics string `json:"videoanalytics,omitempty"` + WebInsight string `json:"webinsight,omitempty"` } -type Appflowpolicy struct { +type AppFlowPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` @@ -194,36 +194,36 @@ type Appflowpolicy struct { Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type AppflowpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AppFlowPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Appflowcollector struct { +type AppFlowCollector struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` State string `json:"state,omitempty"` Transport string `json:"transport,omitempty"` } -type AppflowactionAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type AppFlowActionAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/appfw.go b/nitrogo/models/appfw.go index 5193a80..072d744 100644 --- a/nitrogo/models/appfw.go +++ b/nitrogo/models/appfw.go @@ -1,1167 +1,1167 @@ package models // appfw configuration structs -type Appfwxmlerrorpage struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type AppfwpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type Appfwgrpcwebtextcontenttype struct { - Count float64 `json:"__count,omitempty"` - Grpcwebtextcontenttypevalue string `json:"grpcwebtextcontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type AppfwglobalAppfwpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` - Policytype string `json:"policytype,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AppfwprofileCookieconsistencyBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Cookieconsistency string `json:"cookieconsistency,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Isregex string `json:"isregex,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileXmldosurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmlblockdtd string `json:"xmlblockdtd,omitempty"` - Xmlblockexternalentities string `json:"xmlblockexternalentities,omitempty"` - Xmlblockpi string `json:"xmlblockpi,omitempty"` - Xmldosurl string `json:"xmldosurl,omitempty"` - Xmlmaxattributenamelength int `json:"xmlmaxattributenamelength,omitempty"` - Xmlmaxattributenamelengthcheck string `json:"xmlmaxattributenamelengthcheck,omitempty"` - Xmlmaxattributes int `json:"xmlmaxattributes,omitempty"` - Xmlmaxattributescheck string `json:"xmlmaxattributescheck,omitempty"` - Xmlmaxattributevaluelength int `json:"xmlmaxattributevaluelength,omitempty"` - Xmlmaxattributevaluelengthcheck string `json:"xmlmaxattributevaluelengthcheck,omitempty"` - Xmlmaxchardatalength int `json:"xmlmaxchardatalength,omitempty"` - Xmlmaxchardatalengthcheck string `json:"xmlmaxchardatalengthcheck,omitempty"` - Xmlmaxelementchildren int `json:"xmlmaxelementchildren,omitempty"` - Xmlmaxelementchildrencheck string `json:"xmlmaxelementchildrencheck,omitempty"` - Xmlmaxelementdepth int `json:"xmlmaxelementdepth,omitempty"` - Xmlmaxelementdepthcheck string `json:"xmlmaxelementdepthcheck,omitempty"` - Xmlmaxelementnamelength int `json:"xmlmaxelementnamelength,omitempty"` - Xmlmaxelementnamelengthcheck string `json:"xmlmaxelementnamelengthcheck,omitempty"` - Xmlmaxelements int `json:"xmlmaxelements,omitempty"` - Xmlmaxelementscheck string `json:"xmlmaxelementscheck,omitempty"` - Xmlmaxentityexpansiondepth int `json:"xmlmaxentityexpansiondepth,omitempty"` - Xmlmaxentityexpansiondepthcheck string `json:"xmlmaxentityexpansiondepthcheck,omitempty"` - Xmlmaxentityexpansions int `json:"xmlmaxentityexpansions,omitempty"` - Xmlmaxentityexpansionscheck string `json:"xmlmaxentityexpansionscheck,omitempty"` - Xmlmaxfilesize int `json:"xmlmaxfilesize,omitempty"` - Xmlmaxfilesizecheck string `json:"xmlmaxfilesizecheck,omitempty"` - Xmlmaxnamespaces int `json:"xmlmaxnamespaces,omitempty"` - Xmlmaxnamespacescheck string `json:"xmlmaxnamespacescheck,omitempty"` - Xmlmaxnamespaceurilength int `json:"xmlmaxnamespaceurilength,omitempty"` - Xmlmaxnamespaceurilengthcheck string `json:"xmlmaxnamespaceurilengthcheck,omitempty"` - Xmlmaxnodes int `json:"xmlmaxnodes,omitempty"` - Xmlmaxnodescheck string `json:"xmlmaxnodescheck,omitempty"` - Xmlmaxsoaparrayrank int `json:"xmlmaxsoaparrayrank,omitempty"` - Xmlmaxsoaparraysize int `json:"xmlmaxsoaparraysize,omitempty"` - Xmlminfilesize int `json:"xmlminfilesize,omitempty"` - Xmlminfilesizecheck string `json:"xmlminfilesizecheck,omitempty"` - Xmlsoaparraycheck string `json:"xmlsoaparraycheck,omitempty"` -} - -type AppfwprofileDenyurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Denyurl string `json:"denyurl,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwsignatures struct { - Action []string `json:"action,omitempty"` - Autoenablenewsignatures string `json:"autoenablenewsignatures,omitempty"` - Category string `json:"category,omitempty"` - Comment string `json:"comment,omitempty"` - Enabled string `json:"enabled,omitempty"` - Encryptedversion int `json:"encryptedversion,omitempty"` - Merge bool `json:"merge,omitempty"` - Mergedefault bool `json:"mergedefault,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Preservedefactions bool `json:"preservedefactions,omitempty"` - Response string `json:"response,omitempty"` - Ruleid []interface{} `json:"ruleid,omitempty"` - Sha1 string `json:"sha1,omitempty"` - Src string `json:"src,omitempty"` - Vendortype string `json:"vendortype,omitempty"` - Xslt string `json:"xslt,omitempty"` -} - -type AppfwprofileFieldformatBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Fieldformat string `json:"fieldformat,omitempty"` - Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` - Fieldformatminlength int `json:"fieldformatminlength,omitempty"` - Fieldtype string `json:"fieldtype,omitempty"` - FormactionurlFf string `json:"formactionurl_ff,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexFf string `json:"isregex_ff,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileLogexpressionBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsLogexpression string `json:"as_logexpression,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Logexpression string `json:"logexpression,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwjsonerrorpage struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type AppfwprofileJsondosurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Jsondosurl string `json:"jsondosurl,omitempty"` - Jsonmaxarraylength int `json:"jsonmaxarraylength,omitempty"` - Jsonmaxarraylengthcheck string `json:"jsonmaxarraylengthcheck,omitempty"` - Jsonmaxcontainerdepth int `json:"jsonmaxcontainerdepth,omitempty"` - Jsonmaxcontainerdepthcheck string `json:"jsonmaxcontainerdepthcheck,omitempty"` - Jsonmaxdocumentlength int `json:"jsonmaxdocumentlength,omitempty"` - Jsonmaxdocumentlengthcheck string `json:"jsonmaxdocumentlengthcheck,omitempty"` - Jsonmaxobjectkeycount int `json:"jsonmaxobjectkeycount,omitempty"` - Jsonmaxobjectkeycountcheck string `json:"jsonmaxobjectkeycountcheck,omitempty"` - Jsonmaxobjectkeylength int `json:"jsonmaxobjectkeylength,omitempty"` - Jsonmaxobjectkeylengthcheck string `json:"jsonmaxobjectkeylengthcheck,omitempty"` - Jsonmaxstringlength int `json:"jsonmaxstringlength,omitempty"` - Jsonmaxstringlengthcheck string `json:"jsonmaxstringlengthcheck,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwpolicy struct { - Builtin []string `json:"builtin,omitempty"` - Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` - Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policytype string `json:"policytype,omitempty"` - Profilename string `json:"profilename,omitempty"` - Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` -} - -type AppfwprofileFakeaccountBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Fakeaccount string `json:"fakeaccount,omitempty"` - Formexpression string `json:"formexpression,omitempty"` - FormurlFad string `json:"formurl_fad,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Isfieldnameregex string `json:"isfieldnameregex,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Tag string `json:"tag,omitempty"` -} - -type AppfwprofileJsoncmdurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsValueExprJsonCmd string `json:"as_value_expr_json_cmd,omitempty"` - AsValueTypeJsonCmd string `json:"as_value_type_json_cmd,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IskeyregexJsonCmd string `json:"iskeyregex_json_cmd,omitempty"` - IsvalueregexJsonCmd string `json:"isvalueregex_json_cmd,omitempty"` - Jsoncmdurl string `json:"jsoncmdurl,omitempty"` - KeynameJsonCmd string `json:"keyname_json_cmd,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwconfidfield struct { - Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` - Fieldname string `json:"fieldname,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - State string `json:"state,omitempty"` - Url string `json:"url,omitempty"` -} - -type AppfwglobalAuditnslogpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Policytype string `json:"policytype,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AppfwprofileXmlvalidationurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmladditionalsoapheaders string `json:"xmladditionalsoapheaders,omitempty"` - Xmlendpointcheck string `json:"xmlendpointcheck,omitempty"` - Xmlrequestschema string `json:"xmlrequestschema,omitempty"` - Xmlresponseschema string `json:"xmlresponseschema,omitempty"` - Xmlvalidateresponse string `json:"xmlvalidateresponse,omitempty"` - Xmlvalidatesoapenvelope string `json:"xmlvalidatesoapenvelope,omitempty"` - Xmlvalidationurl string `json:"xmlvalidationurl,omitempty"` - Xmlwsdl string `json:"xmlwsdl,omitempty"` -} - -type AppfwprofileAppfwconfidfieldBinding struct { - Alertonly string `json:"alertonly,omitempty"` - CffieldUrl string `json:"cffield_url,omitempty"` - Comment string `json:"comment,omitempty"` - Confidfield string `json:"confidfield,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexCffield string `json:"isregex_cffield,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileCrosssitescriptingBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsScanLocationXss string `json:"as_scan_location_xss,omitempty"` - AsValueExprXss string `json:"as_value_expr_xss,omitempty"` - AsValueTypeXss string `json:"as_value_type_xss,omitempty"` - Comment string `json:"comment,omitempty"` - Crosssitescripting string `json:"crosssitescripting,omitempty"` - FormactionurlXss string `json:"formactionurl_xss,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexXss string `json:"isregex_xss,omitempty"` - IsvalueregexXss string `json:"isvalueregex_xss,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwtransactionrecords struct { - Appfwsessionid string `json:"appfwsessionid,omitempty"` - Clientip string `json:"clientip,omitempty"` - Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Endtime string `json:"endtime,omitempty"` - Httptransactionid int `json:"httptransactionid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Packetengineid int `json:"packetengineid,omitempty"` - Profilename string `json:"profilename,omitempty"` - Requestcontentlength int `json:"requestcontentlength,omitempty"` - Requestmaxprocessingtime int `json:"requestmaxprocessingtime,omitempty"` - Requestyields int `json:"requestyields,omitempty"` - Responsecontentlength int `json:"responsecontentlength,omitempty"` - Responsemaxprocessingtime int `json:"responsemaxprocessingtime,omitempty"` - Responseyields int `json:"responseyields,omitempty"` - Starttime string `json:"starttime,omitempty"` - Url string `json:"url,omitempty"` -} - -type AppfwprofileBinding struct { - AppfwprofileAppfwconfidfieldBinding []interface{} `json:"appfwprofile_appfwconfidfield_binding,omitempty"` - AppfwprofileBlockkeywordBinding []interface{} `json:"appfwprofile_blockkeyword_binding,omitempty"` - AppfwprofileBypasslistBinding []interface{} `json:"appfwprofile_bypasslist_binding,omitempty"` - AppfwprofileCmdinjectionBinding []interface{} `json:"appfwprofile_cmdinjection_binding,omitempty"` - AppfwprofileContenttypeBinding []interface{} `json:"appfwprofile_contenttype_binding,omitempty"` - AppfwprofileCookieconsistencyBinding []interface{} `json:"appfwprofile_cookieconsistency_binding,omitempty"` - AppfwprofileCreditcardnumberBinding []interface{} `json:"appfwprofile_creditcardnumber_binding,omitempty"` - AppfwprofileCrosssitescriptingBinding []interface{} `json:"appfwprofile_crosssitescripting_binding,omitempty"` - AppfwprofileCsrftagBinding []interface{} `json:"appfwprofile_csrftag_binding,omitempty"` - AppfwprofileDenylistBinding []interface{} `json:"appfwprofile_denylist_binding,omitempty"` - AppfwprofileDenyurlBinding []interface{} `json:"appfwprofile_denyurl_binding,omitempty"` - AppfwprofileExcluderescontenttypeBinding []interface{} `json:"appfwprofile_excluderescontenttype_binding,omitempty"` - AppfwprofileFakeaccountBinding []interface{} `json:"appfwprofile_fakeaccount_binding,omitempty"` - AppfwprofileFieldconsistencyBinding []interface{} `json:"appfwprofile_fieldconsistency_binding,omitempty"` - AppfwprofileFieldformatBinding []interface{} `json:"appfwprofile_fieldformat_binding,omitempty"` - AppfwprofileFileuploadtypeBinding []interface{} `json:"appfwprofile_fileuploadtype_binding,omitempty"` - AppfwprofileGrpcvalidationBinding []interface{} `json:"appfwprofile_grpcvalidation_binding,omitempty"` - AppfwprofileJsonblockkeywordBinding []interface{} `json:"appfwprofile_jsonblockkeyword_binding,omitempty"` - AppfwprofileJsoncmdurlBinding []interface{} `json:"appfwprofile_jsoncmdurl_binding,omitempty"` - AppfwprofileJsondosurlBinding []interface{} `json:"appfwprofile_jsondosurl_binding,omitempty"` - AppfwprofileJsonsqlurlBinding []interface{} `json:"appfwprofile_jsonsqlurl_binding,omitempty"` - AppfwprofileJsonxssurlBinding []interface{} `json:"appfwprofile_jsonxssurl_binding,omitempty"` - AppfwprofileLogexpressionBinding []interface{} `json:"appfwprofile_logexpression_binding,omitempty"` - AppfwprofileRestvalidationBinding []interface{} `json:"appfwprofile_restvalidation_binding,omitempty"` - AppfwprofileSafeobjectBinding []interface{} `json:"appfwprofile_safeobject_binding,omitempty"` - AppfwprofileSqlinjectionBinding []interface{} `json:"appfwprofile_sqlinjection_binding,omitempty"` - AppfwprofileStarturlBinding []interface{} `json:"appfwprofile_starturl_binding,omitempty"` - AppfwprofileTrustedlearningclientsBinding []interface{} `json:"appfwprofile_trustedlearningclients_binding,omitempty"` - AppfwprofileXmlattachmenturlBinding []interface{} `json:"appfwprofile_xmlattachmenturl_binding,omitempty"` - AppfwprofileXmldosurlBinding []interface{} `json:"appfwprofile_xmldosurl_binding,omitempty"` - AppfwprofileXmlsqlinjectionBinding []interface{} `json:"appfwprofile_xmlsqlinjection_binding,omitempty"` - AppfwprofileXmlvalidationurlBinding []interface{} `json:"appfwprofile_xmlvalidationurl_binding,omitempty"` - AppfwprofileXmlwsiurlBinding []interface{} `json:"appfwprofile_xmlwsiurl_binding,omitempty"` - AppfwprofileXmlxssBinding []interface{} `json:"appfwprofile_xmlxss_binding,omitempty"` - Name string `json:"name,omitempty"` -} - -type AppfwprofileCsrftagBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Csrfformactionurl string `json:"csrfformactionurl,omitempty"` - Csrftag string `json:"csrftag,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwwsdl struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type Appfwpolicylabel struct { - Count float64 `json:"__count,omitempty"` - Description string `json:"description,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` - Policytype string `json:"policytype,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type Appfwprotofile struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type AppfwglobalAuditsyslogpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Policytype string `json:"policytype,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - TypeField string `json:"type,omitempty"` -} - -type AppfwglobalBinding struct { - AppfwglobalAppfwpolicyBinding []interface{} `json:"appfwglobal_appfwpolicy_binding,omitempty"` - AppfwglobalAuditnslogpolicyBinding []interface{} `json:"appfwglobal_auditnslogpolicy_binding,omitempty"` - AppfwglobalAuditsyslogpolicyBinding []interface{} `json:"appfwglobal_auditsyslogpolicy_binding,omitempty"` -} - -type AppfwprofileJsonxssurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsValueExprJsonXss string `json:"as_value_expr_json_xss,omitempty"` - AsValueTypeJsonXss string `json:"as_value_type_json_xss,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IskeyregexJsonXss string `json:"iskeyregex_json_xss,omitempty"` - IsvalueregexJsonXss string `json:"isvalueregex_json_xss,omitempty"` - Jsonxssurl string `json:"jsonxssurl,omitempty"` - KeynameJsonXss string `json:"keyname_json_xss,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileFileuploadtypeBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsFileuploadtypesUrl string `json:"as_fileuploadtypes_url,omitempty"` - Comment string `json:"comment,omitempty"` - Filetype []string `json:"filetype,omitempty"` - Fileuploadtype string `json:"fileuploadtype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Isnameregex string `json:"isnameregex,omitempty"` - IsregexFileuploadtypesUrl string `json:"isregex_fileuploadtypes_url,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileXmlattachmenturlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmlattachmentcontenttype string `json:"xmlattachmentcontenttype,omitempty"` - Xmlattachmentcontenttypecheck string `json:"xmlattachmentcontenttypecheck,omitempty"` - Xmlattachmenturl string `json:"xmlattachmenturl,omitempty"` - Xmlmaxattachmentsize int `json:"xmlmaxattachmentsize,omitempty"` - Xmlmaxattachmentsizecheck string `json:"xmlmaxattachmentsizecheck,omitempty"` -} - -type Appfwurlencodedformcontenttype struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Urlencodedformcontenttypevalue string `json:"urlencodedformcontenttypevalue,omitempty"` -} - -type AppfwpolicyBinding struct { - AppfwpolicyAppfwglobalBinding []interface{} `json:"appfwpolicy_appfwglobal_binding,omitempty"` - AppfwpolicyAppfwpolicylabelBinding []interface{} `json:"appfwpolicy_appfwpolicylabel_binding,omitempty"` - AppfwpolicyCsvserverBinding []interface{} `json:"appfwpolicy_csvserver_binding,omitempty"` - AppfwpolicyLbvserverBinding []interface{} `json:"appfwpolicy_lbvserver_binding,omitempty"` - AppfwpolicyVpnvserverBinding []interface{} `json:"appfwpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` -} - -type AppfwprofileFieldconsistencyBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Fieldconsistency string `json:"fieldconsistency,omitempty"` - FormactionurlFfc string `json:"formactionurl_ffc,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexFfc string `json:"isregex_ffc,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwxmlschema struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type Appfwarchive struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` - Target string `json:"target,omitempty"` -} - -type AppfwpolicyAppfwpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwprofileBlockkeywordBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsBlockkeywordFormurl string `json:"as_blockkeyword_formurl,omitempty"` - AsFieldnameIsregexBlockkeyword string `json:"as_fieldname_isregex_blockkeyword,omitempty"` - Blockkeyword string `json:"blockkeyword,omitempty"` - Blockkeywordtype string `json:"blockkeywordtype,omitempty"` - Comment string `json:"comment,omitempty"` - Fieldname string `json:"fieldname,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwsettings struct { - Builtin []string `json:"builtin,omitempty"` - Ceflogging string `json:"ceflogging,omitempty"` - Centralizedlearning string `json:"centralizedlearning,omitempty"` - Clientiploggingheader string `json:"clientiploggingheader,omitempty"` - Cookieflags string `json:"cookieflags,omitempty"` - Cookiepostencryptprefix string `json:"cookiepostencryptprefix,omitempty"` - Defaultprofile string `json:"defaultprofile,omitempty"` - Entitydecoding string `json:"entitydecoding,omitempty"` - Feature string `json:"feature,omitempty"` - Geolocationlogging string `json:"geolocationlogging,omitempty"` - Importsizelimit int `json:"importsizelimit,omitempty"` - Learning string `json:"learning,omitempty"` - Learnratelimit int `json:"learnratelimit,omitempty"` - Logmalformedreq string `json:"logmalformedreq,omitempty"` - Malformedreqaction []string `json:"malformedreqaction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Proxyport int `json:"proxyport,omitempty"` - Proxyserver string `json:"proxyserver,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Sessionlifetime int `json:"sessionlifetime,omitempty"` - Sessionlimit int `json:"sessionlimit,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Signatureautoupdate string `json:"signatureautoupdate,omitempty"` - Signatureurl string `json:"signatureurl,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Useconfigurablesecretkey string `json:"useconfigurablesecretkey,omitempty"` -} - -type AppfwpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwprofileCmdinjectionBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsScanLocationCmd string `json:"as_scan_location_cmd,omitempty"` - AsValueExprCmd string `json:"as_value_expr_cmd,omitempty"` - AsValueTypeCmd string `json:"as_value_type_cmd,omitempty"` - Cmdinjection string `json:"cmdinjection,omitempty"` - Comment string `json:"comment,omitempty"` - FormactionurlCmd string `json:"formactionurl_cmd,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexCmd string `json:"isregex_cmd,omitempty"` - IsvalueregexCmd string `json:"isvalueregex_cmd,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwprofileStarturlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Starturl string `json:"starturl,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileJsonblockkeywordBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IskeyregexJsonBlockkeyword string `json:"iskeyregex_json_blockkeyword,omitempty"` - Jsonblockkeyword string `json:"jsonblockkeyword,omitempty"` - Jsonblockkeywordtype string `json:"jsonblockkeywordtype,omitempty"` - Jsonblockkeywordurl string `json:"jsonblockkeywordurl,omitempty"` - KeynameJsonBlockkeyword string `json:"keyname_json_blockkeyword,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwfieldtype struct { - Builtin []string `json:"builtin,omitempty"` - Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nocharmaps bool `json:"nocharmaps,omitempty"` - Priority int `json:"priority,omitempty"` - Regex string `json:"regex,omitempty"` -} - -type Appfwlearningdata struct { - AsScanLocationSql string `json:"as_scan_location_sql,omitempty"` - AsScanLocationXss string `json:"as_scan_location_xss,omitempty"` - AsValueExprSql string `json:"as_value_expr_sql,omitempty"` - AsValueExprXss string `json:"as_value_expr_xss,omitempty"` - AsValueTypeSql string `json:"as_value_type_sql,omitempty"` - AsValueTypeXss string `json:"as_value_type_xss,omitempty"` - Contenttype string `json:"contenttype,omitempty"` - Cookieconsistency string `json:"cookieconsistency,omitempty"` - Count float64 `json:"__count,omitempty"` - Creditcardnumber string `json:"creditcardnumber,omitempty"` - Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` - Crosssitescripting string `json:"crosssitescripting,omitempty"` - Csrfformoriginurl string `json:"csrfformoriginurl,omitempty"` - Csrftag string `json:"csrftag,omitempty"` - Data string `json:"data,omitempty"` - Fieldconsistency string `json:"fieldconsistency,omitempty"` - Fieldformat string `json:"fieldformat,omitempty"` - Fieldformatcharmappcre string `json:"fieldformatcharmappcre,omitempty"` - Fieldformatmaxlength int `json:"fieldformatmaxlength,omitempty"` - Fieldformatminlength int `json:"fieldformatminlength,omitempty"` - Fieldtype string `json:"fieldtype,omitempty"` - FormactionurlFf string `json:"formactionurl_ff,omitempty"` - FormactionurlFfc string `json:"formactionurl_ffc,omitempty"` - FormactionurlSql string `json:"formactionurl_sql,omitempty"` - FormactionurlXss string `json:"formactionurl_xss,omitempty"` - Hits int `json:"hits,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` - Securitycheck string `json:"securitycheck,omitempty"` - Sqlinjection string `json:"sqlinjection,omitempty"` - Starturl string `json:"starturl,omitempty"` - Target string `json:"target,omitempty"` - Totalxmlrequests bool `json:"totalxmlrequests,omitempty"` - Url string `json:"url,omitempty"` - Value string `json:"value,omitempty"` - ValueType string `json:"value_type,omitempty"` - Xmlattachmentcheck string `json:"xmlattachmentcheck,omitempty"` - Xmldoscheck string `json:"xmldoscheck,omitempty"` - Xmlwsicheck string `json:"xmlwsicheck,omitempty"` -} - -type AppfwpolicylabelAppfwpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwprofileXmlsqlinjectionBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsScanLocationXmlsql string `json:"as_scan_location_xmlsql,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexXmlsql string `json:"isregex_xmlsql,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmlsqlinjection string `json:"xmlsqlinjection,omitempty"` -} - -type Appfwgrpcwebjsoncontenttype struct { - Count float64 `json:"__count,omitempty"` - Grpcwebjsoncontenttypevalue string `json:"grpcwebjsoncontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type AppfwprofileTrustedlearningclientsBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Trustedlearningclients string `json:"trustedlearningclients,omitempty"` -} - -type AppfwprofileCreditcardnumberBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Creditcardnumber string `json:"creditcardnumber,omitempty"` - Creditcardnumberurl string `json:"creditcardnumberurl,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileExcluderescontenttypeBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Excluderescontenttype string `json:"excluderescontenttype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwjsoncontenttype struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Isregex string `json:"isregex,omitempty"` - Jsoncontenttypevalue string `json:"jsoncontenttypevalue,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type AppfwprofileSqlinjectionBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsScanLocationSql string `json:"as_scan_location_sql,omitempty"` - AsValueExprSql string `json:"as_value_expr_sql,omitempty"` - AsValueTypeSql string `json:"as_value_type_sql,omitempty"` - Comment string `json:"comment,omitempty"` - FormactionurlSql string `json:"formactionurl_sql,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexSql string `json:"isregex_sql,omitempty"` - IsvalueregexSql string `json:"isvalueregex_sql,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Sqlinjection string `json:"sqlinjection,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileRestvalidationBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - RestValidationAction string `json:"rest_validation_action,omitempty"` - Restvalidation string `json:"restvalidation,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwgrpccontenttype struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Grpccontenttypevalue string `json:"grpccontenttypevalue,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type AppfwprofileBypasslistBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsBypassList string `json:"as_bypass_list,omitempty"` - AsBypassListAction string `json:"as_bypass_list_action,omitempty"` - AsBypassListLocation string `json:"as_bypass_list_location,omitempty"` - AsBypassListValueType string `json:"as_bypass_list_value_type,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwhtmlerrorpage struct { - Comment string `json:"comment,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Response string `json:"response,omitempty"` - Src string `json:"src,omitempty"` -} - -type AppfwprofileSafeobjectBinding struct { - Action []string `json:"action,omitempty"` - Alertonly string `json:"alertonly,omitempty"` - AsExpression string `json:"as_expression,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Maxmatchlength int `json:"maxmatchlength,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - Safeobject string `json:"safeobject,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileGrpcvalidationBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - GrpcRelaxValidationAction string `json:"grpc_relax_validation_action,omitempty"` - Grpcvalidation string `json:"grpcvalidation,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileXmlwsiurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmlwsichecks string `json:"xmlwsichecks,omitempty"` - Xmlwsiurl string `json:"xmlwsiurl,omitempty"` -} - -type AppfwpolicyAppfwglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` -} - -type AppfwprofileDenylistBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsDenyList string `json:"as_deny_list,omitempty"` - AsDenyListAction []string `json:"as_deny_list_action,omitempty"` - AsDenyListLocation string `json:"as_deny_list_location,omitempty"` - AsDenyListValueType string `json:"as_deny_list_value_type,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwpolicylabelBinding struct { - AppfwpolicylabelAppfwpolicyBinding []interface{} `json:"appfwpolicylabel_appfwpolicy_binding,omitempty"` - AppfwpolicylabelPolicybindingBinding []interface{} `json:"appfwpolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` -} - -type Appfwprofile struct { - Addcookieflags string `json:"addcookieflags,omitempty"` - Apispec string `json:"apispec,omitempty"` - Archivename string `json:"archivename,omitempty"` - AsProfBypassListEnable string `json:"as_prof_bypass_list_enable,omitempty"` - AsProfDenyListEnable string `json:"as_prof_deny_list_enable,omitempty"` - Augment bool `json:"augment,omitempty"` - Blockkeywordaction []string `json:"blockkeywordaction,omitempty"` - Bufferoverflowaction []string `json:"bufferoverflowaction,omitempty"` - Bufferoverflowmaxcookielength int `json:"bufferoverflowmaxcookielength,omitempty"` - Bufferoverflowmaxheaderlength int `json:"bufferoverflowmaxheaderlength,omitempty"` - Bufferoverflowmaxquerylength int `json:"bufferoverflowmaxquerylength,omitempty"` - Bufferoverflowmaxtotalheaderlength int `json:"bufferoverflowmaxtotalheaderlength,omitempty"` - Bufferoverflowmaxurllength int `json:"bufferoverflowmaxurllength,omitempty"` - Builtin bool `json:"builtin,omitempty"` - Canonicalizehtmlresponse string `json:"canonicalizehtmlresponse,omitempty"` - Ceflogging string `json:"ceflogging,omitempty"` - Checkrequestheaders string `json:"checkrequestheaders,omitempty"` - Clientipexpression string `json:"clientipexpression,omitempty"` - Cmdinjectionaction []string `json:"cmdinjectionaction,omitempty"` - Cmdinjectiongrammar string `json:"cmdinjectiongrammar,omitempty"` - Cmdinjectiontype string `json:"cmdinjectiontype,omitempty"` - Comment string `json:"comment,omitempty"` - Contenttypeaction []string `json:"contenttypeaction,omitempty"` - Cookieconsistencyaction []string `json:"cookieconsistencyaction,omitempty"` - Cookieencryption string `json:"cookieencryption,omitempty"` - Cookiehijackingaction []string `json:"cookiehijackingaction,omitempty"` - Cookieproxying string `json:"cookieproxying,omitempty"` - Cookiesamesiteattribute string `json:"cookiesamesiteattribute,omitempty"` - Cookietransforms string `json:"cookietransforms,omitempty"` - Count float64 `json:"__count,omitempty"` - Creditcard []string `json:"creditcard,omitempty"` - Creditcardaction []string `json:"creditcardaction,omitempty"` - Creditcardmaxallowed int `json:"creditcardmaxallowed,omitempty"` - Creditcardxout string `json:"creditcardxout,omitempty"` - Crosssitescriptingaction []string `json:"crosssitescriptingaction,omitempty"` - Crosssitescriptingcheckcompleteurls string `json:"crosssitescriptingcheckcompleteurls,omitempty"` - Crosssitescriptingtransformunsafehtml string `json:"crosssitescriptingtransformunsafehtml,omitempty"` - Csrftag string `json:"csrftag,omitempty"` - Csrftagaction []string `json:"csrftagaction,omitempty"` - Customsettings string `json:"customsettings,omitempty"` - Defaultcharset string `json:"defaultcharset,omitempty"` - Defaultfieldformatmaxlength int `json:"defaultfieldformatmaxlength,omitempty"` - Defaultfieldformatmaxoccurrences int `json:"defaultfieldformatmaxoccurrences,omitempty"` - Defaultfieldformatminlength int `json:"defaultfieldformatminlength,omitempty"` - Defaultfieldformattype string `json:"defaultfieldformattype,omitempty"` - Defaults string `json:"defaults,omitempty"` - Denyurlaction []string `json:"denyurlaction,omitempty"` - Dosecurecreditcardlogging string `json:"dosecurecreditcardlogging,omitempty"` - Dynamiclearning []string `json:"dynamiclearning,omitempty"` - Enableformtagging string `json:"enableformtagging,omitempty"` - Errorurl string `json:"errorurl,omitempty"` - Excludefileuploadfromchecks string `json:"excludefileuploadfromchecks,omitempty"` - Exemptclosureurlsfromsecuritychecks string `json:"exemptclosureurlsfromsecuritychecks,omitempty"` - Fakeaccountdetection string `json:"fakeaccountdetection,omitempty"` - Fieldconsistencyaction []string `json:"fieldconsistencyaction,omitempty"` - Fieldformataction []string `json:"fieldformataction,omitempty"` - Fieldscan string `json:"fieldscan,omitempty"` - Fieldscanlimit int `json:"fieldscanlimit,omitempty"` - Fileuploadmaxnum int `json:"fileuploadmaxnum,omitempty"` - Fileuploadtypesaction []string `json:"fileuploadtypesaction,omitempty"` - Geolocationlogging string `json:"geolocationlogging,omitempty"` - Grpcaction []string `json:"grpcaction,omitempty"` - Htmlerrorobject string `json:"htmlerrorobject,omitempty"` - Htmlerrorstatuscode int `json:"htmlerrorstatuscode,omitempty"` - Htmlerrorstatusmessage string `json:"htmlerrorstatusmessage,omitempty"` - Importprofilename string `json:"importprofilename,omitempty"` - Infercontenttypexmlpayloadaction []string `json:"infercontenttypexmlpayloadaction,omitempty"` - Insertcookiesamesiteattribute string `json:"insertcookiesamesiteattribute,omitempty"` - Inspectcontenttypes []string `json:"inspectcontenttypes,omitempty"` - Inspectquerycontenttypes []string `json:"inspectquerycontenttypes,omitempty"` - Invalidpercenthandling string `json:"invalidpercenthandling,omitempty"` - Jsonblockkeywordaction []string `json:"jsonblockkeywordaction,omitempty"` - Jsoncmdinjectionaction []string `json:"jsoncmdinjectionaction,omitempty"` - Jsoncmdinjectiongrammar string `json:"jsoncmdinjectiongrammar,omitempty"` - Jsoncmdinjectiontype string `json:"jsoncmdinjectiontype,omitempty"` - Jsondosaction []string `json:"jsondosaction,omitempty"` - Jsonerrorobject string `json:"jsonerrorobject,omitempty"` - Jsonerrorstatuscode int `json:"jsonerrorstatuscode,omitempty"` - Jsonerrorstatusmessage string `json:"jsonerrorstatusmessage,omitempty"` - Jsonfieldscan string `json:"jsonfieldscan,omitempty"` - Jsonfieldscanlimit int `json:"jsonfieldscanlimit,omitempty"` - Jsonmessagescan string `json:"jsonmessagescan,omitempty"` - Jsonmessagescanlimit int `json:"jsonmessagescanlimit,omitempty"` - Jsonsqlinjectionaction []string `json:"jsonsqlinjectionaction,omitempty"` - Jsonsqlinjectiongrammar string `json:"jsonsqlinjectiongrammar,omitempty"` - Jsonsqlinjectiontype string `json:"jsonsqlinjectiontype,omitempty"` - Jsonxssaction []string `json:"jsonxssaction,omitempty"` - Learning string `json:"learning,omitempty"` - Logeverypolicyhit string `json:"logeverypolicyhit,omitempty"` - Matchurlstring string `json:"matchurlstring,omitempty"` - Messagescan string `json:"messagescan,omitempty"` - Messagescanlimit int `json:"messagescanlimit,omitempty"` - Messagescanlimitcontenttypes []string `json:"messagescanlimitcontenttypes,omitempty"` - Multipleheaderaction []string `json:"multipleheaderaction,omitempty"` - Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Optimizepartialreqs string `json:"optimizepartialreqs,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - Percentdecoderecursively string `json:"percentdecoderecursively,omitempty"` - Postbodylimit int `json:"postbodylimit,omitempty"` - Postbodylimitaction []string `json:"postbodylimitaction,omitempty"` - Postbodylimitsignature int `json:"postbodylimitsignature,omitempty"` - Protofileobject string `json:"protofileobject,omitempty"` - Refererheadercheck string `json:"refererheadercheck,omitempty"` - Relaxationrules bool `json:"relaxationrules,omitempty"` - Replaceurlstring string `json:"replaceurlstring,omitempty"` - Requestcontenttype string `json:"requestcontenttype,omitempty"` - Responsecontenttype string `json:"responsecontenttype,omitempty"` - Restaction []string `json:"restaction,omitempty"` - Rfcprofile string `json:"rfcprofile,omitempty"` - Semicolonfieldseparator string `json:"semicolonfieldseparator,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Sessionlessfieldconsistency string `json:"sessionlessfieldconsistency,omitempty"` - Sessionlessurlclosure string `json:"sessionlessurlclosure,omitempty"` - Signatures string `json:"signatures,omitempty"` - Sqlinjectionaction []string `json:"sqlinjectionaction,omitempty"` - Sqlinjectionchecksqlwildchars string `json:"sqlinjectionchecksqlwildchars,omitempty"` - Sqlinjectiongrammar string `json:"sqlinjectiongrammar,omitempty"` - Sqlinjectiononlycheckfieldswithsqlchars string `json:"sqlinjectiononlycheckfieldswithsqlchars,omitempty"` - Sqlinjectionparsecomments string `json:"sqlinjectionparsecomments,omitempty"` - Sqlinjectionruletype string `json:"sqlinjectionruletype,omitempty"` - Sqlinjectiontransformspecialchars string `json:"sqlinjectiontransformspecialchars,omitempty"` - Sqlinjectiontype string `json:"sqlinjectiontype,omitempty"` - Starturlaction []string `json:"starturlaction,omitempty"` - Starturlclosure string `json:"starturlclosure,omitempty"` - State string `json:"state,omitempty"` - Streaming string `json:"streaming,omitempty"` - Stripcomments string `json:"stripcomments,omitempty"` - Striphtmlcomments string `json:"striphtmlcomments,omitempty"` - Stripxmlcomments string `json:"stripxmlcomments,omitempty"` - Trace string `json:"trace,omitempty"` - TypeField []string `json:"type,omitempty"` - Urldecoderequestcookies string `json:"urldecoderequestcookies,omitempty"` - Usehtmlerrorobject string `json:"usehtmlerrorobject,omitempty"` - Verboseloglevel string `json:"verboseloglevel,omitempty"` - Xmlattachmentaction []string `json:"xmlattachmentaction,omitempty"` - Xmldosaction []string `json:"xmldosaction,omitempty"` - Xmlerrorobject string `json:"xmlerrorobject,omitempty"` - Xmlerrorstatuscode int `json:"xmlerrorstatuscode,omitempty"` - Xmlerrorstatusmessage string `json:"xmlerrorstatusmessage,omitempty"` - Xmlformataction []string `json:"xmlformataction,omitempty"` - Xmlsoapfaultaction []string `json:"xmlsoapfaultaction,omitempty"` - Xmlsqlinjectionaction []string `json:"xmlsqlinjectionaction,omitempty"` - Xmlsqlinjectionchecksqlwildchars string `json:"xmlsqlinjectionchecksqlwildchars,omitempty"` - Xmlsqlinjectiononlycheckfieldswithsqlchars string `json:"xmlsqlinjectiononlycheckfieldswithsqlchars,omitempty"` - Xmlsqlinjectionparsecomments string `json:"xmlsqlinjectionparsecomments,omitempty"` - Xmlsqlinjectiontype string `json:"xmlsqlinjectiontype,omitempty"` - Xmlvalidationaction []string `json:"xmlvalidationaction,omitempty"` - Xmlwsiaction []string `json:"xmlwsiaction,omitempty"` - Xmlxssaction []string `json:"xmlxssaction,omitempty"` -} - -type Appfwxmlcontenttype struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Isregex string `json:"isregex,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Xmlcontenttypevalue string `json:"xmlcontenttypevalue,omitempty"` -} - -type Appfwmultipartformcontenttype struct { - Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Isregex string `json:"isregex,omitempty"` - Multipartformcontenttypevalue string `json:"multipartformcontenttypevalue,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Appfwlearningsettings struct { - Contenttypeautodeploygraceperiod int `json:"contenttypeautodeploygraceperiod,omitempty"` - Contenttypeminthreshold int `json:"contenttypeminthreshold,omitempty"` - Contenttypepercentthreshold int `json:"contenttypepercentthreshold,omitempty"` - Cookieconsistencyautodeploygraceperiod int `json:"cookieconsistencyautodeploygraceperiod,omitempty"` - Cookieconsistencyminthreshold int `json:"cookieconsistencyminthreshold,omitempty"` - Cookieconsistencypercentthreshold int `json:"cookieconsistencypercentthreshold,omitempty"` - Count float64 `json:"__count,omitempty"` - Creditcardnumberminthreshold int `json:"creditcardnumberminthreshold,omitempty"` - Creditcardnumberpercentthreshold int `json:"creditcardnumberpercentthreshold,omitempty"` - Crosssitescriptingautodeploygraceperiod int `json:"crosssitescriptingautodeploygraceperiod,omitempty"` - Crosssitescriptingminthreshold int `json:"crosssitescriptingminthreshold,omitempty"` - Crosssitescriptingpercentthreshold int `json:"crosssitescriptingpercentthreshold,omitempty"` - Csrftagautodeploygraceperiod int `json:"csrftagautodeploygraceperiod,omitempty"` - Csrftagminthreshold int `json:"csrftagminthreshold,omitempty"` - Csrftagpercentthreshold int `json:"csrftagpercentthreshold,omitempty"` - Fieldconsistencyautodeploygraceperiod int `json:"fieldconsistencyautodeploygraceperiod,omitempty"` - Fieldconsistencyminthreshold int `json:"fieldconsistencyminthreshold,omitempty"` - Fieldconsistencypercentthreshold int `json:"fieldconsistencypercentthreshold,omitempty"` - Fieldformatautodeploygraceperiod int `json:"fieldformatautodeploygraceperiod,omitempty"` - Fieldformatminthreshold int `json:"fieldformatminthreshold,omitempty"` - Fieldformatpercentthreshold int `json:"fieldformatpercentthreshold,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` - Sqlinjectionautodeploygraceperiod int `json:"sqlinjectionautodeploygraceperiod,omitempty"` - Sqlinjectionminthreshold int `json:"sqlinjectionminthreshold,omitempty"` - Sqlinjectionpercentthreshold int `json:"sqlinjectionpercentthreshold,omitempty"` - Starturlautodeploygraceperiod int `json:"starturlautodeploygraceperiod,omitempty"` - Starturlminthreshold int `json:"starturlminthreshold,omitempty"` - Starturlpercentthreshold int `json:"starturlpercentthreshold,omitempty"` - Xmlattachmentminthreshold int `json:"xmlattachmentminthreshold,omitempty"` - Xmlattachmentpercentthreshold int `json:"xmlattachmentpercentthreshold,omitempty"` - Xmlwsiminthreshold int `json:"xmlwsiminthreshold,omitempty"` - Xmlwsipercentthreshold int `json:"xmlwsipercentthreshold,omitempty"` -} - -type AppfwprofileXmlxssBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsScanLocationXmlxss string `json:"as_scan_location_xmlxss,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IsregexXmlxss string `json:"isregex_xmlxss,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` - Xmlxss string `json:"xmlxss,omitempty"` -} - -type AppfwprofileContenttypeBinding struct { - Alertonly string `json:"alertonly,omitempty"` - Comment string `json:"comment,omitempty"` - Contenttype string `json:"contenttype,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type AppfwprofileJsonsqlurlBinding struct { - Alertonly string `json:"alertonly,omitempty"` - AsValueExprJsonSql string `json:"as_value_expr_json_sql,omitempty"` - AsValueTypeJsonSql string `json:"as_value_type_json_sql,omitempty"` - Comment string `json:"comment,omitempty"` - Isautodeployed string `json:"isautodeployed,omitempty"` - IskeyregexJsonSql string `json:"iskeyregex_json_sql,omitempty"` - IsvalueregexJsonSql string `json:"isvalueregex_json_sql,omitempty"` - Jsonsqlurl string `json:"jsonsqlurl,omitempty"` - KeynameJsonSql string `json:"keyname_json_sql,omitempty"` - Name string `json:"name,omitempty"` - Resourceid string `json:"resourceid,omitempty"` - Ruletype string `json:"ruletype,omitempty"` - State string `json:"state,omitempty"` -} - -type Appfwcustomsettings struct { - Name string `json:"name,omitempty"` +type AppFWXMLErrorPage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWGRPCWebTextContentType struct { + Count float64 `json:"__count,omitempty"` + GRPCWebTextContentTypeValue string `json:"grpcwebtextcontenttypevalue,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type AppFWGlobalAppFWPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolicyType string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AppFWProfileCookieConsistencyBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + CookieConsistency string `json:"cookieconsistency,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegex string `json:"isregex,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileXMLDOSURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLBlockDTD string `json:"xmlblockdtd,omitempty"` + XMLBlockExternalEntities string `json:"xmlblockexternalentities,omitempty"` + XMLBlockPI string `json:"xmlblockpi,omitempty"` + XMLDOSURL string `json:"xmldosurl,omitempty"` + XMLMaxAttributeNameLength int `json:"xmlmaxattributenamelength,omitempty"` + XMLMaxAttributeNameLengthCheck string `json:"xmlmaxattributenamelengthcheck,omitempty"` + XMLMaxAttributes int `json:"xmlmaxattributes,omitempty"` + XMLMaxAttributesCheck string `json:"xmlmaxattributescheck,omitempty"` + XMLMaxAttributeValueLength int `json:"xmlmaxattributevaluelength,omitempty"` + XMLMaxAttributeValueLengthCheck string `json:"xmlmaxattributevaluelengthcheck,omitempty"` + XMLMaxCharDataLength int `json:"xmlmaxchardatalength,omitempty"` + XMLMaxCharDataLengthCheck string `json:"xmlmaxchardatalengthcheck,omitempty"` + XMLMaxElementChildren int `json:"xmlmaxelementchildren,omitempty"` + XMLMaxElementChildrenCheck string `json:"xmlmaxelementchildrencheck,omitempty"` + XMLMaxElementDepth int `json:"xmlmaxelementdepth,omitempty"` + XMLMaxElementDepthCheck string `json:"xmlmaxelementdepthcheck,omitempty"` + XMLMaxElementNameLength int `json:"xmlmaxelementnamelength,omitempty"` + XMLMaxElementNameLengthCheck string `json:"xmlmaxelementnamelengthcheck,omitempty"` + XMLMaxElements int `json:"xmlmaxelements,omitempty"` + XMLMaxElementsCheck string `json:"xmlmaxelementscheck,omitempty"` + XMLMaxEntityExpansionDepth int `json:"xmlmaxentityexpansiondepth,omitempty"` + XMLMaxEntityExpansionDepthCheck string `json:"xmlmaxentityexpansiondepthcheck,omitempty"` + XMLMaxEntityExpansions int `json:"xmlmaxentityexpansions,omitempty"` + XMLMaxEntityExpansionsCheck string `json:"xmlmaxentityexpansionscheck,omitempty"` + XMLMaxFileSize int `json:"xmlmaxfilesize,omitempty"` + XMLMaxFileSizeCheck string `json:"xmlmaxfilesizecheck,omitempty"` + XMLMaxNamespaces int `json:"xmlmaxnamespaces,omitempty"` + XMLMaxNamespacesCheck string `json:"xmlmaxnamespacescheck,omitempty"` + XMLMaxNamespaceURILength int `json:"xmlmaxnamespaceurilength,omitempty"` + XMLMaxNamespaceURILengthCheck string `json:"xmlmaxnamespaceurilengthcheck,omitempty"` + XMLMaxNodes int `json:"xmlmaxnodes,omitempty"` + XMLMaxNodesCheck string `json:"xmlmaxnodescheck,omitempty"` + XMLMaxSOAPArrayRank int `json:"xmlmaxsoaparrayrank,omitempty"` + XMLMaxSOAPArraySize int `json:"xmlmaxsoaparraysize,omitempty"` + XMLMinFileSize int `json:"xmlminfilesize,omitempty"` + XMLMinFileSizeCheck string `json:"xmlminfilesizecheck,omitempty"` + XMLSOAPArrayCheck string `json:"xmlsoaparraycheck,omitempty"` +} + +type AppFWProfileDenyURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + DenyURL string `json:"denyurl,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWSignatures struct { + Action []string `json:"action,omitempty"` + AutoEnableNewSignatures string `json:"autoenablenewsignatures,omitempty"` + Category string `json:"category,omitempty"` + Comment string `json:"comment,omitempty"` + Enabled string `json:"enabled,omitempty"` + EncryptedVersion int `json:"encryptedversion,omitempty"` + Merge bool `json:"merge,omitempty"` + MergeDefault bool `json:"mergedefault,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + PreserveDefActions bool `json:"preservedefactions,omitempty"` + Response string `json:"response,omitempty"` + RuleID []interface{} `json:"ruleid,omitempty"` + SHA1 string `json:"sha1,omitempty"` + Src string `json:"src,omitempty"` + VendorType string `json:"vendortype,omitempty"` + XSLT string `json:"xslt,omitempty"` +} + +type AppFWProfileFieldFormatBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + FieldFormat string `json:"fieldformat,omitempty"` + FieldFormatMaxLength int `json:"fieldformatmaxlength,omitempty"` + FieldFormatMinLength int `json:"fieldformatminlength,omitempty"` + FieldType string `json:"fieldtype,omitempty"` + FormActionURLFF string `json:"formactionurl_ff,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexFF string `json:"isregex_ff,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileLogExpressionBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASLogExpression string `json:"as_logexpression,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + LogExpression string `json:"logexpression,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWJSONErrorPage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWProfileJSONDOSURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + JSONDOSURL string `json:"jsondosurl,omitempty"` + JSONMaxArrayLength int `json:"jsonmaxarraylength,omitempty"` + JSONMaxArrayLengthCheck string `json:"jsonmaxarraylengthcheck,omitempty"` + JSONMaxContainerDepth int `json:"jsonmaxcontainerdepth,omitempty"` + JSONMaxContainerDepthCheck string `json:"jsonmaxcontainerdepthcheck,omitempty"` + JSONMaxDocumentLength int `json:"jsonmaxdocumentlength,omitempty"` + JSONMaxDocumentLengthCheck string `json:"jsonmaxdocumentlengthcheck,omitempty"` + JSONMaxObjectKeyCount int `json:"jsonmaxobjectkeycount,omitempty"` + JSONMaxObjectKeyCountCheck string `json:"jsonmaxobjectkeycountcheck,omitempty"` + JSONMaxObjectKeyLength int `json:"jsonmaxobjectkeylength,omitempty"` + JSONMaxObjectKeyLengthCheck string `json:"jsonmaxobjectkeylengthcheck,omitempty"` + JSONMaxStringLength int `json:"jsonmaxstringlength,omitempty"` + JSONMaxStringLengthCheck string `json:"jsonmaxstringlengthcheck,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWPolicy struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + LogAction string `json:"logaction,omitempty"` + Name string `json:"name,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyType string `json:"policytype,omitempty"` + ProfileName string `json:"profilename,omitempty"` + Rule string `json:"rule,omitempty"` + UndefHits int `json:"undefhits,omitempty"` +} + +type AppFWProfileFakeAccountBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + FakeAccount string `json:"fakeaccount,omitempty"` + FormExpression string `json:"formexpression,omitempty"` + FormURLFAD string `json:"formurl_fad,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsFieldNameRegex string `json:"isfieldnameregex,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + Tag string `json:"tag,omitempty"` +} + +type AppFWProfileJSONCMDURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASValueExprJSONCMD string `json:"as_value_expr_json_cmd,omitempty"` + ASValueTypeJSONCMD string `json:"as_value_type_json_cmd,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsKeyRegexJSONCMD string `json:"iskeyregex_json_cmd,omitempty"` + IsValueRegexJSONCMD string `json:"isvalueregex_json_cmd,omitempty"` + JSONCMDURL string `json:"jsoncmdurl,omitempty"` + KeyNameJSONCMD string `json:"keyname_json_cmd,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWConfidField struct { + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + FieldName string `json:"fieldname,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + State string `json:"state,omitempty"` + URL string `json:"url,omitempty"` +} + +type AppFWGlobalAuditNSLogPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolicyType string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AppFWProfileXMLValidationURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLAdditionalSOAPHeaders string `json:"xmladditionalsoapheaders,omitempty"` + XMLEndpointCheck string `json:"xmlendpointcheck,omitempty"` + XMLRequestSchema string `json:"xmlrequestschema,omitempty"` + XMLResponseSchema string `json:"xmlresponseschema,omitempty"` + XMLValidateResponse string `json:"xmlvalidateresponse,omitempty"` + XMLValidateSOAPEnvelope string `json:"xmlvalidatesoapenvelope,omitempty"` + XMLValidationURL string `json:"xmlvalidationurl,omitempty"` + XMLWSDL string `json:"xmlwsdl,omitempty"` +} + +type AppFWProfileAppFWConfidFieldBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + CFFieldURL string `json:"cffield_url,omitempty"` + Comment string `json:"comment,omitempty"` + ConfidField string `json:"confidfield,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexCFField string `json:"isregex_cffield,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileCrossSiteScriptingBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASScanLocationXSS string `json:"as_scan_location_xss,omitempty"` + ASValueExprXSS string `json:"as_value_expr_xss,omitempty"` + ASValueTypeXSS string `json:"as_value_type_xss,omitempty"` + Comment string `json:"comment,omitempty"` + CrossSiteScripting string `json:"crosssitescripting,omitempty"` + FormActionURLXSS string `json:"formactionurl_xss,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexXSS string `json:"isregex_xss,omitempty"` + IsValueRegexXSS string `json:"isvalueregex_xss,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWTransactionRecords struct { + AppFWSessionID string `json:"appfwsessionid,omitempty"` + ClientIP string `json:"clientip,omitempty"` + Count float64 `json:"__count,omitempty"` + DestIP string `json:"destip,omitempty"` + EndTime string `json:"endtime,omitempty"` + HTTPTransactionID int `json:"httptransactionid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PacketEngineID int `json:"packetengineid,omitempty"` + ProfileName string `json:"profilename,omitempty"` + RequestContentLength int `json:"requestcontentlength,omitempty"` + RequestMaxProcessingTime int `json:"requestmaxprocessingtime,omitempty"` + RequestYields int `json:"requestyields,omitempty"` + ResponseContentLength int `json:"responsecontentlength,omitempty"` + ResponseMaxProcessingTime int `json:"responsemaxprocessingtime,omitempty"` + ResponseYields int `json:"responseyields,omitempty"` + StartTime string `json:"starttime,omitempty"` + URL string `json:"url,omitempty"` +} + +type AppFWProfileBinding struct { + AppFWProfileAppFWConfidFieldBinding []interface{} `json:"appfwprofile_appfwconfidfield_binding,omitempty"` + AppFWProfileBlockKeywordBinding []interface{} `json:"appfwprofile_blockkeyword_binding,omitempty"` + AppFWProfileBypassListBinding []interface{} `json:"appfwprofile_bypasslist_binding,omitempty"` + AppFWProfileCMDInjectionBinding []interface{} `json:"appfwprofile_cmdinjection_binding,omitempty"` + AppFWProfileContentTypeBinding []interface{} `json:"appfwprofile_contenttype_binding,omitempty"` + AppFWProfileCookieConsistencyBinding []interface{} `json:"appfwprofile_cookieconsistency_binding,omitempty"` + AppFWProfileCreditCardNumberBinding []interface{} `json:"appfwprofile_creditcardnumber_binding,omitempty"` + AppFWProfileCrossSiteScriptingBinding []interface{} `json:"appfwprofile_crosssitescripting_binding,omitempty"` + AppFWProfileCSRFTagBinding []interface{} `json:"appfwprofile_csrftag_binding,omitempty"` + AppFWProfileDenyListBinding []interface{} `json:"appfwprofile_denylist_binding,omitempty"` + AppFWProfileDenyURLBinding []interface{} `json:"appfwprofile_denyurl_binding,omitempty"` + AppFWProfileExcludeRESContentTypeBinding []interface{} `json:"appfwprofile_excluderescontenttype_binding,omitempty"` + AppFWProfileFakeAccountBinding []interface{} `json:"appfwprofile_fakeaccount_binding,omitempty"` + AppFWProfileFieldConsistencyBinding []interface{} `json:"appfwprofile_fieldconsistency_binding,omitempty"` + AppFWProfileFieldFormatBinding []interface{} `json:"appfwprofile_fieldformat_binding,omitempty"` + AppFWProfileFileUploadTypeBinding []interface{} `json:"appfwprofile_fileuploadtype_binding,omitempty"` + AppFWProfileGRPCValidationBinding []interface{} `json:"appfwprofile_grpcvalidation_binding,omitempty"` + AppFWProfileJSONBlockKeywordBinding []interface{} `json:"appfwprofile_jsonblockkeyword_binding,omitempty"` + AppFWProfileJSONCMDURLBinding []interface{} `json:"appfwprofile_jsoncmdurl_binding,omitempty"` + AppFWProfileJSONDOSURLBinding []interface{} `json:"appfwprofile_jsondosurl_binding,omitempty"` + AppFWProfileJSONSQLURLBinding []interface{} `json:"appfwprofile_jsonsqlurl_binding,omitempty"` + AppFWProfileJSONXSSURLBinding []interface{} `json:"appfwprofile_jsonxssurl_binding,omitempty"` + AppFWProfileLogExpressionBinding []interface{} `json:"appfwprofile_logexpression_binding,omitempty"` + AppFWProfileRESTValidationBinding []interface{} `json:"appfwprofile_restvalidation_binding,omitempty"` + AppFWProfileSafeObjectBinding []interface{} `json:"appfwprofile_safeobject_binding,omitempty"` + AppFWProfileSQLInjectionBinding []interface{} `json:"appfwprofile_sqlinjection_binding,omitempty"` + AppFWProfileStartURLBinding []interface{} `json:"appfwprofile_starturl_binding,omitempty"` + AppFWProfileTrustedLearningClientsBinding []interface{} `json:"appfwprofile_trustedlearningclients_binding,omitempty"` + AppFWProfileXMLAttachmentURLBinding []interface{} `json:"appfwprofile_xmlattachmenturl_binding,omitempty"` + AppFWProfileXMLDOSURLBinding []interface{} `json:"appfwprofile_xmldosurl_binding,omitempty"` + AppFWProfileXMLSQLInjectionBinding []interface{} `json:"appfwprofile_xmlsqlinjection_binding,omitempty"` + AppFWProfileXMLValidationURLBinding []interface{} `json:"appfwprofile_xmlvalidationurl_binding,omitempty"` + AppFWProfileXMLWSIURLBinding []interface{} `json:"appfwprofile_xmlwsiurl_binding,omitempty"` + AppFWProfileXMLXSSBinding []interface{} `json:"appfwprofile_xmlxss_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AppFWProfileCSRFTagBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + CSRFFormActionURL string `json:"csrfformactionurl,omitempty"` + CSRFTag string `json:"csrftag,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWWSDL struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWPolicyLabel struct { + Count float64 `json:"__count,omitempty"` + Description string `json:"description,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Hits int `json:"hits,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` + PolicyType string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProtoFile struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWGlobalAuditSyslogPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolicyType string `json:"policytype,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + TypeField string `json:"type,omitempty"` +} + +type AppFWGlobalBinding struct { + AppFWGlobalAppFWPolicyBinding []interface{} `json:"appfwglobal_appfwpolicy_binding,omitempty"` + AppFWGlobalAuditNSLogPolicyBinding []interface{} `json:"appfwglobal_auditnslogpolicy_binding,omitempty"` + AppFWGlobalAuditSyslogPolicyBinding []interface{} `json:"appfwglobal_auditsyslogpolicy_binding,omitempty"` +} + +type AppFWProfileJSONXSSURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASValueExprJSONXSS string `json:"as_value_expr_json_xss,omitempty"` + ASValueTypeJSONXSS string `json:"as_value_type_json_xss,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsKeyRegexJSONXSS string `json:"iskeyregex_json_xss,omitempty"` + IsValueRegexJSONXSS string `json:"isvalueregex_json_xss,omitempty"` + JSONXSSURL string `json:"jsonxssurl,omitempty"` + KeyNameJSONXSS string `json:"keyname_json_xss,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileFileUploadTypeBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASFileUploadTypesURL string `json:"as_fileuploadtypes_url,omitempty"` + Comment string `json:"comment,omitempty"` + FileType []string `json:"filetype,omitempty"` + FileUploadType string `json:"fileuploadtype,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsNameRegex string `json:"isnameregex,omitempty"` + IsRegexFileUploadTypesURL string `json:"isregex_fileuploadtypes_url,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileXMLAttachmentURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLAttachmentContentType string `json:"xmlattachmentcontenttype,omitempty"` + XMLAttachmentContentTypeCheck string `json:"xmlattachmentcontenttypecheck,omitempty"` + XMLAttachmentURL string `json:"xmlattachmenturl,omitempty"` + XMLMaxAttachmentSize int `json:"xmlmaxattachmentsize,omitempty"` + XMLMaxAttachmentSizeCheck string `json:"xmlmaxattachmentsizecheck,omitempty"` +} + +type AppFWURLEncodedFormContentType struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + URLEncodedFormContentTypeValue string `json:"urlencodedformcontenttypevalue,omitempty"` +} + +type AppFWPolicyBinding struct { + AppFWPolicyAppFWGlobalBinding []interface{} `json:"appfwpolicy_appfwglobal_binding,omitempty"` + AppFWPolicyAppFWPolicyLabelBinding []interface{} `json:"appfwpolicy_appfwpolicylabel_binding,omitempty"` + AppFWPolicyCSVServerBinding []interface{} `json:"appfwpolicy_csvserver_binding,omitempty"` + AppFWPolicyLBVServerBinding []interface{} `json:"appfwpolicy_lbvserver_binding,omitempty"` + AppFWPolicyVPNVServerBinding []interface{} `json:"appfwpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` +} + +type AppFWProfileFieldConsistencyBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + FieldConsistency string `json:"fieldconsistency,omitempty"` + FormActionURLFFC string `json:"formactionurl_ffc,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexFFC string `json:"isregex_ffc,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWXMLSchema struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWArchive struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` + Target string `json:"target,omitempty"` +} + +type AppFWPolicyAppFWPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProfileBlockKeywordBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASBlockKeywordFormURL string `json:"as_blockkeyword_formurl,omitempty"` + ASFieldNameIsRegexBlockKeyword string `json:"as_fieldname_isregex_blockkeyword,omitempty"` + BlockKeyword string `json:"blockkeyword,omitempty"` + BlockKeywordType string `json:"blockkeywordtype,omitempty"` + Comment string `json:"comment,omitempty"` + FieldName string `json:"fieldname,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWSettings struct { + Builtin []string `json:"builtin,omitempty"` + CEFLogging string `json:"ceflogging,omitempty"` + CentralizedLearning string `json:"centralizedlearning,omitempty"` + ClientIPLoggingHeader string `json:"clientiploggingheader,omitempty"` + CookieFlags string `json:"cookieflags,omitempty"` + CookiePostEncryptPrefix string `json:"cookiepostencryptprefix,omitempty"` + DefaultProfile string `json:"defaultprofile,omitempty"` + EntityDecoding string `json:"entitydecoding,omitempty"` + Feature string `json:"feature,omitempty"` + GeoLocationLogging string `json:"geolocationlogging,omitempty"` + ImportSizeLimit int `json:"importsizelimit,omitempty"` + Learning string `json:"learning,omitempty"` + LearnRateLimit int `json:"learnratelimit,omitempty"` + LogMalformedReq string `json:"logmalformedreq,omitempty"` + MalformedReqAction []string `json:"malformedreqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProxyPassword string `json:"proxypassword,omitempty"` + ProxyPort int `json:"proxyport,omitempty"` + ProxyServer string `json:"proxyserver,omitempty"` + ProxyUsername string `json:"proxyusername,omitempty"` + SessionCookieName string `json:"sessioncookiename,omitempty"` + SessionLifetime int `json:"sessionlifetime,omitempty"` + SessionLimit int `json:"sessionlimit,omitempty"` + SessionTimeout int `json:"sessiontimeout,omitempty"` + SignatureAutoUpdate string `json:"signatureautoupdate,omitempty"` + SignatureURL string `json:"signatureurl,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UseConfigurableSecretKey string `json:"useconfigurablesecretkey,omitempty"` +} + +type AppFWPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProfileCMDInjectionBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASScanLocationCMD string `json:"as_scan_location_cmd,omitempty"` + ASValueExprCMD string `json:"as_value_expr_cmd,omitempty"` + ASValueTypeCMD string `json:"as_value_type_cmd,omitempty"` + CMDInjection string `json:"cmdinjection,omitempty"` + Comment string `json:"comment,omitempty"` + FormActionURLCMD string `json:"formactionurl_cmd,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexCMD string `json:"isregex_cmd,omitempty"` + IsValueRegexCMD string `json:"isvalueregex_cmd,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProfileStartURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + StartURL string `json:"starturl,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileJSONBlockKeywordBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsKeyRegexJSONBlockKeyword string `json:"iskeyregex_json_blockkeyword,omitempty"` + JSONBlockKeyword string `json:"jsonblockkeyword,omitempty"` + JSONBlockKeywordType string `json:"jsonblockkeywordtype,omitempty"` + JSONBlockKeywordURL string `json:"jsonblockkeywordurl,omitempty"` + KeyNameJSONBlockKeyword string `json:"keyname_json_blockkeyword,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWFieldType struct { + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoCharMaps bool `json:"nocharmaps,omitempty"` + Priority int `json:"priority,omitempty"` + Regex string `json:"regex,omitempty"` +} + +type AppFWLearningData struct { + ASScanLocationSQL string `json:"as_scan_location_sql,omitempty"` + ASScanLocationXSS string `json:"as_scan_location_xss,omitempty"` + ASValueExprSQL string `json:"as_value_expr_sql,omitempty"` + ASValueExprXSS string `json:"as_value_expr_xss,omitempty"` + ASValueTypeSQL string `json:"as_value_type_sql,omitempty"` + ASValueTypeXSS string `json:"as_value_type_xss,omitempty"` + ContentType string `json:"contenttype,omitempty"` + CookieConsistency string `json:"cookieconsistency,omitempty"` + Count float64 `json:"__count,omitempty"` + CreditCardNumber string `json:"creditcardnumber,omitempty"` + CreditCardNumberURL string `json:"creditcardnumberurl,omitempty"` + CrossSiteScripting string `json:"crosssitescripting,omitempty"` + CSRFFormOriginURL string `json:"csrfformoriginurl,omitempty"` + CSRFTag string `json:"csrftag,omitempty"` + Data string `json:"data,omitempty"` + FieldConsistency string `json:"fieldconsistency,omitempty"` + FieldFormat string `json:"fieldformat,omitempty"` + FieldFormatCharMapPCRE string `json:"fieldformatcharmappcre,omitempty"` + FieldFormatMaxLength int `json:"fieldformatmaxlength,omitempty"` + FieldFormatMinLength int `json:"fieldformatminlength,omitempty"` + FieldType string `json:"fieldtype,omitempty"` + FormActionURLFF string `json:"formactionurl_ff,omitempty"` + FormActionURLFFC string `json:"formactionurl_ffc,omitempty"` + FormActionURLSQL string `json:"formactionurl_sql,omitempty"` + FormActionURLXSS string `json:"formactionurl_xss,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` + SecurityCheck string `json:"securitycheck,omitempty"` + SQLInjection string `json:"sqlinjection,omitempty"` + StartURL string `json:"starturl,omitempty"` + Target string `json:"target,omitempty"` + TotalXMLRequests bool `json:"totalxmlrequests,omitempty"` + URL string `json:"url,omitempty"` + Value string `json:"value,omitempty"` + ValueType string `json:"value_type,omitempty"` + XMLAttachmentCheck string `json:"xmlattachmentcheck,omitempty"` + XMLDOSCheck string `json:"xmldoscheck,omitempty"` + XMLWSICheck string `json:"xmlwsicheck,omitempty"` +} + +type AppFWPolicyLabelAppFWPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Invoke bool `json:"invoke,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProfileXMLSQLInjectionBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASScanLocationXMLSQL string `json:"as_scan_location_xmlsql,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexXMLSQL string `json:"isregex_xmlsql,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLSQLInjection string `json:"xmlsqlinjection,omitempty"` +} + +type AppFWGRPCWebJSONContentType struct { + Count float64 `json:"__count,omitempty"` + GRPCWebJSONContentTypeValue string `json:"grpcwebjsoncontenttypevalue,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type AppFWProfileTrustedLearningClientsBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + TrustedLearningClients string `json:"trustedlearningclients,omitempty"` +} + +type AppFWProfileCreditCardNumberBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + CreditCardNumber string `json:"creditcardnumber,omitempty"` + CreditCardNumberURL string `json:"creditcardnumberurl,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileExcludeRESContentTypeBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + ExcludeRESContentType string `json:"excluderescontenttype,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWJSONContentType struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + IsRegex string `json:"isregex,omitempty"` + JSONContentTypeValue string `json:"jsoncontenttypevalue,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type AppFWProfileSQLInjectionBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASScanLocationSQL string `json:"as_scan_location_sql,omitempty"` + ASValueExprSQL string `json:"as_value_expr_sql,omitempty"` + ASValueTypeSQL string `json:"as_value_type_sql,omitempty"` + Comment string `json:"comment,omitempty"` + FormActionURLSQL string `json:"formactionurl_sql,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexSQL string `json:"isregex_sql,omitempty"` + IsValueRegexSQL string `json:"isvalueregex_sql,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + SQLInjection string `json:"sqlinjection,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileRESTValidationBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RESTValidationAction string `json:"rest_validation_action,omitempty"` + RESTValidation string `json:"restvalidation,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWGRPCContentType struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + GRPCContentTypeValue string `json:"grpccontenttypevalue,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type AppFWProfileBypassListBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASBypassList string `json:"as_bypass_list,omitempty"` + ASBypassListAction string `json:"as_bypass_list_action,omitempty"` + ASBypassListLocation string `json:"as_bypass_list_location,omitempty"` + ASBypassListValueType string `json:"as_bypass_list_value_type,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWHTMLErrorPage struct { + Comment string `json:"comment,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + Response string `json:"response,omitempty"` + Src string `json:"src,omitempty"` +} + +type AppFWProfileSafeObjectBinding struct { + Action []string `json:"action,omitempty"` + AlertOnly string `json:"alertonly,omitempty"` + ASExpression string `json:"as_expression,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + MaxMatchLength int `json:"maxmatchlength,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + SafeObject string `json:"safeobject,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileGRPCValidationBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + GRPCRelaxValidationAction string `json:"grpc_relax_validation_action,omitempty"` + GRPCValidation string `json:"grpcvalidation,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileXMLWSIURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLWSIChecks string `json:"xmlwsichecks,omitempty"` + XMLWSIURL string `json:"xmlwsiurl,omitempty"` +} + +type AppFWPolicyAppFWGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` +} + +type AppFWProfileDenyListBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASDenyList string `json:"as_deny_list,omitempty"` + ASDenyListAction []string `json:"as_deny_list_action,omitempty"` + ASDenyListLocation string `json:"as_deny_list_location,omitempty"` + ASDenyListValueType string `json:"as_deny_list_value_type,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWPolicyLabelBinding struct { + AppFWPolicyLabelAppFWPolicyBinding []interface{} `json:"appfwpolicylabel_appfwpolicy_binding,omitempty"` + AppFWPolicyLabelPolicyBindingBinding []interface{} `json:"appfwpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` +} + +type AppFWProfile struct { + AddCookieFlags string `json:"addcookieflags,omitempty"` + APISpec string `json:"apispec,omitempty"` + ArchiveName string `json:"archivename,omitempty"` + ASProfBypassListEnable string `json:"as_prof_bypass_list_enable,omitempty"` + ASProfDenyListEnable string `json:"as_prof_deny_list_enable,omitempty"` + Augment bool `json:"augment,omitempty"` + BlockKeywordAction []string `json:"blockkeywordaction,omitempty"` + BufferOverflowAction []string `json:"bufferoverflowaction,omitempty"` + BufferOverflowMaxCookieLength int `json:"bufferoverflowmaxcookielength,omitempty"` + BufferOverflowMaxHeaderLength int `json:"bufferoverflowmaxheaderlength,omitempty"` + BufferOverflowMaxQueryLength int `json:"bufferoverflowmaxquerylength,omitempty"` + BufferOverflowMaxTotalHeaderLength int `json:"bufferoverflowmaxtotalheaderlength,omitempty"` + BufferOverflowMaxURLLength int `json:"bufferoverflowmaxurllength,omitempty"` + Builtin bool `json:"builtin,omitempty"` + CanonicalizeHTMLResponse string `json:"canonicalizehtmlresponse,omitempty"` + CEFLogging string `json:"ceflogging,omitempty"` + CheckRequestHeaders string `json:"checkrequestheaders,omitempty"` + ClientIPExpression string `json:"clientipexpression,omitempty"` + CMDInjectionAction []string `json:"cmdinjectionaction,omitempty"` + CMDInjectionGrammar string `json:"cmdinjectiongrammar,omitempty"` + CMDInjectionType string `json:"cmdinjectiontype,omitempty"` + Comment string `json:"comment,omitempty"` + ContentTypeAction []string `json:"contenttypeaction,omitempty"` + CookieConsistencyAction []string `json:"cookieconsistencyaction,omitempty"` + CookieEncryption string `json:"cookieencryption,omitempty"` + CookieHijackingAction []string `json:"cookiehijackingaction,omitempty"` + CookieProxying string `json:"cookieproxying,omitempty"` + CookieSameSiteAttribute string `json:"cookiesamesiteattribute,omitempty"` + CookieTransforms string `json:"cookietransforms,omitempty"` + Count float64 `json:"__count,omitempty"` + CreditCard []string `json:"creditcard,omitempty"` + CreditCardAction []string `json:"creditcardaction,omitempty"` + CreditCardMaxAllowed int `json:"creditcardmaxallowed,omitempty"` + CreditCardXOut string `json:"creditcardxout,omitempty"` + CrossSiteScriptingAction []string `json:"crosssitescriptingaction,omitempty"` + CrossSiteScriptingCheckCompleteURLs string `json:"crosssitescriptingcheckcompleteurls,omitempty"` + CrossSiteScriptingTransformUnsafeHTML string `json:"crosssitescriptingtransformunsafehtml,omitempty"` + CSRFTag string `json:"csrftag,omitempty"` + CSRFTagAction []string `json:"csrftagaction,omitempty"` + CustomSettings string `json:"customsettings,omitempty"` + DefaultCharset string `json:"defaultcharset,omitempty"` + DefaultFieldFormatMaxLength int `json:"defaultfieldformatmaxlength,omitempty"` + DefaultFieldFormatMaxOccurrences int `json:"defaultfieldformatmaxoccurrences,omitempty"` + DefaultFieldFormatMinLength int `json:"defaultfieldformatminlength,omitempty"` + DefaultFieldFormatType string `json:"defaultfieldformattype,omitempty"` + Defaults string `json:"defaults,omitempty"` + DenyURLAction []string `json:"denyurlaction,omitempty"` + DoSecureCreditCardLogging string `json:"dosecurecreditcardlogging,omitempty"` + DynamicLearning []string `json:"dynamiclearning,omitempty"` + EnableFormTagging string `json:"enableformtagging,omitempty"` + ErrorURL string `json:"errorurl,omitempty"` + ExcludeFileUploadFromChecks string `json:"excludefileuploadfromchecks,omitempty"` + ExemptClosureURLsFromSecurityChecks string `json:"exemptclosureurlsfromsecuritychecks,omitempty"` + FakeAccountDetection string `json:"fakeaccountdetection,omitempty"` + FieldConsistencyAction []string `json:"fieldconsistencyaction,omitempty"` + FieldFormatAction []string `json:"fieldformataction,omitempty"` + FieldScan string `json:"fieldscan,omitempty"` + FieldScanLimit int `json:"fieldscanlimit,omitempty"` + FileUploadMaxNum int `json:"fileuploadmaxnum,omitempty"` + FileUploadTypesAction []string `json:"fileuploadtypesaction,omitempty"` + GeoLocationLogging string `json:"geolocationlogging,omitempty"` + GRPCAction []string `json:"grpcaction,omitempty"` + HTMLErrorObject string `json:"htmlerrorobject,omitempty"` + HTMLErrorStatusCode int `json:"htmlerrorstatuscode,omitempty"` + HTMLErrorStatusMessage string `json:"htmlerrorstatusmessage,omitempty"` + ImportProfileName string `json:"importprofilename,omitempty"` + InferContentTypeXMLPayloadAction []string `json:"infercontenttypexmlpayloadaction,omitempty"` + InsertCookieSameSiteAttribute string `json:"insertcookiesamesiteattribute,omitempty"` + InspectContentTypes []string `json:"inspectcontenttypes,omitempty"` + InspectQueryContentTypes []string `json:"inspectquerycontenttypes,omitempty"` + InvalidPercentHandling string `json:"invalidpercenthandling,omitempty"` + JSONBlockKeywordAction []string `json:"jsonblockkeywordaction,omitempty"` + JSONCMDInjectionAction []string `json:"jsoncmdinjectionaction,omitempty"` + JSONCMDInjectionGrammar string `json:"jsoncmdinjectiongrammar,omitempty"` + JSONCMDInjectionType string `json:"jsoncmdinjectiontype,omitempty"` + JSONDOSAction []string `json:"jsondosaction,omitempty"` + JSONErrorObject string `json:"jsonerrorobject,omitempty"` + JSONErrorStatusCode int `json:"jsonerrorstatuscode,omitempty"` + JSONErrorStatusMessage string `json:"jsonerrorstatusmessage,omitempty"` + JSONFieldScan string `json:"jsonfieldscan,omitempty"` + JSONFieldScanLimit int `json:"jsonfieldscanlimit,omitempty"` + JSONMessageScan string `json:"jsonmessagescan,omitempty"` + JSONMessageScanLimit int `json:"jsonmessagescanlimit,omitempty"` + JSONSQLInjectionAction []string `json:"jsonsqlinjectionaction,omitempty"` + JSONSQLInjectionGrammar string `json:"jsonsqlinjectiongrammar,omitempty"` + JSONSQLInjectionType string `json:"jsonsqlinjectiontype,omitempty"` + JSONXSSAction []string `json:"jsonxssaction,omitempty"` + Learning string `json:"learning,omitempty"` + LogEveryPolicyHit string `json:"logeverypolicyhit,omitempty"` + MatchURLString string `json:"matchurlstring,omitempty"` + MessageScan string `json:"messagescan,omitempty"` + MessageScanLimit int `json:"messagescanlimit,omitempty"` + MessageScanLimitContentTypes []string `json:"messagescanlimitcontenttypes,omitempty"` + MultipleHeaderAction []string `json:"multipleheaderaction,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OptimizePartialReqs string `json:"optimizepartialreqs,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + PercentDecodeRecursively string `json:"percentdecoderecursively,omitempty"` + PostBodyLimit int `json:"postbodylimit,omitempty"` + PostBodyLimitAction []string `json:"postbodylimitaction,omitempty"` + PostBodyLimitSignature int `json:"postbodylimitsignature,omitempty"` + ProtoFileObject string `json:"protofileobject,omitempty"` + RefererHeaderCheck string `json:"refererheadercheck,omitempty"` + RelaxationRules bool `json:"relaxationrules,omitempty"` + ReplaceURLString string `json:"replaceurlstring,omitempty"` + RequestContentType string `json:"requestcontenttype,omitempty"` + ResponseContentType string `json:"responsecontenttype,omitempty"` + RESTAction []string `json:"restaction,omitempty"` + RFCProfile string `json:"rfcprofile,omitempty"` + SemicolonFieldSeparator string `json:"semicolonfieldseparator,omitempty"` + SessionCookieName string `json:"sessioncookiename,omitempty"` + SessionlessFieldConsistency string `json:"sessionlessfieldconsistency,omitempty"` + SessionlessURLClosure string `json:"sessionlessurlclosure,omitempty"` + Signatures string `json:"signatures,omitempty"` + SQLInjectionAction []string `json:"sqlinjectionaction,omitempty"` + SQLInjectionCheckSQLWildChars string `json:"sqlinjectionchecksqlwildchars,omitempty"` + SQLInjectionGrammar string `json:"sqlinjectiongrammar,omitempty"` + SQLInjectionOnlyCheckFieldsWithSQLChars string `json:"sqlinjectiononlycheckfieldswithsqlchars,omitempty"` + SQLInjectionParseComments string `json:"sqlinjectionparsecomments,omitempty"` + SQLInjectionRuleType string `json:"sqlinjectionruletype,omitempty"` + SQLInjectionTransformSpecialChars string `json:"sqlinjectiontransformspecialchars,omitempty"` + SQLInjectionType string `json:"sqlinjectiontype,omitempty"` + StartURLAction []string `json:"starturlaction,omitempty"` + StartURLClosure string `json:"starturlclosure,omitempty"` + State string `json:"state,omitempty"` + Streaming string `json:"streaming,omitempty"` + StripComments string `json:"stripcomments,omitempty"` + StripHTMLComments string `json:"striphtmlcomments,omitempty"` + StripXMLComments string `json:"stripxmlcomments,omitempty"` + Trace string `json:"trace,omitempty"` + TypeField []string `json:"type,omitempty"` + URLDecodeRequestCookies string `json:"urldecoderequestcookies,omitempty"` + UseHTMLErrorObject string `json:"usehtmlerrorobject,omitempty"` + VerboseLogLevel string `json:"verboseloglevel,omitempty"` + XMLAttachmentAction []string `json:"xmlattachmentaction,omitempty"` + XMLDOSAction []string `json:"xmldosaction,omitempty"` + XMLErrorObject string `json:"xmlerrorobject,omitempty"` + XMLErrorStatusCode int `json:"xmlerrorstatuscode,omitempty"` + XMLErrorStatusMessage string `json:"xmlerrorstatusmessage,omitempty"` + XMLFormatAction []string `json:"xmlformataction,omitempty"` + XMLSOAPFaultAction []string `json:"xmlsoapfaultaction,omitempty"` + XMLSQLInjectionAction []string `json:"xmlsqlinjectionaction,omitempty"` + XMLSQLInjectionCheckSQLWildChars string `json:"xmlsqlinjectionchecksqlwildchars,omitempty"` + XMLSQLInjectionOnlyCheckFieldsWithSQLChars string `json:"xmlsqlinjectiononlycheckfieldswithsqlchars,omitempty"` + XMLSQLInjectionParseComments string `json:"xmlsqlinjectionparsecomments,omitempty"` + XMLSQLInjectionType string `json:"xmlsqlinjectiontype,omitempty"` + XMLValidationAction []string `json:"xmlvalidationaction,omitempty"` + XMLWSIAction []string `json:"xmlwsiaction,omitempty"` + XMLXSSAction []string `json:"xmlxssaction,omitempty"` +} + +type AppFWXMLContentType struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + IsRegex string `json:"isregex,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + XMLContentTypeValue string `json:"xmlcontenttypevalue,omitempty"` +} + +type AppFWMultipartFormContentType struct { + Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + IsRegex string `json:"isregex,omitempty"` + MultipartFormContentTypeValue string `json:"multipartformcontenttypevalue,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type AppFWLearningSettings struct { + ContentTypeAutoDeployGracePeriod int `json:"contenttypeautodeploygraceperiod,omitempty"` + ContentTypeMinThreshold int `json:"contenttypeminthreshold,omitempty"` + ContentTypePercentThreshold int `json:"contenttypepercentthreshold,omitempty"` + CookieConsistencyAutoDeployGracePeriod int `json:"cookieconsistencyautodeploygraceperiod,omitempty"` + CookieConsistencyMinThreshold int `json:"cookieconsistencyminthreshold,omitempty"` + CookieConsistencyPercentThreshold int `json:"cookieconsistencypercentthreshold,omitempty"` + Count float64 `json:"__count,omitempty"` + CreditCardNumberMinThreshold int `json:"creditcardnumberminthreshold,omitempty"` + CreditCardNumberPercentThreshold int `json:"creditcardnumberpercentthreshold,omitempty"` + CrossSiteScriptingAutoDeployGracePeriod int `json:"crosssitescriptingautodeploygraceperiod,omitempty"` + CrossSiteScriptingMinThreshold int `json:"crosssitescriptingminthreshold,omitempty"` + CrossSiteScriptingPercentThreshold int `json:"crosssitescriptingpercentthreshold,omitempty"` + CSRFTagAutoDeployGracePeriod int `json:"csrftagautodeploygraceperiod,omitempty"` + CSRFTagMinThreshold int `json:"csrftagminthreshold,omitempty"` + CSRFTagPercentThreshold int `json:"csrftagpercentthreshold,omitempty"` + FieldConsistencyAutoDeployGracePeriod int `json:"fieldconsistencyautodeploygraceperiod,omitempty"` + FieldConsistencyMinThreshold int `json:"fieldconsistencyminthreshold,omitempty"` + FieldConsistencyPercentThreshold int `json:"fieldconsistencypercentthreshold,omitempty"` + FieldFormatAutoDeployGracePeriod int `json:"fieldformatautodeploygraceperiod,omitempty"` + FieldFormatMinThreshold int `json:"fieldformatminthreshold,omitempty"` + FieldFormatPercentThreshold int `json:"fieldformatpercentthreshold,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` + SQLInjectionAutoDeployGracePeriod int `json:"sqlinjectionautodeploygraceperiod,omitempty"` + SQLInjectionMinThreshold int `json:"sqlinjectionminthreshold,omitempty"` + SQLInjectionPercentThreshold int `json:"sqlinjectionpercentthreshold,omitempty"` + StartURLAutoDeployGracePeriod int `json:"starturlautodeploygraceperiod,omitempty"` + StartURLMinThreshold int `json:"starturlminthreshold,omitempty"` + StartURLPercentThreshold int `json:"starturlpercentthreshold,omitempty"` + XMLAttachmentMinThreshold int `json:"xmlattachmentminthreshold,omitempty"` + XMLAttachmentPercentThreshold int `json:"xmlattachmentpercentthreshold,omitempty"` + XMLWSIMinThreshold int `json:"xmlwsiminthreshold,omitempty"` + XMLWSIPercentThreshold int `json:"xmlwsipercentthreshold,omitempty"` +} + +type AppFWProfileXMLXSSBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASScanLocationXMLXSS string `json:"as_scan_location_xmlxss,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsRegexXMLXSS string `json:"isregex_xmlxss,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` + XMLXSS string `json:"xmlxss,omitempty"` +} + +type AppFWProfileContentTypeBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + Comment string `json:"comment,omitempty"` + ContentType string `json:"contenttype,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWProfileJSONSQLURLBinding struct { + AlertOnly string `json:"alertonly,omitempty"` + ASValueExprJSONSQL string `json:"as_value_expr_json_sql,omitempty"` + ASValueTypeJSONSQL string `json:"as_value_type_json_sql,omitempty"` + Comment string `json:"comment,omitempty"` + IsAutoDeployed string `json:"isautodeployed,omitempty"` + IsKeyRegexJSONSQL string `json:"iskeyregex_json_sql,omitempty"` + IsValueRegexJSONSQL string `json:"isvalueregex_json_sql,omitempty"` + JSONSQLURL string `json:"jsonsqlurl,omitempty"` + KeyNameJSONSQL string `json:"keyname_json_sql,omitempty"` + Name string `json:"name,omitempty"` + ResourceID string `json:"resourceid,omitempty"` + RuleType string `json:"ruletype,omitempty"` + State string `json:"state,omitempty"` +} + +type AppFWCustomSettings struct { + Name string `json:"name,omitempty"` Target string `json:"target,omitempty"` } diff --git a/nitrogo/models/appqoe.go b/nitrogo/models/appqoe.go index 6682277..e1b9477 100644 --- a/nitrogo/models/appqoe.go +++ b/nitrogo/models/appqoe.go @@ -1,61 +1,61 @@ package models // appqoe configuration structs -type Appqoecustomresp struct { +type AppQOECustomResp struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` } -type AppqoepolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Bindpriority int `json:"bindpriority,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AppQOEPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BindPriority int `json:"bindpriority,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` } -type Appqoeparameter struct { - Avgwaitingclient int `json:"avgwaitingclient,omitempty"` - Dosattackthresh int `json:"dosattackthresh,omitempty"` - Maxaltrespbandwidth int `json:"maxaltrespbandwidth,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sessionlife int `json:"sessionlife,omitempty"` +type AppQOEParameter struct { + AvgWaitingClient int `json:"avgwaitingclient,omitempty"` + DosAttackThresh int `json:"dosattackthresh,omitempty"` + MaxAltRespBandwidth int `json:"maxaltrespbandwidth,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SessionLife int `json:"sessionlife,omitempty"` } -type Appqoeaction struct { - Altcontentpath string `json:"altcontentpath,omitempty"` - Altcontentsvcname string `json:"altcontentsvcname,omitempty"` +type AppQOEAction struct { + AltContentPath string `json:"altcontentpath,omitempty"` + AltContentSvcName string `json:"altcontentsvcname,omitempty"` Count float64 `json:"__count,omitempty"` - Customfile string `json:"customfile,omitempty"` + CustomFile string `json:"customfile,omitempty"` Delay int `json:"delay,omitempty"` - Dosaction string `json:"dosaction,omitempty"` - Dostrigexpression string `json:"dostrigexpression,omitempty"` + DosAction string `json:"dosaction,omitempty"` + DosTrigExpression string `json:"dostrigexpression,omitempty"` Hits int `json:"hits,omitempty"` - Maxconn int `json:"maxconn,omitempty"` + MaxConn int `json:"maxconn,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numretries int `json:"numretries,omitempty"` - Polqdepth int `json:"polqdepth,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumRetries int `json:"numretries,omitempty"` + PolQDepth int `json:"polqdepth,omitempty"` Priority string `json:"priority,omitempty"` - Priqdepth int `json:"priqdepth,omitempty"` - Respondwith string `json:"respondwith,omitempty"` - Retryonreset string `json:"retryonreset,omitempty"` - Retryontimeout int `json:"retryontimeout,omitempty"` - Tcpprofile string `json:"tcpprofile,omitempty"` + PriQDepth int `json:"priqdepth,omitempty"` + RespondWith string `json:"respondwith,omitempty"` + RetryOnReset string `json:"retryonreset,omitempty"` + RetryOnTimeout int `json:"retryontimeout,omitempty"` + TCPProfile string `json:"tcpprofile,omitempty"` } -type AppqoepolicyBinding struct { - AppqoepolicyLbvserverBinding []interface{} `json:"appqoepolicy_lbvserver_binding,omitempty"` +type AppQOEPolicyBinding struct { + AppQOEPolicyLBVServerBinding []interface{} `json:"appqoepolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Appqoepolicy struct { +type AppQOEPolicy struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } diff --git a/nitrogo/models/audit.go b/nitrogo/models/audit.go index d9f2bdb..4d731c6 100644 --- a/nitrogo/models/audit.go +++ b/nitrogo/models/audit.go @@ -1,373 +1,373 @@ package models // audit configuration structs -type Auditsyslogaction struct { - Acl string `json:"acl,omitempty"` - Alg string `json:"alg,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` +type AuditSyslogAction struct { + ACL string `json:"acl,omitempty"` + ALG string `json:"alg,omitempty"` + AppFlowExport string `json:"appflowexport,omitempty"` Builtin []string `json:"builtin,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + ContentInspectionLog string `json:"contentinspectionlog,omitempty"` Count float64 `json:"__count,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Dns string `json:"dns,omitempty"` - Domainresolvenow bool `json:"domainresolvenow,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` + DateFormat string `json:"dateformat,omitempty"` + DNS string `json:"dns,omitempty"` + DomainResolveNow bool `json:"domainresolvenow,omitempty"` + DomainResolveRetry int `json:"domainresolveretry,omitempty"` Feature string `json:"feature,omitempty"` - Httpauthtoken string `json:"httpauthtoken,omitempty"` - Httpendpointurl string `json:"httpendpointurl,omitempty"` - Ip string `json:"ip,omitempty"` - Lbvservername string `json:"lbvservername,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Lsn string `json:"lsn,omitempty"` - Managementlog []string `json:"managementlog,omitempty"` - Maxlogdatasizetohold int `json:"maxlogdatasizetohold,omitempty"` - Mgmtloglevel []string `json:"mgmtloglevel,omitempty"` + HTTPAuthToken string `json:"httpauthtoken,omitempty"` + HTTPEndpointURL string `json:"httpendpointurl,omitempty"` + IP string `json:"ip,omitempty"` + LBVServerName string `json:"lbvservername,omitempty"` + LogFacility string `json:"logfacility,omitempty"` + LogLevel []string `json:"loglevel,omitempty"` + LSN string `json:"lsn,omitempty"` + ManagementLog []string `json:"managementlog,omitempty"` + MaxLogDataSizeToHold int `json:"maxlogdatasizetohold,omitempty"` + MgmtLogLevel []string `json:"mgmtloglevel,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Serverdomainname string `json:"serverdomainname,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Streamanalytics string `json:"streamanalytics,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Syslogcompliance string `json:"syslogcompliance,omitempty"` - Tcp string `json:"tcp,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Timezone string `json:"timezone,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProtocolViolations string `json:"protocolviolations,omitempty"` + ServerDomainName string `json:"serverdomainname,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSLInterception string `json:"sslinterception,omitempty"` + StreamAnalytics string `json:"streamanalytics,omitempty"` + SubscriberLog string `json:"subscriberlog,omitempty"` + SyslogCompliance string `json:"syslogcompliance,omitempty"` + TCP string `json:"tcp,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TimeZone string `json:"timezone,omitempty"` Transport string `json:"transport,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` + URLFiltering string `json:"urlfiltering,omitempty"` + UserDefinedAuditLog string `json:"userdefinedauditlog,omitempty"` } -type Auditsyslogparams struct { - Acl string `json:"acl,omitempty"` - Alg string `json:"alg,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` +type AuditSyslogParams struct { + ACL string `json:"acl,omitempty"` + ALG string `json:"alg,omitempty"` + AppFlowExport string `json:"appflowexport,omitempty"` Builtin []string `json:"builtin,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Dns string `json:"dns,omitempty"` + ContentInspectionLog string `json:"contentinspectionlog,omitempty"` + DateFormat string `json:"dateformat,omitempty"` + DNS string `json:"dns,omitempty"` Feature string `json:"feature,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Lsn string `json:"lsn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Streamanalytics string `json:"streamanalytics,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Tcp string `json:"tcp,omitempty"` - Timezone string `json:"timezone,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` -} - -type AuditsyslogpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + LogFacility string `json:"logfacility,omitempty"` + LogLevel []string `json:"loglevel,omitempty"` + LSN string `json:"lsn,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProtocolViolations string `json:"protocolviolations,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSLInterception string `json:"sslinterception,omitempty"` + StreamAnalytics string `json:"streamanalytics,omitempty"` + SubscriberLog string `json:"subscriberlog,omitempty"` + TCP string `json:"tcp,omitempty"` + TimeZone string `json:"timezone,omitempty"` + URLFiltering string `json:"urlfiltering,omitempty"` + UserDefinedAuditLog string `json:"userdefinedauditlog,omitempty"` +} + +type AuditSyslogPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyAuditnslogglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyAuditNSLogGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyRnatglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyRNATGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyTmglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyTMGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Auditnslogaction struct { - Acl string `json:"acl,omitempty"` - Alg string `json:"alg,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` +type AuditNSLogAction struct { + ACL string `json:"acl,omitempty"` + ALG string `json:"alg,omitempty"` + AppFlowExport string `json:"appflowexport,omitempty"` Builtin []string `json:"builtin,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` + ContentInspectionLog string `json:"contentinspectionlog,omitempty"` Count float64 `json:"__count,omitempty"` - Dateformat string `json:"dateformat,omitempty"` - Domainresolvenow bool `json:"domainresolvenow,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` + DateFormat string `json:"dateformat,omitempty"` + DomainResolveNow bool `json:"domainresolvenow,omitempty"` + DomainResolveRetry int `json:"domainresolveretry,omitempty"` Feature string `json:"feature,omitempty"` - Ip string `json:"ip,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Lsn string `json:"lsn,omitempty"` + IP string `json:"ip,omitempty"` + LogFacility string `json:"logfacility,omitempty"` + LogLevel []string `json:"loglevel,omitempty"` + LSN string `json:"lsn,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Serverdomainname string `json:"serverdomainname,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Tcp string `json:"tcp,omitempty"` - Timezone string `json:"timezone,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` -} - -type Auditsyslogpolicy struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProtocolViolations string `json:"protocolviolations,omitempty"` + ServerDomainName string `json:"serverdomainname,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSLInterception string `json:"sslinterception,omitempty"` + SubscriberLog string `json:"subscriberlog,omitempty"` + TCP string `json:"tcp,omitempty"` + TimeZone string `json:"timezone,omitempty"` + URLFiltering string `json:"urlfiltering,omitempty"` + UserDefinedAuditLog string `json:"userdefinedauditlog,omitempty"` +} + +type AuditSyslogPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type Auditmessageaction struct { - Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` +type AuditMessageAction struct { + BypassSafetyCheck string `json:"bypasssafetycheck,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` - Loglevel string `json:"loglevel,omitempty"` - Loglevel1 string `json:"loglevel1,omitempty"` - Logtonewnslog string `json:"logtonewnslog,omitempty"` + LogLevel string `json:"loglevel,omitempty"` + LogLevel1 string `json:"loglevel1,omitempty"` + LogToNewNSLog string `json:"logtonewnslog,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + StringBuilderExpr string `json:"stringbuilderexpr,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type AuditsyslogpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Auditmessages struct { +type AuditMessages struct { Count float64 `json:"__count,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numofmesgs int `json:"numofmesgs,omitempty"` + LogLevel []string `json:"loglevel,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumOfMesgs int `json:"numofmesgs,omitempty"` Value string `json:"value,omitempty"` } -type Auditnslogpolicy struct { +type AuditNSLogPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type AuditnslogglobalAuditnslogpolicyBinding struct { +type AuditNSLogGlobalAuditNSLogPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyAppfwglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyAppFWGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyTmglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyTMGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyBinding struct { - AuditnslogpolicyAaagroupBinding []interface{} `json:"auditnslogpolicy_aaagroup_binding,omitempty"` - AuditnslogpolicyAaauserBinding []interface{} `json:"auditnslogpolicy_aaauser_binding,omitempty"` - AuditnslogpolicyAppfwglobalBinding []interface{} `json:"auditnslogpolicy_appfwglobal_binding,omitempty"` - AuditnslogpolicyAuditnslogglobalBinding []interface{} `json:"auditnslogpolicy_auditnslogglobal_binding,omitempty"` - AuditnslogpolicyAuthenticationvserverBinding []interface{} `json:"auditnslogpolicy_authenticationvserver_binding,omitempty"` - AuditnslogpolicyCsvserverBinding []interface{} `json:"auditnslogpolicy_csvserver_binding,omitempty"` - AuditnslogpolicyLbvserverBinding []interface{} `json:"auditnslogpolicy_lbvserver_binding,omitempty"` - AuditnslogpolicySystemglobalBinding []interface{} `json:"auditnslogpolicy_systemglobal_binding,omitempty"` - AuditnslogpolicyTmglobalBinding []interface{} `json:"auditnslogpolicy_tmglobal_binding,omitempty"` - AuditnslogpolicyVpnglobalBinding []interface{} `json:"auditnslogpolicy_vpnglobal_binding,omitempty"` - AuditnslogpolicyVpnvserverBinding []interface{} `json:"auditnslogpolicy_vpnvserver_binding,omitempty"` +type AuditNSLogPolicyBinding struct { + AuditNSLogPolicyAAAGroupBinding []interface{} `json:"auditnslogpolicy_aaagroup_binding,omitempty"` + AuditNSLogPolicyAAAUserBinding []interface{} `json:"auditnslogpolicy_aaauser_binding,omitempty"` + AuditNSLogPolicyAppFWGlobalBinding []interface{} `json:"auditnslogpolicy_appfwglobal_binding,omitempty"` + AuditNSLogPolicyAuditNSLogGlobalBinding []interface{} `json:"auditnslogpolicy_auditnslogglobal_binding,omitempty"` + AuditNSLogPolicyAuthenticationVServerBinding []interface{} `json:"auditnslogpolicy_authenticationvserver_binding,omitempty"` + AuditNSLogPolicyCSVServerBinding []interface{} `json:"auditnslogpolicy_csvserver_binding,omitempty"` + AuditNSLogPolicyLBVServerBinding []interface{} `json:"auditnslogpolicy_lbvserver_binding,omitempty"` + AuditNSLogPolicySystemGlobalBinding []interface{} `json:"auditnslogpolicy_systemglobal_binding,omitempty"` + AuditNSLogPolicyTMGlobalBinding []interface{} `json:"auditnslogpolicy_tmglobal_binding,omitempty"` + AuditNSLogPolicyVPNGlobalBinding []interface{} `json:"auditnslogpolicy_vpnglobal_binding,omitempty"` + AuditNSLogPolicyVPNVServerBinding []interface{} `json:"auditnslogpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuditsyslogpolicyBinding struct { - AuditsyslogpolicyAaagroupBinding []interface{} `json:"auditsyslogpolicy_aaagroup_binding,omitempty"` - AuditsyslogpolicyAaauserBinding []interface{} `json:"auditsyslogpolicy_aaauser_binding,omitempty"` - AuditsyslogpolicyAuditsyslogglobalBinding []interface{} `json:"auditsyslogpolicy_auditsyslogglobal_binding,omitempty"` - AuditsyslogpolicyAuthenticationvserverBinding []interface{} `json:"auditsyslogpolicy_authenticationvserver_binding,omitempty"` - AuditsyslogpolicyCsvserverBinding []interface{} `json:"auditsyslogpolicy_csvserver_binding,omitempty"` - AuditsyslogpolicyLbvserverBinding []interface{} `json:"auditsyslogpolicy_lbvserver_binding,omitempty"` - AuditsyslogpolicyRnatglobalBinding []interface{} `json:"auditsyslogpolicy_rnatglobal_binding,omitempty"` - AuditsyslogpolicySystemglobalBinding []interface{} `json:"auditsyslogpolicy_systemglobal_binding,omitempty"` - AuditsyslogpolicyTmglobalBinding []interface{} `json:"auditsyslogpolicy_tmglobal_binding,omitempty"` - AuditsyslogpolicyVpnglobalBinding []interface{} `json:"auditsyslogpolicy_vpnglobal_binding,omitempty"` - AuditsyslogpolicyVpnvserverBinding []interface{} `json:"auditsyslogpolicy_vpnvserver_binding,omitempty"` +type AuditSyslogPolicyBinding struct { + AuditSyslogPolicyAAAGroupBinding []interface{} `json:"auditsyslogpolicy_aaagroup_binding,omitempty"` + AuditSyslogPolicyAAAUserBinding []interface{} `json:"auditsyslogpolicy_aaauser_binding,omitempty"` + AuditSyslogPolicyAuditSyslogGlobalBinding []interface{} `json:"auditsyslogpolicy_auditsyslogglobal_binding,omitempty"` + AuditSyslogPolicyAuthenticationVServerBinding []interface{} `json:"auditsyslogpolicy_authenticationvserver_binding,omitempty"` + AuditSyslogPolicyCSVServerBinding []interface{} `json:"auditsyslogpolicy_csvserver_binding,omitempty"` + AuditSyslogPolicyLBVServerBinding []interface{} `json:"auditsyslogpolicy_lbvserver_binding,omitempty"` + AuditSyslogPolicyRNATGlobalBinding []interface{} `json:"auditsyslogpolicy_rnatglobal_binding,omitempty"` + AuditSyslogPolicySystemGlobalBinding []interface{} `json:"auditsyslogpolicy_systemglobal_binding,omitempty"` + AuditSyslogPolicyTMGlobalBinding []interface{} `json:"auditsyslogpolicy_tmglobal_binding,omitempty"` + AuditSyslogPolicyVPNGlobalBinding []interface{} `json:"auditsyslogpolicy_vpnglobal_binding,omitempty"` + AuditSyslogPolicyVPNVServerBinding []interface{} `json:"auditsyslogpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuditsyslogglobalAuditsyslogpolicyBinding struct { +type AuditSyslogGlobalAuditSyslogPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogglobalBinding struct { - AuditsyslogglobalAuditsyslogpolicyBinding []interface{} `json:"auditsyslogglobal_auditsyslogpolicy_binding,omitempty"` +type AuditSyslogGlobalBinding struct { + AuditSyslogGlobalAuditSyslogPolicyBinding []interface{} `json:"auditsyslogglobal_auditsyslogpolicy_binding,omitempty"` } -type AuditsyslogpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditNSLogPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyAuditsyslogglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyAuditSyslogGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Auditnslogparams struct { - Acl string `json:"acl,omitempty"` - Alg string `json:"alg,omitempty"` - Appflowexport string `json:"appflowexport,omitempty"` +type AuditNSLogParams struct { + ACL string `json:"acl,omitempty"` + ALG string `json:"alg,omitempty"` + AppFlowExport string `json:"appflowexport,omitempty"` Builtin []string `json:"builtin,omitempty"` - Contentinspectionlog string `json:"contentinspectionlog,omitempty"` - Dateformat string `json:"dateformat,omitempty"` + ContentInspectionLog string `json:"contentinspectionlog,omitempty"` + DateFormat string `json:"dateformat,omitempty"` Feature string `json:"feature,omitempty"` - Logfacility string `json:"logfacility,omitempty"` - Loglevel []string `json:"loglevel,omitempty"` - Lsn string `json:"lsn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Protocolviolations string `json:"protocolviolations,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Subscriberlog string `json:"subscriberlog,omitempty"` - Tcp string `json:"tcp,omitempty"` - Timezone string `json:"timezone,omitempty"` - Urlfiltering string `json:"urlfiltering,omitempty"` - Userdefinedauditlog string `json:"userdefinedauditlog,omitempty"` -} - -type AuditnslogpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + LogFacility string `json:"logfacility,omitempty"` + LogLevel []string `json:"loglevel,omitempty"` + LSN string `json:"lsn,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProtocolViolations string `json:"protocolviolations,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSLInterception string `json:"sslinterception,omitempty"` + SubscriberLog string `json:"subscriberlog,omitempty"` + TCP string `json:"tcp,omitempty"` + TimeZone string `json:"timezone,omitempty"` + URLFiltering string `json:"urlfiltering,omitempty"` + UserDefinedAuditLog string `json:"userdefinedauditlog,omitempty"` +} + +type AuditNSLogPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditsyslogpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuditnslogglobalBinding struct { - AuditnslogglobalAuditnslogpolicyBinding []interface{} `json:"auditnslogglobal_auditnslogpolicy_binding,omitempty"` +type AuditNSLogGlobalBinding struct { + AuditNSLogGlobalAuditNSLogPolicyBinding []interface{} `json:"auditnslogglobal_auditnslogpolicy_binding,omitempty"` } -type AuditsyslogpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuditSyslogPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/authentication.go b/nitrogo/models/authentication.go index 42bb40f..2e0a5f0 100644 --- a/nitrogo/models/authentication.go +++ b/nitrogo/models/authentication.go @@ -1,370 +1,370 @@ package models // authentication configuration structs -type AuthenticationdfapolicyBinding struct { - AuthenticationdfapolicyVpnvserverBinding []interface{} `json:"authenticationdfapolicy_vpnvserver_binding,omitempty"` +type AuthenticationDFAPolicyBinding struct { + AuthenticationDFAPolicyVPNVServerBinding []interface{} `json:"authenticationdfapolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Authenticationwebauthpolicy struct { +type AuthenticationWebAuthPolicy struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationldappolicyBinding struct { - AuthenticationldappolicyAuthenticationvserverBinding []interface{} `json:"authenticationldappolicy_authenticationvserver_binding,omitempty"` - AuthenticationldappolicySystemglobalBinding []interface{} `json:"authenticationldappolicy_systemglobal_binding,omitempty"` - AuthenticationldappolicyVpnglobalBinding []interface{} `json:"authenticationldappolicy_vpnglobal_binding,omitempty"` - AuthenticationldappolicyVpnvserverBinding []interface{} `json:"authenticationldappolicy_vpnvserver_binding,omitempty"` +type AuthenticationLDAPPolicyBinding struct { + AuthenticationLDAPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationldappolicy_authenticationvserver_binding,omitempty"` + AuthenticationLDAPPolicySystemGlobalBinding []interface{} `json:"authenticationldappolicy_systemglobal_binding,omitempty"` + AuthenticationLDAPPolicyVPNGlobalBinding []interface{} `json:"authenticationldappolicy_vpnglobal_binding,omitempty"` + AuthenticationLDAPPolicyVPNVServerBinding []interface{} `json:"authenticationldappolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationwebauthpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationWebAuthPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationpolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AuthenticationPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationnegotiatepolicy struct { +type AuthenticationNegotiatePolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationcertpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationCertPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationldappolicy struct { +type AuthenticationLDAPPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type Authenticationsmartaccessprofile struct { +type AuthenticationSmartAccessProfile struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Tags string `json:"tags,omitempty"` } -type AuthenticationlocalpolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLocalPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationpushservice struct { - Certendpoint string `json:"certendpoint,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` +type AuthenticationPushService struct { + CertEndpoint string `json:"certendpoint,omitempty"` + ClientID string `json:"clientid,omitempty"` + ClientSecret string `json:"clientsecret,omitempty"` Count float64 `json:"__count,omitempty"` - Customerid string `json:"customerid,omitempty"` - Hubname string `json:"hubname,omitempty"` + CustomerID string `json:"customerid,omitempty"` + HubName string `json:"hubname,omitempty"` Name string `json:"name,omitempty"` Namespace string `json:"Namespace,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pushcloudserverstatus string `json:"pushcloudserverstatus,omitempty"` - Pushservicestatus string `json:"pushservicestatus,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Servicekey string `json:"servicekey,omitempty"` - Servicekeyname string `json:"servicekeyname,omitempty"` - Signingkey string `json:"signingkey,omitempty"` - Signingkeyname string `json:"signingkeyname,omitempty"` - Trustservice string `json:"trustservice,omitempty"` -} - -type Authenticationstorefrontauthaction struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PushCloudServerStatus string `json:"pushcloudserverstatus,omitempty"` + PushServiceStatus string `json:"pushservicestatus,omitempty"` + RefreshInterval int `json:"refreshinterval,omitempty"` + ServiceKey string `json:"servicekey,omitempty"` + ServiceKeyName string `json:"servicekeyname,omitempty"` + SigningKey string `json:"signingkey,omitempty"` + SigningKeyName string `json:"signingkeyname,omitempty"` + TrustService string `json:"trustservice,omitempty"` +} + +type AuthenticationStoreFrontAuthAction struct { Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Domain string `json:"domain,omitempty"` Failure int `json:"failure,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Serverurl string `json:"serverurl,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServerURL string `json:"serverurl,omitempty"` Success int `json:"success,omitempty"` } -type AuthenticationwebauthpolicyBinding struct { - AuthenticationwebauthpolicyAuthenticationvserverBinding []interface{} `json:"authenticationwebauthpolicy_authenticationvserver_binding,omitempty"` - AuthenticationwebauthpolicySystemglobalBinding []interface{} `json:"authenticationwebauthpolicy_systemglobal_binding,omitempty"` - AuthenticationwebauthpolicyVpnglobalBinding []interface{} `json:"authenticationwebauthpolicy_vpnglobal_binding,omitempty"` - AuthenticationwebauthpolicyVpnvserverBinding []interface{} `json:"authenticationwebauthpolicy_vpnvserver_binding,omitempty"` +type AuthenticationWebAuthPolicyBinding struct { + AuthenticationWebAuthPolicyAuthenticationVServerBinding []interface{} `json:"authenticationwebauthpolicy_authenticationvserver_binding,omitempty"` + AuthenticationWebAuthPolicySystemGlobalBinding []interface{} `json:"authenticationwebauthpolicy_systemglobal_binding,omitempty"` + AuthenticationWebAuthPolicyVPNGlobalBinding []interface{} `json:"authenticationwebauthpolicy_vpnglobal_binding,omitempty"` + AuthenticationWebAuthPolicyVPNVServerBinding []interface{} `json:"authenticationwebauthpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationlocalpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLocalPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationwebauthpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationWebAuthPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationsmartaccesspolicy struct { +type AuthenticationSmartAccessPolicy struct { Action string `json:"action,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationsamlidppolicyBinding struct { - AuthenticationsamlidppolicyAuthenticationvserverBinding []interface{} `json:"authenticationsamlidppolicy_authenticationvserver_binding,omitempty"` - AuthenticationsamlidppolicyVpnvserverBinding []interface{} `json:"authenticationsamlidppolicy_vpnvserver_binding,omitempty"` +type AuthenticationSAMLIDPPolicyBinding struct { + AuthenticationSAMLIDPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsamlidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationSAMLIDPPolicyVPNVServerBinding []interface{} `json:"authenticationsamlidppolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Authenticationoauthidppolicy struct { +type AuthenticationOAuthIDPPolicy struct { Action string `json:"action,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` -} - -type AuthenticationvserverBinding struct { - AuthenticationvserverAuditnslogpolicyBinding []interface{} `json:"authenticationvserver_auditnslogpolicy_binding,omitempty"` - AuthenticationvserverAuditsyslogpolicyBinding []interface{} `json:"authenticationvserver_auditsyslogpolicy_binding,omitempty"` - AuthenticationvserverAuthenticationcertpolicyBinding []interface{} `json:"authenticationvserver_authenticationcertpolicy_binding,omitempty"` - AuthenticationvserverAuthenticationldappolicyBinding []interface{} `json:"authenticationvserver_authenticationldappolicy_binding,omitempty"` - AuthenticationvserverAuthenticationlocalpolicyBinding []interface{} `json:"authenticationvserver_authenticationlocalpolicy_binding,omitempty"` - AuthenticationvserverAuthenticationloginschemapolicyBinding []interface{} `json:"authenticationvserver_authenticationloginschemapolicy_binding,omitempty"` - AuthenticationvserverAuthenticationnegotiatepolicyBinding []interface{} `json:"authenticationvserver_authenticationnegotiatepolicy_binding,omitempty"` - AuthenticationvserverAuthenticationoauthidppolicyBinding []interface{} `json:"authenticationvserver_authenticationoauthidppolicy_binding,omitempty"` - AuthenticationvserverAuthenticationpolicyBinding []interface{} `json:"authenticationvserver_authenticationpolicy_binding,omitempty"` - AuthenticationvserverAuthenticationradiuspolicyBinding []interface{} `json:"authenticationvserver_authenticationradiuspolicy_binding,omitempty"` - AuthenticationvserverAuthenticationsamlidppolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlidppolicy_binding,omitempty"` - AuthenticationvserverAuthenticationsamlpolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlpolicy_binding,omitempty"` - AuthenticationvserverAuthenticationsmartaccesspolicyBinding []interface{} `json:"authenticationvserver_authenticationsmartaccesspolicy_binding,omitempty"` - AuthenticationvserverAuthenticationtacacspolicyBinding []interface{} `json:"authenticationvserver_authenticationtacacspolicy_binding,omitempty"` - AuthenticationvserverAuthenticationwebauthpolicyBinding []interface{} `json:"authenticationvserver_authenticationwebauthpolicy_binding,omitempty"` - AuthenticationvserverCachepolicyBinding []interface{} `json:"authenticationvserver_cachepolicy_binding,omitempty"` - AuthenticationvserverCspolicyBinding []interface{} `json:"authenticationvserver_cspolicy_binding,omitempty"` - AuthenticationvserverResponderpolicyBinding []interface{} `json:"authenticationvserver_responderpolicy_binding,omitempty"` - AuthenticationvserverRewritepolicyBinding []interface{} `json:"authenticationvserver_rewritepolicy_binding,omitempty"` - AuthenticationvserverTmsessionpolicyBinding []interface{} `json:"authenticationvserver_tmsessionpolicy_binding,omitempty"` - AuthenticationvserverVpnportalthemeBinding []interface{} `json:"authenticationvserver_vpnportaltheme_binding,omitempty"` + UndefAction string `json:"undefaction,omitempty"` +} + +type AuthenticationVServerBinding struct { + AuthenticationVServerAuditNSLogPolicyBinding []interface{} `json:"authenticationvserver_auditnslogpolicy_binding,omitempty"` + AuthenticationVServerAuditSyslogPolicyBinding []interface{} `json:"authenticationvserver_auditsyslogpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationCertPolicyBinding []interface{} `json:"authenticationvserver_authenticationcertpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLDAPPolicyBinding []interface{} `json:"authenticationvserver_authenticationldappolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLocalPolicyBinding []interface{} `json:"authenticationvserver_authenticationlocalpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLoginSchemaPolicyBinding []interface{} `json:"authenticationvserver_authenticationloginschemapolicy_binding,omitempty"` + AuthenticationVServerAuthenticationNegotiatePolicyBinding []interface{} `json:"authenticationvserver_authenticationnegotiatepolicy_binding,omitempty"` + AuthenticationVServerAuthenticationOAuthIDPPolicyBinding []interface{} `json:"authenticationvserver_authenticationoauthidppolicy_binding,omitempty"` + AuthenticationVServerAuthenticationPolicyBinding []interface{} `json:"authenticationvserver_authenticationpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationRADIUSPolicyBinding []interface{} `json:"authenticationvserver_authenticationradiuspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSAMLIDPPolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlidppolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSAMLPolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSmartAccessPolicyBinding []interface{} `json:"authenticationvserver_authenticationsmartaccesspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationTACACSPolicyBinding []interface{} `json:"authenticationvserver_authenticationtacacspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationWebAuthPolicyBinding []interface{} `json:"authenticationvserver_authenticationwebauthpolicy_binding,omitempty"` + AuthenticationVServerCachePolicyBinding []interface{} `json:"authenticationvserver_cachepolicy_binding,omitempty"` + AuthenticationVServerCSPolicyBinding []interface{} `json:"authenticationvserver_cspolicy_binding,omitempty"` + AuthenticationVServerResponderPolicyBinding []interface{} `json:"authenticationvserver_responderpolicy_binding,omitempty"` + AuthenticationVServerRewritePolicyBinding []interface{} `json:"authenticationvserver_rewritepolicy_binding,omitempty"` + AuthenticationVServerTMSessionPolicyBinding []interface{} `json:"authenticationvserver_tmsessionpolicy_binding,omitempty"` + AuthenticationVServerVPNPortalThemeBinding []interface{} `json:"authenticationvserver_vpnportaltheme_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationlocalpolicyBinding struct { - AuthenticationlocalpolicyAuthenticationvserverBinding []interface{} `json:"authenticationlocalpolicy_authenticationvserver_binding,omitempty"` - AuthenticationlocalpolicySystemglobalBinding []interface{} `json:"authenticationlocalpolicy_systemglobal_binding,omitempty"` - AuthenticationlocalpolicyVpnglobalBinding []interface{} `json:"authenticationlocalpolicy_vpnglobal_binding,omitempty"` - AuthenticationlocalpolicyVpnvserverBinding []interface{} `json:"authenticationlocalpolicy_vpnvserver_binding,omitempty"` +type AuthenticationLocalPolicyBinding struct { + AuthenticationLocalPolicyAuthenticationVServerBinding []interface{} `json:"authenticationlocalpolicy_authenticationvserver_binding,omitempty"` + AuthenticationLocalPolicySystemGlobalBinding []interface{} `json:"authenticationlocalpolicy_systemglobal_binding,omitempty"` + AuthenticationLocalPolicyVPNGlobalBinding []interface{} `json:"authenticationlocalpolicy_vpnglobal_binding,omitempty"` + AuthenticationLocalPolicyVPNVServerBinding []interface{} `json:"authenticationlocalpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationsmartaccesspolicyBinding struct { - AuthenticationsmartaccesspolicyAuthenticationvserverBinding []interface{} `json:"authenticationsmartaccesspolicy_authenticationvserver_binding,omitempty"` +type AuthenticationSmartAccessPolicyBinding struct { + AuthenticationSmartAccessPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsmartaccesspolicy_authenticationvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationvserverAuthenticationwebauthpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationWebAuthPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationvserverAuditsyslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuditSyslogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationradiuspolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationRADIUSPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationsamlidppolicy struct { +type AuthenticationSAMLIDPPolicy struct { Action string `json:"action,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` + UndefAction string `json:"undefaction,omitempty"` } -type Authenticationradiusaction struct { +type AuthenticationRADIUSAction struct { Accounting string `json:"accounting,omitempty"` Authentication string `json:"authentication,omitempty"` - Authservretry int `json:"authservretry,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Callingstationid string `json:"callingstationid,omitempty"` + AuthServRetry int `json:"authservretry,omitempty"` + AuthTimeout int `json:"authtimeout,omitempty"` + CallingStationID string `json:"callingstationid,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Failure int `json:"failure,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Ipattributetype int `json:"ipattributetype,omitempty"` - Ipvendorid int `json:"ipvendorid,omitempty"` - Messageauthenticator string `json:"messageauthenticator,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPAttributeType int `json:"ipattributetype,omitempty"` + IPVendorID int `json:"ipvendorid,omitempty"` + MessageAuthenticator string `json:"messageauthenticator,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passencoding string `json:"passencoding,omitempty"` - Pwdattributetype int `json:"pwdattributetype,omitempty"` - Pwdvendorid int `json:"pwdvendorid,omitempty"` - Radattributetype int `json:"radattributetype,omitempty"` - Radgroupseparator string `json:"radgroupseparator,omitempty"` - Radgroupsprefix string `json:"radgroupsprefix,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radnasip string `json:"radnasip,omitempty"` - Radvendorid int `json:"radvendorid,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PassEncoding string `json:"passencoding,omitempty"` + PwdAttributeType int `json:"pwdattributetype,omitempty"` + PwdVendorID int `json:"pwdvendorid,omitempty"` + RadAttributeType int `json:"radattributetype,omitempty"` + RadGroupSeparator string `json:"radgroupseparator,omitempty"` + RadGroupsPrefix string `json:"radgroupsprefix,omitempty"` + RadKey string `json:"radkey,omitempty"` + RadNASID string `json:"radnasid,omitempty"` + RadNASIP string `json:"radnasip,omitempty"` + RadVendorID int `json:"radvendorid,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` + ServerPort int `json:"serverport,omitempty"` Success int `json:"success,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` Transport string `json:"transport,omitempty"` - Tunnelendpointclientip string `json:"tunnelendpointclientip,omitempty"` + TunnelEndpointClientIP string `json:"tunnelendpointclientip,omitempty"` } -type Authenticationazurekeyvault struct { +type AuthenticationAzureKeyVault struct { Authentication string `json:"authentication,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` + ClientID string `json:"clientid,omitempty"` + ClientSecret string `json:"clientsecret,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pushservice string `json:"pushservice,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Servicekeyname string `json:"servicekeyname,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Vaultname string `json:"vaultname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PushService string `json:"pushservice,omitempty"` + RefreshInterval int `json:"refreshinterval,omitempty"` + ServiceKeyName string `json:"servicekeyname,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + TenantID string `json:"tenantid,omitempty"` + TokenEndpoint string `json:"tokenendpoint,omitempty"` + VaultName string `json:"vaultname,omitempty"` } -type Authenticationemailaction struct { +type AuthenticationEmailAction struct { Content string `json:"content,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + EmailAddress string `json:"emailaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` - Serverurl string `json:"serverurl,omitempty"` + ServerURL string `json:"serverurl,omitempty"` Timeout int `json:"timeout,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type AuthenticationvserverTmsessionpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerTMSessionPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Authenticationtacacspolicy struct { +type AuthenticationTACACSPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationldappolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLDAPPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationnegotiatepolicyBinding struct { - AuthenticationnegotiatepolicyAuthenticationvserverBinding []interface{} `json:"authenticationnegotiatepolicy_authenticationvserver_binding,omitempty"` - AuthenticationnegotiatepolicyVpnglobalBinding []interface{} `json:"authenticationnegotiatepolicy_vpnglobal_binding,omitempty"` - AuthenticationnegotiatepolicyVpnvserverBinding []interface{} `json:"authenticationnegotiatepolicy_vpnvserver_binding,omitempty"` +type AuthenticationNegotiatePolicyBinding struct { + AuthenticationNegotiatePolicyAuthenticationVServerBinding []interface{} `json:"authenticationnegotiatepolicy_authenticationvserver_binding,omitempty"` + AuthenticationNegotiatePolicyVPNGlobalBinding []interface{} `json:"authenticationnegotiatepolicy_vpnglobal_binding,omitempty"` + AuthenticationNegotiatePolicyVPNVServerBinding []interface{} `json:"authenticationnegotiatepolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationsmartaccesspolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSmartAccessPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationloginschemapolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AuthenticationLoginSchemaPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationnegotiatepolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationNegotiatePolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationsamlaction struct { - Artifactresolutionserviceurl string `json:"artifactresolutionserviceurl,omitempty"` +type AuthenticationSAMLAction struct { + ArtifactResolutionServiceURL string `json:"artifactresolutionserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` Attribute11 string `json:"attribute11,omitempty"` @@ -381,103 +381,103 @@ type Authenticationsamlaction struct { Attribute7 string `json:"attribute7,omitempty"` Attribute8 string `json:"attribute8,omitempty"` Attribute9 string `json:"attribute9,omitempty"` - Attributeconsumingserviceindex int `json:"attributeconsumingserviceindex,omitempty"` + AttributeConsumingServiceIndex int `json:"attributeconsumingserviceindex,omitempty"` Attributes string `json:"attributes,omitempty"` Audience string `json:"audience,omitempty"` - Authnctxclassref []string `json:"authnctxclassref,omitempty"` + AuthnCtxClassRef []string `json:"authnctxclassref,omitempty"` Count float64 `json:"__count,omitempty"` - Customauthnctxclassref string `json:"customauthnctxclassref,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Enforceusername string `json:"enforceusername,omitempty"` - Forceauthn string `json:"forceauthn,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` - Logoutbinding string `json:"logoutbinding,omitempty"` - Logouturl string `json:"logouturl,omitempty"` - Metadataimportstatus string `json:"metadataimportstatus,omitempty"` - Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` + CustomAuthnCtxClassRef string `json:"customauthnctxclassref,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + DigestMethod string `json:"digestmethod,omitempty"` + EnforceUsername string `json:"enforceusername,omitempty"` + ForceAuthn string `json:"forceauthn,omitempty"` + GroupNameField string `json:"groupnamefield,omitempty"` + LogoutBinding string `json:"logoutbinding,omitempty"` + LogoutURL string `json:"logouturl,omitempty"` + MetadataImportStatus string `json:"metadataimportstatus,omitempty"` + MetadataRefreshInterval int `json:"metadatarefreshinterval,omitempty"` + MetadataURL string `json:"metadataurl,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preferredbindtype []string `json:"preferredbindtype,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Requestedauthncontext string `json:"requestedauthncontext,omitempty"` - Samlacsindex int `json:"samlacsindex,omitempty"` - Samlbinding string `json:"samlbinding,omitempty"` - Samlidpcertname string `json:"samlidpcertname,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Samlredirecturl string `json:"samlredirecturl,omitempty"` - Samlrejectunsignedassertion string `json:"samlrejectunsignedassertion,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Samltwofactor string `json:"samltwofactor,omitempty"` - Samluserfield string `json:"samluserfield,omitempty"` - Sendthumbprint string `json:"sendthumbprint,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Statechecks string `json:"statechecks,omitempty"` - Storesamlresponse string `json:"storesamlresponse,omitempty"` -} - -type AuthenticationvserverVpnportalthemeBinding struct { - Acttype int `json:"acttype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreferredBindType []string `json:"preferredbindtype,omitempty"` + RelayStateRule string `json:"relaystaterule,omitempty"` + RequestedAuthnContext string `json:"requestedauthncontext,omitempty"` + SAMLAcsIndex int `json:"samlacsindex,omitempty"` + SAMLBinding string `json:"samlbinding,omitempty"` + SAMLIDPCertName string `json:"samlidpcertname,omitempty"` + SAMLIssuerName string `json:"samlissuername,omitempty"` + SAMLRedirectURL string `json:"samlredirecturl,omitempty"` + SAMLRejectUnsignedAssertion string `json:"samlrejectunsignedassertion,omitempty"` + SAMLSigningCertName string `json:"samlsigningcertname,omitempty"` + SAMLTwoFactor string `json:"samltwofactor,omitempty"` + SAMLUserField string `json:"samluserfield,omitempty"` + SendThumbprint string `json:"sendthumbprint,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + SkewTime int `json:"skewtime,omitempty"` + StateChecks string `json:"statechecks,omitempty"` + StoreSAMLResponse string `json:"storesamlresponse,omitempty"` +} + +type AuthenticationVServerVPNPortalThemeBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Portaltheme string `json:"portaltheme,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } -type AuthenticationlocalpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLocalPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationloginschemapolicy struct { +type AuthenticationLoginSchemaPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type AuthenticationloginschemapolicyBinding struct { - AuthenticationloginschemapolicyAuthenticationvserverBinding []interface{} `json:"authenticationloginschemapolicy_authenticationvserver_binding,omitempty"` - AuthenticationloginschemapolicyVpnvserverBinding []interface{} `json:"authenticationloginschemapolicy_vpnvserver_binding,omitempty"` +type AuthenticationLoginSchemaPolicyBinding struct { + AuthenticationLoginSchemaPolicyAuthenticationVServerBinding []interface{} `json:"authenticationloginschemapolicy_authenticationvserver_binding,omitempty"` + AuthenticationLoginSchemaPolicyVPNVServerBinding []interface{} `json:"authenticationloginschemapolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Authenticationprotecteduseraction struct { +type AuthenticationProtectedUserAction struct { Count float64 `json:"__count,omitempty"` - Maxconcurrentusers int `json:"maxconcurrentusers,omitempty"` + MaxConcurrentUsers int `json:"maxconcurrentusers,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Realmstr string `json:"realmstr,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RealmStr string `json:"realmstr,omitempty"` } -type AuthenticationpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AuthenticationPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationsamlpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSAMLPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationtacacsaction struct { +type AuthenticationTACACSAction struct { Accounting string `json:"accounting,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` @@ -496,400 +496,400 @@ type Authenticationtacacsaction struct { Attribute8 string `json:"attribute8,omitempty"` Attribute9 string `json:"attribute9,omitempty"` Attributes string `json:"attributes,omitempty"` - Auditfailedcmds string `json:"auditfailedcmds,omitempty"` + AuditFailedCmds string `json:"auditfailedcmds,omitempty"` Authorization string `json:"authorization,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` + AuthTimeout int `json:"authtimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Failure int `json:"failure,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` + GroupAttrName string `json:"groupattrname,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` Success int `json:"success,omitempty"` - Tacacssecret string `json:"tacacssecret,omitempty"` + TACACSSecret string `json:"tacacssecret,omitempty"` } -type AuthenticationcertpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationCertPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuthenticationloginschemapolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationLoginSchemaPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationsamlidppolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSAMLIDPPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationnegotiatepolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationNegotiatePolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationsamlpolicyBinding struct { - AuthenticationsamlpolicyAuthenticationvserverBinding []interface{} `json:"authenticationsamlpolicy_authenticationvserver_binding,omitempty"` - AuthenticationsamlpolicyVpnglobalBinding []interface{} `json:"authenticationsamlpolicy_vpnglobal_binding,omitempty"` - AuthenticationsamlpolicyVpnvserverBinding []interface{} `json:"authenticationsamlpolicy_vpnvserver_binding,omitempty"` +type AuthenticationSAMLPolicyBinding struct { + AuthenticationSAMLPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsamlpolicy_authenticationvserver_binding,omitempty"` + AuthenticationSAMLPolicyVPNGlobalBinding []interface{} `json:"authenticationsamlpolicy_vpnglobal_binding,omitempty"` + AuthenticationSAMLPolicyVPNVServerBinding []interface{} `json:"authenticationsamlpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationvserverAuthenticationlocalpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationLocalPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationradiuspolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationRADIUSPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationvserver struct { - Appflowlog string `json:"appflowlog,omitempty"` +type AuthenticationVServer struct { + AppFlowLog string `json:"appflowlog,omitempty"` Authentication string `json:"authentication,omitempty"` - Authenticationdomain string `json:"authenticationdomain,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Certkeynames string `json:"certkeynames,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + AuthenticationDomain string `json:"authenticationdomain,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CertKeyNames string `json:"certkeynames,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Curaaausers int `json:"curaaausers,omitempty"` - Curstate string `json:"curstate,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Ip string `json:"ip,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` + CurAAAUsers int `json:"curaaausers,omitempty"` + CurState string `json:"curstate,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + FailedLoginTimeout int `json:"failedlogintimeout,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + IP string `json:"ip,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` + MaxLoginAttempts int `json:"maxloginattempts,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NGName string `json:"ngname,omitempty"` Policy string `json:"policy,omitempty"` Port int `json:"port,omitempty"` Precedence string `json:"precedence,omitempty"` Priority int `json:"priority,omitempty"` Range int `json:"range,omitempty"` Redirect string `json:"redirect,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Samesite string `json:"samesite,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` + SameSite string `json:"samesite,omitempty"` Secondary bool `json:"secondary,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` State string `json:"state,omitempty"` Status int `json:"status,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` TypeField string `json:"type,omitempty"` Value string `json:"value,omitempty"` - Vstype int `json:"vstype,omitempty"` + VSType int `json:"vstype,omitempty"` Weight int `json:"weight,omitempty"` } -type Authenticationnoauthaction struct { +type AuthenticationNoAuthAction struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type AuthenticationnegotiatepolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationNegotiatePolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationsamlpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSAMLPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationauthnprofile struct { - Authenticationdomain string `json:"authenticationdomain,omitempty"` - Authenticationhost string `json:"authenticationhost,omitempty"` - Authenticationlevel int `json:"authenticationlevel,omitempty"` - Authnvsname string `json:"authnvsname,omitempty"` +type AuthenticationAuthNProfile struct { + AuthenticationDomain string `json:"authenticationdomain,omitempty"` + AuthenticationHost string `json:"authenticationhost,omitempty"` + AuthenticationLevel int `json:"authenticationlevel,omitempty"` + AuthNVSName string `json:"authnvsname,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Authenticationcaptchaaction struct { +type AuthenticationCaptchaAction struct { Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Scorethreshold int `json:"scorethreshold,omitempty"` - Secretkey string `json:"secretkey,omitempty"` - Serverurl string `json:"serverurl,omitempty"` - Sitekey string `json:"sitekey,omitempty"` -} - -type AuthenticationradiuspolicyBinding struct { - AuthenticationradiuspolicyAuthenticationvserverBinding []interface{} `json:"authenticationradiuspolicy_authenticationvserver_binding,omitempty"` - AuthenticationradiuspolicySystemglobalBinding []interface{} `json:"authenticationradiuspolicy_systemglobal_binding,omitempty"` - AuthenticationradiuspolicyVpnglobalBinding []interface{} `json:"authenticationradiuspolicy_vpnglobal_binding,omitempty"` - AuthenticationradiuspolicyVpnvserverBinding []interface{} `json:"authenticationradiuspolicy_vpnvserver_binding,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ScoreThreshold int `json:"scorethreshold,omitempty"` + SecretKey string `json:"secretkey,omitempty"` + ServerURL string `json:"serverurl,omitempty"` + SiteKey string `json:"sitekey,omitempty"` +} + +type AuthenticationRADIUSPolicyBinding struct { + AuthenticationRADIUSPolicyAuthenticationVServerBinding []interface{} `json:"authenticationradiuspolicy_authenticationvserver_binding,omitempty"` + AuthenticationRADIUSPolicySystemGlobalBinding []interface{} `json:"authenticationradiuspolicy_systemglobal_binding,omitempty"` + AuthenticationRADIUSPolicyVPNGlobalBinding []interface{} `json:"authenticationradiuspolicy_vpnglobal_binding,omitempty"` + AuthenticationRADIUSPolicyVPNVServerBinding []interface{} `json:"authenticationradiuspolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationtacacspolicyBinding struct { - AuthenticationtacacspolicyAuthenticationvserverBinding []interface{} `json:"authenticationtacacspolicy_authenticationvserver_binding,omitempty"` - AuthenticationtacacspolicySystemglobalBinding []interface{} `json:"authenticationtacacspolicy_systemglobal_binding,omitempty"` - AuthenticationtacacspolicyVpnglobalBinding []interface{} `json:"authenticationtacacspolicy_vpnglobal_binding,omitempty"` - AuthenticationtacacspolicyVpnvserverBinding []interface{} `json:"authenticationtacacspolicy_vpnvserver_binding,omitempty"` +type AuthenticationTACACSPolicyBinding struct { + AuthenticationTACACSPolicyAuthenticationVServerBinding []interface{} `json:"authenticationtacacspolicy_authenticationvserver_binding,omitempty"` + AuthenticationTACACSPolicySystemGlobalBinding []interface{} `json:"authenticationtacacspolicy_systemglobal_binding,omitempty"` + AuthenticationTACACSPolicyVPNGlobalBinding []interface{} `json:"authenticationtacacspolicy_vpnglobal_binding,omitempty"` + AuthenticationTACACSPolicyVPNVServerBinding []interface{} `json:"authenticationtacacspolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Authenticationsamlpolicy struct { +type AuthenticationSAMLPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationldappolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLDAPPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationwebauthpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationWebAuthPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationlocalpolicy struct { +type AuthenticationLocalPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationvserverAuthenticationradiuspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationRADIUSPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationloginschemapolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type AuthenticationLoginSchemaPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationlocalpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLocalPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuthenticationsamlpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationSAMLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationsamlidppolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSAMLIDPPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationoauthidppolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationOAuthIDPPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationcitrixauthaction struct { +type AuthenticationCitrixAuthAction struct { Authentication string `json:"authentication,omitempty"` - Authenticationtype string `json:"authenticationtype,omitempty"` + AuthenticationType string `json:"authenticationtype,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type AuthenticationvserverAuthenticationcertpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationCertPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationpolicylabelBinding struct { - AuthenticationpolicylabelAuthenticationpolicyBinding []interface{} `json:"authenticationpolicylabel_authenticationpolicy_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AuthenticationPolicyLabelBinding struct { + AuthenticationPolicyLabelAuthenticationPolicyBinding []interface{} `json:"authenticationpolicylabel_authenticationpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type Authenticationdfapolicy struct { +type AuthenticationDFAPolicy struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationtacacspolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationTACACSPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationradiuspolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationRADIUSPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuthenticationldappolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationLDAPPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Authenticationoauthidpprofile struct { +type AuthenticationOAuthIDPProfile struct { Attributes string `json:"attributes,omitempty"` Audience string `json:"audience,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` - Configservice string `json:"configservice,omitempty"` + ClientID string `json:"clientid,omitempty"` + ClientSecret string `json:"clientsecret,omitempty"` + ConfigService string `json:"configservice,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Encrypttoken string `json:"encrypttoken,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + EncryptToken string `json:"encrypttoken,omitempty"` Issuer string `json:"issuer,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oauthstatus string `json:"oauthstatus,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Relyingpartymetadataurl string `json:"relyingpartymetadataurl,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Skewtime int `json:"skewtime,omitempty"` -} - -type AuthenticationtacacspolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OAuthStatus string `json:"oauthstatus,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` + RefreshInterval int `json:"refreshinterval,omitempty"` + RelyingPartyMetadataURL string `json:"relyingpartymetadataurl,omitempty"` + SendPassword string `json:"sendpassword,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + SignatureService string `json:"signatureservice,omitempty"` + SkewTime int `json:"skewtime,omitempty"` +} + +type AuthenticationTACACSPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationepaaction struct { +type AuthenticationEPAAction struct { Count float64 `json:"__count,omitempty"` - Csecexpr string `json:"csecexpr,omitempty"` - Defaultepagroup string `json:"defaultepagroup,omitempty"` - Deletefiles string `json:"deletefiles,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Killprocess string `json:"killprocess,omitempty"` + CSecExpr string `json:"csecexpr,omitempty"` + DefaultEPAGroup string `json:"defaultepagroup,omitempty"` + DeleteFiles string `json:"deletefiles,omitempty"` + DevicePosture string `json:"deviceposture,omitempty"` + KillProcess string `json:"killprocess,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Quarantinegroup string `json:"quarantinegroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + QuarantineGroup string `json:"quarantinegroup,omitempty"` } -type AuthenticationpolicyBinding struct { - AuthenticationpolicyAuthenticationpolicylabelBinding []interface{} `json:"authenticationpolicy_authenticationpolicylabel_binding,omitempty"` - AuthenticationpolicyAuthenticationvserverBinding []interface{} `json:"authenticationpolicy_authenticationvserver_binding,omitempty"` - AuthenticationpolicySystemglobalBinding []interface{} `json:"authenticationpolicy_systemglobal_binding,omitempty"` +type AuthenticationPolicyBinding struct { + AuthenticationPolicyAuthenticationPolicyLabelBinding []interface{} `json:"authenticationpolicy_authenticationpolicylabel_binding,omitempty"` + AuthenticationPolicyAuthenticationVServerBinding []interface{} `json:"authenticationpolicy_authenticationvserver_binding,omitempty"` + AuthenticationPolicySystemGlobalBinding []interface{} `json:"authenticationpolicy_systemglobal_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationcertpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationCertPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationdfapolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationDFAPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationwebauthaction struct { +type AuthenticationWebAuthAction struct { Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` Attribute11 string `json:"attribute11,omitempty"` @@ -907,145 +907,145 @@ type Authenticationwebauthaction struct { Attribute8 string `json:"attribute8,omitempty"` Attribute9 string `json:"attribute9,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Fullreqexpr string `json:"fullreqexpr,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + FullReqExpr string `json:"fullreqexpr,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Scheme string `json:"scheme,omitempty"` - Serverip string `json:"serverip,omitempty"` - Serverport int `json:"serverport,omitempty"` - Successrule string `json:"successrule,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SuccessRule string `json:"successrule,omitempty"` } -type Authenticationpolicylabel struct { +type AuthenticationPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Loginschema string `json:"loginschema,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LoginSchema string `json:"loginschema,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Authenticationradiuspolicy struct { +type AuthenticationRADIUSPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } -type AuthenticationvserverAuthenticationoauthidppolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationOAuthIDPPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationvserverRewritepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerRewritePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Authenticationdfaaction struct { - Clientid string `json:"clientid,omitempty"` +type AuthenticationDFAAction struct { + ClientID string `json:"clientid,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Failure int `json:"failure,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Passphrase string `json:"passphrase,omitempty"` - Serverurl string `json:"serverurl,omitempty"` + ServerURL string `json:"serverurl,omitempty"` Success int `json:"success,omitempty"` } -type AuthenticationoauthidppolicyBinding struct { - AuthenticationoauthidppolicyAuthenticationvserverBinding []interface{} `json:"authenticationoauthidppolicy_authenticationvserver_binding,omitempty"` - AuthenticationoauthidppolicyVpnvserverBinding []interface{} `json:"authenticationoauthidppolicy_vpnvserver_binding,omitempty"` +type AuthenticationOAuthIDPPolicyBinding struct { + AuthenticationOAuthIDPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationoauthidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationOAuthIDPPolicyVPNVServerBinding []interface{} `json:"authenticationoauthidppolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationvserverCachepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerCachePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationvserverAuthenticationnegotiatepolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationNegotiatePolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationtacacspolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationTACACSPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationtacacspolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationTACACSPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuthenticationsamlidppolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationSAMLIDPPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationvserverAuthenticationtacacspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationTACACSPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Authenticationldapaction struct { - Alternateemailattr string `json:"alternateemailattr,omitempty"` +type AuthenticationLDAPAction struct { + AlternateEmailAttr string `json:"alternateemailattr,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` Attribute11 string `json:"attribute11,omitempty"` @@ -1064,94 +1064,94 @@ type Authenticationldapaction struct { Attribute9 string `json:"attribute9,omitempty"` Attributes string `json:"attributes,omitempty"` Authentication string `json:"authentication,omitempty"` - Authtimeout int `json:"authtimeout,omitempty"` - Cloudattributes string `json:"cloudattributes,omitempty"` + AuthTimeout int `json:"authtimeout,omitempty"` + CloudAttributes string `json:"cloudattributes,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Email string `json:"email,omitempty"` Failure int `json:"failure,omitempty"` - Followreferrals string `json:"followreferrals,omitempty"` - Groupattrname string `json:"groupattrname,omitempty"` - Groupnameidentifier string `json:"groupnameidentifier,omitempty"` - Groupsearchattribute string `json:"groupsearchattribute,omitempty"` - Groupsearchfilter string `json:"groupsearchfilter,omitempty"` - Groupsearchsubattribute string `json:"groupsearchsubattribute,omitempty"` - Kbattribute string `json:"kbattribute,omitempty"` - Ldapbase string `json:"ldapbase,omitempty"` - Ldapbinddn string `json:"ldapbinddn,omitempty"` - Ldapbinddnpassword string `json:"ldapbinddnpassword,omitempty"` - Ldaphostname string `json:"ldaphostname,omitempty"` - Ldaploginname string `json:"ldaploginname,omitempty"` - Maxldapreferrals int `json:"maxldapreferrals,omitempty"` - Maxnestinglevel int `json:"maxnestinglevel,omitempty"` - Mssrvrecordlocation string `json:"mssrvrecordlocation,omitempty"` + FollowReferrals string `json:"followreferrals,omitempty"` + GroupAttrName string `json:"groupattrname,omitempty"` + GroupNameIdentifier string `json:"groupnameidentifier,omitempty"` + GroupSearchAttribute string `json:"groupsearchattribute,omitempty"` + GroupSearchFilter string `json:"groupsearchfilter,omitempty"` + GroupSearchSubAttribute string `json:"groupsearchsubattribute,omitempty"` + KBAttribute string `json:"kbattribute,omitempty"` + LDAPBase string `json:"ldapbase,omitempty"` + LDAPBindDN string `json:"ldapbinddn,omitempty"` + LDAPBindDNPassword string `json:"ldapbinddnpassword,omitempty"` + LDAPHostname string `json:"ldaphostname,omitempty"` + LDAPLoginName string `json:"ldaploginname,omitempty"` + MaxLDAPReferrals int `json:"maxldapreferrals,omitempty"` + MaxNestingLevel int `json:"maxnestinglevel,omitempty"` + MSSRVRecordLocation string `json:"mssrvrecordlocation,omitempty"` Name string `json:"name,omitempty"` - Nestedgroupextraction string `json:"nestedgroupextraction,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Otpsecret string `json:"otpsecret,omitempty"` - Passwdchange string `json:"passwdchange,omitempty"` - Pushservice string `json:"pushservice,omitempty"` - Referraldnslookup string `json:"referraldnslookup,omitempty"` - Requireuser string `json:"requireuser,omitempty"` - Searchfilter string `json:"searchfilter,omitempty"` - Sectype string `json:"sectype,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` - Sshpublickey string `json:"sshpublickey,omitempty"` - Ssonameattribute string `json:"ssonameattribute,omitempty"` - Subattributename string `json:"subattributename,omitempty"` + NestedGroupExtraction string `json:"nestedgroupextraction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OTPSecret string `json:"otpsecret,omitempty"` + PasswdChange string `json:"passwdchange,omitempty"` + PushService string `json:"pushservice,omitempty"` + ReferralDNSLookup string `json:"referraldnslookup,omitempty"` + RequireUser string `json:"requireuser,omitempty"` + SearchFilter string `json:"searchfilter,omitempty"` + SecType string `json:"sectype,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` + ServerPort int `json:"serverport,omitempty"` + SSHPublicKey string `json:"sshpublickey,omitempty"` + SSONameAttribute string `json:"ssonameattribute,omitempty"` + SubAttributeName string `json:"subattributename,omitempty"` Success int `json:"success,omitempty"` - Svrtype string `json:"svrtype,omitempty"` - Validateservercert string `json:"validateservercert,omitempty"` + SvrType string `json:"svrtype,omitempty"` + ValidateServerCert string `json:"validateservercert,omitempty"` } -type AuthenticationvserverAuthenticationpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationcertpolicyBinding struct { - AuthenticationcertpolicyAuthenticationvserverBinding []interface{} `json:"authenticationcertpolicy_authenticationvserver_binding,omitempty"` - AuthenticationcertpolicyVpnglobalBinding []interface{} `json:"authenticationcertpolicy_vpnglobal_binding,omitempty"` - AuthenticationcertpolicyVpnvserverBinding []interface{} `json:"authenticationcertpolicy_vpnvserver_binding,omitempty"` +type AuthenticationCertPolicyBinding struct { + AuthenticationCertPolicyAuthenticationVServerBinding []interface{} `json:"authenticationcertpolicy_authenticationvserver_binding,omitempty"` + AuthenticationCertPolicyVPNGlobalBinding []interface{} `json:"authenticationcertpolicy_vpnglobal_binding,omitempty"` + AuthenticationCertPolicyVPNVServerBinding []interface{} `json:"authenticationcertpolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthenticationwebauthpolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationWebAuthPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuditnslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuditNSLogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationsamlpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationSAMLPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationoauthaction struct { - Allowedalgorithms []string `json:"allowedalgorithms,omitempty"` +type AuthenticationOAuthAction struct { + AllowedAlgorithms []string `json:"allowedalgorithms,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` Attribute11 string `json:"attribute11,omitempty"` @@ -1171,283 +1171,283 @@ type Authenticationoauthaction struct { Attributes string `json:"attributes,omitempty"` Audience string `json:"audience,omitempty"` Authentication string `json:"authentication,omitempty"` - Authorizationendpoint string `json:"authorizationendpoint,omitempty"` - Certendpoint string `json:"certendpoint,omitempty"` - Certfilepath string `json:"certfilepath,omitempty"` - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` + AuthorizationEndpoint string `json:"authorizationendpoint,omitempty"` + CertEndpoint string `json:"certendpoint,omitempty"` + CertFilePath string `json:"certfilepath,omitempty"` + ClientID string `json:"clientid,omitempty"` + ClientSecret string `json:"clientsecret,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Granttype string `json:"granttype,omitempty"` - Graphendpoint string `json:"graphendpoint,omitempty"` - Idtokendecryptendpoint string `json:"idtokendecryptendpoint,omitempty"` - Introspecturl string `json:"introspecturl,omitempty"` - Intunedeviceidexpression string `json:"intunedeviceidexpression,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + GrantType string `json:"granttype,omitempty"` + GraphEndpoint string `json:"graphendpoint,omitempty"` + IDTokenDecryptEndpoint string `json:"idtokendecryptendpoint,omitempty"` + IntrospectURL string `json:"introspecturl,omitempty"` + IntuneDeviceIDExpression string `json:"intunedeviceidexpression,omitempty"` Issuer string `json:"issuer,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` + MetadataURL string `json:"metadataurl,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oauthmiscflags []string `json:"oauthmiscflags,omitempty"` - Oauthstatus string `json:"oauthstatus,omitempty"` - Oauthtype string `json:"oauthtype,omitempty"` - Pkce string `json:"pkce,omitempty"` - Refreshinterval int `json:"refreshinterval,omitempty"` - Requestattribute string `json:"requestattribute,omitempty"` - Resourceuri string `json:"resourceuri,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Tokenendpointauthmethod string `json:"tokenendpointauthmethod,omitempty"` - Userinfourl string `json:"userinfourl,omitempty"` - Usernamefield string `json:"usernamefield,omitempty"` -} - -type Authenticationnegotiateaction struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OAuthMiscFlags []string `json:"oauthmiscflags,omitempty"` + OAuthStatus string `json:"oauthstatus,omitempty"` + OAuthType string `json:"oauthtype,omitempty"` + PKCE string `json:"pkce,omitempty"` + RefreshInterval int `json:"refreshinterval,omitempty"` + RequestAttribute string `json:"requestattribute,omitempty"` + ResourceURI string `json:"resourceuri,omitempty"` + SkewTime int `json:"skewtime,omitempty"` + TenantID string `json:"tenantid,omitempty"` + TokenEndpoint string `json:"tokenendpoint,omitempty"` + TokenEndpointAuthMethod string `json:"tokenendpointauthmethod,omitempty"` + UserInfoURL string `json:"userinfourl,omitempty"` + UsernameField string `json:"usernamefield,omitempty"` +} + +type AuthenticationNegotiateAction struct { Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Domain string `json:"domain,omitempty"` - Domainuser string `json:"domainuser,omitempty"` - Domainuserpasswd string `json:"domainuserpasswd,omitempty"` - Kcdspn string `json:"kcdspn,omitempty"` - Keytab string `json:"keytab,omitempty"` + DomainUser string `json:"domainuser,omitempty"` + DomainUserPasswd string `json:"domainuserpasswd,omitempty"` + KCDSPN string `json:"kcdspn,omitempty"` + KeyTab string `json:"keytab,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ntlmpath string `json:"ntlmpath,omitempty"` - Ou string `json:"ou,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NTLMPath string `json:"ntlmpath,omitempty"` + OU string `json:"ou,omitempty"` } -type AuthenticationldappolicySystemglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationLDAPPolicySystemGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationloginschema struct { - Authenticationschema string `json:"authenticationschema,omitempty"` - Authenticationstrength int `json:"authenticationstrength,omitempty"` +type AuthenticationLoginSchema struct { + AuthenticationSchema string `json:"authenticationschema,omitempty"` + AuthenticationStrength int `json:"authenticationstrength,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` - Passwordcredentialindex int `json:"passwordcredentialindex,omitempty"` - Ssocredentials string `json:"ssocredentials,omitempty"` - Usercredentialindex int `json:"usercredentialindex,omitempty"` - Userexpression string `json:"userexpression,omitempty"` -} - -type AuthenticationpolicylabelAuthenticationpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PasswdExpression string `json:"passwdexpression,omitempty"` + PasswordCredentialIndex int `json:"passwordcredentialindex,omitempty"` + SSOCredentials string `json:"ssocredentials,omitempty"` + UserCredentialIndex int `json:"usercredentialindex,omitempty"` + UserExpression string `json:"userexpression,omitempty"` +} + +type AuthenticationPolicyLabelAuthenticationPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationradiuspolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationRADIUSPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationcertaction struct { +type AuthenticationCertAction struct { Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Groupnamefield string `json:"groupnamefield,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + GroupNameField string `json:"groupnamefield,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Twofactor string `json:"twofactor,omitempty"` - Usernamefield string `json:"usernamefield,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TwoFactor string `json:"twofactor,omitempty"` + UsernameField string `json:"usernamefield,omitempty"` } -type Authenticationadfsproxyprofile struct { - Adfstruststatus string `json:"adfstruststatus,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` +type AuthenticationADFSProxyProfile struct { + ADFSTrustStatus string `json:"adfstruststatus,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` - Serverurl string `json:"serverurl,omitempty"` + ServerURL string `json:"serverurl,omitempty"` Username string `json:"username,omitempty"` } -type AuthenticationvserverResponderpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerResponderPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationvserverCspolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerCSPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type AuthenticationpolicyAuthenticationpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AuthenticationPolicyAuthenticationPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationoauthidppolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type AuthenticationOAuthIDPPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authenticationpolicy struct { +type AuthenticationPolicy struct { Action string `json:"action,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policysubtype string `json:"policysubtype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicySubType string `json:"policysubtype,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` + UndefAction string `json:"undefaction,omitempty"` } -type Authenticationsamlidpprofile struct { - Acsurlrule string `json:"acsurlrule,omitempty"` - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` +type AuthenticationSAMLIDPProfile struct { + ACSURLRule string `json:"acsurlrule,omitempty"` + AssertionConsumerServiceURL string `json:"assertionconsumerserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10Expr string `json:"attribute10expr,omitempty"` + Attribute10Format string `json:"attribute10format,omitempty"` + Attribute10FriendlyName string `json:"attribute10friendlyname,omitempty"` Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11Expr string `json:"attribute11expr,omitempty"` + Attribute11Format string `json:"attribute11format,omitempty"` + Attribute11FriendlyName string `json:"attribute11friendlyname,omitempty"` Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12Expr string `json:"attribute12expr,omitempty"` + Attribute12Format string `json:"attribute12format,omitempty"` + Attribute12FriendlyName string `json:"attribute12friendlyname,omitempty"` Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13Expr string `json:"attribute13expr,omitempty"` + Attribute13Format string `json:"attribute13format,omitempty"` + Attribute13FriendlyName string `json:"attribute13friendlyname,omitempty"` Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14Expr string `json:"attribute14expr,omitempty"` + Attribute14Format string `json:"attribute14format,omitempty"` + Attribute14FriendlyName string `json:"attribute14friendlyname,omitempty"` Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15Expr string `json:"attribute15expr,omitempty"` + Attribute15Format string `json:"attribute15format,omitempty"` + Attribute15FriendlyName string `json:"attribute15friendlyname,omitempty"` Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute16Expr string `json:"attribute16expr,omitempty"` + Attribute16Format string `json:"attribute16format,omitempty"` + Attribute16FriendlyName string `json:"attribute16friendlyname,omitempty"` + Attribute1Expr string `json:"attribute1expr,omitempty"` + Attribute1Format string `json:"attribute1format,omitempty"` + Attribute1FriendlyName string `json:"attribute1friendlyname,omitempty"` Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2Expr string `json:"attribute2expr,omitempty"` + Attribute2Format string `json:"attribute2format,omitempty"` + Attribute2FriendlyName string `json:"attribute2friendlyname,omitempty"` Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3Expr string `json:"attribute3expr,omitempty"` + Attribute3Format string `json:"attribute3format,omitempty"` + Attribute3FriendlyName string `json:"attribute3friendlyname,omitempty"` Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4Expr string `json:"attribute4expr,omitempty"` + Attribute4Format string `json:"attribute4format,omitempty"` + Attribute4FriendlyName string `json:"attribute4friendlyname,omitempty"` Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5Expr string `json:"attribute5expr,omitempty"` + Attribute5Format string `json:"attribute5format,omitempty"` + Attribute5FriendlyName string `json:"attribute5friendlyname,omitempty"` Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6Expr string `json:"attribute6expr,omitempty"` + Attribute6Format string `json:"attribute6format,omitempty"` + Attribute6FriendlyName string `json:"attribute6friendlyname,omitempty"` Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7Expr string `json:"attribute7expr,omitempty"` + Attribute7Format string `json:"attribute7format,omitempty"` + Attribute7FriendlyName string `json:"attribute7friendlyname,omitempty"` Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8Expr string `json:"attribute8expr,omitempty"` + Attribute8Format string `json:"attribute8format,omitempty"` + Attribute8FriendlyName string `json:"attribute8friendlyname,omitempty"` Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9Expr string `json:"attribute9expr,omitempty"` + Attribute9Format string `json:"attribute9format,omitempty"` + Attribute9FriendlyName string `json:"attribute9friendlyname,omitempty"` Audience string `json:"audience,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthenticationgroup string `json:"defaultauthenticationgroup,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` - Keytransportalg string `json:"keytransportalg,omitempty"` - Logoutbinding string `json:"logoutbinding,omitempty"` - Metadataimportstatus string `json:"metadataimportstatus,omitempty"` - Metadatarefreshinterval int `json:"metadatarefreshinterval,omitempty"` - Metadataurl string `json:"metadataurl,omitempty"` + DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` + DigestMethod string `json:"digestmethod,omitempty"` + EncryptAssertion string `json:"encryptassertion,omitempty"` + EncryptionAlgorithm string `json:"encryptionalgorithm,omitempty"` + KeyTransportAlg string `json:"keytransportalg,omitempty"` + LogoutBinding string `json:"logoutbinding,omitempty"` + MetadataImportStatus string `json:"metadataimportstatus,omitempty"` + MetadataRefreshInterval int `json:"metadatarefreshinterval,omitempty"` + MetadataURL string `json:"metadataurl,omitempty"` Name string `json:"name,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Rejectunsignedrequests string `json:"rejectunsignedrequests,omitempty"` - Samlbinding string `json:"samlbinding,omitempty"` - Samlidpcertname string `json:"samlidpcertname,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Samlsigningcertversion string `json:"samlsigningcertversion,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Samlspcertversion string `json:"samlspcertversion,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Serviceproviderid string `json:"serviceproviderid,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Skewtime int `json:"skewtime,omitempty"` - Splogouturl string `json:"splogouturl,omitempty"` -} - -type AuthenticationldappolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + NameIDExpr string `json:"nameidexpr,omitempty"` + NameIDFormat string `json:"nameidformat,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RejectUnsignedRequests string `json:"rejectunsignedrequests,omitempty"` + SAMLBinding string `json:"samlbinding,omitempty"` + SAMLIDPCertName string `json:"samlidpcertname,omitempty"` + SAMLIssuerName string `json:"samlissuername,omitempty"` + SAMLSigningCertVersion string `json:"samlsigningcertversion,omitempty"` + SAMLSPCertName string `json:"samlspcertname,omitempty"` + SAMLSPCertVersion string `json:"samlspcertversion,omitempty"` + SendPassword string `json:"sendpassword,omitempty"` + ServiceProviderID string `json:"serviceproviderid,omitempty"` + SignAssertion string `json:"signassertion,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + SignatureService string `json:"signatureservice,omitempty"` + SkewTime int `json:"skewtime,omitempty"` + SPLogoutURL string `json:"splogouturl,omitempty"` +} + +type AuthenticationLDAPPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthenticationvserverAuthenticationsmartaccesspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type AuthenticationVServerAuthenticationSmartAccessPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Authenticationcertpolicy struct { +type AuthenticationCertPolicy struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` } diff --git a/nitrogo/models/authorization.go b/nitrogo/models/authorization.go index 5528228..f672f36 100644 --- a/nitrogo/models/authorization.go +++ b/nitrogo/models/authorization.go @@ -1,90 +1,90 @@ package models // authorization configuration structs -type AuthorizationpolicyAuthorizationpolicylabelBinding struct { - Boundto string `json:"boundto,omitempty"` +type AuthorizationPolicyAuthorizationPolicyLabelBinding struct { + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthorizationpolicylabelAuthorizationpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AuthorizationPolicyLabelAuthorizationPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthorizationpolicyCsvserverBinding struct { - Boundto string `json:"boundto,omitempty"` +type AuthorizationPolicyCSVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthorizationpolicyBinding struct { - AuthorizationpolicyAaagroupBinding []interface{} `json:"authorizationpolicy_aaagroup_binding,omitempty"` - AuthorizationpolicyAaauserBinding []interface{} `json:"authorizationpolicy_aaauser_binding,omitempty"` - AuthorizationpolicyAuthorizationpolicylabelBinding []interface{} `json:"authorizationpolicy_authorizationpolicylabel_binding,omitempty"` - AuthorizationpolicyCsvserverBinding []interface{} `json:"authorizationpolicy_csvserver_binding,omitempty"` - AuthorizationpolicyLbvserverBinding []interface{} `json:"authorizationpolicy_lbvserver_binding,omitempty"` +type AuthorizationPolicyBinding struct { + AuthorizationPolicyAAAGroupBinding []interface{} `json:"authorizationpolicy_aaagroup_binding,omitempty"` + AuthorizationPolicyAAAUserBinding []interface{} `json:"authorizationpolicy_aaauser_binding,omitempty"` + AuthorizationPolicyAuthorizationPolicyLabelBinding []interface{} `json:"authorizationpolicy_authorizationpolicylabel_binding,omitempty"` + AuthorizationPolicyCSVServerBinding []interface{} `json:"authorizationpolicy_csvserver_binding,omitempty"` + AuthorizationPolicyLBVServerBinding []interface{} `json:"authorizationpolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type AuthorizationpolicyLbvserverBinding struct { - Boundto string `json:"boundto,omitempty"` +type AuthorizationPolicyLBVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authorizationpolicylabel struct { +type AuthorizationPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type AuthorizationpolicyAaagroupBinding struct { - Boundto string `json:"boundto,omitempty"` +type AuthorizationPolicyAAAGroupBinding struct { + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Authorizationpolicy struct { +type AuthorizationPolicy struct { Action string `json:"action,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type Authorizationaction struct { +type AuthorizationAction struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type AuthorizationpolicylabelBinding struct { - AuthorizationpolicylabelAuthorizationpolicyBinding []interface{} `json:"authorizationpolicylabel_authorizationpolicy_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type AuthorizationPolicyLabelBinding struct { + AuthorizationPolicyLabelAuthorizationPolicyBinding []interface{} `json:"authorizationpolicylabel_authorizationpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type AuthorizationpolicyAaauserBinding struct { - Boundto string `json:"boundto,omitempty"` +type AuthorizationPolicyAAAUserBinding struct { + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/autoscale.go b/nitrogo/models/autoscale.go index 21c8c15..2bddd5d 100644 --- a/nitrogo/models/autoscale.go +++ b/nitrogo/models/autoscale.go @@ -1,50 +1,50 @@ package models // autoscale configuration structs -type Autoscaleprofile struct { - Apikey string `json:"apikey,omitempty"` +type AutoscaleProfile struct { + APIKey string `json:"apikey,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sharedsecret string `json:"sharedsecret,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SharedSecret string `json:"sharedsecret,omitempty"` TypeField string `json:"type,omitempty"` - Url string `json:"url,omitempty"` + URL string `json:"url,omitempty"` } -type Autoscaleaction struct { +type AutoscaleAction struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Parameters string `json:"parameters,omitempty"` - Profilename string `json:"profilename,omitempty"` - Quiettime int `json:"quiettime,omitempty"` + ProfileName string `json:"profilename,omitempty"` + QuietTime int `json:"quiettime,omitempty"` TypeField string `json:"type,omitempty"` - Vmdestroygraceperiod int `json:"vmdestroygraceperiod,omitempty"` - Vserver string `json:"vserver,omitempty"` + VMDestroyGracePeriod int `json:"vmdestroygraceperiod,omitempty"` + VServer string `json:"vserver,omitempty"` } -type AutoscalepolicyNstimerBinding struct { - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type AutoscalePolicyNSTimerBinding struct { + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type AutoscalepolicyBinding struct { - AutoscalepolicyNstimerBinding []interface{} `json:"autoscalepolicy_nstimer_binding,omitempty"` +type AutoscalePolicyBinding struct { + AutoscalePolicyNSTimerBinding []interface{} `json:"autoscalepolicy_nstimer_binding,omitempty"` Name string `json:"name,omitempty"` } -type Autoscalepolicy struct { +type AutoscalePolicy struct { Action string `json:"action,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Priority int `json:"priority,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } diff --git a/nitrogo/models/azure.go b/nitrogo/models/azure.go index 634112e..7271614 100644 --- a/nitrogo/models/azure.go +++ b/nitrogo/models/azure.go @@ -1,22 +1,22 @@ package models // azure configuration structs -type Azurekeyvault struct { - Azureapplication string `json:"azureapplication,omitempty"` - Azurevaultname string `json:"azurevaultname,omitempty"` +type AzureKeyVault struct { + AzureApplication string `json:"azureapplication,omitempty"` + AzureVaultName string `json:"azurevaultname,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } -type Azureapplication struct { - Clientid string `json:"clientid,omitempty"` - Clientsecret string `json:"clientsecret,omitempty"` +type AzureApplication struct { + ClientID string `json:"clientid,omitempty"` + ClientSecret string `json:"clientsecret,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Tenantid string `json:"tenantid,omitempty"` - Tokenendpoint string `json:"tokenendpoint,omitempty"` - Vaultresource string `json:"vaultresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TenantID string `json:"tenantid,omitempty"` + TokenEndpoint string `json:"tokenendpoint,omitempty"` + VaultResource string `json:"vaultresource,omitempty"` } diff --git a/nitrogo/models/basic.go b/nitrogo/models/basic.go index f6d8f77..87ca68f 100644 --- a/nitrogo/models/basic.go +++ b/nitrogo/models/basic.go @@ -1,58 +1,58 @@ package models // basic configuration structs -type ServerGslbservicegroupBinding struct { - Appflowlog string `json:"appflowlog,omitempty"` - Boundtd int `json:"boundtd,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Customserverid string `json:"customserverid,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` +type ServerGSLBServiceGroupBinding struct { + AppFlowLog string `json:"appflowlog,omitempty"` + BoundTD int `json:"boundtd,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + CustomServerID string `json:"customserverid,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` DupPort int `json:"dup_port,omitempty"` - DupSvctype string `json:"dup_svctype,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` + DupSvcType string `json:"dup_svctype,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Serviceipaddress string `json:"serviceipaddress,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Svctype string `json:"svctype,omitempty"` - Svrcfgflags int `json:"svrcfgflags,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceIPAddress string `json:"serviceipaddress,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + SvcType string `json:"svctype,omitempty"` + SvrCfgFlags int `json:"svrcfgflags,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` } type ServerServiceBinding struct { Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` - Serviceipaddress string `json:"serviceipaddress,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicename string `json:"servicename,omitempty"` - Svctype string `json:"svctype,omitempty"` - Svrstate string `json:"svrstate,omitempty"` + ServiceIPAddress string `json:"serviceipaddress,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SvcType string `json:"svctype,omitempty"` + SvrState string `json:"svrstate,omitempty"` } -type Servicegroupbindings struct { +type ServiceGroupBindings struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Vservername string `json:"vservername,omitempty"` + SvrState string `json:"svrstate,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Locationparameter struct { +type LocationParameter struct { Builtin []string `json:"builtin,omitempty"` Context string `json:"context,omitempty"` Custom int `json:"custom,omitempty"` Custom6 int `json:"custom6,omitempty"` - Databasemode string `json:"databasemode,omitempty"` + DatabaseMode string `json:"databasemode,omitempty"` Entries int `json:"entries,omitempty"` Entries6 int `json:"entries6,omitempty"` Errors int `json:"errors,omitempty"` @@ -65,16 +65,16 @@ type Locationparameter struct { Lines int `json:"lines,omitempty"` Lines6 int `json:"lines6,omitempty"` Loading string `json:"loading,omitempty"` - Locationfile string `json:"Locationfile,omitempty"` - Locationfile6 string `json:"locationfile6,omitempty"` - Matchwildcardtoany string `json:"matchwildcardtoany,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Q1label string `json:"q1label,omitempty"` - Q2label string `json:"q2label,omitempty"` - Q3label string `json:"q3label,omitempty"` - Q4label string `json:"q4label,omitempty"` - Q5label string `json:"q5label,omitempty"` - Q6label string `json:"q6label,omitempty"` + LocationFile string `json:"Locationfile,omitempty"` + LocationFile6 string `json:"locationfile6,omitempty"` + MatchWildcardToAny string `json:"matchwildcardtoany,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Q1Label string `json:"q1label,omitempty"` + Q2Label string `json:"q2label,omitempty"` + Q3Label string `json:"q3label,omitempty"` + Q4Label string `json:"q4label,omitempty"` + Q5Label string `json:"q5label,omitempty"` + Q6Label string `json:"q6label,omitempty"` Static int `json:"Static,omitempty"` Static6 int `json:"static6,omitempty"` Status int `json:"status,omitempty"` @@ -82,467 +82,467 @@ type Locationparameter struct { Warnings6 int `json:"warnings6,omitempty"` } -type Locationdata struct { +type LocationData struct { } -type ServicegroupServicegroupentitymonbindingsBinding struct { - Customserverid string `json:"customserverid,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` - Hashid int `json:"hashid,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` +type ServiceGroupServiceGroupEntityMonBindingsBinding struct { + CustomServerID string `json:"customserverid,omitempty"` + DBSTTL int `json:"dbsttl,omitempty"` + HashID int `json:"hashid,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` MonitorName string `json:"monitor_name,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Nameserver string `json:"nameserver,omitempty"` + MonitorCurrentFailedProbes int `json:"monitorcurrentfailedprobes,omitempty"` + MonitorTotalFailedProbes int `json:"monitortotalfailedprobes,omitempty"` + MonitorTotalProbes int `json:"monitortotalprobes,omitempty"` + NameServer string `json:"nameserver,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Serverid int `json:"serverid,omitempty"` - Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ResponseTime int `json:"responsetime,omitempty"` + ServerID int `json:"serverid,omitempty"` + ServiceGroupEntName2 string `json:"servicegroupentname2,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } type ServiceGroupBinding struct { - ServicegroupLbmonitorBinding []interface{} `json:"servicegroup_lbmonitor_binding,omitempty"` - ServicegroupServicegroupentitymonbindingsBinding []interface{} `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` - ServicegroupServicegroupmemberBinding []interface{} `json:"servicegroup_servicegroupmember_binding,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupLBMonitorBinding []interface{} `json:"servicegroup_lbmonitor_binding,omitempty"` + ServiceGroupServiceGroupEntityMonBindingsBinding []interface{} `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` + ServiceGroupServiceGroupMemberBinding []interface{} `json:"servicegroup_servicegroupmember_binding,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type ServicegroupLbmonitorBinding struct { - Customserverid string `json:"customserverid,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` - Hashid int `json:"hashid,omitempty"` +type ServiceGroupLBMonitorBinding struct { + CustomServerID string `json:"customserverid,omitempty"` + DBSTTL int `json:"dbsttl,omitempty"` + HashID int `json:"hashid,omitempty"` MonitorName string `json:"monitor_name,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monweight int `json:"monweight,omitempty"` - Nameserver string `json:"nameserver,omitempty"` + MonState string `json:"monstate,omitempty"` + MonWeight int `json:"monweight,omitempty"` + NameServer string `json:"nameserver,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` - Serverid int `json:"serverid,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServerID int `json:"serverid,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } type ServiceBinding struct { Name string `json:"name,omitempty"` - ServiceLbmonitorBinding []interface{} `json:"service_lbmonitor_binding,omitempty"` + ServiceLBMonitorBinding []interface{} `json:"service_lbmonitor_binding,omitempty"` } -type Radiusnode struct { +type RADIUSNode struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeprefix string `json:"nodeprefix,omitempty"` - Radkey string `json:"radkey,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodePrefix string `json:"nodeprefix,omitempty"` + RADKey string `json:"radkey,omitempty"` } -type Svcbindings struct { +type SVCBindings struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` - Servicename string `json:"servicename,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Vservername string `json:"vservername,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SvrState string `json:"svrstate,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type ServicegroupServicegroupmemberBinding struct { - Customserverid string `json:"customserverid,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` +type ServiceGroupServiceGroupMemberBinding struct { + CustomServerID string `json:"customserverid,omitempty"` + DBSTTL int `json:"dbsttl,omitempty"` Delay int `json:"delay,omitempty"` Graceful string `json:"graceful,omitempty"` - Hashid int `json:"hashid,omitempty"` - Ip string `json:"ip,omitempty"` - Nameserver string `json:"nameserver,omitempty"` + HashID int `json:"hashid,omitempty"` + IP string `json:"ip,omitempty"` + NameServer string `json:"nameserver,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Serverid int `json:"serverid,omitempty"` - Servername string `json:"servername,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServerID int `json:"serverid,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` State string `json:"state,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Svcitmpriority int `json:"svcitmpriority,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Trofsdelay int `json:"trofsdelay,omitempty"` - Trofsreason string `json:"trofsreason,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + SvcItmPriority int `json:"svcitmpriority,omitempty"` + SvrState string `json:"svrstate,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + TROFSDelay int `json:"trofsdelay,omitempty"` + TROFSReason string `json:"trofsreason,omitempty"` Weight int `json:"weight,omitempty"` } -type Vserver struct { - Backupvserver string `json:"backupvserver,omitempty"` +type VServer struct { + BackupVServer string `json:"backupvserver,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Name string `json:"name,omitempty"` - Pushvserver string `json:"pushvserver,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + PushVServer string `json:"pushvserver,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` } -type Nstrace struct { - Capdroppkt string `json:"capdroppkt,omitempty"` - Capsslkeys string `json:"capsslkeys,omitempty"` - Doruntimecleanup string `json:"doruntimecleanup,omitempty"` - Fileid string `json:"fileid,omitempty"` - Filename string `json:"filename,omitempty"` - Filesize int `json:"filesize,omitempty"` +type NSTrace struct { + CapDropPkt string `json:"capdroppkt,omitempty"` + CapSSLKeys string `json:"capsslkeys,omitempty"` + DoRuntimeCleanup string `json:"doruntimecleanup,omitempty"` + FileID string `json:"fileid,omitempty"` + FileName string `json:"filename,omitempty"` + FileSize int `json:"filesize,omitempty"` Filter string `json:"filter,omitempty"` - Inmemorytrace string `json:"inmemorytrace,omitempty"` + InMemoryTrace string `json:"inmemorytrace,omitempty"` Link string `json:"link,omitempty"` Merge string `json:"merge,omitempty"` Mode []string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nf int `json:"nf,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NF int `json:"nf,omitempty"` + NodeID int `json:"nodeid,omitempty"` Nodes []interface{} `json:"nodes,omitempty"` - Pernic string `json:"pernic,omitempty"` + PerNIC string `json:"pernic,omitempty"` Scope string `json:"scope,omitempty"` Size int `json:"size,omitempty"` - Skiplocalssh string `json:"skiplocalssh,omitempty"` - Skiprpc string `json:"skiprpc,omitempty"` + SkipLocalSSH string `json:"skiplocalssh,omitempty"` + SkipRPC string `json:"skiprpc,omitempty"` State string `json:"state,omitempty"` Time int `json:"time,omitempty"` - Tracebuffers int `json:"tracebuffers,omitempty"` - Traceformat string `json:"traceformat,omitempty"` - Tracelocation string `json:"tracelocation,omitempty"` + TraceBuffers int `json:"tracebuffers,omitempty"` + TraceFormat string `json:"traceformat,omitempty"` + TraceLocation string `json:"tracelocation,omitempty"` } -type Locationfile struct { - Curlocfilestatus string `json:"curlocfilestatus,omitempty"` +type LocationFile struct { + CurLocFileStatus string `json:"curlocfilestatus,omitempty"` Format string `json:"format,omitempty"` - Locationfile string `json:"Locationfile,omitempty"` - Locfilestatusstr string `json:"locfilestatusstr,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Prevlocationfile string `json:"prevlocationfile,omitempty"` - Prevlocfileformat string `json:"prevlocfileformat,omitempty"` - Prevlocfilestatus string `json:"prevlocfilestatus,omitempty"` + LocationFile string `json:"Locationfile,omitempty"` + LocFileStatusStr string `json:"locfilestatusstr,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PrevLocationFile string `json:"prevlocationfile,omitempty"` + PrevLocFileFormat string `json:"prevlocfileformat,omitempty"` + PrevLocFileStatus string `json:"prevlocfilestatus,omitempty"` Src string `json:"src,omitempty"` } -type ServerGslbserviceBinding struct { +type ServerGSLBServiceBinding struct { Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` - Serviceipaddress string `json:"serviceipaddress,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicename string `json:"servicename,omitempty"` - Svctype string `json:"svctype,omitempty"` - Svrstate string `json:"svrstate,omitempty"` + ServiceIPAddress string `json:"serviceipaddress,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SvcType string `json:"svctype,omitempty"` + SvrState string `json:"svrstate,omitempty"` } -type Extendedmemoryparam struct { - Maxmemlimit int `json:"maxmemlimit,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Memlimitactive int `json:"memlimitactive,omitempty"` - Minrequiredmemory int `json:"minrequiredmemory,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ExtendedMemoryParam struct { + MaxMemLimit int `json:"maxmemlimit,omitempty"` + MemLimit int `json:"memlimit,omitempty"` + MemLimitActive int `json:"memlimitactive,omitempty"` + MinRequiredMemory int `json:"minrequiredmemory,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } type Service struct { - Accessdown string `json:"accessdown,omitempty"` + AccessDown string `json:"accessdown,omitempty"` All bool `json:"all,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` Builtin []string `json:"builtin,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cka string `json:"cka,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Clmonowner int `json:"clmonowner,omitempty"` - Clmonview int `json:"clmonview,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Cmp string `json:"cmp,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CKA string `json:"cka,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + ClMonOwner int `json:"clmonowner,omitempty"` + ClMonView int `json:"clmonview,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + CMP string `json:"cmp,omitempty"` Comment string `json:"comment,omitempty"` - Contentinspectionprofilename string `json:"contentinspectionprofilename,omitempty"` + ContentInspectionProfileName string `json:"contentinspectionprofilename,omitempty"` Count float64 `json:"__count,omitempty"` - Customserverid string `json:"customserverid,omitempty"` + CustomServerID string `json:"customserverid,omitempty"` Delay int `json:"delay,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` DupState string `json:"dup_state,omitempty"` Feature string `json:"feature,omitempty"` Graceful string `json:"graceful,omitempty"` - Gslb string `json:"gslb,omitempty"` - Hashid int `json:"hashid,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` + GSLB string `json:"gslb,omitempty"` + HashID int `json:"hashid,omitempty"` + HealthMonitor string `json:"healthmonitor,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` Internal bool `json:"Internal,omitempty"` - Ip string `json:"ip,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Monconnectionclose string `json:"monconnectionclose,omitempty"` + IP string `json:"ip,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MonConnectionClose string `json:"monconnectionclose,omitempty"` MonitorNameSvc string `json:"monitor_name_svc,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - Monuserstatusmesg string `json:"monuserstatusmesg,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` + MonUserStatusMesg string `json:"monuserstatusmesg,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Numofconnections int `json:"numofconnections,omitempty"` - Oracleserverversion string `json:"oracleserverversion,omitempty"` - Pathmonitor string `json:"pathmonitor,omitempty"` - Pathmonitorindv string `json:"pathmonitorindv,omitempty"` - Policyname string `json:"policyname,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + NumOfConnections int `json:"numofconnections,omitempty"` + OracleServerVersion string `json:"oracleserverversion,omitempty"` + PathMonitor string `json:"pathmonitor,omitempty"` + PathMonitorIndv string `json:"pathmonitorindv,omitempty"` + PolicyName string `json:"policyname,omitempty"` Port int `json:"port,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Rtspsessionidremap string `json:"rtspsessionidremap,omitempty"` - Serverid int `json:"serverid,omitempty"` - Servername string `json:"servername,omitempty"` - Serviceconftype bool `json:"serviceconftype,omitempty"` - Serviceconftype2 string `json:"serviceconftype2,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sp string `json:"sp,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` + ResponseTime int `json:"responsetime,omitempty"` + RTSPSessionIDRemap string `json:"rtspsessionidremap,omitempty"` + ServerID int `json:"serverid,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceConfType bool `json:"serviceconftype,omitempty"` + ServiceConfType2 string `json:"serviceconftype2,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SP string `json:"sp,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Stateupdatereason int `json:"stateupdatereason,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` - Tcpb string `json:"tcpb,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` - Usip string `json:"usip,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + StateUpdateReason int `json:"stateupdatereason,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` + TCPB string `json:"tcpb,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` + USIP string `json:"usip,omitempty"` Value string `json:"value,omitempty"` Weight int `json:"weight,omitempty"` } -type ServerServicegroupBinding struct { - Appflowlog string `json:"appflowlog,omitempty"` - Boundtd int `json:"boundtd,omitempty"` +type ServerServiceGroupBinding struct { + AppFlowLog string `json:"appflowlog,omitempty"` + BoundTD int `json:"boundtd,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cka string `json:"cka,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Cmp string `json:"cmp,omitempty"` - Customserverid string `json:"customserverid,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CKA string `json:"cka,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + CMP string `json:"cmp,omitempty"` + CustomServerID string `json:"customserverid,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` DupPort int `json:"dup_port,omitempty"` - DupSvctype string `json:"dup_svctype,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` + DupSvcType string `json:"dup_svctype,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` - Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Serviceipaddress string `json:"serviceipaddress,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Sp string `json:"sp,omitempty"` - Svcitmactsvcs int `json:"svcitmactsvcs,omitempty"` - Svcitmboundsvcs int `json:"svcitmboundsvcs,omitempty"` - Svcitmpriority int `json:"svcitmpriority,omitempty"` - Svctype string `json:"svctype,omitempty"` - Svrcfgflags int `json:"svrcfgflags,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` - Tcpb string `json:"tcpb,omitempty"` - Usip string `json:"usip,omitempty"` + ServiceGroupEntName2 string `json:"servicegroupentname2,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceIPAddress string `json:"serviceipaddress,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + SP string `json:"sp,omitempty"` + SvcItmActSvcs int `json:"svcitmactsvcs,omitempty"` + SvcItmBoundSvcs int `json:"svcitmboundsvcs,omitempty"` + SvcItmPriority int `json:"svcitmpriority,omitempty"` + SvcType string `json:"svctype,omitempty"` + SvrCfgFlags int `json:"svrcfgflags,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` + TCPB string `json:"tcpb,omitempty"` + USIP string `json:"usip,omitempty"` Weight int `json:"weight,omitempty"` } -type Dbsmonitors struct { +type DBSMonitors struct { } -type Locationfile6 struct { +type LocationFile6 struct { Count float64 `json:"__count,omitempty"` - Curlocfilestatus string `json:"curlocfilestatus,omitempty"` + CurLocFileStatus string `json:"curlocfilestatus,omitempty"` Format string `json:"format,omitempty"` - Locationfile string `json:"Locationfile,omitempty"` - Locfilestatusstr string `json:"locfilestatusstr,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Prevlocationfile string `json:"prevlocationfile,omitempty"` - Prevlocfileformat string `json:"prevlocfileformat,omitempty"` - Prevlocfilestatus string `json:"prevlocfilestatus,omitempty"` + LocationFile string `json:"Locationfile,omitempty"` + LocFileStatusStr string `json:"locfilestatusstr,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PrevLocationFile string `json:"prevlocationfile,omitempty"` + PrevLocFileFormat string `json:"prevlocfileformat,omitempty"` + PrevLocFileStatus string `json:"prevlocfilestatus,omitempty"` Src string `json:"src,omitempty"` } -type Servicegroup struct { - Appflowlog string `json:"appflowlog,omitempty"` - Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` - Autodisabledelay int `json:"autodisabledelay,omitempty"` - Autodisablegraceful string `json:"autodisablegraceful,omitempty"` - Autoscale string `json:"autoscale,omitempty"` +type ServiceGroup struct { + AppFlowLog string `json:"appflowlog,omitempty"` + AutoDelayedTROFS string `json:"autodelayedtrofs,omitempty"` + AutoDisableDelay int `json:"autodisabledelay,omitempty"` + AutoDisableGraceful string `json:"autodisablegraceful,omitempty"` + AutoScale string `json:"autoscale,omitempty"` Bootstrap string `json:"bootstrap,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cka string `json:"cka,omitempty"` - Clmonowner int `json:"clmonowner,omitempty"` - Clmonview int `json:"clmonview,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Cmp string `json:"cmp,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CKA string `json:"cka,omitempty"` + ClMonOwner int `json:"clmonowner,omitempty"` + ClMonView int `json:"clmonview,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + CMP string `json:"cmp,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Customserverid string `json:"customserverid,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` + CustomServerID string `json:"customserverid,omitempty"` + DBSTTL int `json:"dbsttl,omitempty"` Delay int `json:"delay,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` DupWeight int `json:"dup_weight,omitempty"` Graceful string `json:"graceful,omitempty"` - Groupcount int `json:"groupcount,omitempty"` - Hashid int `json:"hashid,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Includemembers bool `json:"includemembers,omitempty"` - Ip string `json:"ip,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Memberport int `json:"memberport,omitempty"` - Monconnectionclose string `json:"monconnectionclose,omitempty"` + GroupCount int `json:"groupcount,omitempty"` + HashID int `json:"hashid,omitempty"` + HealthMonitor string `json:"healthmonitor,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + IncludeMembers bool `json:"includemembers,omitempty"` + IP string `json:"ip,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MemberPort int `json:"memberport,omitempty"` + MonConnectionClose string `json:"monconnectionclose,omitempty"` MonitorNameSvc string `json:"monitor_name_svc,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - Monuserstatusmesg string `json:"monuserstatusmesg,omitempty"` - Nameserver string `json:"nameserver,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Numofconnections int `json:"numofconnections,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` + MonUserStatusMesg string `json:"monuserstatusmesg,omitempty"` + NameServer string `json:"nameserver,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + NumOfConnections int `json:"numofconnections,omitempty"` Order int `json:"order,omitempty"` - Pathmonitor string `json:"pathmonitor,omitempty"` - Pathmonitorindv string `json:"pathmonitorindv,omitempty"` + PathMonitor string `json:"pathmonitor,omitempty"` + PathMonitorIndv string `json:"pathmonitorindv,omitempty"` Port int `json:"port,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` - Rtspsessionidremap string `json:"rtspsessionidremap,omitempty"` - Serverid int `json:"serverid,omitempty"` - Servername string `json:"servername,omitempty"` - Serviceconftype bool `json:"serviceconftype,omitempty"` - Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sp string `json:"sp,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` + RTSPSessionIDRemap string `json:"rtspsessionidremap,omitempty"` + ServerID int `json:"serverid,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceConfType bool `json:"serviceconftype,omitempty"` + ServiceGroupEffectiveState string `json:"servicegroupeffectivestate,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SP string `json:"sp,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Stateupdatereason int `json:"stateupdatereason,omitempty"` - Svcitmactsvcs int `json:"svcitmactsvcs,omitempty"` - Svcitmboundsvcs int `json:"svcitmboundsvcs,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` - Tcpb string `json:"tcpb,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` - Topicname string `json:"topicname,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` - Usip string `json:"usip,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateUpdateReason int `json:"stateupdatereason,omitempty"` + SvcItmActSvcs int `json:"svcitmactsvcs,omitempty"` + SvcItmBoundSvcs int `json:"svcitmboundsvcs,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` + TCPB string `json:"tcpb,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` + TopicName string `json:"topicname,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` + USIP string `json:"usip,omitempty"` Value string `json:"value,omitempty"` Weight int `json:"weight,omitempty"` } type ServerBinding struct { Name string `json:"name,omitempty"` - ServerGslbserviceBinding []interface{} `json:"server_gslbservice_binding,omitempty"` - ServerGslbservicegroupBinding []interface{} `json:"server_gslbservicegroup_binding,omitempty"` + ServerGSLBServiceBinding []interface{} `json:"server_gslbservice_binding,omitempty"` + ServerGSLBServiceGroupBinding []interface{} `json:"server_gslbservicegroup_binding,omitempty"` ServerServiceBinding []interface{} `json:"server_service_binding,omitempty"` - ServerServicegroupBinding []interface{} `json:"server_servicegroup_binding,omitempty"` + ServerServiceGroupBinding []interface{} `json:"server_servicegroup_binding,omitempty"` } -type ServiceLbmonitorBinding struct { +type ServiceLBMonitorBinding struct { DupState string `json:"dup_state,omitempty"` DupWeight int `json:"dup_weight,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` + FailedProbes int `json:"failedprobes,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` MonitorName string `json:"monitor_name,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` + MonitorCurrentFailedProbes int `json:"monitorcurrentfailedprobes,omitempty"` + MonitorTotalFailedProbes int `json:"monitortotalfailedprobes,omitempty"` + MonitorTotalProbes int `json:"monitortotalprobes,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonState string `json:"monstate,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` Name string `json:"name,omitempty"` Passive bool `json:"passive,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Totalprobes int `json:"totalprobes,omitempty"` + ResponseTime int `json:"responsetime,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` + TotalProbes int `json:"totalprobes,omitempty"` Weight int `json:"weight,omitempty"` } -type ServicegroupServicegroupmemberlistBinding struct { - Failedmembers []interface{} `json:"failedmembers,omitempty"` +type ServiceGroupServiceGroupMemberListBinding struct { + FailedMembers []interface{} `json:"failedmembers,omitempty"` Members []interface{} `json:"members,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } type Server struct { - Autoscale string `json:"autoscale,omitempty"` + AutoScale string `json:"autoscale,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cka string `json:"cka,omitempty"` - Cmp string `json:"cmp,omitempty"` + CKA string `json:"cka,omitempty"` + CMP string `json:"cmp,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Delay int `json:"delay,omitempty"` Domain string `json:"domain,omitempty"` - Domainresolvenow bool `json:"domainresolvenow,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` + DomainResolveNow bool `json:"domainresolvenow,omitempty"` + DomainResolveRetry int `json:"domainresolveretry,omitempty"` Graceful string `json:"graceful,omitempty"` Internal bool `json:"Internal,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPv6Address string `json:"ipv6address,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Querytype string `json:"querytype,omitempty"` - Sp string `json:"sp,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + QueryType string `json:"querytype,omitempty"` + SP string `json:"sp,omitempty"` State string `json:"state,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Tcpb string `json:"tcpb,omitempty"` - Td int `json:"td,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Translationip string `json:"translationip,omitempty"` - Translationmask string `json:"translationmask,omitempty"` - Usip string `json:"usip,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + TCPB string `json:"tcpb,omitempty"` + TD int `json:"td,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + TranslationIP string `json:"translationip,omitempty"` + TranslationMask string `json:"translationmask,omitempty"` + USIP string `json:"usip,omitempty"` } type Location struct { Count float64 `json:"__count,omitempty"` - Ipfrom string `json:"ipfrom,omitempty"` - Ipto string `json:"ipto,omitempty"` + IPFrom string `json:"ipfrom,omitempty"` + IPTo string `json:"ipto,omitempty"` Latitude int `json:"latitude,omitempty"` Longitude int `json:"longitude,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Q1label string `json:"q1label,omitempty"` - Q2label string `json:"q2label,omitempty"` - Q3label string `json:"q3label,omitempty"` - Q4label string `json:"q4label,omitempty"` - Q5label string `json:"q5label,omitempty"` - Q6label string `json:"q6label,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + Q1Label string `json:"q1label,omitempty"` + Q2Label string `json:"q2label,omitempty"` + Q3Label string `json:"q3label,omitempty"` + Q4Label string `json:"q4label,omitempty"` + Q5Label string `json:"q5label,omitempty"` + Q6Label string `json:"q6label,omitempty"` } diff --git a/nitrogo/models/bfd.go b/nitrogo/models/bfd.go index 23ca627..38f7f5b 100644 --- a/nitrogo/models/bfd.go +++ b/nitrogo/models/bfd.go @@ -1,28 +1,28 @@ package models // bfd configuration structs -type Bfdsession struct { - Admindown bool `json:"admindown,omitempty"` +type BFDSession struct { + AdminDown bool `json:"admindown,omitempty"` Count float64 `json:"__count,omitempty"` - Currentownerpe int `json:"currentownerpe,omitempty"` - Localdiagnotic int `json:"localdiagnotic,omitempty"` - Localdiscriminator int `json:"localdiscriminator,omitempty"` - Localip string `json:"localip,omitempty"` - Localport int `json:"localport,omitempty"` - Minimumreceiveinterval int `json:"minimumreceiveinterval,omitempty"` - Minimumtransmitinterval int `json:"minimumtransmitinterval,omitempty"` - Multihop bool `json:"multihop,omitempty"` + CurrentOwnerPE int `json:"currentownerpe,omitempty"` + LocalDiagnotic int `json:"localdiagnotic,omitempty"` + LocalDiscriminator int `json:"localdiscriminator,omitempty"` + LocalIP string `json:"localip,omitempty"` + LocalPort int `json:"localport,omitempty"` + MinimumReceiveInterval int `json:"minimumreceiveinterval,omitempty"` + MinimumTransmitInterval int `json:"minimumtransmitinterval,omitempty"` + MultiHop bool `json:"multihop,omitempty"` Multiplier int `json:"multiplier,omitempty"` - Negotiatedminimumreceiveinterval int `json:"negotiatedminimumreceiveinterval,omitempty"` - Negotiatedminimumtransmitinterval int `json:"negotiatedminimumtransmitinterval,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Originalownerpe int `json:"originalownerpe,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + NegotiatedMinimumReceiveInterval int `json:"negotiatedminimumreceiveinterval,omitempty"` + NegotiatedMinimumTransmitInterval int `json:"negotiatedminimumtransmitinterval,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OriginalOwnerPE int `json:"originalownerpe,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` Passive bool `json:"passive,omitempty"` - Remotediscriminator int `json:"remotediscriminator,omitempty"` - Remoteip string `json:"remoteip,omitempty"` - Remotemultiplier int `json:"remotemultiplier,omitempty"` - Remoteport int `json:"remoteport,omitempty"` + RemoteDiscriminator int `json:"remotediscriminator,omitempty"` + RemoteIP string `json:"remoteip,omitempty"` + RemoteMultiplier int `json:"remotemultiplier,omitempty"` + RemotePort int `json:"remoteport,omitempty"` State string `json:"state,omitempty"` - Vlan int `json:"vlan,omitempty"` + VLAN int `json:"vlan,omitempty"` } diff --git a/nitrogo/models/bot.go b/nitrogo/models/bot.go index 3b43544..7248313 100644 --- a/nitrogo/models/bot.go +++ b/nitrogo/models/bot.go @@ -1,302 +1,302 @@ package models // bot configuration structs -type Botprofile struct { - Addcookieflags string `json:"addcookieflags,omitempty"` +type BotProfile struct { + AddCookieFlags string `json:"addcookieflags,omitempty"` BotEnableBlackList string `json:"bot_enable_black_list,omitempty"` - BotEnableIpReputation string `json:"bot_enable_ip_reputation,omitempty"` + BotEnableIPReputation string `json:"bot_enable_ip_reputation,omitempty"` BotEnableRateLimit string `json:"bot_enable_rate_limit,omitempty"` - BotEnableTps string `json:"bot_enable_tps,omitempty"` + BotEnableTPS string `json:"bot_enable_tps,omitempty"` BotEnableWhiteList string `json:"bot_enable_white_list,omitempty"` Builtin []string `json:"builtin,omitempty"` - Clientipexpression string `json:"clientipexpression,omitempty"` + ClientIPExpression string `json:"clientipexpression,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Devicefingerprint string `json:"devicefingerprint,omitempty"` - Devicefingerprintaction []string `json:"devicefingerprintaction,omitempty"` - Devicefingerprintmobile []string `json:"devicefingerprintmobile,omitempty"` - Dfprequestlimit int `json:"dfprequestlimit,omitempty"` - Errorurl string `json:"errorurl,omitempty"` + DeviceFingerprint string `json:"devicefingerprint,omitempty"` + DeviceFingerprintAction []string `json:"devicefingerprintaction,omitempty"` + DeviceFingerprintMobile []string `json:"devicefingerprintmobile,omitempty"` + DFPRequestLimit int `json:"dfprequestlimit,omitempty"` + ErrorURL string `json:"errorurl,omitempty"` Feature string `json:"feature,omitempty"` - Headlessbrowserdetection string `json:"headlessbrowserdetection,omitempty"` - Kmdetection string `json:"kmdetection,omitempty"` - Kmeventspostbodylimit int `json:"kmeventspostbodylimit,omitempty"` - Kmjavascriptname string `json:"kmjavascriptname,omitempty"` + HeadlessBrowserDetection string `json:"headlessbrowserdetection,omitempty"` + KMDetection string `json:"kmdetection,omitempty"` + KMEventsPostBodyLimit int `json:"kmeventspostbodylimit,omitempty"` + KMJavascriptName string `json:"kmjavascriptname,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SessionCookieName string `json:"sessioncookiename,omitempty"` + SessionTimeout int `json:"sessiontimeout,omitempty"` Signature string `json:"signature,omitempty"` - Signaturemultipleuseragentheaderaction []string `json:"signaturemultipleuseragentheaderaction,omitempty"` - Signaturenouseragentheaderaction []string `json:"signaturenouseragentheaderaction,omitempty"` - Spoofedreqaction []string `json:"spoofedreqaction,omitempty"` + SignatureMultipleUserAgentHeaderAction []string `json:"signaturemultipleuseragentheaderaction,omitempty"` + SignatureNoUserAgentHeaderAction []string `json:"signaturenouseragentheaderaction,omitempty"` + SpoofedReqAction []string `json:"spoofedreqaction,omitempty"` Trap string `json:"trap,omitempty"` - Trapaction []string `json:"trapaction,omitempty"` - Trapurl string `json:"trapurl,omitempty"` - Verboseloglevel string `json:"verboseloglevel,omitempty"` + TrapAction []string `json:"trapaction,omitempty"` + TrapURL string `json:"trapurl,omitempty"` + VerboseLogLevel string `json:"verboseloglevel,omitempty"` } -type BotpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type BotPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type BotprofileKmdetectionexprBinding struct { +type BotProfileKMDetectionExprBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` - BotKmDetectionEnabled string `json:"bot_km_detection_enabled,omitempty"` - BotKmExpressionName string `json:"bot_km_expression_name,omitempty"` - BotKmExpressionValue string `json:"bot_km_expression_value,omitempty"` - Kmdetectionexpr bool `json:"kmdetectionexpr,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + BotKMDetectionEnabled string `json:"bot_km_detection_enabled,omitempty"` + BotKMExpressionName string `json:"bot_km_expression_name,omitempty"` + BotKMExpressionValue string `json:"bot_km_expression_value,omitempty"` + KMDetectionExpr bool `json:"kmdetectionexpr,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` } -type BotprofileIpreputationBinding struct { +type BotProfileIPReputationBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` - BotIprepAction []string `json:"bot_iprep_action,omitempty"` - BotIprepEnabled string `json:"bot_iprep_enabled,omitempty"` - BotIpreputation bool `json:"bot_ipreputation,omitempty"` + BotIPRepAction []string `json:"bot_iprep_action,omitempty"` + BotIPRepEnabled string `json:"bot_iprep_enabled,omitempty"` + BotIPReputation bool `json:"bot_ipreputation,omitempty"` Category string `json:"category,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` } -type Botsignature struct { +type BotSignature struct { Comment string `json:"comment,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` Response string `json:"response,omitempty"` Src string `json:"src,omitempty"` } -type BotpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type BotPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Botsettings struct { +type BotSettings struct { Builtin []string `json:"builtin,omitempty"` - Defaultnonintrusiveprofile string `json:"defaultnonintrusiveprofile,omitempty"` - Defaultprofile string `json:"defaultprofile,omitempty"` - Dfprequestlimit int `json:"dfprequestlimit,omitempty"` + DefaultNonIntrusiveProfile string `json:"defaultnonintrusiveprofile,omitempty"` + DefaultProfile string `json:"defaultprofile,omitempty"` + DFPRequestLimit int `json:"dfprequestlimit,omitempty"` Feature string `json:"feature,omitempty"` - Javascriptname string `json:"javascriptname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Proxyport int `json:"proxyport,omitempty"` - Proxyserver string `json:"proxyserver,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` - Sessioncookiename string `json:"sessioncookiename,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Signatureautoupdate string `json:"signatureautoupdate,omitempty"` - Signatureurl string `json:"signatureurl,omitempty"` - Trapurlautogenerate string `json:"trapurlautogenerate,omitempty"` - Trapurlinterval int `json:"trapurlinterval,omitempty"` - Trapurllength int `json:"trapurllength,omitempty"` + JavascriptName string `json:"javascriptname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProxyPassword string `json:"proxypassword,omitempty"` + ProxyPort int `json:"proxyport,omitempty"` + ProxyServer string `json:"proxyserver,omitempty"` + ProxyUsername string `json:"proxyusername,omitempty"` + SessionCookieName string `json:"sessioncookiename,omitempty"` + SessionTimeout int `json:"sessiontimeout,omitempty"` + SignatureAutoUpdate string `json:"signatureautoupdate,omitempty"` + SignatureURL string `json:"signatureurl,omitempty"` + TrapURLAutoGenerate string `json:"trapurlautogenerate,omitempty"` + TrapURLInterval int `json:"trapurlinterval,omitempty"` + TrapURLLength int `json:"trapurllength,omitempty"` } -type BotpolicylabelBinding struct { - BotpolicylabelBotpolicyBinding []interface{} `json:"botpolicylabel_botpolicy_binding,omitempty"` - BotpolicylabelPolicybindingBinding []interface{} `json:"botpolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type BotPolicyLabelBinding struct { + BotPolicyLabelBotPolicyBinding []interface{} `json:"botpolicylabel_botpolicy_binding,omitempty"` + BotPolicyLabelPolicyBindingBinding []interface{} `json:"botpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type BotglobalBotpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type BotGlobalBotPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type BotpolicyBinding struct { - BotpolicyBotglobalBinding []interface{} `json:"botpolicy_botglobal_binding,omitempty"` - BotpolicyBotpolicylabelBinding []interface{} `json:"botpolicy_botpolicylabel_binding,omitempty"` - BotpolicyCsvserverBinding []interface{} `json:"botpolicy_csvserver_binding,omitempty"` - BotpolicyLbvserverBinding []interface{} `json:"botpolicy_lbvserver_binding,omitempty"` +type BotPolicyBinding struct { + BotPolicyBotGlobalBinding []interface{} `json:"botpolicy_botglobal_binding,omitempty"` + BotPolicyBotPolicyLabelBinding []interface{} `json:"botpolicy_botpolicylabel_binding,omitempty"` + BotPolicyCSVServerBinding []interface{} `json:"botpolicy_csvserver_binding,omitempty"` + BotPolicyLBVServerBinding []interface{} `json:"botpolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type BotprofileTrapinsertionurlBinding struct { +type BotProfileTrapInsertionURLBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` - BotTrapUrl string `json:"bot_trap_url,omitempty"` - BotTrapUrlInsertionEnabled string `json:"bot_trap_url_insertion_enabled,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + BotTrapURL string `json:"bot_trap_url,omitempty"` + BotTrapURLInsertionEnabled string `json:"bot_trap_url_insertion_enabled,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` - Trapinsertionurl bool `json:"trapinsertionurl,omitempty"` + TrapInsertionURL bool `json:"trapinsertionurl,omitempty"` } -type BotprofileBinding struct { - BotprofileBlacklistBinding []interface{} `json:"botprofile_blacklist_binding,omitempty"` - BotprofileCaptchaBinding []interface{} `json:"botprofile_captcha_binding,omitempty"` - BotprofileIpreputationBinding []interface{} `json:"botprofile_ipreputation_binding,omitempty"` - BotprofileKmdetectionexprBinding []interface{} `json:"botprofile_kmdetectionexpr_binding,omitempty"` - BotprofileLogexpressionBinding []interface{} `json:"botprofile_logexpression_binding,omitempty"` - BotprofileRatelimitBinding []interface{} `json:"botprofile_ratelimit_binding,omitempty"` - BotprofileTpsBinding []interface{} `json:"botprofile_tps_binding,omitempty"` - BotprofileTrapinsertionurlBinding []interface{} `json:"botprofile_trapinsertionurl_binding,omitempty"` - BotprofileWhitelistBinding []interface{} `json:"botprofile_whitelist_binding,omitempty"` +type BotProfileBinding struct { + BotProfileBlacklistBinding []interface{} `json:"botprofile_blacklist_binding,omitempty"` + BotProfileCaptchaBinding []interface{} `json:"botprofile_captcha_binding,omitempty"` + BotProfileIPReputationBinding []interface{} `json:"botprofile_ipreputation_binding,omitempty"` + BotProfileKMDetectionExprBinding []interface{} `json:"botprofile_kmdetectionexpr_binding,omitempty"` + BotProfileLogExpressionBinding []interface{} `json:"botprofile_logexpression_binding,omitempty"` + BotProfileRateLimitBinding []interface{} `json:"botprofile_ratelimit_binding,omitempty"` + BotProfileTPSBinding []interface{} `json:"botprofile_tps_binding,omitempty"` + BotProfileTrapInsertionURLBinding []interface{} `json:"botprofile_trapinsertionurl_binding,omitempty"` + BotProfileWhitelistBinding []interface{} `json:"botprofile_whitelist_binding,omitempty"` Name string `json:"name,omitempty"` } -type Botpolicy struct { +type BotPolicy struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type BotpolicylabelBotpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type BotPolicyLabelBotPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type BotprofileWhitelistBinding struct { +type BotProfileWhitelistBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` BotWhitelist bool `json:"bot_whitelist,omitempty"` BotWhitelistEnabled string `json:"bot_whitelist_enabled,omitempty"` BotWhitelistType string `json:"bot_whitelist_type,omitempty"` BotWhitelistValue string `json:"bot_whitelist_value,omitempty"` Log string `json:"log,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` } -type BotglobalBinding struct { - BotglobalBotpolicyBinding []interface{} `json:"botglobal_botpolicy_binding,omitempty"` +type BotGlobalBinding struct { + BotGlobalBotPolicyBinding []interface{} `json:"botglobal_botpolicy_binding,omitempty"` } -type BotprofileLogexpressionBinding struct { +type BotProfileLogExpressionBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` BotLogExpressionEnabled string `json:"bot_log_expression_enabled,omitempty"` BotLogExpressionName string `json:"bot_log_expression_name,omitempty"` BotLogExpressionValue string `json:"bot_log_expression_value,omitempty"` - Logexpression bool `json:"logexpression,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + LogExpression bool `json:"logexpression,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` } -type Botpolicylabel struct { +type BotPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + LabelName string `json:"labelname,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` } -type BotprofileCaptchaBinding struct { +type BotProfileCaptchaBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` BotCaptchaAction []string `json:"bot_captcha_action,omitempty"` BotCaptchaEnabled string `json:"bot_captcha_enabled,omitempty"` - BotCaptchaUrl string `json:"bot_captcha_url,omitempty"` - Captcharesource bool `json:"captcharesource,omitempty"` - Graceperiod int `json:"graceperiod,omitempty"` - Logmessage string `json:"logmessage,omitempty"` - Muteperiod int `json:"muteperiod,omitempty"` + BotCaptchaURL string `json:"bot_captcha_url,omitempty"` + CaptchaResource bool `json:"captcharesource,omitempty"` + GracePeriod int `json:"graceperiod,omitempty"` + LogMessage string `json:"logmessage,omitempty"` + MutePeriod int `json:"muteperiod,omitempty"` Name string `json:"name,omitempty"` - Requestsizelimit int `json:"requestsizelimit,omitempty"` - Retryattempts int `json:"retryattempts,omitempty"` - Waittime int `json:"waittime,omitempty"` + RequestSizeLimit int `json:"requestsizelimit,omitempty"` + RetryAttempts int `json:"retryattempts,omitempty"` + WaitTime int `json:"waittime,omitempty"` } -type BotpolicyBotglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type BotPolicyBotGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type BotpolicyBotpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type BotPolicyBotPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type BotpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type BotPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type BotprofileTpsBinding struct { +type BotProfileTPSBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` - BotTps bool `json:"bot_tps,omitempty"` - BotTpsAction []string `json:"bot_tps_action,omitempty"` - BotTpsEnabled string `json:"bot_tps_enabled,omitempty"` - BotTpsType string `json:"bot_tps_type,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + BotTPS bool `json:"bot_tps,omitempty"` + BotTPSAction []string `json:"bot_tps_action,omitempty"` + BotTPSEnabled string `json:"bot_tps_enabled,omitempty"` + BotTPSType string `json:"bot_tps_type,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` Percentage int `json:"percentage,omitempty"` Threshold int `json:"threshold,omitempty"` } -type BotprofileRatelimitBinding struct { +type BotProfileRateLimitBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` BotRateLimitAction []string `json:"bot_rate_limit_action,omitempty"` BotRateLimitEnabled string `json:"bot_rate_limit_enabled,omitempty"` BotRateLimitType string `json:"bot_rate_limit_type,omitempty"` - BotRateLimitUrl string `json:"bot_rate_limit_url,omitempty"` - BotRatelimit bool `json:"bot_ratelimit,omitempty"` + BotRateLimitURL string `json:"bot_rate_limit_url,omitempty"` + BotRateLimit bool `json:"bot_ratelimit,omitempty"` Condition string `json:"condition,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Countrycode string `json:"countrycode,omitempty"` - Limittype string `json:"limittype,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CountryCode string `json:"countrycode,omitempty"` + LimitType string `json:"limittype,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` Rate int `json:"rate,omitempty"` - Timeslice int `json:"timeslice,omitempty"` + TimeSlice int `json:"timeslice,omitempty"` } -type BotprofileBlacklistBinding struct { +type BotProfileBlacklistBinding struct { BotBindComment string `json:"bot_bind_comment,omitempty"` BotBlacklist bool `json:"bot_blacklist,omitempty"` BotBlacklistAction []string `json:"bot_blacklist_action,omitempty"` BotBlacklistEnabled string `json:"bot_blacklist_enabled,omitempty"` BotBlacklistType string `json:"bot_blacklist_type,omitempty"` BotBlacklistValue string `json:"bot_blacklist_value,omitempty"` - Logmessage string `json:"logmessage,omitempty"` + LogMessage string `json:"logmessage,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/cache.go b/nitrogo/models/cache.go index 2f84093..a7bf0fa 100644 --- a/nitrogo/models/cache.go +++ b/nitrogo/models/cache.go @@ -1,304 +1,304 @@ package models // cache configuration structs -type CachepolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachePolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CacheglobalBinding struct { - CacheglobalCachepolicyBinding []interface{} `json:"cacheglobal_cachepolicy_binding,omitempty"` +type CacheGlobalBinding struct { + CacheGlobalCachePolicyBinding []interface{} `json:"cacheglobal_cachepolicy_binding,omitempty"` } -type CachepolicyCachepolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachePolicyCachePolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Cachepolicy struct { +type CachePolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Flags int `json:"flags,omitempty"` Hits int `json:"hits,omitempty"` - Invalgroups []string `json:"invalgroups,omitempty"` - Invalobjects []string `json:"invalobjects,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvalGroups []string `json:"invalgroups,omitempty"` + InvalObjects []string `json:"invalobjects,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyName string `json:"policyname,omitempty"` Rule string `json:"rule,omitempty"` - Storeingroup string `json:"storeingroup,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + StoreInGroup string `json:"storeingroup,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type CachepolicyCacheglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachePolicyCacheGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CachepolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachePolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Cacheparameter struct { - Cacheevictionpolicy string `json:"cacheevictionpolicy,omitempty"` - Disklimit int `json:"disklimit,omitempty"` - Enablebypass string `json:"enablebypass,omitempty"` - Enablehaobjpersist string `json:"enablehaobjpersist,omitempty"` - Maxdisklimit int `json:"maxdisklimit,omitempty"` - Maxmemlimit int `json:"maxmemlimit,omitempty"` - Maxpostlen int `json:"maxpostlen,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Memlimitactive int `json:"memlimitactive,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Prefetchcur int `json:"prefetchcur,omitempty"` - Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Verifyusing string `json:"verifyusing,omitempty"` +type CacheParameter struct { + CacheEvictionPolicy string `json:"cacheevictionpolicy,omitempty"` + DiskLimit int `json:"disklimit,omitempty"` + EnableBypass string `json:"enablebypass,omitempty"` + EnableHAObjPersist string `json:"enablehaobjpersist,omitempty"` + MaxDiskLimit int `json:"maxdisklimit,omitempty"` + MaxMemLimit int `json:"maxmemlimit,omitempty"` + MaxPostLen int `json:"maxpostlen,omitempty"` + MemLimit int `json:"memlimit,omitempty"` + MemLimitActive int `json:"memlimitactive,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PrefetchCur int `json:"prefetchcur,omitempty"` + PrefetchMaxPending int `json:"prefetchmaxpending,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + VerifyUsing string `json:"verifyusing,omitempty"` Via string `json:"via,omitempty"` } -type CachepolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CachePolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CachepolicyBinding struct { - CachepolicyCacheglobalBinding []interface{} `json:"cachepolicy_cacheglobal_binding,omitempty"` - CachepolicyCachepolicylabelBinding []interface{} `json:"cachepolicy_cachepolicylabel_binding,omitempty"` - CachepolicyCsvserverBinding []interface{} `json:"cachepolicy_csvserver_binding,omitempty"` - CachepolicyLbvserverBinding []interface{} `json:"cachepolicy_lbvserver_binding,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CachePolicyBinding struct { + CachePolicyCacheGlobalBinding []interface{} `json:"cachepolicy_cacheglobal_binding,omitempty"` + CachePolicyCachePolicyLabelBinding []interface{} `json:"cachepolicy_cachepolicylabel_binding,omitempty"` + CachePolicyCSVServerBinding []interface{} `json:"cachepolicy_csvserver_binding,omitempty"` + CachePolicyLBVServerBinding []interface{} `json:"cachepolicy_lbvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } -type Cacheselector struct { +type CacheSelector struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Flags int `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule []string `json:"rule,omitempty"` - Selectorname string `json:"selectorname,omitempty"` + SelectorName string `json:"selectorname,omitempty"` } -type Cachepolicylabel struct { +type CachePolicyLabel struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Evaluates string `json:"evaluates,omitempty"` Feature string `json:"feature,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` Priority int `json:"priority,omitempty"` } -type CacheglobalCachepolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CacheGlobalCachePolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` Policy string `json:"policy,omitempty"` - Precededefrules string `json:"precededefrules,omitempty"` + PrecedeDefRules string `json:"precededefrules,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Cacheobject struct { - Cachecellappfwmetadataexists string `json:"cachecellappfwmetadataexists,omitempty"` - Cachecellbasefile string `json:"cachecellbasefile,omitempty"` - Cachecellcomplex string `json:"cachecellcomplex,omitempty"` - Cachecellcompressionformat string `json:"cachecellcompressionformat,omitempty"` - Cachecellcurmisses int `json:"cachecellcurmisses,omitempty"` - Cachecellcurreaders int `json:"cachecellcurreaders,omitempty"` - Cachecelldestipverified string `json:"cachecelldestipverified,omitempty"` - Cachecelldhits int `json:"cachecelldhits,omitempty"` - Cachecelletaginserted string `json:"cachecelletaginserted,omitempty"` - Cachecellexpires int `json:"cachecellexpires,omitempty"` - Cachecellexpiresmillisec int `json:"cachecellexpiresmillisec,omitempty"` - Cachecellfwpxyobj string `json:"cachecellfwpxyobj,omitempty"` - Cachecellhits int `json:"cachecellhits,omitempty"` - Cachecellhttp11 string `json:"cachecellhttp11,omitempty"` - Cachecellminhit int `json:"cachecellminhit,omitempty"` - Cachecellminhitflag string `json:"cachecellminhitflag,omitempty"` - Cachecellmisses int `json:"cachecellmisses,omitempty"` - Cachecellpolleverytime string `json:"cachecellpolleverytime,omitempty"` - Cachecellreadywithlastbyte string `json:"cachecellreadywithlastbyte,omitempty"` - Cachecellreqtime int `json:"cachecellreqtime,omitempty"` - Cachecellresbadsize string `json:"cachecellresbadsize,omitempty"` - Cachecellrestime int `json:"cachecellrestime,omitempty"` - Cachecellweaketag string `json:"cachecellweaketag,omitempty"` - Cachecontrol string `json:"cachecontrol,omitempty"` - Cachecurage int `json:"cachecurage,omitempty"` - Cachedirname string `json:"cachedirname,omitempty"` - Cacheetag string `json:"cacheetag,omitempty"` - Cachefilename string `json:"cachefilename,omitempty"` - Cacheindisk string `json:"cacheindisk,omitempty"` - Cacheinmemory string `json:"cacheinmemory,omitempty"` - Cacheinsecondary string `json:"cacheinsecondary,omitempty"` - Cacheresdate string `json:"cacheresdate,omitempty"` - Cachereshdrsize int `json:"cachereshdrsize,omitempty"` - Cachereslastmod string `json:"cachereslastmod,omitempty"` - Cacheressize int `json:"cacheressize,omitempty"` - Cacheurls string `json:"cacheurls,omitempty"` - Ceflags int `json:"ceflags,omitempty"` - Contentgroup string `json:"contentgroup,omitempty"` +type CacheObject struct { + CacheCellAppFWMetadataExists string `json:"cachecellappfwmetadataexists,omitempty"` + CacheCellBaseFile string `json:"cachecellbasefile,omitempty"` + CacheCellComplex string `json:"cachecellcomplex,omitempty"` + CacheCellCompressionFormat string `json:"cachecellcompressionformat,omitempty"` + CacheCellCurMisses int `json:"cachecellcurmisses,omitempty"` + CacheCellCurReaders int `json:"cachecellcurreaders,omitempty"` + CacheCellDestIPVerified string `json:"cachecelldestipverified,omitempty"` + CacheCellDHits int `json:"cachecelldhits,omitempty"` + CacheCellETagInserted string `json:"cachecelletaginserted,omitempty"` + CacheCellExpires int `json:"cachecellexpires,omitempty"` + CacheCellExpiresMillisec int `json:"cachecellexpiresmillisec,omitempty"` + CacheCellFWPxyObj string `json:"cachecellfwpxyobj,omitempty"` + CacheCellHits int `json:"cachecellhits,omitempty"` + CacheCellHTTP11 string `json:"cachecellhttp11,omitempty"` + CacheCellMinHit int `json:"cachecellminhit,omitempty"` + CacheCellMinHitFlag string `json:"cachecellminhitflag,omitempty"` + CacheCellMisses int `json:"cachecellmisses,omitempty"` + CacheCellPollEveryTime string `json:"cachecellpolleverytime,omitempty"` + CacheCellReadyWithLastByte string `json:"cachecellreadywithlastbyte,omitempty"` + CacheCellReqTime int `json:"cachecellreqtime,omitempty"` + CacheCellResBadSize string `json:"cachecellresbadsize,omitempty"` + CacheCellResTime int `json:"cachecellrestime,omitempty"` + CacheCellWeakETag string `json:"cachecellweaketag,omitempty"` + CacheControl string `json:"cachecontrol,omitempty"` + CacheCurAge int `json:"cachecurage,omitempty"` + CacheDirName string `json:"cachedirname,omitempty"` + CacheETag string `json:"cacheetag,omitempty"` + CacheFileName string `json:"cachefilename,omitempty"` + CacheInDisk string `json:"cacheindisk,omitempty"` + CacheInMemory string `json:"cacheinmemory,omitempty"` + CacheInSecondary string `json:"cacheinsecondary,omitempty"` + CacheResDate string `json:"cacheresdate,omitempty"` + CacheResHdrSize int `json:"cachereshdrsize,omitempty"` + CacheResLastMod string `json:"cachereslastmod,omitempty"` + CacheResSize int `json:"cacheressize,omitempty"` + CacheURLs string `json:"cacheurls,omitempty"` + CEFlags int `json:"ceflags,omitempty"` + ContentGroup string `json:"contentgroup,omitempty"` Count float64 `json:"__count,omitempty"` - Destipv46 string `json:"destipv46,omitempty"` - Destport int `json:"destport,omitempty"` + DestIPv46 string `json:"destipv46,omitempty"` + DestPort int `json:"destport,omitempty"` Flushed string `json:"flushed,omitempty"` Group string `json:"group,omitempty"` - Groupname string `json:"groupname,omitempty"` - Hitparams []string `json:"hitparams,omitempty"` - Hitvalues []string `json:"hitvalues,omitempty"` + GroupName string `json:"groupname,omitempty"` + HitParams []string `json:"hitparams,omitempty"` + HitValues []string `json:"hitvalues,omitempty"` Host string `json:"host,omitempty"` - Httpcalloutcell string `json:"httpcalloutcell,omitempty"` - Httpcalloutname string `json:"httpcalloutname,omitempty"` - Httpcalloutresult string `json:"httpcalloutresult,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httpstatus int `json:"httpstatus,omitempty"` - Httpstatusoutput int `json:"httpstatusoutput,omitempty"` - Ignoremarkerobjects string `json:"ignoremarkerobjects,omitempty"` - Includenotreadyobjects string `json:"includenotreadyobjects,omitempty"` + HTTPCalloutCell string `json:"httpcalloutcell,omitempty"` + HTTPCalloutName string `json:"httpcalloutname,omitempty"` + HTTPCalloutResult string `json:"httpcalloutresult,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + HTTPStatus int `json:"httpstatus,omitempty"` + HTTPStatusOutput int `json:"httpstatusoutput,omitempty"` + IgnoreMarkerObjects string `json:"ignoremarkerobjects,omitempty"` + IncludeNotReadyObjects string `json:"includenotreadyobjects,omitempty"` Locator int `json:"locator,omitempty"` - Locatorshow int `json:"locatorshow,omitempty"` - Markerreason string `json:"markerreason,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + LocatorShow int `json:"locatorshow,omitempty"` + MarkerReason string `json:"markerreason,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Policy int `json:"policy,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Port int `json:"port,omitempty"` Prefetch string `json:"prefetch,omitempty"` - Prefetchperiod int `json:"prefetchperiod,omitempty"` - Prefetchperiodmillisec int `json:"prefetchperiodmillisec,omitempty"` - Returntype string `json:"returntype,omitempty"` + PrefetchPeriod int `json:"prefetchperiod,omitempty"` + PrefetchPeriodMillisec int `json:"prefetchperiodmillisec,omitempty"` + ReturnType string `json:"returntype,omitempty"` Rule []string `json:"rule,omitempty"` - Selectorname []string `json:"selectorname,omitempty"` - Selectorvalue []string `json:"selectorvalue,omitempty"` - Tosecondary string `json:"tosecondary,omitempty"` - Totalobjs int `json:"totalobjs,omitempty"` - Url string `json:"url,omitempty"` - Warnbucketskip int `json:"warnbucketskip,omitempty"` + SelectorName []string `json:"selectorname,omitempty"` + SelectorValue []string `json:"selectorvalue,omitempty"` + ToSecondary string `json:"tosecondary,omitempty"` + TotalObjs int `json:"totalobjs,omitempty"` + URL string `json:"url,omitempty"` + WarnBucketSkip int `json:"warnbucketskip,omitempty"` } -type CachepolicylabelBinding struct { - CachepolicylabelCachepolicyBinding []interface{} `json:"cachepolicylabel_cachepolicy_binding,omitempty"` - CachepolicylabelPolicybindingBinding []interface{} `json:"cachepolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type CachePolicyLabelBinding struct { + CachePolicyLabelCachePolicyBinding []interface{} `json:"cachepolicylabel_cachepolicy_binding,omitempty"` + CachePolicyLabelPolicyBindingBinding []interface{} `json:"cachepolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type CachepolicylabelCachepolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CachePolicyLabelCachePolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Cachecontentgroup struct { - Absexpiry []string `json:"absexpiry,omitempty"` - Absexpirygmt []string `json:"absexpirygmt,omitempty"` - Alwaysevalpolicies string `json:"alwaysevalpolicies,omitempty"` +type CacheContentGroup struct { + AbsExpiry []string `json:"absexpiry,omitempty"` + AbsExpiryGMT []string `json:"absexpirygmt,omitempty"` + AlwaysEvalPolicies string `json:"alwaysevalpolicies,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cache304hits int `json:"cache304hits,omitempty"` - Cachecells int `json:"cachecells,omitempty"` - Cachecontrol string `json:"cachecontrol,omitempty"` - Cachegroupincarnation int `json:"cachegroupincarnation,omitempty"` - Cachenon304hits int `json:"cachenon304hits,omitempty"` - Cachenuminvalpolicy int `json:"cachenuminvalpolicy,omitempty"` + Cache304Hits int `json:"cache304hits,omitempty"` + CacheCells int `json:"cachecells,omitempty"` + CacheControl string `json:"cachecontrol,omitempty"` + CacheGroupIncarnation int `json:"cachegroupincarnation,omitempty"` + CacheNon304Hits int `json:"cachenon304hits,omitempty"` + CacheNumInvalPolicy int `json:"cachenuminvalpolicy,omitempty"` Count float64 `json:"__count,omitempty"` - Disklimit int `json:"disklimit,omitempty"` - Expireatlastbyte string `json:"expireatlastbyte,omitempty"` + DiskLimit int `json:"disklimit,omitempty"` + ExpireAtLastByte string `json:"expireatlastbyte,omitempty"` Feature string `json:"feature,omitempty"` Flags int `json:"flags,omitempty"` - Flashcache string `json:"flashcache,omitempty"` - Heurexpiryparam int `json:"heurexpiryparam,omitempty"` - Hitparams []string `json:"hitparams,omitempty"` - Hitselector string `json:"hitselector,omitempty"` + FlashCache string `json:"flashcache,omitempty"` + HeurExpiryParam int `json:"heurexpiryparam,omitempty"` + HitParams []string `json:"hitparams,omitempty"` + HitSelector string `json:"hitselector,omitempty"` Host string `json:"host,omitempty"` - Ignoreparamvaluecase string `json:"ignoreparamvaluecase,omitempty"` - Ignorereloadreq string `json:"ignorereloadreq,omitempty"` - Ignorereqcachinghdrs string `json:"ignorereqcachinghdrs,omitempty"` - Insertage string `json:"insertage,omitempty"` - Insertetag string `json:"insertetag,omitempty"` - Insertvia string `json:"insertvia,omitempty"` - Invalparams []string `json:"invalparams,omitempty"` - Invalrestrictedtohost string `json:"invalrestrictedtohost,omitempty"` - Invalselector string `json:"invalselector,omitempty"` - Lazydnsresolve string `json:"lazydnsresolve,omitempty"` - Markercells int `json:"markercells,omitempty"` - Matchcookies string `json:"matchcookies,omitempty"` - Maxressize int `json:"maxressize,omitempty"` - Memdusage int `json:"memdusage,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Memusage int `json:"memusage,omitempty"` - Minhits int `json:"minhits,omitempty"` - Minressize int `json:"minressize,omitempty"` + IgnoreParamValueCase string `json:"ignoreparamvaluecase,omitempty"` + IgnoreReloadReq string `json:"ignorereloadreq,omitempty"` + IgnoreReqCachingHdrs string `json:"ignorereqcachinghdrs,omitempty"` + InsertAge string `json:"insertage,omitempty"` + InsertETag string `json:"insertetag,omitempty"` + InsertVia string `json:"insertvia,omitempty"` + InvalParams []string `json:"invalparams,omitempty"` + InvalRestrictedToHost string `json:"invalrestrictedtohost,omitempty"` + InvalSelector string `json:"invalselector,omitempty"` + LazyDNSResolve string `json:"lazydnsresolve,omitempty"` + MarkerCells int `json:"markercells,omitempty"` + MatchCookies string `json:"matchcookies,omitempty"` + MaxResSize int `json:"maxressize,omitempty"` + MemDUsage int `json:"memdusage,omitempty"` + MemLimit int `json:"memlimit,omitempty"` + MemUsage int `json:"memusage,omitempty"` + MinHits int `json:"minhits,omitempty"` + MinResSize int `json:"minressize,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Persist string `json:"persist,omitempty"` - Persistha string `json:"persistha,omitempty"` + PersistHA string `json:"persistha,omitempty"` Pinned string `json:"pinned,omitempty"` - Policyname []string `json:"policyname,omitempty"` - Polleverytime string `json:"polleverytime,omitempty"` + PolicyName []string `json:"policyname,omitempty"` + PollEveryTime string `json:"polleverytime,omitempty"` Prefetch string `json:"prefetch,omitempty"` - Prefetchcur int `json:"prefetchcur,omitempty"` - Prefetchmaxpending int `json:"prefetchmaxpending,omitempty"` - Prefetchperiod int `json:"prefetchperiod,omitempty"` - Prefetchperiodmillisec int `json:"prefetchperiodmillisec,omitempty"` + PrefetchCur int `json:"prefetchcur,omitempty"` + PrefetchMaxPending int `json:"prefetchmaxpending,omitempty"` + PrefetchPeriod int `json:"prefetchperiod,omitempty"` + PrefetchPeriodMillisec int `json:"prefetchperiodmillisec,omitempty"` Query string `json:"query,omitempty"` - Quickabortsize int `json:"quickabortsize,omitempty"` - Relexpiry int `json:"relexpiry,omitempty"` - Relexpirymillisec int `json:"relexpirymillisec,omitempty"` - Removecookies string `json:"removecookies,omitempty"` - Selectorvalue string `json:"selectorvalue,omitempty"` - Tosecondary string `json:"tosecondary,omitempty"` + QuickAbortSize int `json:"quickabortsize,omitempty"` + RelExpiry int `json:"relexpiry,omitempty"` + RelExpiryMillisec int `json:"relexpirymillisec,omitempty"` + RemoveCookies string `json:"removecookies,omitempty"` + SelectorValue string `json:"selectorvalue,omitempty"` + ToSecondary string `json:"tosecondary,omitempty"` TypeField string `json:"type,omitempty"` - Weaknegrelexpiry int `json:"weaknegrelexpiry,omitempty"` - Weakposrelexpiry int `json:"weakposrelexpiry,omitempty"` + WeakNegRelExpiry int `json:"weaknegrelexpiry,omitempty"` + WeakPosRelExpiry int `json:"weakposrelexpiry,omitempty"` } -type Cacheforwardproxy struct { +type CacheForwardProxy struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` } diff --git a/nitrogo/models/cloud.go b/nitrogo/models/cloud.go index 716d203..e1992d2 100644 --- a/nitrogo/models/cloud.go +++ b/nitrogo/models/cloud.go @@ -1,88 +1,88 @@ package models // cloud configuration structs -type Cloudcredential struct { - Applicationid string `json:"applicationid,omitempty"` - Applicationsecret string `json:"applicationsecret,omitempty"` - Isset int `json:"isset,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Tenantidentifier string `json:"tenantidentifier,omitempty"` +type CloudCredential struct { + ApplicationID string `json:"applicationid,omitempty"` + ApplicationSecret string `json:"applicationsecret,omitempty"` + IsSet int `json:"isset,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TenantIdentifier string `json:"tenantidentifier,omitempty"` } -type Cloudngsparameter struct { - Allowdtls12 string `json:"allowdtls12,omitempty"` - Allowedudtversion string `json:"allowedudtversion,omitempty"` - Blockonallowedngstktprof string `json:"blockonallowedngstktprof,omitempty"` - Csvserverticketingdecouple string `json:"csvserverticketingdecouple,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type CloudNGSParameter struct { + AllowDTLS12 string `json:"allowdtls12,omitempty"` + AllowedUDTVersion string `json:"allowedudtversion,omitempty"` + BlockOnAllowedNGSTktProf string `json:"blockonallowedngstktprof,omitempty"` + CSVServerTicketingDecouple string `json:"csvserverticketingdecouple,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Cloudawsparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Rolearn string `json:"rolearn,omitempty"` +type CloudAWSParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RoleARN string `json:"rolearn,omitempty"` } -type Cloudparameter struct { - Activationcode string `json:"activationcode,omitempty"` - Connectorresidence string `json:"connectorresidence,omitempty"` - Controlconnectionstatus string `json:"controlconnectionstatus,omitempty"` - Controllerfqdn string `json:"controllerfqdn,omitempty"` - Controllerport int `json:"controllerport,omitempty"` - Customerid string `json:"customerid,omitempty"` +type CloudParameter struct { + ActivationCode string `json:"activationcode,omitempty"` + ConnectorResidence string `json:"connectorresidence,omitempty"` + ControlConnectionStatus string `json:"controlconnectionstatus,omitempty"` + ControllerFQDN string `json:"controllerfqdn,omitempty"` + ControllerPort int `json:"controllerport,omitempty"` + CustomerID string `json:"customerid,omitempty"` Deployment string `json:"deployment,omitempty"` - Instanceid string `json:"instanceid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Resourcelocation string `json:"resourcelocation,omitempty"` + InstanceID string `json:"instanceid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ResourceLocation string `json:"resourcelocation,omitempty"` } -type Cloudallowedngsticketprofile struct { +type CloudAllowedNGSTicketProfile struct { Count float64 `json:"__count,omitempty"` Creator string `json:"creator,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Cloudservice struct { +type CloudService struct { Response string `json:"response,omitempty"` } -type Cloudparaminternal struct { +type CloudParamInternal struct { Count float64 `json:"__count,omitempty"` - Iamperm string `json:"iamperm,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nonftumode string `json:"nonftumode,omitempty"` + IAMPerm string `json:"iamperm,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NonFTUMode string `json:"nonftumode,omitempty"` } -type Cloudprofile struct { - Azurepollperiod int `json:"azurepollperiod,omitempty"` - Azuretagname string `json:"azuretagname,omitempty"` - Azuretagvalue string `json:"azuretagvalue,omitempty"` - Boundservicegroupsvctype string `json:"boundservicegroupsvctype,omitempty"` +type CloudProfile struct { + AzurePollPeriod int `json:"azurepollperiod,omitempty"` + AzureTagName string `json:"azuretagname,omitempty"` + AzureTagValue string `json:"azuretagvalue,omitempty"` + BoundServiceGroupSvcType string `json:"boundservicegroupsvctype,omitempty"` Count float64 `json:"__count,omitempty"` Delay int `json:"delay,omitempty"` Graceful string `json:"graceful,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` - Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + VServerName string `json:"vservername,omitempty"` + VSvrBindSvcPort int `json:"vsvrbindsvcport,omitempty"` } -type Cloudautoscalegroup struct { - Azcount int `json:"azcount,omitempty"` - Aznames []string `json:"aznames,omitempty"` +type CloudAutoscaleGroup struct { + AZCount int `json:"azcount,omitempty"` + AZNames []string `json:"aznames,omitempty"` Count float64 `json:"__count,omitempty"` Graceful string `json:"graceful,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Cloudvserverip struct { +type CloudVServerIP struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/cloudtunnel.go b/nitrogo/models/cloudtunnel.go index 8f6cd55..beb84f7 100644 --- a/nitrogo/models/cloudtunnel.go +++ b/nitrogo/models/cloudtunnel.go @@ -1,28 +1,28 @@ package models // cloudtunnel configuration structs -type Cloudtunnelparameter struct { - Controllerfqdn string `json:"controllerfqdn,omitempty"` - Fqdn string `json:"fqdn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Resourcelocation string `json:"resourcelocation,omitempty"` - Subnetresourcelocationmappings string `json:"subnetresourcelocationmappings,omitempty"` +type CloudTunnelParameter struct { + ControllerFQDN string `json:"controllerfqdn,omitempty"` + FQDN string `json:"fqdn,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ResourceLocation string `json:"resourcelocation,omitempty"` + SubnetResourceLocationMappings string `json:"subnetresourcelocationmappings,omitempty"` } -type Cloudtunnelvserver struct { - Cachetype string `json:"cachetype,omitempty"` +type CloudTunnelVServer struct { + CacheType string `json:"cachetype,omitempty"` Count float64 `json:"__count,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Ip string `json:"ip,omitempty"` - Ippattern string `json:"ippattern,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + IP string `json:"ip,omitempty"` + IPPattern string `json:"ippattern,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` Range int `json:"range,omitempty"` - Servicetype string `json:"servicetype,omitempty"` + ServiceType string `json:"servicetype,omitempty"` State string `json:"state,omitempty"` TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/cluster.go b/nitrogo/models/cluster.go index 248852d..e51a1e8 100644 --- a/nitrogo/models/cluster.go +++ b/nitrogo/models/cluster.go @@ -1,50 +1,50 @@ package models // cluster configuration structs -type ClusternodeBinding struct { - ClusternodeRoutemonitorBinding []interface{} `json:"clusternode_routemonitor_binding,omitempty"` - Nodeid int `json:"nodeid,omitempty"` +type ClusterNodeBinding struct { + ClusterNodeRouteMonitorBinding []interface{} `json:"clusternode_routemonitor_binding,omitempty"` + NodeID int `json:"nodeid,omitempty"` } -type Clusternode struct { +type ClusterNode struct { Backplane string `json:"backplane,omitempty"` - Cfgflags int `json:"cfgflags,omitempty"` - Clearnodegroupconfig string `json:"clearnodegroupconfig,omitempty"` - Clusterhealth string `json:"clusterhealth,omitempty"` + CfgFlags int `json:"cfgflags,omitempty"` + ClearNodeGroupConfig string `json:"clearnodegroupconfig,omitempty"` + ClusterHealth string `json:"clusterhealth,omitempty"` Count float64 `json:"__count,omitempty"` Delay int `json:"delay,omitempty"` - Disabledifaces string `json:"disabledifaces,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Enabledifaces string `json:"enabledifaces,omitempty"` + DisabledIfaces string `json:"disabledifaces,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + EnabledIfaces string `json:"enabledifaces,omitempty"` Force bool `json:"force,omitempty"` - Hamonifaces string `json:"hamonifaces,omitempty"` + HAMonIfaces string `json:"hamonifaces,omitempty"` Health string `json:"health,omitempty"` - Ifaceslist []string `json:"ifaceslist,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` - Islocalnode bool `json:"islocalnode,omitempty"` - Masterstate string `json:"masterstate,omitempty"` + IfacesList []string `json:"ifaceslist,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IsConfigurationCoordinator bool `json:"isconfigurationcoordinator,omitempty"` + IsLocalNode bool `json:"islocalnode,omitempty"` + MasterState string `json:"masterstate,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodegroup string `json:"nodegroup,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` - Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` - Nodelist []interface{} `json:"nodelist,omitempty"` - Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` - Operationalsyncstate string `json:"operationalsyncstate,omitempty"` - Partialfailifaces string `json:"partialfailifaces,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeGroup string `json:"nodegroup,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NodeJumboNotSupported bool `json:"nodejumbonotsupported,omitempty"` + NodeLicenseMismatch bool `json:"nodelicensemismatch,omitempty"` + NodeList []interface{} `json:"nodelist,omitempty"` + NodeRSSKeyMismatch bool `json:"nodersskeymismatch,omitempty"` + OperationalSyncState string `json:"operationalsyncstate,omitempty"` + PartialFailIfaces string `json:"partialfailifaces,omitempty"` Priority int `json:"priority,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` State string `json:"state,omitempty"` - Syncfailurereason string `json:"syncfailurereason,omitempty"` - Syncstate string `json:"syncstate,omitempty"` - Tunnelmode string `json:"tunnelmode,omitempty"` + SyncFailureReason string `json:"syncfailurereason,omitempty"` + SyncState string `json:"syncstate,omitempty"` + TunnelMode string `json:"tunnelmode,omitempty"` } -type ClusternodegroupStreamidentifierBinding struct { - Identifiername string `json:"identifiername,omitempty"` +type ClusterNodeGroupStreamIdentifierBinding struct { + IdentifierName string `json:"identifiername,omitempty"` Name string `json:"name,omitempty"` } @@ -53,167 +53,167 @@ type Cluster struct { Password string `json:"password,omitempty"` } -type Clusterinstance struct { - Adminstate string `json:"adminstate,omitempty"` - Backplanebasedview string `json:"backplanebasedview,omitempty"` - Clid int `json:"clid,omitempty"` - Clusterclipfailure bool `json:"clusterclipfailure,omitempty"` - Clusterhbhmacerrordetected bool `json:"clusterhbhmacerrordetected,omitempty"` - Clusternoheartbeatonnode bool `json:"clusternoheartbeatonnode,omitempty"` - Clusternolinksetmbf bool `json:"clusternolinksetmbf,omitempty"` - Clusternospottedip bool `json:"clusternospottedip,omitempty"` - Clusterproxyarp string `json:"clusterproxyarp,omitempty"` - Clustertunnelmodemismatch bool `json:"clustertunnelmodemismatch,omitempty"` +type ClusterInstance struct { + AdminState string `json:"adminstate,omitempty"` + BackplaneBasedView string `json:"backplanebasedview,omitempty"` + CLID int `json:"clid,omitempty"` + ClusterCLIPFailure bool `json:"clusterclipfailure,omitempty"` + ClusterHBHMacErrorDetected bool `json:"clusterhbhmacerrordetected,omitempty"` + ClusterNoHeartbeatOnNode bool `json:"clusternoheartbeatonnode,omitempty"` + ClusterNoLinksetMBF bool `json:"clusternolinksetmbf,omitempty"` + ClusterNoSpottedIP bool `json:"clusternospottedip,omitempty"` + ClusterProxyARP string `json:"clusterproxyarp,omitempty"` + ClusterTunnelModeMismatch bool `json:"clustertunnelmodemismatch,omitempty"` Count float64 `json:"__count,omitempty"` - Deadinterval int `json:"deadinterval,omitempty"` - Dfdretainl2params string `json:"dfdretainl2params,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Heterogeneousflag string `json:"heterogeneousflag,omitempty"` + DeadInterval int `json:"deadinterval,omitempty"` + DFDRetainL2Params string `json:"dfdretainl2params,omitempty"` + HelloInterval int `json:"hellointerval,omitempty"` + HeterogeneousFlag string `json:"heterogeneousflag,omitempty"` Inc string `json:"inc,omitempty"` - Jumbonotsupported bool `json:"jumbonotsupported,omitempty"` - Licensemismatch bool `json:"licensemismatch,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodegroup string `json:"nodegroup,omitempty"` - Nodegroupstatewarning bool `json:"nodegroupstatewarning,omitempty"` - Nodepenummismatch bool `json:"nodepenummismatch,omitempty"` - Operationalpropstate string `json:"operationalpropstate,omitempty"` - Operationalstate string `json:"operationalstate,omitempty"` - Penummismatch bool `json:"penummismatch,omitempty"` + JumboNotSupported bool `json:"jumbonotsupported,omitempty"` + LicenseMismatch bool `json:"licensemismatch,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeGroup string `json:"nodegroup,omitempty"` + NodeGroupStateWarning bool `json:"nodegroupstatewarning,omitempty"` + NodePENumMismatch bool `json:"nodepenummismatch,omitempty"` + OperationalPropState string `json:"operationalpropstate,omitempty"` + OperationalState string `json:"operationalstate,omitempty"` + PENumMismatch bool `json:"penummismatch,omitempty"` Preemption string `json:"preemption,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Propstate string `json:"propstate,omitempty"` - Quorumtype string `json:"quorumtype,omitempty"` - Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` - Rsskeymismatch bool `json:"rsskeymismatch,omitempty"` - Secureheartbeats string `json:"secureheartbeats,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + PropState string `json:"propstate,omitempty"` + QuorumType string `json:"quorumtype,omitempty"` + RetainConnectionsOnCluster string `json:"retainconnectionsoncluster,omitempty"` + RSSKeyMismatch bool `json:"rsskeymismatch,omitempty"` + SecureHeartbeats string `json:"secureheartbeats,omitempty"` Status string `json:"status,omitempty"` - Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` - Validmtu int `json:"validmtu,omitempty"` + SyncStatusStrictMode string `json:"syncstatusstrictmode,omitempty"` + ValidMTU int `json:"validmtu,omitempty"` } -type ClusternodeRoutemonitorBinding struct { +type ClusterNodeRouteMonitorBinding struct { Netmask string `json:"netmask,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Routemonstate int `json:"routemonstate,omitempty"` + NodeID int `json:"nodeid,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` + RouteMonState int `json:"routemonstate,omitempty"` } -type ClusternodegroupGslbvserverBinding struct { +type ClusterNodeGroupGSLBVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` -} - -type ClusternodegroupBinding struct { - ClusternodegroupAuthenticationvserverBinding []interface{} `json:"clusternodegroup_authenticationvserver_binding,omitempty"` - ClusternodegroupClusternodeBinding []interface{} `json:"clusternodegroup_clusternode_binding,omitempty"` - ClusternodegroupCrvserverBinding []interface{} `json:"clusternodegroup_crvserver_binding,omitempty"` - ClusternodegroupCsvserverBinding []interface{} `json:"clusternodegroup_csvserver_binding,omitempty"` - ClusternodegroupGslbsiteBinding []interface{} `json:"clusternodegroup_gslbsite_binding,omitempty"` - ClusternodegroupGslbvserverBinding []interface{} `json:"clusternodegroup_gslbvserver_binding,omitempty"` - ClusternodegroupLbvserverBinding []interface{} `json:"clusternodegroup_lbvserver_binding,omitempty"` - ClusternodegroupNslimitidentifierBinding []interface{} `json:"clusternodegroup_nslimitidentifier_binding,omitempty"` - ClusternodegroupServiceBinding []interface{} `json:"clusternodegroup_service_binding,omitempty"` - ClusternodegroupStreamidentifierBinding []interface{} `json:"clusternodegroup_streamidentifier_binding,omitempty"` - ClusternodegroupVpnvserverBinding []interface{} `json:"clusternodegroup_vpnvserver_binding,omitempty"` + VServer string `json:"vserver,omitempty"` +} + +type ClusterNodeGroupBinding struct { + ClusterNodeGroupAuthenticationVServerBinding []interface{} `json:"clusternodegroup_authenticationvserver_binding,omitempty"` + ClusterNodeGroupClusterNodeBinding []interface{} `json:"clusternodegroup_clusternode_binding,omitempty"` + ClusterNodeGroupCRVServerBinding []interface{} `json:"clusternodegroup_crvserver_binding,omitempty"` + ClusterNodeGroupCSVServerBinding []interface{} `json:"clusternodegroup_csvserver_binding,omitempty"` + ClusterNodeGroupGSLBSiteBinding []interface{} `json:"clusternodegroup_gslbsite_binding,omitempty"` + ClusterNodeGroupGSLBVServerBinding []interface{} `json:"clusternodegroup_gslbvserver_binding,omitempty"` + ClusterNodeGroupLBVServerBinding []interface{} `json:"clusternodegroup_lbvserver_binding,omitempty"` + ClusterNodeGroupNSLimitIdentifierBinding []interface{} `json:"clusternodegroup_nslimitidentifier_binding,omitempty"` + ClusterNodeGroupServiceBinding []interface{} `json:"clusternodegroup_service_binding,omitempty"` + ClusterNodeGroupStreamIdentifierBinding []interface{} `json:"clusternodegroup_streamidentifier_binding,omitempty"` + ClusterNodeGroupVPNVServerBinding []interface{} `json:"clusternodegroup_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type ClusternodegroupAuthenticationvserverBinding struct { +type ClusterNodeGroupAuthenticationVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type ClusternodegroupLbvserverBinding struct { +type ClusterNodeGroupLBVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type ClusternodegroupCrvserverBinding struct { +type ClusterNodeGroupCRVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type ClusternodegroupNslimitidentifierBinding struct { - Identifiername string `json:"identifiername,omitempty"` +type ClusterNodeGroupNSLimitIdentifierBinding struct { + IdentifierName string `json:"identifiername,omitempty"` Name string `json:"name,omitempty"` } -type Clustersync struct { +type ClusterSync struct { } -type ClusternodegroupGslbsiteBinding struct { - Gslbsite string `json:"gslbsite,omitempty"` +type ClusterNodeGroupGSLBSiteBinding struct { + GSLBSite string `json:"gslbsite,omitempty"` Name string `json:"name,omitempty"` } -type ClusternodegroupServiceBinding struct { +type ClusterNodeGroupServiceBinding struct { Name string `json:"name,omitempty"` Service string `json:"service,omitempty"` } -type Clusternodegroup struct { - Activelist []interface{} `json:"activelist,omitempty"` - Backuplist []interface{} `json:"backuplist,omitempty"` - Backupnodemask int `json:"backupnodemask,omitempty"` - Boundedentitiescntfrompe int `json:"boundedentitiescntfrompe,omitempty"` +type ClusterNodeGroup struct { + ActiveList []interface{} `json:"activelist,omitempty"` + BackupList []interface{} `json:"backuplist,omitempty"` + BackupNodeMask int `json:"backupnodemask,omitempty"` + BoundedEntitiesCntFromPE int `json:"boundedentitiescntfrompe,omitempty"` Count float64 `json:"__count,omitempty"` - Currentnodemask int `json:"currentnodemask,omitempty"` + CurrentNodeMask int `json:"currentnodemask,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Priority int `json:"priority,omitempty"` State string `json:"state,omitempty"` Sticky string `json:"sticky,omitempty"` Strict string `json:"strict,omitempty"` } -type ClusternodegroupClusternodeBinding struct { +type ClusterNodeGroupClusterNodeBinding struct { Name string `json:"name,omitempty"` Node int `json:"node,omitempty"` } -type Clustersyncfailures struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ClusterSyncFailures struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Clusterpropstatus struct { - Cmdstrs string `json:"cmdstrs,omitempty"` +type ClusterPropStatus struct { + CmdStrs string `json:"cmdstrs,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Numpropcmdfailed int `json:"numpropcmdfailed,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NumPropCmdFailed int `json:"numpropcmdfailed,omitempty"` } -type ClusterinstanceBinding struct { - Clid int `json:"clid,omitempty"` - ClusterinstanceClusternodeBinding []interface{} `json:"clusterinstance_clusternode_binding,omitempty"` +type ClusterInstanceBinding struct { + CLID int `json:"clid,omitempty"` + ClusterInstanceClusterNodeBinding []interface{} `json:"clusterinstance_clusternode_binding,omitempty"` } -type Clusterfiles struct { +type ClusterFiles struct { Mode []string `json:"mode,omitempty"` } -type ClusterinstanceClusternodeBinding struct { - Clid int `json:"clid,omitempty"` - Clusterhealth string `json:"clusterhealth,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` +type ClusterInstanceClusterNodeBinding struct { + CLID int `json:"clid,omitempty"` + ClusterHealth string `json:"clusterhealth,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` Health string `json:"health,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Isconfigurationcoordinator bool `json:"isconfigurationcoordinator,omitempty"` - Islocalnode bool `json:"islocalnode,omitempty"` - Masterstate string `json:"masterstate,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Nodejumbonotsupported bool `json:"nodejumbonotsupported,omitempty"` - Nodelicensemismatch bool `json:"nodelicensemismatch,omitempty"` - Nodersskeymismatch bool `json:"nodersskeymismatch,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IsConfigurationCoordinator bool `json:"isconfigurationcoordinator,omitempty"` + IsLocalNode bool `json:"islocalnode,omitempty"` + MasterState string `json:"masterstate,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NodeJumboNotSupported bool `json:"nodejumbonotsupported,omitempty"` + NodeLicenseMismatch bool `json:"nodelicensemismatch,omitempty"` + NodeRSSKeyMismatch bool `json:"nodersskeymismatch,omitempty"` State string `json:"state,omitempty"` } -type ClusternodegroupVpnvserverBinding struct { +type ClusterNodeGroupVPNVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type ClusternodegroupCsvserverBinding struct { +type ClusterNodeGroupCSVServerBinding struct { Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } diff --git a/nitrogo/models/cmp.go b/nitrogo/models/cmp.go index 8fa76ed..7b04155 100644 --- a/nitrogo/models/cmp.go +++ b/nitrogo/models/cmp.go @@ -1,173 +1,173 @@ package models // cmp configuration structs -type Cmpparameter struct { - Addvaryheader string `json:"addvaryheader,omitempty"` +type CMPParameter struct { + AddVaryHeader string `json:"addvaryheader,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cmpbypasspct int `json:"cmpbypasspct,omitempty"` - Cmplevel string `json:"cmplevel,omitempty"` - Cmponpush string `json:"cmponpush,omitempty"` - Externalcache string `json:"externalcache,omitempty"` + CMPBypassPct int `json:"cmpbypasspct,omitempty"` + CMPLevel string `json:"cmplevel,omitempty"` + CMPOnPush string `json:"cmponpush,omitempty"` + ExternalCache string `json:"externalcache,omitempty"` Feature string `json:"feature,omitempty"` - Heurexpiry string `json:"heurexpiry,omitempty"` - Heurexpiryhistwt int `json:"heurexpiryhistwt,omitempty"` - Heurexpirythres int `json:"heurexpirythres,omitempty"` - Minressize int `json:"minressize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policytype string `json:"policytype,omitempty"` - Quantumsize int `json:"quantumsize,omitempty"` - Randomgzipfilename string `json:"randomgzipfilename,omitempty"` - Randomgzipfilenamemaxlength int `json:"randomgzipfilenamemaxlength,omitempty"` - Randomgzipfilenameminlength int `json:"randomgzipfilenameminlength,omitempty"` - Servercmp string `json:"servercmp,omitempty"` - Varyheadervalue string `json:"varyheadervalue,omitempty"` + HeurExpiry string `json:"heurexpiry,omitempty"` + HeurExpiryHistWt int `json:"heurexpiryhistwt,omitempty"` + HeurExpiryThres int `json:"heurexpirythres,omitempty"` + MinResSize int `json:"minressize,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyType string `json:"policytype,omitempty"` + QuantumSize int `json:"quantumsize,omitempty"` + RandomGzipFilename string `json:"randomgzipfilename,omitempty"` + RandomGzipFilenameMaxLength int `json:"randomgzipfilenamemaxlength,omitempty"` + RandomGzipFilenameMinLength int `json:"randomgzipfilenameminlength,omitempty"` + ServerCMP string `json:"servercmp,omitempty"` + VaryHeaderValue string `json:"varyheadervalue,omitempty"` } -type CmpglobalBinding struct { - CmpglobalCmppolicyBinding []interface{} `json:"cmpglobal_cmppolicy_binding,omitempty"` +type CMPGlobalBinding struct { + CMPGlobalCMPPolicyBinding []interface{} `json:"cmpglobal_cmppolicy_binding,omitempty"` } -type CmppolicyBinding struct { - CmppolicyCmpglobalBinding []interface{} `json:"cmppolicy_cmpglobal_binding,omitempty"` - CmppolicyCmppolicylabelBinding []interface{} `json:"cmppolicy_cmppolicylabel_binding,omitempty"` - CmppolicyCrvserverBinding []interface{} `json:"cmppolicy_crvserver_binding,omitempty"` - CmppolicyCsvserverBinding []interface{} `json:"cmppolicy_csvserver_binding,omitempty"` - CmppolicyLbvserverBinding []interface{} `json:"cmppolicy_lbvserver_binding,omitempty"` +type CMPPolicyBinding struct { + CMPPolicyCMPGlobalBinding []interface{} `json:"cmppolicy_cmpglobal_binding,omitempty"` + CMPPolicyCMPPolicyLabelBinding []interface{} `json:"cmppolicy_cmppolicylabel_binding,omitempty"` + CMPPolicyCRVServerBinding []interface{} `json:"cmppolicy_crvserver_binding,omitempty"` + CMPPolicyCSVServerBinding []interface{} `json:"cmppolicy_csvserver_binding,omitempty"` + CMPPolicyLBVServerBinding []interface{} `json:"cmppolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type CmppolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CMPPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CmppolicyCmppolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type CMPPolicyCMPPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type CmpglobalCmppolicyBinding struct { - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CMPGlobalCMPPolicyBinding struct { + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Cmppolicy struct { +type CMPPolicy struct { Builtin []string `json:"builtin,omitempty"` - Clienttransactions int `json:"clienttransactions,omitempty"` - Clientttlb int `json:"clientttlb,omitempty"` + ClientTransactions int `json:"clienttransactions,omitempty"` + ClientTTLB int `json:"clientttlb,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Resaction string `json:"resaction,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` + ResAction string `json:"resaction,omitempty"` Rule string `json:"rule,omitempty"` - Rxbytes int `json:"rxbytes,omitempty"` - Servertransactions int `json:"servertransactions,omitempty"` - Serverttlb int `json:"serverttlb,omitempty"` - Txbytes int `json:"txbytes,omitempty"` + RxBytes int `json:"rxbytes,omitempty"` + ServerTransactions int `json:"servertransactions,omitempty"` + ServerTTLB int `json:"serverttlb,omitempty"` + TxBytes int `json:"txbytes,omitempty"` } -type Cmpaction struct { - Addvaryheader string `json:"addvaryheader,omitempty"` +type CMPAction struct { + AddVaryHeader string `json:"addvaryheader,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cmptype string `json:"cmptype,omitempty"` + CMPType string `json:"cmptype,omitempty"` Count float64 `json:"__count,omitempty"` - Deltatype string `json:"deltatype,omitempty"` + DeltaType string `json:"deltatype,omitempty"` Feature string `json:"feature,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Varyheadervalue string `json:"varyheadervalue,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + VaryHeaderValue string `json:"varyheadervalue,omitempty"` } -type CmppolicyCmpglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type CMPPolicyCMPGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Cmppolicylabel struct { +type CMPPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type CmppolicyCrvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type CMPPolicyCRVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type CmppolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type CMPPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type CmppolicylabelCmppolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CMPPolicyLabelCMPPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CmppolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type CMPPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type CmppolicylabelBinding struct { - CmppolicylabelCmppolicyBinding []interface{} `json:"cmppolicylabel_cmppolicy_binding,omitempty"` - CmppolicylabelPolicybindingBinding []interface{} `json:"cmppolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type CMPPolicyLabelBinding struct { + CMPPolicyLabelCMPPolicyBinding []interface{} `json:"cmppolicylabel_cmppolicy_binding,omitempty"` + CMPPolicyLabelPolicyBindingBinding []interface{} `json:"cmppolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } diff --git a/nitrogo/models/contentinspection.go b/nitrogo/models/contentinspection.go index 283323b..916032a 100644 --- a/nitrogo/models/contentinspection.go +++ b/nitrogo/models/contentinspection.go @@ -1,192 +1,192 @@ package models // contentinspection configuration structs -type ContentinspectionpolicyContentinspectionglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ContentInspectionPolicyContentInspectionGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Contentinspectionpolicylabel struct { +type ContentInspectionPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Contentinspectionwasmprofile struct { - Anomalousdatasize int `json:"anomalousdatasize,omitempty"` - Anomalousttfbtime int `json:"anomalousttfbtime,omitempty"` +type ContentInspectionWasmProfile struct { + AnomalousDataSize int `json:"anomalousdatasize,omitempty"` + AnomalousTTFBTime int `json:"anomalousttfbtime,omitempty"` Count float64 `json:"__count,omitempty"` - Maxbodylen int `json:"maxbodylen,omitempty"` + MaxBodyLen int `json:"maxbodylen,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Timeout int `json:"timeout,omitempty"` - Timeoutaction string `json:"timeoutaction,omitempty"` - Wasmmodule string `json:"wasmmodule,omitempty"` + TimeoutAction string `json:"timeoutaction,omitempty"` + WasmModule string `json:"wasmmodule,omitempty"` } -type ContentinspectionpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ContentInspectionPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type ContentinspectionpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ContentInspectionPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Contentinspectioncallout struct { +type ContentInspectionCallout struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` - Resultexpr string `json:"resultexpr,omitempty"` - Returntype string `json:"returntype,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` + ResultExpr string `json:"resultexpr,omitempty"` + ReturnType string `json:"returntype,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` + ServerPort int `json:"serverport,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` - Undefreason string `json:"undefreason,omitempty"` + UndefHits int `json:"undefhits,omitempty"` + UndefReason string `json:"undefreason,omitempty"` } -type Contentinspectionprofile struct { +type ContentInspectionProfile struct { Count float64 `json:"__count,omitempty"` - Egressinterface string `json:"egressinterface,omitempty"` - Egressvlan int `json:"egressvlan,omitempty"` - Ingressinterface string `json:"ingressinterface,omitempty"` - Ingressvlan int `json:"ingressvlan,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` + EgressInterface string `json:"egressinterface,omitempty"` + EgressVLAN int `json:"egressvlan,omitempty"` + IngressInterface string `json:"ingressinterface,omitempty"` + IngressVLAN int `json:"ingressvlan,omitempty"` + IPTunnel string `json:"iptunnel,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` TypeField string `json:"type,omitempty"` } -type ContentinspectionglobalContentinspectionpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ContentInspectionGlobalContentInspectionPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Contentinspectionparameter struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Undefaction string `json:"undefaction,omitempty"` +type ContentInspectionParameter struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + UndefAction string `json:"undefaction,omitempty"` } -type ContentinspectionpolicylabelBinding struct { - ContentinspectionpolicylabelContentinspectionpolicyBinding []interface{} `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding,omitempty"` - ContentinspectionpolicylabelPolicybindingBinding []interface{} `json:"contentinspectionpolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type ContentInspectionPolicyLabelBinding struct { + ContentInspectionPolicyLabelContentInspectionPolicyBinding []interface{} `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding,omitempty"` + ContentInspectionPolicyLabelPolicyBindingBinding []interface{} `json:"contentinspectionpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type Contentinspectionaction struct { +type ContentInspectionAction struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Icapprofilename string `json:"icapprofilename,omitempty"` - Ifserverdown string `json:"ifserverdown,omitempty"` + ICAPProfileName string `json:"icapprofilename,omitempty"` + IfServerDown string `json:"ifserverdown,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Reqtimeout int `json:"reqtimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` - Serverport int `json:"serverport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + ReqTimeout int `json:"reqtimeout,omitempty"` + ReqTimeoutAction string `json:"reqtimeoutaction,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` + ServerPort int `json:"serverport,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` - Wasmprofilename string `json:"wasmprofilename,omitempty"` + UndefHits int `json:"undefhits,omitempty"` + WasmProfileName string `json:"wasmprofilename,omitempty"` } -type ContentinspectionpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ContentInspectionPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ContentinspectionglobalBinding struct { - ContentinspectionglobalContentinspectionpolicyBinding []interface{} `json:"contentinspectionglobal_contentinspectionpolicy_binding,omitempty"` +type ContentInspectionGlobalBinding struct { + ContentInspectionGlobalContentInspectionPolicyBinding []interface{} `json:"contentinspectionglobal_contentinspectionpolicy_binding,omitempty"` } -type ContentinspectionpolicyContentinspectionpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ContentInspectionPolicyContentInspectionPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ContentinspectionpolicyBinding struct { - ContentinspectionpolicyContentinspectionglobalBinding []interface{} `json:"contentinspectionpolicy_contentinspectionglobal_binding,omitempty"` - ContentinspectionpolicyContentinspectionpolicylabelBinding []interface{} `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding,omitempty"` - ContentinspectionpolicyCsvserverBinding []interface{} `json:"contentinspectionpolicy_csvserver_binding,omitempty"` - ContentinspectionpolicyLbvserverBinding []interface{} `json:"contentinspectionpolicy_lbvserver_binding,omitempty"` +type ContentInspectionPolicyBinding struct { + ContentInspectionPolicyContentInspectionGlobalBinding []interface{} `json:"contentinspectionpolicy_contentinspectionglobal_binding,omitempty"` + ContentInspectionPolicyContentInspectionPolicyLabelBinding []interface{} `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding,omitempty"` + ContentInspectionPolicyCSVServerBinding []interface{} `json:"contentinspectionpolicy_csvserver_binding,omitempty"` + ContentInspectionPolicyLBVServerBinding []interface{} `json:"contentinspectionpolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type ContentinspectionpolicylabelContentinspectionpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ContentInspectionPolicyLabelContentInspectionPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Contentinspectionpolicy struct { +type ContentInspectionPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } diff --git a/nitrogo/models/cr.go b/nitrogo/models/cr.go index 7f97a21..d85d73b 100644 --- a/nitrogo/models/cr.go +++ b/nitrogo/models/cr.go @@ -1,322 +1,322 @@ package models // cr configuration structs -type CrvserverAppqoepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerAppQOEPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverCrpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerCRPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policyname string `json:"policyname,omitempty"` + PIPolicyHits int `json:"pipolicyhits,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverCachepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerCachePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrpolicyBinding struct { - CrpolicyCrvserverBinding []interface{} `json:"crpolicy_crvserver_binding,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CRPolicyBinding struct { + CRPolicyCRVServerBinding []interface{} `json:"crpolicy_crvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } -type CrvserverCmppolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerCMPPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Inherited string `json:"inherited,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type CRVServerAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type CrvserverLbvserverBinding struct { +type CRVServerLBVServerBinding struct { Hits int `json:"hits,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` + LBVServer string `json:"lbvserver,omitempty"` Name string `json:"name,omitempty"` } -type CrvserverAppflowpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerAppFlowPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverFeopolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerFEOPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverIcapolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerICAPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverResponderpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerResponderPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type Craction struct { +type CRAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Crtype string `json:"crtype,omitempty"` + CRType string `json:"crtype,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type CrvserverAppfwpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerAppFWPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverPolicymapBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerPolicyMapBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverRewritepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerRewritePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CrvserverSpilloverpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerSpilloverPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type Crpolicy struct { +type CRPolicy struct { Action string `json:"action,omitempty"` - Activepolicy bool `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + ActivePolicy bool `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policyname string `json:"policyname,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + LogAction string `json:"logaction,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Rule string `json:"rule,omitempty"` - Vstype int `json:"vstype,omitempty"` + VSType int `json:"vstype,omitempty"` } -type CrvserverBinding struct { - CrvserverAnalyticsprofileBinding []interface{} `json:"crvserver_analyticsprofile_binding,omitempty"` - CrvserverAppflowpolicyBinding []interface{} `json:"crvserver_appflowpolicy_binding,omitempty"` - CrvserverAppfwpolicyBinding []interface{} `json:"crvserver_appfwpolicy_binding,omitempty"` - CrvserverAppqoepolicyBinding []interface{} `json:"crvserver_appqoepolicy_binding,omitempty"` - CrvserverCachepolicyBinding []interface{} `json:"crvserver_cachepolicy_binding,omitempty"` - CrvserverCmppolicyBinding []interface{} `json:"crvserver_cmppolicy_binding,omitempty"` - CrvserverCrpolicyBinding []interface{} `json:"crvserver_crpolicy_binding,omitempty"` - CrvserverCspolicyBinding []interface{} `json:"crvserver_cspolicy_binding,omitempty"` - CrvserverFeopolicyBinding []interface{} `json:"crvserver_feopolicy_binding,omitempty"` - CrvserverIcapolicyBinding []interface{} `json:"crvserver_icapolicy_binding,omitempty"` - CrvserverLbvserverBinding []interface{} `json:"crvserver_lbvserver_binding,omitempty"` - CrvserverPolicymapBinding []interface{} `json:"crvserver_policymap_binding,omitempty"` - CrvserverResponderpolicyBinding []interface{} `json:"crvserver_responderpolicy_binding,omitempty"` - CrvserverRewritepolicyBinding []interface{} `json:"crvserver_rewritepolicy_binding,omitempty"` - CrvserverSpilloverpolicyBinding []interface{} `json:"crvserver_spilloverpolicy_binding,omitempty"` +type CRVServerBinding struct { + CRVServerAnalyticsProfileBinding []interface{} `json:"crvserver_analyticsprofile_binding,omitempty"` + CRVServerAppFlowPolicyBinding []interface{} `json:"crvserver_appflowpolicy_binding,omitempty"` + CRVServerAppFWPolicyBinding []interface{} `json:"crvserver_appfwpolicy_binding,omitempty"` + CRVServerAppQOEPolicyBinding []interface{} `json:"crvserver_appqoepolicy_binding,omitempty"` + CRVServerCachePolicyBinding []interface{} `json:"crvserver_cachepolicy_binding,omitempty"` + CRVServerCMPPolicyBinding []interface{} `json:"crvserver_cmppolicy_binding,omitempty"` + CRVServerCRPolicyBinding []interface{} `json:"crvserver_crpolicy_binding,omitempty"` + CRVServerCSPolicyBinding []interface{} `json:"crvserver_cspolicy_binding,omitempty"` + CRVServerFEOPolicyBinding []interface{} `json:"crvserver_feopolicy_binding,omitempty"` + CRVServerICAPolicyBinding []interface{} `json:"crvserver_icapolicy_binding,omitempty"` + CRVServerLBVServerBinding []interface{} `json:"crvserver_lbvserver_binding,omitempty"` + CRVServerPolicyMapBinding []interface{} `json:"crvserver_policymap_binding,omitempty"` + CRVServerResponderPolicyBinding []interface{} `json:"crvserver_responderpolicy_binding,omitempty"` + CRVServerRewritePolicyBinding []interface{} `json:"crvserver_rewritepolicy_binding,omitempty"` + CRVServerSpilloverPolicyBinding []interface{} `json:"crvserver_spilloverpolicy_binding,omitempty"` Name string `json:"name,omitempty"` } -type Crvserver struct { - Appflowlog string `json:"appflowlog,omitempty"` - Arp string `json:"arp,omitempty"` +type CRVServer struct { + AppFlowLog string `json:"appflowlog,omitempty"` + ARP string `json:"arp,omitempty"` Authentication string `json:"authentication,omitempty"` - Backendssl string `json:"backendssl,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + BackendSSL string `json:"backendssl,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate string `json:"curstate,omitempty"` - Destinationvserver string `json:"destinationvserver,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Disallowserviceaccess string `json:"disallowserviceaccess,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` + CurState string `json:"curstate,omitempty"` + DestinationVServer string `json:"destinationvserver,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DisallowServiceAccess string `json:"disallowserviceaccess,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` Domain string `json:"domain,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` Format string `json:"format,omitempty"` Ghost string `json:"ghost,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Homepage string `json:"homepage,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` Invoke bool `json:"invoke,omitempty"` - Ip string `json:"ip,omitempty"` - Ipset string `json:"ipset,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` + IP string `json:"ip,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + LBVServer string `json:"lbvserver,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` MapField string `json:"map,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Onpolicymatch string `json:"onpolicymatch,omitempty"` - Originusip string `json:"originusip,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policyname string `json:"policyname,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NGName string `json:"ngname,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + OnPolicyMatch string `json:"onpolicymatch,omitempty"` + OriginUSIP string `json:"originusip,omitempty"` + PIPolicyHits int `json:"pipolicyhits,omitempty"` + PolicyName string `json:"policyname,omitempty"` Port int `json:"port,omitempty"` Precedence string `json:"precedence,omitempty"` Priority int `json:"priority,omitempty"` - Probeport int `json:"probeport,omitempty"` - Probeprotocol string `json:"probeprotocol,omitempty"` - Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + ProbePort int `json:"probeport,omitempty"` + ProbeProtocol string `json:"probeprotocol,omitempty"` + ProbeSuccessResponseCode string `json:"probesuccessresponsecode,omitempty"` Range int `json:"range,omitempty"` Redirect string `json:"redirect,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` Reuse string `json:"reuse,omitempty"` - Rhistate string `json:"rhistate,omitempty"` + RHIState string `json:"rhistate,omitempty"` Rule string `json:"rule,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` - Srcipexpr string `json:"srcipexpr,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` + SrcIPExpr string `json:"srcipexpr,omitempty"` State string `json:"state,omitempty"` Status int `json:"status,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Tcpprobeport int `json:"tcpprobeport,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` + TCPProbePort int `json:"tcpprobeport,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` TypeField string `json:"type,omitempty"` - Useoriginipportforcache string `json:"useoriginipportforcache,omitempty"` - Useportrange string `json:"useportrange,omitempty"` + UseOriginIPPortForCache string `json:"useoriginipportforcache,omitempty"` + UsePortRange string `json:"useportrange,omitempty"` Value string `json:"value,omitempty"` Via string `json:"via,omitempty"` Weight int `json:"weight,omitempty"` } -type CrpolicyCrvserverBinding struct { - Bindhits int `json:"bindhits,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRPolicyCRVServerBinding struct { + BindHits int `json:"bindhits,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CrvserverCspolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CRVServerCSPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policyname string `json:"policyname,omitempty"` + PIPolicyHits int `json:"pipolicyhits,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } diff --git a/nitrogo/models/cs.go b/nitrogo/models/cs.go index 90c5122..0daa9f4 100644 --- a/nitrogo/models/cs.go +++ b/nitrogo/models/cs.go @@ -1,498 +1,498 @@ package models // cs configuration structs -type CsvserverTransformpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerTransformPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverDomainBinding struct { - Appflowlog string `json:"appflowlog,omitempty"` - Backupip string `json:"backupip,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` - Domainname string `json:"domainname,omitempty"` +type CSVServerDomainBinding struct { + AppFlowLog string `json:"appflowlog,omitempty"` + BackupIP string `json:"backupip,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieTimeout int `json:"cookietimeout,omitempty"` + DomainName string `json:"domainname,omitempty"` Name string `json:"name,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Ttl int `json:"ttl,omitempty"` + SiteDomainTTL int `json:"sitedomainttl,omitempty"` + TTL int `json:"ttl,omitempty"` } -type CsvserverBotpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerBotPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type Csparameter struct { +type CSParameter struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Stateupdate string `json:"stateupdate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + StateUpdate string `json:"stateupdate,omitempty"` } -type CsvserverVpnvserverBinding struct { +type CSVServerVPNVServerBinding struct { Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type CsvserverResponderpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerResponderPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type Cspolicy struct { +type CSPolicy struct { Action string `json:"action,omitempty"` - Activepolicy bool `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` + ActivePolicy bool `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Logaction string `json:"logaction,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + LogAction string `json:"logaction,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Rule string `json:"rule,omitempty"` - Vstype int `json:"vstype,omitempty"` -} - -type CsvserverBinding struct { - CsvserverAnalyticsprofileBinding []interface{} `json:"csvserver_analyticsprofile_binding,omitempty"` - CsvserverAppflowpolicyBinding []interface{} `json:"csvserver_appflowpolicy_binding,omitempty"` - CsvserverAppfwpolicyBinding []interface{} `json:"csvserver_appfwpolicy_binding,omitempty"` - CsvserverAppqoepolicyBinding []interface{} `json:"csvserver_appqoepolicy_binding,omitempty"` - CsvserverAuditnslogpolicyBinding []interface{} `json:"csvserver_auditnslogpolicy_binding,omitempty"` - CsvserverAuditsyslogpolicyBinding []interface{} `json:"csvserver_auditsyslogpolicy_binding,omitempty"` - CsvserverAuthorizationpolicyBinding []interface{} `json:"csvserver_authorizationpolicy_binding,omitempty"` - CsvserverBotpolicyBinding []interface{} `json:"csvserver_botpolicy_binding,omitempty"` - CsvserverCachepolicyBinding []interface{} `json:"csvserver_cachepolicy_binding,omitempty"` - CsvserverCmppolicyBinding []interface{} `json:"csvserver_cmppolicy_binding,omitempty"` - CsvserverContentinspectionpolicyBinding []interface{} `json:"csvserver_contentinspectionpolicy_binding,omitempty"` - CsvserverCspolicyBinding []interface{} `json:"csvserver_cspolicy_binding,omitempty"` - CsvserverFeopolicyBinding []interface{} `json:"csvserver_feopolicy_binding,omitempty"` - CsvserverGslbdomainBinding []interface{} `json:"csvserver_gslbdomain_binding,omitempty"` - CsvserverGslbvserverBinding []interface{} `json:"csvserver_gslbvserver_binding,omitempty"` - CsvserverLbvserverBinding []interface{} `json:"csvserver_lbvserver_binding,omitempty"` - CsvserverResponderpolicyBinding []interface{} `json:"csvserver_responderpolicy_binding,omitempty"` - CsvserverRewritepolicyBinding []interface{} `json:"csvserver_rewritepolicy_binding,omitempty"` - CsvserverSpilloverpolicyBinding []interface{} `json:"csvserver_spilloverpolicy_binding,omitempty"` - CsvserverTmtrafficpolicyBinding []interface{} `json:"csvserver_tmtrafficpolicy_binding,omitempty"` - CsvserverTransformpolicyBinding []interface{} `json:"csvserver_transformpolicy_binding,omitempty"` - CsvserverVpnvserverBinding []interface{} `json:"csvserver_vpnvserver_binding,omitempty"` + VSType int `json:"vstype,omitempty"` +} + +type CSVServerBinding struct { + CSVServerAnalyticsProfileBinding []interface{} `json:"csvserver_analyticsprofile_binding,omitempty"` + CSVServerAppFlowPolicyBinding []interface{} `json:"csvserver_appflowpolicy_binding,omitempty"` + CSVServerAppFWPolicyBinding []interface{} `json:"csvserver_appfwpolicy_binding,omitempty"` + CSVServerAppQOEPolicyBinding []interface{} `json:"csvserver_appqoepolicy_binding,omitempty"` + CSVServerAuditNSLogPolicyBinding []interface{} `json:"csvserver_auditnslogpolicy_binding,omitempty"` + CSVServerAuditSyslogPolicyBinding []interface{} `json:"csvserver_auditsyslogpolicy_binding,omitempty"` + CSVServerAuthorizationPolicyBinding []interface{} `json:"csvserver_authorizationpolicy_binding,omitempty"` + CSVServerBotPolicyBinding []interface{} `json:"csvserver_botpolicy_binding,omitempty"` + CSVServerCachePolicyBinding []interface{} `json:"csvserver_cachepolicy_binding,omitempty"` + CSVServerCMPPolicyBinding []interface{} `json:"csvserver_cmppolicy_binding,omitempty"` + CSVServerContentInspectionPolicyBinding []interface{} `json:"csvserver_contentinspectionpolicy_binding,omitempty"` + CSVServerCSPolicyBinding []interface{} `json:"csvserver_cspolicy_binding,omitempty"` + CSVServerFEOPolicyBinding []interface{} `json:"csvserver_feopolicy_binding,omitempty"` + CSVServerGSLBDomainBinding []interface{} `json:"csvserver_gslbdomain_binding,omitempty"` + CSVServerGSLBVServerBinding []interface{} `json:"csvserver_gslbvserver_binding,omitempty"` + CSVServerLBVServerBinding []interface{} `json:"csvserver_lbvserver_binding,omitempty"` + CSVServerResponderPolicyBinding []interface{} `json:"csvserver_responderpolicy_binding,omitempty"` + CSVServerRewritePolicyBinding []interface{} `json:"csvserver_rewritepolicy_binding,omitempty"` + CSVServerSpilloverPolicyBinding []interface{} `json:"csvserver_spilloverpolicy_binding,omitempty"` + CSVServerTMTrafficPolicyBinding []interface{} `json:"csvserver_tmtrafficpolicy_binding,omitempty"` + CSVServerTransformPolicyBinding []interface{} `json:"csvserver_transformpolicy_binding,omitempty"` + CSVServerVPNVServerBinding []interface{} `json:"csvserver_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type CspolicyCsvserverBinding struct { +type CSPolicyCSVServerBinding struct { Action string `json:"action,omitempty"` - Bindhits int `json:"bindhits,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + BindHits int `json:"bindhits,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CspolicyCspolicylabelBinding struct { - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSPolicyCSPolicyLabelBinding struct { + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CsvserverAuditnslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAuditNSLogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverAppflowpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAppFlowPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverAuditsyslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAuditSyslogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverTmtrafficpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerTMTrafficPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverCachepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerCachePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverAppfwpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAppFWPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverCspolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Cookieipport string `json:"cookieipport,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerCSPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + CookieIPPort string `json:"cookieipport,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policyname string `json:"policyname,omitempty"` + PIPolicyHits int `json:"pipolicyhits,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Rule string `json:"rule,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Vserverid string `json:"vserverid,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` + VServerID string `json:"vserverid,omitempty"` } -type CsvserverAppqoepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAppQOEPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverSpilloverpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerSpilloverPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverAuthorizationpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerAuthorizationPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type CSVServerAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type CspolicyCrvserverBinding struct { - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSPolicyCRVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type CspolicylabelBinding struct { - CspolicylabelCspolicyBinding []interface{} `json:"cspolicylabel_cspolicy_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type CSPolicyLabelBinding struct { + CSPolicyLabelCSPolicyBinding []interface{} `json:"cspolicylabel_cspolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type CsvserverContentinspectionpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerContentInspectionPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type Cspolicylabel struct { +type CSPolicyLabel struct { Count float64 `json:"__count,omitempty"` - Cspolicylabeltype string `json:"cspolicylabeltype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + CSPolicyLabelType string `json:"cspolicylabeltype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type CsvserverGslbvserverBinding struct { +type CSVServerGSLBVServerBinding struct { Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type CsvserverFeopolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerFEOPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverRewritepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerRewritePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type CsvserverCmppolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSVServerCMPPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` } -type Csaction struct { +type CSAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Targetvserverexpr string `json:"targetvserverexpr,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` + TargetVServerExpr string `json:"targetvserverexpr,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type CspolicylabelCspolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type CSPolicyLabelCSPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` } -type Csvserver struct { - Apiprofile string `json:"apiprofile,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` +type CSVServer struct { + APIProfile string `json:"apiprofile,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` Authentication string `json:"authentication,omitempty"` - Authenticationhost string `json:"authenticationhost,omitempty"` + AuthenticationHost string `json:"authenticationhost,omitempty"` Authn401 string `json:"authn401,omitempty"` - Authnprofile string `json:"authnprofile,omitempty"` - Authnvsname string `json:"authnvsname,omitempty"` - Backupip string `json:"backupip,omitempty"` - Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` + AuthnProfile string `json:"authnprofile,omitempty"` + AuthnVSName string `json:"authnvsname,omitempty"` + BackupIP string `json:"backupip,omitempty"` + BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Casesensitive string `json:"casesensitive,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CaseSensitive string `json:"casesensitive,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CookieTimeout int `json:"cookietimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate string `json:"curstate,omitempty"` - Dbprofilename string `json:"dbprofilename,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Dnsoverhttps string `json:"dnsoverhttps,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` + CurState string `json:"curstate,omitempty"` + DBProfileName string `json:"dbprofilename,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSRecordType string `json:"dnsrecordtype,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` Domain string `json:"domain,omitempty"` - Domainname string `json:"domainname,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Dtls string `json:"dtls,omitempty"` + DomainName string `json:"domainname,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + DTLS string `json:"dtls,omitempty"` Gt2gb string `json:"gt2gb,omitempty"` - Homepage string `json:"homepage,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Httpsredirecturl string `json:"httpsredirecturl,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Insertvserveripport string `json:"insertvserveripport,omitempty"` - Ip string `json:"ip,omitempty"` - Ipmask string `json:"ipmask,omitempty"` - Ippattern string `json:"ippattern,omitempty"` - Ipset string `json:"ipset,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Mssqlserverversion string `json:"mssqlserverversion,omitempty"` - Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` - Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` - Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` - Mysqlserverversion string `json:"mysqlserverversion,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` + ICMPVsrResponse string `json:"icmpvsrresponse,omitempty"` + InsertVServerIPPort string `json:"insertvserveripport,omitempty"` + IP string `json:"ip,omitempty"` + IPMask string `json:"ipmask,omitempty"` + IPPattern string `json:"ippattern,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LBVServer string `json:"lbvserver,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` + MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` + MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` + MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` + MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` + MySQLServerVersion string `json:"mysqlserverversion,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Oracleserverversion string `json:"oracleserverversion,omitempty"` - Persistencebackup string `json:"persistencebackup,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NgName string `json:"ngname,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + OracleServerVersion string `json:"oracleserverversion,omitempty"` + PersistenceBackup string `json:"persistencebackup,omitempty"` + PersistenceID int `json:"persistenceid,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` Port int `json:"port,omitempty"` Precedence string `json:"precedence,omitempty"` - Probeport int `json:"probeport,omitempty"` - Probeprotocol string `json:"probeprotocol,omitempty"` - Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` + ProbePort int `json:"probeport,omitempty"` + ProbeProtocol string `json:"probeprotocol,omitempty"` + ProbeSuccessResponseCode string `json:"probesuccessresponsecode,omitempty"` Push string `json:"push,omitempty"` - Pushlabel string `json:"pushlabel,omitempty"` - Pushmulticlients string `json:"pushmulticlients,omitempty"` - Pushvserver string `json:"pushvserver,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` + PushLabel string `json:"pushlabel,omitempty"` + PushMultiClients string `json:"pushmulticlients,omitempty"` + PushVServer string `json:"pushvserver,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` Range int `json:"range,omitempty"` Redirect string `json:"redirect,omitempty"` - Redirectfromport int `json:"redirectfromport,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` - Rhistate string `json:"rhistate,omitempty"` - Rtspnat string `json:"rtspnat,omitempty"` - Ruletype int `json:"ruletype,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Sobackupaction string `json:"sobackupaction,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + RedirectFromPort int `json:"redirectfromport,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` + RHIState string `json:"rhistate,omitempty"` + RTSPNAT string `json:"rtspnat,omitempty"` + RuleType int `json:"ruletype,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteDomainTTL int `json:"sitedomainttl,omitempty"` + SOBackupAction string `json:"sobackupaction,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Stateupdate string `json:"stateupdate,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + StateUpdate string `json:"stateupdate,omitempty"` Status int `json:"status,omitempty"` - Targetlbvserver string `json:"targetlbvserver,omitempty"` - Targettype string `json:"targettype,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Tcpprobeport int `json:"tcpprobeport,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + TargetLBVServer string `json:"targetlbvserver,omitempty"` + TargetType string `json:"targettype,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` + TCPProbePort int `json:"tcpprobeport,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` Timeout int `json:"timeout,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Url string `json:"url,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` + URL string `json:"url,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` Value string `json:"value,omitempty"` Version int `json:"version,omitempty"` - Vipheader string `json:"vipheader,omitempty"` + VIPHeader string `json:"vipheader,omitempty"` Weight int `json:"weight,omitempty"` } -type CspolicyBinding struct { - CspolicyCrvserverBinding []interface{} `json:"cspolicy_crvserver_binding,omitempty"` - CspolicyCspolicylabelBinding []interface{} `json:"cspolicy_cspolicylabel_binding,omitempty"` - CspolicyCsvserverBinding []interface{} `json:"cspolicy_csvserver_binding,omitempty"` - Policyname string `json:"policyname,omitempty"` +type CSPolicyBinding struct { + CSPolicyCRVServerBinding []interface{} `json:"cspolicy_crvserver_binding,omitempty"` + CSPolicyCSPolicyLabelBinding []interface{} `json:"cspolicy_cspolicylabel_binding,omitempty"` + CSPolicyCSVServerBinding []interface{} `json:"cspolicy_csvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } -type CsvserverLbvserverBinding struct { - Cookieipport string `json:"cookieipport,omitempty"` +type CSVServerLBVServerBinding struct { + CookieIPPort string `json:"cookieipport,omitempty"` Hits int `json:"hits,omitempty"` - Lbvserver string `json:"lbvserver,omitempty"` + LBVServer string `json:"lbvserver,omitempty"` Name string `json:"name,omitempty"` - Targetvserver string `json:"targetvserver,omitempty"` - Vserverid string `json:"vserverid,omitempty"` + TargetVServer string `json:"targetvserver,omitempty"` + VServerID string `json:"vserverid,omitempty"` } diff --git a/nitrogo/models/db.go b/nitrogo/models/db.go index 8fdc7da..5c6fbbf 100644 --- a/nitrogo/models/db.go +++ b/nitrogo/models/db.go @@ -1,22 +1,22 @@ package models // db configuration structs -type Dbuser struct { +type DBUser struct { Count float64 `json:"__count,omitempty"` - Loggedin bool `json:"loggedin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + LoggedIn bool `json:"loggedin,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` } -type Dbdbprofile struct { - Conmultiplex string `json:"conmultiplex,omitempty"` +type DBDBProfile struct { + ConMultiplex string `json:"conmultiplex,omitempty"` Count float64 `json:"__count,omitempty"` - Enablecachingconmuxoff string `json:"enablecachingconmuxoff,omitempty"` - Interpretquery string `json:"interpretquery,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + EnableCachingConMuxOff string `json:"enablecachingconmuxoff,omitempty"` + InterpretQuery string `json:"interpretquery,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Refcnt int `json:"refcnt,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RefCnt int `json:"refcnt,omitempty"` Stickiness string `json:"stickiness,omitempty"` } diff --git a/nitrogo/models/dns.go b/nitrogo/models/dns.go index d260124..36c8cc1 100644 --- a/nitrogo/models/dns.go +++ b/nitrogo/models/dns.go @@ -1,521 +1,521 @@ package models // dns configuration structs -type Dnsnsecrec struct { +type DNSNSECRec struct { Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Hostname string `json:"hostname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nextnsec string `json:"nextnsec,omitempty"` - Nextrecs []string `json:"nextrecs,omitempty"` - Ttl int `json:"ttl,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextNSEC string `json:"nextnsec,omitempty"` + NextRecs []string `json:"nextrecs,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnstxtrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSTxtRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Recordid int `json:"recordid,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + RecordID int `json:"recordid,omitempty"` String []string `json:"String,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnszone struct { +type DNSZone struct { Count float64 `json:"__count,omitempty"` - Dnssecoffload string `json:"dnssecoffload,omitempty"` + DNSSECOffload string `json:"dnssecoffload,omitempty"` Flags int `json:"flags,omitempty"` - Keyname []string `json:"keyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nsec string `json:"nsec,omitempty"` - Proxymode string `json:"proxymode,omitempty"` + KeyName []string `json:"keyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSEC string `json:"nsec,omitempty"` + ProxyMode string `json:"proxymode,omitempty"` TypeField string `json:"type,omitempty"` - Zonename string `json:"zonename,omitempty"` + ZoneName string `json:"zonename,omitempty"` } -type DnspolicylabelBinding struct { - DnspolicylabelDnspolicyBinding []interface{} `json:"dnspolicylabel_dnspolicy_binding,omitempty"` - DnspolicylabelPolicybindingBinding []interface{} `json:"dnspolicylabel_policybinding_binding,omitempty"` - Labelname string `json:"labelname,omitempty"` +type DNSPolicyLabelBinding struct { + DNSPolicyLabelDNSPolicyBinding []interface{} `json:"dnspolicylabel_dnspolicy_binding,omitempty"` + DNSPolicyLabelPolicyBindingBinding []interface{} `json:"dnspolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } -type Dnsdsfile struct { - Keyname string `json:"keyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type DNSDSFile struct { + KeyName string `json:"keyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Dnsnegativecacherecords struct { +type DNSNegativeCacheRecords struct { Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Hostname string `json:"hostname,omitempty"` - Negcachetype string `json:"negcachetype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Peid int `json:"peid,omitempty"` - Querytype string `json:"querytype,omitempty"` - Rdclient string `json:"rdclient,omitempty"` - Ttl int `json:"ttl,omitempty"` + NegCacheType string `json:"negcachetype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PEID int `json:"peid,omitempty"` + QueryType string `json:"querytype,omitempty"` + RDClient string `json:"rdclient,omitempty"` + TTL int `json:"ttl,omitempty"` } -type DnspolicylabelDnspolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type DNSPolicyLabelDNSPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Dnsptrrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSPtrRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Reversedomain string `json:"reversedomain,omitempty"` - Ttl int `json:"ttl,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + ReverseDomain string `json:"reversedomain,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type DnszoneDomainBinding struct { +type DNSZoneDomainBinding struct { Domain string `json:"domain,omitempty"` - Nextrecs []string `json:"nextrecs,omitempty"` - Zonename string `json:"zonename,omitempty"` + NextRecs []string `json:"nextrecs,omitempty"` + ZoneName string `json:"zonename,omitempty"` } -type DnszoneBinding struct { - DnszoneDnskeyBinding []interface{} `json:"dnszone_dnskey_binding,omitempty"` - DnszoneGslbdomainBinding []interface{} `json:"dnszone_gslbdomain_binding,omitempty"` - Zonename string `json:"zonename,omitempty"` +type DNSZoneBinding struct { + DNSZoneDNSKeyBinding []interface{} `json:"dnszone_dnskey_binding,omitempty"` + DNSZoneGSLBDomainBinding []interface{} `json:"dnszone_gslbdomain_binding,omitempty"` + ZoneName string `json:"zonename,omitempty"` } -type DnsglobalDnspolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type DNSGlobalDNSPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnsnameserver struct { - Clmonowner int `json:"clmonowner,omitempty"` - Clmonview int `json:"clmonview,omitempty"` +type DNSNameServer struct { + ClMonOwner int `json:"clmonowner,omitempty"` + ClMonView int `json:"clmonview,omitempty"` Count float64 `json:"__count,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Ip string `json:"ip,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + IP string `json:"ip,omitempty"` Local bool `json:"local,omitempty"` - Nameserverstate string `json:"nameserverstate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NameServerState string `json:"nameserverstate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` State string `json:"state,omitempty"` TypeField string `json:"type,omitempty"` } -type DnspolicyDnspolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type DNSPolicyDNSPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Dnssrvrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSSrvRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Port int `json:"port,omitempty"` Priority int `json:"priority,omitempty"` Target string `json:"target,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` Weight int `json:"weight,omitempty"` } -type DnsviewBinding struct { - DnsviewDnspolicyBinding []interface{} `json:"dnsview_dnspolicy_binding,omitempty"` - DnsviewGslbserviceBinding []interface{} `json:"dnsview_gslbservice_binding,omitempty"` - Viewname string `json:"viewname,omitempty"` +type DNSViewBinding struct { + DNSViewDNSPolicyBinding []interface{} `json:"dnsview_dnspolicy_binding,omitempty"` + DNSViewGSLBServiceBinding []interface{} `json:"dnsview_gslbservice_binding,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type Dnspolicylabel struct { +type DNSPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` Priority int `json:"priority,omitempty"` Transform string `json:"transform,omitempty"` } -type Dnsproxyrecords struct { - Negrectype string `json:"negrectype,omitempty"` +type DNSProxyRecords struct { + NegRecType string `json:"negrectype,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnsnsrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSNSRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nameserver string `json:"nameserver,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ttl int `json:"ttl,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + NameServer string `json:"nameserver,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type DnspolicyDnsglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type DNSPolicyDNSGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Dnspolicy struct { - Actionname string `json:"actionname,omitempty"` +type DNSPolicy struct { + ActionName string `json:"actionname,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cachebypass string `json:"cachebypass,omitempty"` + CacheBypass string `json:"cachebypass,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Drop string `json:"drop,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Preferredloclist []string `json:"preferredloclist,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + PreferredLocList []string `json:"preferredloclist,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` - Viewname string `json:"viewname,omitempty"` + UndefHits int `json:"undefhits,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type Dnsaction struct { - Actionname string `json:"actionname,omitempty"` - Actiontype string `json:"actiontype,omitempty"` +type DNSAction struct { + ActionName string `json:"actionname,omitempty"` + ActionType string `json:"actiontype,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cachebypass string `json:"cachebypass,omitempty"` + CacheBypass string `json:"cachebypass,omitempty"` Count float64 `json:"__count,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` Drop string `json:"drop,omitempty"` Feature string `json:"feature,omitempty"` - Ipaddress []string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preferredloclist []string `json:"preferredloclist,omitempty"` - Ttl int `json:"ttl,omitempty"` - Viewname string `json:"viewname,omitempty"` + IPAddress []string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreferredLocList []string `json:"preferredloclist,omitempty"` + TTL int `json:"ttl,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type DnsglobalBinding struct { - DnsglobalDnspolicyBinding []interface{} `json:"dnsglobal_dnspolicy_binding,omitempty"` +type DNSGlobalBinding struct { + DNSGlobalDNSPolicyBinding []interface{} `json:"dnsglobal_dnspolicy_binding,omitempty"` } -type Dnssoarec struct { - Authtype string `json:"authtype,omitempty"` +type DNSSOARec struct { + AuthType string `json:"authtype,omitempty"` Contact string `json:"contact,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Expire int `json:"expire,omitempty"` Minimum int `json:"minimum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Originserver string `json:"originserver,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + OriginServer string `json:"originserver,omitempty"` Refresh int `json:"refresh,omitempty"` Retry int `json:"retry,omitempty"` Serial int `json:"serial,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnspolicy64Binding struct { - Dnspolicy64LbvserverBinding []interface{} `json:"dnspolicy64_lbvserver_binding,omitempty"` +type DNSPolicy64Binding struct { + DNSPolicy64LBVServerBinding []interface{} `json:"dnspolicy64_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type DnspolicyBinding struct { - DnspolicyDnsglobalBinding []interface{} `json:"dnspolicy_dnsglobal_binding,omitempty"` - DnspolicyDnspolicylabelBinding []interface{} `json:"dnspolicy_dnspolicylabel_binding,omitempty"` +type DNSPolicyBinding struct { + DNSPolicyDNSGlobalBinding []interface{} `json:"dnspolicy_dnsglobal_binding,omitempty"` + DNSPolicyDNSPolicyLabelBinding []interface{} `json:"dnspolicy_dnspolicylabel_binding,omitempty"` Name string `json:"name,omitempty"` } -type DnszoneDnskeyBinding struct { +type DNSZoneDNSKeyBinding struct { Expires int `json:"expires,omitempty"` - Keyname []string `json:"keyname,omitempty"` - Siginceptiontime []interface{} `json:"siginceptiontime,omitempty"` + KeyName []string `json:"keyname,omitempty"` + SigInceptionTime []interface{} `json:"siginceptiontime,omitempty"` Signed int `json:"signed,omitempty"` - Zonename string `json:"zonename,omitempty"` + ZoneName string `json:"zonename,omitempty"` } -type Dnspolicy64LbvserverBinding struct { - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type DNSPolicy64LBVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Dnssuffix struct { +type DNSSuffix struct { Count float64 `json:"__count,omitempty"` - Dnssuffix string `json:"Dnssuffix,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + DNSSuffix string `json:"Dnssuffix,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Dnsparameter struct { - Autosavekeyops string `json:"autosavekeyops,omitempty"` +type DNSParameter struct { + AutoSaveKeyOps string `json:"autosavekeyops,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cacheecszeroprefix string `json:"cacheecszeroprefix,omitempty"` - Cachehitbypass string `json:"cachehitbypass,omitempty"` - Cachenoexpire string `json:"cachenoexpire,omitempty"` - Cacherecords string `json:"cacherecords,omitempty"` - Dns64timeout int `json:"dns64timeout,omitempty"` - Dnsrootreferral string `json:"dnsrootreferral,omitempty"` - Dnssec string `json:"dnssec,omitempty"` - Ecsmaxsubnets int `json:"ecsmaxsubnets,omitempty"` + CacheECSZeroPrefix string `json:"cacheecszeroprefix,omitempty"` + CacheHitBypass string `json:"cachehitbypass,omitempty"` + CacheNoExpire string `json:"cachenoexpire,omitempty"` + CacheRecords string `json:"cacherecords,omitempty"` + DNS64Timeout int `json:"dns64timeout,omitempty"` + DNSRootReferral string `json:"dnsrootreferral,omitempty"` + DNSSec string `json:"dnssec,omitempty"` + ECSMaxSubnets int `json:"ecsmaxsubnets,omitempty"` Feature string `json:"feature,omitempty"` - Maxcachesize int `json:"maxcachesize,omitempty"` - Maxnegativecachesize int `json:"maxnegativecachesize,omitempty"` - Maxnegcachettl int `json:"maxnegcachettl,omitempty"` - Maxpipeline int `json:"maxpipeline,omitempty"` - Maxttl int `json:"maxttl,omitempty"` - Maxudppacketsize int `json:"maxudppacketsize,omitempty"` - Minttl int `json:"minttl,omitempty"` - Namelookuppriority string `json:"namelookuppriority,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nxdomainratelimitthreshold int `json:"nxdomainratelimitthreshold,omitempty"` - Nxdomainthresholdcrossed int `json:"nxdomainthresholdcrossed,omitempty"` + MaxCacheSize int `json:"maxcachesize,omitempty"` + MaxNegativeCacheSize int `json:"maxnegativecachesize,omitempty"` + MaxNegCacheTTL int `json:"maxnegcachettl,omitempty"` + MaxPipeline int `json:"maxpipeline,omitempty"` + MaxTTL int `json:"maxttl,omitempty"` + MaxUDPPacketSize int `json:"maxudppacketsize,omitempty"` + MinTTL int `json:"minttl,omitempty"` + NameLookupPriority string `json:"namelookuppriority,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NXDomainRateLimitThreshold int `json:"nxdomainratelimitthreshold,omitempty"` + NXDomainThresholdCrossed int `json:"nxdomainthresholdcrossed,omitempty"` Recursion string `json:"recursion,omitempty"` - Resolutionorder string `json:"resolutionorder,omitempty"` - Resolvermaxactiveresolutions int `json:"resolvermaxactiveresolutions,omitempty"` - Resolvermaxtcpconnections int `json:"resolvermaxtcpconnections,omitempty"` - Resolvermaxtcptimeout int `json:"resolvermaxtcptimeout,omitempty"` + ResolutionOrder string `json:"resolutionorder,omitempty"` + ResolverMaxActiveResolutions int `json:"resolvermaxactiveresolutions,omitempty"` + ResolverMaxTCPConnections int `json:"resolvermaxtcpconnections,omitempty"` + ResolverMaxTCPTimeout int `json:"resolvermaxtcptimeout,omitempty"` Retries int `json:"retries,omitempty"` - Splitpktqueryprocessing string `json:"splitpktqueryprocessing,omitempty"` - Zonetransfer string `json:"zonetransfer,omitempty"` + SplitPktQueryProcessing string `json:"splitpktqueryprocessing,omitempty"` + ZoneTransfer string `json:"zonetransfer,omitempty"` } -type Dnsaction64 struct { - Actionname string `json:"actionname,omitempty"` +type DNSAction64 struct { + ActionName string `json:"actionname,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Excluderule string `json:"excluderule,omitempty"` + ExcludeRule string `json:"excluderule,omitempty"` Feature string `json:"feature,omitempty"` - Mappedrule string `json:"mappedrule,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + MappedRule string `json:"mappedrule,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Prefix string `json:"prefix,omitempty"` } -type Dnscnamerec struct { - Aliasname string `json:"aliasname,omitempty"` - Authtype string `json:"authtype,omitempty"` - Canonicalname string `json:"canonicalname,omitempty"` +type DNSCnameRec struct { + AliasName string `json:"aliasname,omitempty"` + AuthType string `json:"authtype,omitempty"` + CanonicalName string `json:"canonicalname,omitempty"` Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ttl int `json:"ttl,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Dnspolicy64 struct { +type DNSPolicy64 struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Hits int `json:"hits,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Dnsprofile struct { - Cacheecsresponses string `json:"cacheecsresponses,omitempty"` - Cachenegativeresponses string `json:"cachenegativeresponses,omitempty"` - Cacherecords string `json:"cacherecords,omitempty"` +type DNSProfile struct { + CacheECSResponses string `json:"cacheecsresponses,omitempty"` + CacheNegativeResponses string `json:"cachenegativeresponses,omitempty"` + CacheRecords string `json:"cacherecords,omitempty"` Count float64 `json:"__count,omitempty"` - Dnsanswerseclogging string `json:"dnsanswerseclogging,omitempty"` - Dnserrorlogging string `json:"dnserrorlogging,omitempty"` - Dnsextendedlogging string `json:"dnsextendedlogging,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Dnsquerylogging string `json:"dnsquerylogging,omitempty"` - Dropmultiqueryrequest string `json:"dropmultiqueryrequest,omitempty"` - Insertecs string `json:"insertecs,omitempty"` - Maxcacheableecsprefixlength int `json:"maxcacheableecsprefixlength,omitempty"` - Maxcacheableecsprefixlength6 int `json:"maxcacheableecsprefixlength6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Recursiveresolution string `json:"recursiveresolution,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Replaceecs string `json:"replaceecs,omitempty"` -} - -type DnsviewGslbserviceBinding struct { - Gslbservicename string `json:"gslbservicename,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Viewname string `json:"viewname,omitempty"` -} - -type Dnsaaaarec struct { - Authtype string `json:"authtype,omitempty"` + DNSAnswerSecLogging string `json:"dnsanswerseclogging,omitempty"` + DNSErrorLogging string `json:"dnserrorlogging,omitempty"` + DNSExtendedLogging string `json:"dnsextendedlogging,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSQueryLogging string `json:"dnsquerylogging,omitempty"` + DropMultiQueryRequest string `json:"dropmultiqueryrequest,omitempty"` + InsertECS string `json:"insertecs,omitempty"` + MaxCacheableECSPrefixLength int `json:"maxcacheableecsprefixlength,omitempty"` + MaxCacheableECSPrefixLength6 int `json:"maxcacheableecsprefixlength6,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RecursiveResolution string `json:"recursiveresolution,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + ReplaceECS string `json:"replaceecs,omitempty"` +} + +type DNSViewGSLBServiceBinding struct { + GSLBServiceName string `json:"gslbservicename,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + ViewName string `json:"viewname,omitempty"` +} + +type DNSAAAARec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Hostname string `json:"hostname,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ttl int `json:"ttl,omitempty"` + IPv6Address string `json:"ipv6address,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Dnsview struct { +type DNSView struct { Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Viewname string `json:"viewname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type Dnskey struct { - Activationtimestr string `json:"activationtimestr,omitempty"` +type DNSKey struct { + ActivationTimeStr string `json:"activationtimestr,omitempty"` Algorithm string `json:"algorithm,omitempty"` - Autorollover string `json:"autorollover,omitempty"` + AutoRollover string `json:"autorollover,omitempty"` Count float64 `json:"__count,omitempty"` - Createtimestr string `json:"createtimestr,omitempty"` - Deletiontimestr string `json:"deletiontimestr,omitempty"` + CreateTimeStr string `json:"createtimestr,omitempty"` + DeletionTimeStr string `json:"deletiontimestr,omitempty"` Expires int `json:"expires,omitempty"` - Expirytimestr string `json:"expirytimestr,omitempty"` - Filenameprefix string `json:"filenameprefix,omitempty"` - Keyname string `json:"keyname,omitempty"` - Keysize int `json:"keysize,omitempty"` - Keytype string `json:"keytype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Notificationperiod int `json:"notificationperiod,omitempty"` + ExpiryTimeStr string `json:"expirytimestr,omitempty"` + FilenamePrefix string `json:"filenameprefix,omitempty"` + KeyName string `json:"keyname,omitempty"` + KeySize int `json:"keysize,omitempty"` + KeyType string `json:"keytype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NotificationPeriod int `json:"notificationperiod,omitempty"` Password string `json:"password,omitempty"` - Privatekey string `json:"privatekey,omitempty"` - Publickey string `json:"publickey,omitempty"` + PrivateKey string `json:"privatekey,omitempty"` + PublicKey string `json:"publickey,omitempty"` Revoke bool `json:"revoke,omitempty"` - Rolloverfailrc int `json:"rolloverfailrc,omitempty"` - Rollovermethod string `json:"rollovermethod,omitempty"` + RolloverFailRC int `json:"rolloverfailrc,omitempty"` + RolloverMethod string `json:"rollovermethod,omitempty"` Src string `json:"src,omitempty"` State string `json:"state,omitempty"` Tag int `json:"tag,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` Units1 string `json:"units1,omitempty"` Units2 string `json:"units2,omitempty"` - Zonename string `json:"zonename,omitempty"` + ZoneName string `json:"zonename,omitempty"` } -type Dnsnaptrrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSNaptrRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Flags string `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Order int `json:"order,omitempty"` Preference int `json:"preference,omitempty"` - Recordid int `json:"recordid,omitempty"` + RecordID int `json:"recordid,omitempty"` Regexp string `json:"regexp,omitempty"` Replacement string `json:"replacement,omitempty"` Services string `json:"services,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type DnsviewDnspolicyBinding struct { - Dnspolicyname string `json:"dnspolicyname,omitempty"` - Viewname string `json:"viewname,omitempty"` +type DNSViewDNSPolicyBinding struct { + DNSPolicyName string `json:"dnspolicyname,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type Dnssubnetcache struct { +type DNSSubnetCache struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Hostname string `json:"hostname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nextrecs []string `json:"nextrecs,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextRecs []string `json:"nextrecs,omitempty"` + NodeID int `json:"nodeid,omitempty"` } -type Dnsaddrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSAddRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Hostname string `json:"hostname,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ttl int `json:"ttl,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Dnsmxrec struct { - Authtype string `json:"authtype,omitempty"` +type DNSMXRec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` - Mx string `json:"mx,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` + MX string `json:"mx,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Pref int `json:"pref,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` } -type Dnscaarec struct { - Authtype string `json:"authtype,omitempty"` +type DNSCAARec struct { + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Ecssubnet string `json:"ecssubnet,omitempty"` + ECSSubnet string `json:"ecssubnet,omitempty"` Flag string `json:"flag,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Recordid int `json:"recordid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + RecordID int `json:"recordid,omitempty"` Tag string `json:"tag,omitempty"` - Ttl int `json:"ttl,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Valuestring string `json:"valuestring,omitempty"` + ValueString string `json:"valuestring,omitempty"` } -type DnspolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type DNSPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/dos.go b/nitrogo/models/dos.go index ad42ba7..c8ecdd0 100644 --- a/nitrogo/models/dos.go +++ b/nitrogo/models/dos.go @@ -4,8 +4,8 @@ package models -type Dospolicy struct { +type DOSPolicy struct { Name string `json:"name,omitempty"` - Qdepth int `json:"qdepth,omitempty"` - Cltdetectrate int `json:"cltdetectrate,omitempty"` + QDepth int `json:"qdepth,omitempty"` + CltDetectRate int `json:"cltdetectrate,omitempty"` } diff --git a/nitrogo/models/dps.go b/nitrogo/models/dps.go index 9be5840..45ae245 100644 --- a/nitrogo/models/dps.go +++ b/nitrogo/models/dps.go @@ -1,11 +1,11 @@ package models // dps configuration structs -type Dpsparameter struct { +type DPSParameter struct { Builtin []string `json:"builtin,omitempty"` - Customerid string `json:"customerid,omitempty"` + CustomerID string `json:"customerid,omitempty"` Deployment string `json:"deployment,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Serviceurl string `json:"serviceurl,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServiceURL string `json:"serviceurl,omitempty"` } diff --git a/nitrogo/models/endpoint.go b/nitrogo/models/endpoint.go index 863b6c9..1b56182 100644 --- a/nitrogo/models/endpoint.go +++ b/nitrogo/models/endpoint.go @@ -1,11 +1,11 @@ package models // endpoint configuration structs -type Endpointinfo struct { +type EndpointInfo struct { Count float64 `json:"__count,omitempty"` - Endpointkind string `json:"endpointkind,omitempty"` - Endpointlabelsjson string `json:"endpointlabelsjson,omitempty"` - Endpointmetadata string `json:"endpointmetadata,omitempty"` - Endpointname string `json:"endpointname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + EndpointKind string `json:"endpointkind,omitempty"` + EndpointLabelsJSON string `json:"endpointlabelsjson,omitempty"` + EndpointMetadata string `json:"endpointmetadata,omitempty"` + EndpointName string `json:"endpointname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/feo.go b/nitrogo/models/feo.go index d169e07..c3e2a7e 100644 --- a/nitrogo/models/feo.go +++ b/nitrogo/models/feo.go @@ -1,109 +1,109 @@ package models // feo configuration structs -type FeopolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type FEOPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type FeoglobalBinding struct { - FeoglobalFeopolicyBinding []interface{} `json:"feoglobal_feopolicy_binding,omitempty"` +type FEOGlobalBinding struct { + FEOGlobalFEOPolicyBinding []interface{} `json:"feoglobal_feopolicy_binding,omitempty"` } -type FeopolicyFeoglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type FEOPolicyFEOGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type FeopolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type FEOPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Feopolicy struct { +type FEOPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Feoaction struct { +type FEOAction struct { Builtin []string `json:"builtin,omitempty"` - Cachemaxage int `json:"cachemaxage,omitempty"` - Clientsidemeasurements bool `json:"clientsidemeasurements,omitempty"` - Convertimporttolink bool `json:"convertimporttolink,omitempty"` + CacheMaxAge int `json:"cachemaxage,omitempty"` + ClientSideMeasurements bool `json:"clientsidemeasurements,omitempty"` + ConvertImportToLink bool `json:"convertimporttolink,omitempty"` Count float64 `json:"__count,omitempty"` - Csscombine bool `json:"csscombine,omitempty"` - Cssflattenimports bool `json:"cssflattenimports,omitempty"` - Cssimginline bool `json:"cssimginline,omitempty"` - Cssinline bool `json:"cssinline,omitempty"` - Cssminify bool `json:"cssminify,omitempty"` - Cssmovetohead bool `json:"cssmovetohead,omitempty"` - Dnsshards []string `json:"dnsshards,omitempty"` - Domainsharding string `json:"domainsharding,omitempty"` + CSSCombine bool `json:"csscombine,omitempty"` + CSSFlattenImports bool `json:"cssflattenimports,omitempty"` + CSSImgInline bool `json:"cssimginline,omitempty"` + CSSInline bool `json:"cssinline,omitempty"` + CSSMinify bool `json:"cssminify,omitempty"` + CSSMoveToHead bool `json:"cssmovetohead,omitempty"` + DNSShards []string `json:"dnsshards,omitempty"` + DomainSharding string `json:"domainsharding,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Htmlminify bool `json:"htmlminify,omitempty"` - Htmlrmattribquotes bool `json:"htmlrmattribquotes,omitempty"` - Htmlrmdefaultattribs bool `json:"htmlrmdefaultattribs,omitempty"` - Htmltrimurls bool `json:"htmltrimurls,omitempty"` - Imgadddimensions bool `json:"imgadddimensions,omitempty"` - Imggiftopng bool `json:"imggiftopng,omitempty"` - Imginline bool `json:"imginline,omitempty"` - Imglazyload bool `json:"imglazyload,omitempty"` - Imgshrinkformobile bool `json:"imgshrinkformobile,omitempty"` - Imgshrinktoattrib bool `json:"imgshrinktoattrib,omitempty"` - Imgtojpegxr bool `json:"imgtojpegxr,omitempty"` - Imgtowebp bool `json:"imgtowebp,omitempty"` - Imgweaken bool `json:"imgweaken,omitempty"` - Jpgoptimize bool `json:"jpgoptimize,omitempty"` - Jpgprogressive bool `json:"jpgprogressive,omitempty"` - Jscombine bool `json:"jscombine,omitempty"` - Jsinline bool `json:"jsinline,omitempty"` - Jsminify bool `json:"jsminify,omitempty"` - Jsmovetoend bool `json:"jsmovetoend,omitempty"` + HTMLMinify bool `json:"htmlminify,omitempty"` + HTMLRmAttribQuotes bool `json:"htmlrmattribquotes,omitempty"` + HTMLRmDefaultAttribs bool `json:"htmlrmdefaultattribs,omitempty"` + HTMLTrimURLs bool `json:"htmltrimurls,omitempty"` + ImgAddDimensions bool `json:"imgadddimensions,omitempty"` + ImgGifToPNG bool `json:"imggiftopng,omitempty"` + ImgInline bool `json:"imginline,omitempty"` + ImgLazyLoad bool `json:"imglazyload,omitempty"` + ImgShrinkForMobile bool `json:"imgshrinkformobile,omitempty"` + ImgShrinkToAttrib bool `json:"imgshrinktoattrib,omitempty"` + ImgToJPEGXR bool `json:"imgtojpegxr,omitempty"` + ImgToWebP bool `json:"imgtowebp,omitempty"` + ImgWeaken bool `json:"imgweaken,omitempty"` + JPGOptimize bool `json:"jpgoptimize,omitempty"` + JPGProgressive bool `json:"jpgprogressive,omitempty"` + JSCombine bool `json:"jscombine,omitempty"` + JSInline bool `json:"jsinline,omitempty"` + JSMinify bool `json:"jsminify,omitempty"` + JSMoveToEnd bool `json:"jsmovetoend,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pageextendcache bool `json:"pageextendcache,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PageExtendCache bool `json:"pageextendcache,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type FeopolicyBinding struct { - FeopolicyCsvserverBinding []interface{} `json:"feopolicy_csvserver_binding,omitempty"` - FeopolicyFeoglobalBinding []interface{} `json:"feopolicy_feoglobal_binding,omitempty"` - FeopolicyLbvserverBinding []interface{} `json:"feopolicy_lbvserver_binding,omitempty"` +type FEOPolicyBinding struct { + FEOPolicyCSVServerBinding []interface{} `json:"feopolicy_csvserver_binding,omitempty"` + FEOPolicyFEOGlobalBinding []interface{} `json:"feopolicy_feoglobal_binding,omitempty"` + FEOPolicyLBVServerBinding []interface{} `json:"feopolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Feoparameter struct { +type FEOParameter struct { Builtin []string `json:"builtin,omitempty"` - Cssinlinethressize int `json:"cssinlinethressize,omitempty"` + CSSInlineThresSize int `json:"cssinlinethressize,omitempty"` Feature string `json:"feature,omitempty"` - Imginlinethressize int `json:"imginlinethressize,omitempty"` - Jpegqualitypercent int `json:"jpegqualitypercent,omitempty"` - Jsinlinethressize int `json:"jsinlinethressize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + ImgInlineThresSize int `json:"imginlinethressize,omitempty"` + JPEGQualityPercent int `json:"jpegqualitypercent,omitempty"` + JSInlineThresSize int `json:"jsinlinethressize,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type FeoglobalFeopolicyBinding struct { - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` +type FEOGlobalFEOPolicyBinding struct { + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/filter.go b/nitrogo/models/filter.go index f5082bf..c570c28 100644 --- a/nitrogo/models/filter.go +++ b/nitrogo/models/filter.go @@ -4,52 +4,52 @@ package models -type Filterpolicyfilterglobalbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyFilterGlobalBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } -type Filterprebodyinjection struct { - Prebody string `json:"prebody,omitempty"` - Systemiid string `json:"systemiid,omitempty"` +type FilterPreBodyInjection struct { + PreBody string `json:"prebody,omitempty"` + SystemIID string `json:"systemiid,omitempty"` } -type Filterglobalbinding struct { +type FilterGlobalBinding struct { } -type Filterglobalfilterpolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type FilterGlobalFilterPolicyBinding struct { + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` State string `json:"state,omitempty"` } -type Filterpolicy struct { +type FilterPolicy struct { Name string `json:"name,omitempty"` Rule string `json:"rule,omitempty"` - Reqaction string `json:"reqaction,omitempty"` - Resaction string `json:"resaction,omitempty"` + ReqAction string `json:"reqaction,omitempty"` + ResAction string `json:"resaction,omitempty"` Hits string `json:"hits,omitempty"` } -type Filterpolicylbvserverbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyLBVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } -type Filterhtmlinjectionparameter struct { +type FilterHTMLInjectionParameter struct { Rate int `json:"rate,omitempty"` Frequency int `json:"frequency,omitempty"` Strict string `json:"strict,omitempty"` - Htmlsearchlen int `json:"htmlsearchlen,omitempty"` + HTMLSearchLen int `json:"htmlsearchlen,omitempty"` Builtin string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` } -type Filterhtmlinjectionvariable struct { +type FilterHTMLInjectionVariable struct { Variable string `json:"variable,omitempty"` Value string `json:"value,omitempty"` Builtin string `json:"builtin,omitempty"` @@ -57,57 +57,57 @@ type Filterhtmlinjectionvariable struct { Type string `json:"type,omitempty"` } -type Filteraction struct { +type FilterAction struct { Name string `json:"name,omitempty"` Qual string `json:"qual,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` Value string `json:"value,omitempty"` - Respcode int `json:"respcode,omitempty"` + RespCode int `json:"respcode,omitempty"` Page string `json:"page,omitempty"` - Isdefault string `json:"isdefault,omitempty"` + IsDefault string `json:"isdefault,omitempty"` Builtin string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` } -type Filterpolicyglobalbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyGlobalBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` + ActivePolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } -type Filterpolicyvserverbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority uint32 `json:"priority,omitempty"` - Activepolicy uint32 `json:"activepolicy,omitempty"` + ActivePolicy uint32 `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } -type Filterpostbodyinjection struct { - Postbody string `json:"postbody,omitempty"` - Systemiid string `json:"systemiid,omitempty"` +type FilterPostBodyInjection struct { + PostBody string `json:"postbody,omitempty"` + SystemIID string `json:"systemiid,omitempty"` } -type Filterglobalpolicybinding struct { - Policyname string `json:"policyname,omitempty"` +type FilterGlobalPolicyBinding struct { + PolicyName string `json:"policyname,omitempty"` Priority uint32 `json:"priority,omitempty"` State string `json:"state,omitempty"` } -type Filterpolicybinding struct { +type FilterPolicyBinding struct { Name string `json:"name,omitempty"` } -type Filterpolicycrvserverbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyCRVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } -type Filterpolicycsvserverbinding struct { - Boundto string `json:"boundto,omitempty"` +type FilterPolicyCSVServerBinding struct { + BoundTo string `json:"boundto,omitempty"` Priority int `json:"priority,omitempty"` - Activepolicy int `json:"activepolicy,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/gslb.go b/nitrogo/models/gslb.go index 975c2f7..d6aab68 100644 --- a/nitrogo/models/gslb.go +++ b/nitrogo/models/gslb.go @@ -1,588 +1,588 @@ package models // gslb configuration structs -type GslbservicegroupBinding struct { - GslbservicegroupGslbservicegroupmemberBinding []interface{} `json:"gslbservicegroup_gslbservicegroupmember_binding,omitempty"` - GslbservicegroupLbmonitorBinding []interface{} `json:"gslbservicegroup_lbmonitor_binding,omitempty"` - GslbservicegroupServicegroupentitymonbindingsBinding []interface{} `json:"gslbservicegroup_servicegroupentitymonbindings_binding,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` -} - -type Gslbservicegroup struct { - Appflowlog string `json:"appflowlog,omitempty"` - Autodelayedtrofs string `json:"autodelayedtrofs,omitempty"` - Autoscale string `json:"autoscale,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Clmonowner int `json:"clmonowner,omitempty"` - Clmonview int `json:"clmonview,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` +type GSLBServiceGroupBinding struct { + GSLBServiceGroupGSLBServiceGroupMemberBinding []interface{} `json:"gslbservicegroup_gslbservicegroupmember_binding,omitempty"` + GSLBServiceGroupLBMonitorBinding []interface{} `json:"gslbservicegroup_lbmonitor_binding,omitempty"` + GSLBServiceGroupServiceGroupEntityMonBindingsBinding []interface{} `json:"gslbservicegroup_servicegroupentitymonbindings_binding,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` +} + +type GSLBServiceGroup struct { + AppFlowLog string `json:"appflowlog,omitempty"` + AutoDelayedTROFS string `json:"autodelayedtrofs,omitempty"` + AutoScale string `json:"autoscale,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + ClMonOwner int `json:"clmonowner,omitempty"` + ClMonView int `json:"clmonview,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Delay int `json:"delay,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` DupWeight int `json:"dup_weight,omitempty"` Graceful string `json:"graceful,omitempty"` - Groupcount int `json:"groupcount,omitempty"` - Gslb string `json:"gslb,omitempty"` - Hashid int `json:"hashid,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Includemembers bool `json:"includemembers,omitempty"` - Ip string `json:"ip,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` + GroupCount int `json:"groupcount,omitempty"` + GSLB string `json:"gslb,omitempty"` + HashID int `json:"hashid,omitempty"` + HealthMonitor string `json:"healthmonitor,omitempty"` + IncludeMembers bool `json:"includemembers,omitempty"` + IP string `json:"ip,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` MonitorNameSvc string `json:"monitor_name_svc,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Numofconnections int `json:"numofconnections,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + NumOfConnections int `json:"numofconnections,omitempty"` Order int `json:"order,omitempty"` Port int `json:"port,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Servername string `json:"servername,omitempty"` - Serviceconftype bool `json:"serviceconftype,omitempty"` - Servicegroupeffectivestate string `json:"servicegroupeffectivestate,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Serviceipstr string `json:"serviceipstr,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceConfType bool `json:"serviceconftype,omitempty"` + ServiceGroupEffectiveState string `json:"servicegroupeffectivestate,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceIPStr string `json:"serviceipstr,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` + SitePersistence string `json:"sitepersistence,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Stateupdatereason int `json:"stateupdatereason,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateUpdateReason int `json:"stateupdatereason,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` Value string `json:"value,omitempty"` Weight int `json:"weight,omitempty"` } -type Gslbldnsentries struct { +type GSLBLDNSEntries struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Numsites int `json:"numsites,omitempty"` - Rtt []interface{} `json:"rtt,omitempty"` - Sitename string `json:"sitename,omitempty"` - Ttl int `json:"ttl,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NumSites int `json:"numsites,omitempty"` + RTT []interface{} `json:"rtt,omitempty"` + SiteName string `json:"sitename,omitempty"` + TTL int `json:"ttl,omitempty"` } -type GslbservicegroupServicegroupentitymonbindingsBinding struct { - Hashid int `json:"hashid,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` +type GSLBServiceGroupServiceGroupEntityMonBindingsBinding struct { + HashID int `json:"hashid,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` MonitorName string `json:"monitor_name,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` + MonitorCurrentFailedProbes int `json:"monitorcurrentfailedprobes,omitempty"` + MonitorTotalFailedProbes int `json:"monitortotalfailedprobes,omitempty"` + MonitorTotalProbes int `json:"monitortotalprobes,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Servicegroupentname2 string `json:"servicegroupentname2,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + ServiceGroupEntName2 string `json:"servicegroupentname2,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbvserverLbpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type GSLBVServerLBPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Gslbvserver struct { - Activeservices int `json:"activeservices,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Backupip string `json:"backupip,omitempty"` - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Backupsessiontimeout int `json:"backupsessiontimeout,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` +type GSLBVServer struct { + ActiveServices int `json:"activeservices,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` + BackupIP string `json:"backupip,omitempty"` + BackupLBMethod string `json:"backuplbmethod,omitempty"` + BackupSessionTimeout int `json:"backupsessiontimeout,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` Comment string `json:"comment,omitempty"` - Considereffectivestate string `json:"considereffectivestate,omitempty"` + ConsiderEffectiveState string `json:"considereffectivestate,omitempty"` CookieDomain string `json:"cookie_domain,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` + CookieTimeout int `json:"cookietimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Currentactiveorder string `json:"currentactiveorder,omitempty"` - Curstate string `json:"curstate,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Domainname string `json:"domainname,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Ecs string `json:"ecs,omitempty"` - Ecsaddrvalidation string `json:"ecsaddrvalidation,omitempty"` - Edr string `json:"edr,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + CurrentActiveOrder string `json:"currentactiveorder,omitempty"` + CurState string `json:"curstate,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DNSRecordType string `json:"dnsrecordtype,omitempty"` + DomainName string `json:"domainname,omitempty"` + DynamicWeight string `json:"dynamicweight,omitempty"` + ECS string `json:"ecs,omitempty"` + ECSAddrValidation string `json:"ecsaddrvalidation,omitempty"` + EDR string `json:"edr,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Health int `json:"health,omitempty"` - Iptype string `json:"iptype,omitempty"` - Iscname string `json:"iscname,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Lbrrreason int `json:"lbrrreason,omitempty"` - Mir string `json:"mir,omitempty"` + IPType string `json:"iptype,omitempty"` + ISCName string `json:"iscname,omitempty"` + LBMethod string `json:"lbmethod,omitempty"` + LBRRReason int `json:"lbrrreason,omitempty"` + MIR string `json:"mir,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` Order int `json:"order,omitempty"` - Orderthreshold int `json:"orderthreshold,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - Policyname string `json:"policyname,omitempty"` + OrderThreshold int `json:"orderthreshold,omitempty"` + PersistenceID int `json:"persistenceid,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Rule string `json:"rule,omitempty"` - Servername string `json:"servername,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Sobackupaction string `json:"sobackupaction,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteDomainTTL int `json:"sitedomainttl,omitempty"` + SitePersistence string `json:"sitepersistence,omitempty"` + SOBackupAction string `json:"sobackupaction,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` Status int `json:"status,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` Timeout int `json:"timeout,omitempty"` - Toggleorder string `json:"toggleorder,omitempty"` + ToggleOrder string `json:"toggleorder,omitempty"` Tolerance int `json:"tolerance,omitempty"` - Totalservices int `json:"totalservices,omitempty"` - Ttl int `json:"ttl,omitempty"` + TotalServices int `json:"totalservices,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - V6netmasklen int `json:"v6netmasklen,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` - Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + V6NetmaskLen int `json:"v6netmasklen,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` + VSvrBindSvcIP string `json:"vsvrbindsvcip,omitempty"` + VSvrBindSvcPort int `json:"vsvrbindsvcport,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbdomainLbmonitorBinding struct { - Customheaders string `json:"customheaders,omitempty"` - Grpchealthcheck string `json:"grpchealthcheck,omitempty"` - Grpcservicename string `json:"grpcservicename,omitempty"` - Grpcstatuscode int `json:"grpcstatuscode,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstate string `json:"monstate,omitempty"` +type GSLBDomainLBMonitorBinding struct { + CustomHeaders string `json:"customheaders,omitempty"` + GRPCHealthCheck string `json:"grpchealthcheck,omitempty"` + GRPCServiceName string `json:"grpcservicename,omitempty"` + GRPCStatusCode int `json:"grpcstatuscode,omitempty"` + HTTPRequest string `json:"httprequest,omitempty"` + IPTunnel string `json:"iptunnel,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` + MonitorCurrentFailedProbes int `json:"monitorcurrentfailedprobes,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MonitorTotalFailedProbes int `json:"monitortotalfailedprobes,omitempty"` + MonitorTotalProbes int `json:"monitortotalprobes,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonState string `json:"monstate,omitempty"` Name string `json:"name,omitempty"` - Respcode string `json:"respcode,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Servicename string `json:"servicename,omitempty"` - Vservername string `json:"vservername,omitempty"` + RespCode string `json:"respcode,omitempty"` + ResponseTime int `json:"responsetime,omitempty"` + ServiceName string `json:"servicename,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Gslbparameter struct { - Automaticconfigsync string `json:"automaticconfigsync,omitempty"` +type GSLBParameter struct { + AutomaticConfigSync string `json:"automaticconfigsync,omitempty"` Builtin []string `json:"builtin,omitempty"` - Dropldnsreq string `json:"dropldnsreq,omitempty"` + DropLDNSReq string `json:"dropldnsreq,omitempty"` Feature string `json:"feature,omitempty"` Flags int `json:"flags,omitempty"` - Gslbconfigsyncmonitor string `json:"gslbconfigsyncmonitor,omitempty"` - Gslbsvcstatedelaytime int `json:"gslbsvcstatedelaytime,omitempty"` - Gslbsyncinterval int `json:"gslbsyncinterval,omitempty"` - Gslbsynclocfiles string `json:"gslbsynclocfiles,omitempty"` - Gslbsyncmode string `json:"gslbsyncmode,omitempty"` - Gslbsyncsaveconfigcommand string `json:"gslbsyncsaveconfigcommand,omitempty"` + GSLBConfigSyncMonitor string `json:"gslbconfigsyncmonitor,omitempty"` + GSLBSvcStateDelayTime int `json:"gslbsvcstatedelaytime,omitempty"` + GSLBSyncInterval int `json:"gslbsyncinterval,omitempty"` + GSLBSyncLocFiles string `json:"gslbsynclocfiles,omitempty"` + GSLBSyncMode string `json:"gslbsyncmode,omitempty"` + GSLBSyncSaveConfigCommand string `json:"gslbsyncsaveconfigcommand,omitempty"` Incarnation int `json:"incarnation,omitempty"` - Ldnsentrytimeout int `json:"ldnsentrytimeout,omitempty"` - Ldnsmask string `json:"ldnsmask,omitempty"` - Ldnsprobeorder []string `json:"ldnsprobeorder,omitempty"` - Mepkeepalivetimeout int `json:"mepkeepalivetimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` - Rtttolerance int `json:"rtttolerance,omitempty"` - Svcstatelearningtime int `json:"svcstatelearningtime,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - V6ldnsmasklen int `json:"v6ldnsmasklen,omitempty"` -} - -type GslbvserverSpilloverpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + LDNSEntryTimeout int `json:"ldnsentrytimeout,omitempty"` + LDNSMask string `json:"ldnsmask,omitempty"` + LDNSProbeOrder []string `json:"ldnsprobeorder,omitempty"` + MEPKeepaliveTimeout int `json:"mepkeepalivetimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OverridePersistencyForOrder string `json:"overridepersistencyfororder,omitempty"` + RTTTolerance int `json:"rtttolerance,omitempty"` + SvcStateLearningTime int `json:"svcstatelearningtime,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + V6LDNSMaskLen int `json:"v6ldnsmasklen,omitempty"` +} + +type GSLBVServerSpilloverPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type GslbvserverBinding struct { - GslbvserverGslbdomainBinding []interface{} `json:"gslbvserver_gslbdomain_binding,omitempty"` - GslbvserverGslbserviceBinding []interface{} `json:"gslbvserver_gslbservice_binding,omitempty"` - GslbvserverGslbservicegroupBinding []interface{} `json:"gslbvserver_gslbservicegroup_binding,omitempty"` - GslbvserverGslbservicegroupmemberBinding []interface{} `json:"gslbvserver_gslbservicegroupmember_binding,omitempty"` - GslbvserverLbpolicyBinding []interface{} `json:"gslbvserver_lbpolicy_binding,omitempty"` - GslbvserverSpilloverpolicyBinding []interface{} `json:"gslbvserver_spilloverpolicy_binding,omitempty"` +type GSLBVServerBinding struct { + GSLBVServerGSLBDomainBinding []interface{} `json:"gslbvserver_gslbdomain_binding,omitempty"` + GSLBVServerGSLBServiceBinding []interface{} `json:"gslbvserver_gslbservice_binding,omitempty"` + GSLBVServerGSLBServiceGroupBinding []interface{} `json:"gslbvserver_gslbservicegroup_binding,omitempty"` + GSLBVServerGSLBServiceGroupMemberBinding []interface{} `json:"gslbvserver_gslbservicegroupmember_binding,omitempty"` + GSLBVServerLBPolicyBinding []interface{} `json:"gslbvserver_lbpolicy_binding,omitempty"` + GSLBVServerSpilloverPolicyBinding []interface{} `json:"gslbvserver_spilloverpolicy_binding,omitempty"` Name string `json:"name,omitempty"` } -type GslbserviceDnsviewBinding struct { - Servicename string `json:"servicename,omitempty"` - Viewip string `json:"viewip,omitempty"` - Viewname string `json:"viewname,omitempty"` +type GSLBServiceDNSViewBinding struct { + ServiceName string `json:"servicename,omitempty"` + ViewIP string `json:"viewip,omitempty"` + ViewName string `json:"viewname,omitempty"` } -type GslbservicegroupGslbservicegroupmemberBinding struct { +type GSLBServiceGroupGSLBServiceGroupMemberBinding struct { Delay int `json:"delay,omitempty"` Graceful string `json:"graceful,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Hashid int `json:"hashid,omitempty"` - Ip string `json:"ip,omitempty"` + GSLBThreshold int `json:"gslbthreshold,omitempty"` + HashID int `json:"hashid,omitempty"` + IP string `json:"ip,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Servername string `json:"servername,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Svrstate string `json:"svrstate,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + SvrState string `json:"svrstate,omitempty"` Threshold string `json:"threshold,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Trofsdelay int `json:"trofsdelay,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + TROFSDelay int `json:"trofsdelay,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbdomainGslbservicegroupBinding struct { +type GSLBDomainGSLBServiceGroupBinding struct { Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type Gslbdomain struct { +type GSLBDomain struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type GslbvserverGslbservicegroupmemberBinding struct { - Curstate string `json:"curstate,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBVServerGSLBServiceGroupMemberBinding struct { + CurState string `json:"curstate,omitempty"` + DynamicWeight string `json:"dynamicweight,omitempty"` + GSLBThreshold int `json:"gslbthreshold,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitepersistcookie string `json:"sitepersistcookie,omitempty"` - Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SitePersistCookie string `json:"sitepersistcookie,omitempty"` + SvcSitePersistence string `json:"svcsitepersistence,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbsiteGslbserviceBinding struct { - Cnameentry string `json:"cnameentry,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBSiteGSLBServiceBinding struct { + CnameEntry string `json:"cnameentry,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Port int `json:"port,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` State string `json:"state,omitempty"` } -type GslbsiteGslbservicegroupmemberBinding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBSiteGSLBServiceGroupMemberBinding struct { + IPAddress string `json:"ipaddress,omitempty"` Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` State string `json:"state,omitempty"` } -type GslbsiteBinding struct { - GslbsiteGslbserviceBinding []interface{} `json:"gslbsite_gslbservice_binding,omitempty"` - GslbsiteGslbservicegroupBinding []interface{} `json:"gslbsite_gslbservicegroup_binding,omitempty"` - GslbsiteGslbservicegroupmemberBinding []interface{} `json:"gslbsite_gslbservicegroupmember_binding,omitempty"` - Sitename string `json:"sitename,omitempty"` +type GSLBSiteBinding struct { + GSLBSiteGSLBServiceBinding []interface{} `json:"gslbsite_gslbservice_binding,omitempty"` + GSLBSiteGSLBServiceGroupBinding []interface{} `json:"gslbsite_gslbservicegroup_binding,omitempty"` + GSLBSiteGSLBServiceGroupMemberBinding []interface{} `json:"gslbsite_gslbservicegroupmember_binding,omitempty"` + SiteName string `json:"sitename,omitempty"` } -type GslbdomainGslbserviceBinding struct { - Cnameentry string `json:"cnameentry,omitempty"` - Cumulativeweight int `json:"cumulativeweight,omitempty"` - Dynamicconfwt int `json:"dynamicconfwt,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBDomainGSLBServiceBinding struct { + CnameEntry string `json:"cnameentry,omitempty"` + CumulativeWeight int `json:"cumulativeweight,omitempty"` + DynamicConfWt int `json:"dynamicconfwt,omitempty"` + GSLBThreshold int `json:"gslbthreshold,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` Port int `json:"port,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` State string `json:"state,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Vservername string `json:"vservername,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` + VServerName string `json:"vservername,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbvserverGslbservicegroupBinding struct { +type GSLBVServerGSLBServiceGroupBinding struct { Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type GslbsiteGslbservicegroupBinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` +type GSLBSiteGSLBServiceGroupBinding struct { + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` } -type GslbservicegroupLbmonitorBinding struct { - Hashid int `json:"hashid,omitempty"` +type GSLBServiceGroupLBMonitorBinding struct { + HashID int `json:"hashid,omitempty"` MonitorName string `json:"monitor_name,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monweight int `json:"monweight,omitempty"` + MonState string `json:"monstate,omitempty"` + MonWeight int `json:"monweight,omitempty"` Order int `json:"order,omitempty"` Passive bool `json:"passive,omitempty"` Port int `json:"port,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbvserverDomainBinding struct { - Backupip string `json:"backupip,omitempty"` - Backupipflag bool `json:"backupipflag,omitempty"` +type GSLBVServerDomainBinding struct { + BackupIP string `json:"backupip,omitempty"` + BackupIPFlag bool `json:"backupipflag,omitempty"` CookieDomain string `json:"cookie_domain,omitempty"` - CookieDomainflag bool `json:"cookie_domainflag,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` - Domainname string `json:"domainname,omitempty"` + CookieDomainFlag bool `json:"cookie_domainflag,omitempty"` + CookieTimeout int `json:"cookietimeout,omitempty"` + DomainName string `json:"domainname,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Sitedomainttl int `json:"sitedomainttl,omitempty"` - Ttl int `json:"ttl,omitempty"` + SiteDomainTTL int `json:"sitedomainttl,omitempty"` + TTL int `json:"ttl,omitempty"` } -type GslbdomainBinding struct { - GslbdomainGslbserviceBinding []interface{} `json:"gslbdomain_gslbservice_binding,omitempty"` - GslbdomainGslbservicegroupBinding []interface{} `json:"gslbdomain_gslbservicegroup_binding,omitempty"` - GslbdomainGslbservicegroupmemberBinding []interface{} `json:"gslbdomain_gslbservicegroupmember_binding,omitempty"` - GslbdomainGslbvserverBinding []interface{} `json:"gslbdomain_gslbvserver_binding,omitempty"` - GslbdomainLbmonitorBinding []interface{} `json:"gslbdomain_lbmonitor_binding,omitempty"` +type GSLBDomainBinding struct { + GSLBDomainGSLBServiceBinding []interface{} `json:"gslbdomain_gslbservice_binding,omitempty"` + GSLBDomainGSLBServiceGroupBinding []interface{} `json:"gslbdomain_gslbservicegroup_binding,omitempty"` + GSLBDomainGSLBServiceGroupMemberBinding []interface{} `json:"gslbdomain_gslbservicegroupmember_binding,omitempty"` + GSLBDomainGSLBVServerBinding []interface{} `json:"gslbdomain_gslbvserver_binding,omitempty"` + GSLBDomainLBMonitorBinding []interface{} `json:"gslbdomain_lbmonitor_binding,omitempty"` Name string `json:"name,omitempty"` } -type GslbserviceBinding struct { - GslbserviceDnsviewBinding []interface{} `json:"gslbservice_dnsview_binding,omitempty"` - GslbserviceLbmonitorBinding []interface{} `json:"gslbservice_lbmonitor_binding,omitempty"` - Servicename string `json:"servicename,omitempty"` +type GSLBServiceBinding struct { + GSLBServiceDNSViewBinding []interface{} `json:"gslbservice_dnsview_binding,omitempty"` + GSLBServiceLBMonitorBinding []interface{} `json:"gslbservice_lbmonitor_binding,omitempty"` + ServiceName string `json:"servicename,omitempty"` } -type GslbserviceLbmonitorBinding struct { - Failedprobes int `json:"failedprobes,omitempty"` - Lastresponse string `json:"lastresponse,omitempty"` +type GSLBServiceLBMonitorBinding struct { + FailedProbes int `json:"failedprobes,omitempty"` + LastResponse string `json:"lastresponse,omitempty"` MonitorName string `json:"monitor_name,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monitorcurrentfailedprobes int `json:"monitorcurrentfailedprobes,omitempty"` - Monitortotalfailedprobes int `json:"monitortotalfailedprobes,omitempty"` - Monitortotalprobes int `json:"monitortotalprobes,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Responsetime int `json:"responsetime,omitempty"` - Servicename string `json:"servicename,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` + MonitorCurrentFailedProbes int `json:"monitorcurrentfailedprobes,omitempty"` + MonitorTotalFailedProbes int `json:"monitortotalfailedprobes,omitempty"` + MonitorTotalProbes int `json:"monitortotalprobes,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonState string `json:"monstate,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + ResponseTime int `json:"responsetime,omitempty"` + ServiceName string `json:"servicename,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbdomainGslbservicegroupmemberBinding struct { - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBDomainGSLBServiceGroupMemberBinding struct { + GSLBThreshold int `json:"gslbthreshold,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` Port int `json:"port,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` Weight int `json:"weight,omitempty"` } -type Gslbservice struct { - Appflowlog string `json:"appflowlog,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Clmonowner int `json:"clmonowner,omitempty"` - Clmonview int `json:"clmonview,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` - Cnameentry string `json:"cnameentry,omitempty"` +type GSLBService struct { + AppFlowLog string `json:"appflowlog,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + ClMonOwner int `json:"clmonowner,omitempty"` + ClMonView int `json:"clmonview,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + CnameEntry string `json:"cnameentry,omitempty"` Comment string `json:"comment,omitempty"` - Cookietimeout int `json:"cookietimeout,omitempty"` + CookieTimeout int `json:"cookietimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Glsbsvchealthdescr string `json:"glsbsvchealthdescr,omitempty"` - Gslb string `json:"gslb,omitempty"` - Gslbsvchealth int `json:"gslbsvchealth,omitempty"` - Gslbsvcstats int `json:"gslbsvcstats,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Hashid int `json:"hashid,omitempty"` - Healthmonitor string `json:"healthmonitor,omitempty"` - Ip string `json:"ip,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + GLSBSvcHealthDescr string `json:"glsbsvchealthdescr,omitempty"` + GSLB string `json:"gslb,omitempty"` + GSLBSvcHealth int `json:"gslbsvchealth,omitempty"` + GSLBSvcStats int `json:"gslbsvcstats,omitempty"` + GSLBThreshold int `json:"gslbthreshold,omitempty"` + HashID int `json:"hashid,omitempty"` + HealthMonitor string `json:"healthmonitor,omitempty"` + IP string `json:"ip,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + MaxAAAUsers int `json:"maxaaausers,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` MonitorNameSvc string `json:"monitor_name_svc,omitempty"` MonitorState string `json:"monitor_state,omitempty"` - Monstate string `json:"monstate,omitempty"` - Monthreshold int `json:"monthreshold,omitempty"` - Naptrdomainttl int `json:"naptrdomainttl,omitempty"` - Naptrorder int `json:"naptrorder,omitempty"` - Naptrpreference int `json:"naptrpreference,omitempty"` - Naptrreplacement string `json:"naptrreplacement,omitempty"` - Naptrservices string `json:"naptrservices,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + MonState string `json:"monstate,omitempty"` + MonThreshold int `json:"monthreshold,omitempty"` + NAPTRDomainTTL int `json:"naptrdomainttl,omitempty"` + NAPTROrder int `json:"naptrorder,omitempty"` + NAPTRPreference int `json:"naptrpreference,omitempty"` + NAPTRReplacement string `json:"naptrreplacement,omitempty"` + NAPTRServices string `json:"naptrservices,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Publicip string `json:"publicip,omitempty"` - Publicport int `json:"publicport,omitempty"` - Servername string `json:"servername,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + PublicIP string `json:"publicip,omitempty"` + PublicPort int `json:"publicport,omitempty"` + ServerName string `json:"servername,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` + SitePersistence string `json:"sitepersistence,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Svrtimeout int `json:"svrtimeout,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` + SvrState string `json:"svrstate,omitempty"` + SvrTimeout int `json:"svrtimeout,omitempty"` Threshold string `json:"threshold,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Viewip string `json:"viewip,omitempty"` - Viewname string `json:"viewname,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + ViewIP string `json:"viewip,omitempty"` + ViewName string `json:"viewname,omitempty"` Weight int `json:"weight,omitempty"` } -type Gslbconfig struct { +type GSLBConfig struct { Command string `json:"command,omitempty"` Debug bool `json:"debug,omitempty"` - Forcesync string `json:"forcesync,omitempty"` - Nowarn bool `json:"nowarn,omitempty"` + ForceSync string `json:"forcesync,omitempty"` + NoWarn bool `json:"nowarn,omitempty"` Preview bool `json:"preview,omitempty"` - Saveconfig bool `json:"saveconfig,omitempty"` + SaveConfig bool `json:"saveconfig,omitempty"` } -type Gslbrunningconfig struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type GSLBRunningConfig struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Response string `json:"response,omitempty"` } -type Gslbsite struct { - Backupparentlist []string `json:"backupparentlist,omitempty"` - Clip string `json:"clip,omitempty"` +type GSLBSite struct { + BackupParentList []string `json:"backupparentlist,omitempty"` + CLIP string `json:"clip,omitempty"` Count float64 `json:"__count,omitempty"` - Curbackupparentip string `json:"curbackupparentip,omitempty"` - Metricexchange string `json:"metricexchange,omitempty"` - Naptrreplacementsuffix string `json:"naptrreplacementsuffix,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nwmetricexchange string `json:"nwmetricexchange,omitempty"` - Oldname string `json:"oldname,omitempty"` - Parentsite string `json:"parentsite,omitempty"` - Persistencemepstatus string `json:"persistencemepstatus,omitempty"` - Publicclip string `json:"publicclip,omitempty"` - Publicip string `json:"publicip,omitempty"` - Sessionexchange string `json:"sessionexchange,omitempty"` - Siteipaddress string `json:"siteipaddress,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepassword string `json:"sitepassword,omitempty"` - Sitestate string `json:"sitestate,omitempty"` - Sitetype string `json:"sitetype,omitempty"` + CurBackupParentIP string `json:"curbackupparentip,omitempty"` + MetricExchange string `json:"metricexchange,omitempty"` + NAPTRReplacementSuffix string `json:"naptrreplacementsuffix,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NWMetricExchange string `json:"nwmetricexchange,omitempty"` + OldName string `json:"oldname,omitempty"` + ParentSite string `json:"parentsite,omitempty"` + PersistenceMEPStatus string `json:"persistencemepstatus,omitempty"` + PublicCLIP string `json:"publicclip,omitempty"` + PublicIP string `json:"publicip,omitempty"` + SessionExchange string `json:"sessionexchange,omitempty"` + SiteIPAddress string `json:"siteipaddress,omitempty"` + SiteName string `json:"sitename,omitempty"` + SitePassword string `json:"sitepassword,omitempty"` + SiteState string `json:"sitestate,omitempty"` + SiteType string `json:"sitetype,omitempty"` Status string `json:"status,omitempty"` - Triggermonitor string `json:"triggermonitor,omitempty"` + TriggerMonitor string `json:"triggermonitor,omitempty"` Version int `json:"version,omitempty"` } -type Gslbsyncstatus struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type GSLBSyncStatus struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Response string `json:"response,omitempty"` Summary bool `json:"summary,omitempty"` } -type Gslbldnsentry struct { - Ipaddress string `json:"ipaddress,omitempty"` +type GSLBLDNSEntry struct { + IPAddress string `json:"ipaddress,omitempty"` } -type GslbvserverGslbserviceBinding struct { - Cnameentry string `json:"cnameentry,omitempty"` - Cumulativeweight int `json:"cumulativeweight,omitempty"` - Curstate string `json:"curstate,omitempty"` - Domainname string `json:"domainname,omitempty"` - Dynamicconfwt int `json:"dynamicconfwt,omitempty"` - Gslbboundsvctype string `json:"gslbboundsvctype,omitempty"` - Gslbthreshold int `json:"gslbthreshold,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Iscname string `json:"iscname,omitempty"` +type GSLBVServerGSLBServiceBinding struct { + CnameEntry string `json:"cnameentry,omitempty"` + CumulativeWeight int `json:"cumulativeweight,omitempty"` + CurState string `json:"curstate,omitempty"` + DomainName string `json:"domainname,omitempty"` + DynamicConfWt int `json:"dynamicconfwt,omitempty"` + GSLBBoundSvcType string `json:"gslbboundsvctype,omitempty"` + GSLBThreshold int `json:"gslbthreshold,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + ISCName string `json:"iscname,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Servicename string `json:"servicename,omitempty"` - Sitepersistcookie string `json:"sitepersistcookie,omitempty"` - Svcsitepersistence string `json:"svcsitepersistence,omitempty"` - Svreffgslbstate string `json:"svreffgslbstate,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SitePersistCookie string `json:"sitepersistcookie,omitempty"` + SvcSitePersistence string `json:"svcsitepersistence,omitempty"` + SvrEffGSLBState string `json:"svreffgslbstate,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` Weight int `json:"weight,omitempty"` } -type GslbdomainGslbvserverBinding struct { - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Cip string `json:"cip,omitempty"` - Customheaders string `json:"customheaders,omitempty"` - Dnsrecordtype string `json:"dnsrecordtype,omitempty"` - Dynamicweight string `json:"dynamicweight,omitempty"` - Edr string `json:"edr,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Mir string `json:"mir,omitempty"` +type GSLBDomainGSLBVServerBinding struct { + BackupLBMethod string `json:"backuplbmethod,omitempty"` + CIP string `json:"cip,omitempty"` + CustomHeaders string `json:"customheaders,omitempty"` + DNSRecordType string `json:"dnsrecordtype,omitempty"` + DynamicWeight string `json:"dynamicweight,omitempty"` + EDR string `json:"edr,omitempty"` + LBMethod string `json:"lbmethod,omitempty"` + MIR string `json:"mir,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Persistenceid int `json:"persistenceid,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Sitename string `json:"sitename,omitempty"` - Sitepersistence string `json:"sitepersistence,omitempty"` - Siteprefix string `json:"siteprefix,omitempty"` + PersistenceID int `json:"persistenceid,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SiteName string `json:"sitename,omitempty"` + SitePersistence string `json:"sitepersistence,omitempty"` + SitePrefix string `json:"siteprefix,omitempty"` State string `json:"state,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - V6netmasklen int `json:"v6netmasklen,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` - Vservername string `json:"vservername,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + V6NetmaskLen int `json:"v6netmasklen,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` + VServerName string `json:"vservername,omitempty"` } diff --git a/nitrogo/models/ha.go b/nitrogo/models/ha.go index 40baaf8..05457f0 100644 --- a/nitrogo/models/ha.go +++ b/nitrogo/models/ha.go @@ -1,100 +1,100 @@ package models // ha configuration structs -type Hasyncfailures struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type HASyncFailures struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Response string `json:"response,omitempty"` } -type HanodeRoutemonitor6Binding struct { +type HANodeRouteMonitor6Binding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Netmask string `json:"netmask,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Routemonitorstate string `json:"routemonitorstate,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` + RouteMonitorState string `json:"routemonitorstate,omitempty"` } -type HanodeRoutemonitorBinding struct { +type HANodeRouteMonitorBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Netmask string `json:"netmask,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Routemonitorstate string `json:"routemonitorstate,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` + RouteMonitorState string `json:"routemonitorstate,omitempty"` } -type Hafiles struct { +type HAFiles struct { Mode []string `json:"mode,omitempty"` } -type HanodeCiBinding struct { - Enaifaces string `json:"enaifaces,omitempty"` - Id int `json:"id,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` +type HANodeCIBinding struct { + EnaIfaces string `json:"enaifaces,omitempty"` + ID int `json:"id,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` } -type Hafailover struct { +type HAFailover struct { Force bool `json:"force,omitempty"` } -type Hanode struct { - Completedfliptime int `json:"completedfliptime,omitempty"` +type HANode struct { + CompletedFlipTime int `json:"completedfliptime,omitempty"` Count float64 `json:"__count,omitempty"` - Curflips int `json:"curflips,omitempty"` - Deadinterval int `json:"deadinterval,omitempty"` - Disifaces string `json:"disifaces,omitempty"` - Enaifaces string `json:"enaifaces,omitempty"` - Failsafe string `json:"failsafe,omitempty"` + CurFlips int `json:"curflips,omitempty"` + DeadInterval int `json:"deadinterval,omitempty"` + DisIfaces string `json:"disifaces,omitempty"` + EnaIfaces string `json:"enaifaces,omitempty"` + FailSafe string `json:"failsafe,omitempty"` Flags int `json:"flags,omitempty"` - Haheartbeatifaces string `json:"haheartbeatifaces,omitempty"` - Hamonifaces string `json:"hamonifaces,omitempty"` - Haprop string `json:"haprop,omitempty"` - Hastatus string `json:"hastatus,omitempty"` - Hasync string `json:"hasync,omitempty"` - Hasyncfailurereason string `json:"hasyncfailurereason,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Id int `json:"id,omitempty"` + HAHeartbeatIfaces string `json:"haheartbeatifaces,omitempty"` + HAMonIfaces string `json:"hamonifaces,omitempty"` + HAProp string `json:"haprop,omitempty"` + HAStatus string `json:"hastatus,omitempty"` + HASync string `json:"hasync,omitempty"` + HASyncFailureReason string `json:"hasyncfailurereason,omitempty"` + HelloInterval int `json:"hellointerval,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` Inc string `json:"inc,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Masterstatetime int `json:"masterstatetime,omitempty"` - Maxflips int `json:"maxflips,omitempty"` - Maxfliptime int `json:"maxfliptime,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + MasterStateTime int `json:"masterstatetime,omitempty"` + MaxFlips int `json:"maxflips,omitempty"` + MaxFlipTime int `json:"maxfliptime,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pfifaces string `json:"pfifaces,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` - Routemonitorstate string `json:"routemonitorstate,omitempty"` - Rpcnodepassword string `json:"rpcnodepassword,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PFIfaces string `json:"pfifaces,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` + RouteMonitorState string `json:"routemonitorstate,omitempty"` + RPCNodePassword string `json:"rpcnodepassword,omitempty"` + SSL2 string `json:"ssl2,omitempty"` State string `json:"state,omitempty"` - Syncstatusstrictmode string `json:"syncstatusstrictmode,omitempty"` - Syncvlan int `json:"syncvlan,omitempty"` + SyncStatusStrictMode string `json:"syncstatusstrictmode,omitempty"` + SyncVLAN int `json:"syncvlan,omitempty"` } -type HanodeFisBinding struct { - Enaifaces string `json:"enaifaces,omitempty"` - Id int `json:"id,omitempty"` +type HANodeFISBinding struct { + EnaIfaces string `json:"enaifaces,omitempty"` + ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` } -type HanodeBinding struct { - HanodeCiBinding []interface{} `json:"hanode_ci_binding,omitempty"` - HanodeFisBinding []interface{} `json:"hanode_fis_binding,omitempty"` - HanodePartialfailureinterfacesBinding []interface{} `json:"hanode_partialfailureinterfaces_binding,omitempty"` - HanodeRoutemonitor6Binding []interface{} `json:"hanode_routemonitor6_binding,omitempty"` - HanodeRoutemonitorBinding []interface{} `json:"hanode_routemonitor_binding,omitempty"` - Id int `json:"id,omitempty"` +type HANodeBinding struct { + HANodeCIBinding []interface{} `json:"hanode_ci_binding,omitempty"` + HANodeFISBinding []interface{} `json:"hanode_fis_binding,omitempty"` + HANodePartialFailureInterfacesBinding []interface{} `json:"hanode_partialfailureinterfaces_binding,omitempty"` + HANodeRouteMonitor6Binding []interface{} `json:"hanode_routemonitor6_binding,omitempty"` + HANodeRouteMonitorBinding []interface{} `json:"hanode_routemonitor_binding,omitempty"` + ID int `json:"id,omitempty"` } -type HanodePartialfailureinterfacesBinding struct { - Id int `json:"id,omitempty"` - Pfifaces string `json:"pfifaces,omitempty"` - Routemonitor string `json:"routemonitor,omitempty"` +type HANodePartialFailureInterfacesBinding struct { + ID int `json:"id,omitempty"` + PFIfaces string `json:"pfifaces,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` } -type Hasync struct { +type HASync struct { Force bool `json:"force,omitempty"` Save string `json:"save,omitempty"` } diff --git a/nitrogo/models/ica.go b/nitrogo/models/ica.go index bfe009c..9016fc7 100644 --- a/nitrogo/models/ica.go +++ b/nitrogo/models/ica.go @@ -1,130 +1,130 @@ package models // ica configuration structs -type IcapolicyCrvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ICAPolicyCRVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type IcaglobalIcapolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` +type ICAGlobalICAPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Icalatencyprofile struct { +type ICALatencyProfile struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - L7latencymaxnotifycount int `json:"l7latencymaxnotifycount,omitempty"` - L7latencymonitoring string `json:"l7latencymonitoring,omitempty"` - L7latencynotifyinterval int `json:"l7latencynotifyinterval,omitempty"` - L7latencythresholdfactor int `json:"l7latencythresholdfactor,omitempty"` - L7latencywaittime int `json:"l7latencywaittime,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + L7LatencyMaxNotifyCount int `json:"l7latencymaxnotifycount,omitempty"` + L7LatencyMonitoring string `json:"l7latencymonitoring,omitempty"` + L7LatencyNotifyInterval int `json:"l7latencynotifyinterval,omitempty"` + L7LatencyThresholdFactor int `json:"l7latencythresholdfactor,omitempty"` + L7LatencyWaitTime int `json:"l7latencywaittime,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Refcnt int `json:"refcnt,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RefCnt int `json:"refcnt,omitempty"` } -type Icaaction struct { - Accessprofilename string `json:"accessprofilename,omitempty"` +type ICAAction struct { + AccessProfileName string `json:"accessprofilename,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Latencyprofilename string `json:"latencyprofilename,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LatencyProfileName string `json:"latencyprofilename,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type IcapolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ICAPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type IcaglobalBinding struct { - IcaglobalIcapolicyBinding []interface{} `json:"icaglobal_icapolicy_binding,omitempty"` +type ICAGlobalBinding struct { + ICAGlobalICAPolicyBinding []interface{} `json:"icaglobal_icapolicy_binding,omitempty"` } -type Icaparameter struct { +type ICAParameter struct { Builtin []string `json:"builtin,omitempty"` - Dfpersistence string `json:"dfpersistence,omitempty"` - Edtlosstolerant string `json:"edtlosstolerant,omitempty"` - Edtpmtuddf string `json:"edtpmtuddf,omitempty"` - Edtpmtuddftimeout int `json:"edtpmtuddftimeout,omitempty"` - Edtpmtudrediscovery string `json:"edtpmtudrediscovery,omitempty"` - Enablesronhafailover string `json:"enablesronhafailover,omitempty"` - Hdxinsightnonnsap string `json:"hdxinsightnonnsap,omitempty"` - Insightonlytodirector string `json:"insightonlytodirector,omitempty"` - L7latencyfrequency int `json:"l7latencyfrequency,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + DFPersistence string `json:"dfpersistence,omitempty"` + EDTLossTolerant string `json:"edtlosstolerant,omitempty"` + EDTPMTUDDF string `json:"edtpmtuddf,omitempty"` + EDTPMTUDDFTimeout int `json:"edtpmtuddftimeout,omitempty"` + EDTPMTUDRediscovery string `json:"edtpmtudrediscovery,omitempty"` + EnableSROnHAFailover string `json:"enablesronhafailover,omitempty"` + HDXInsightNonNSAP string `json:"hdxinsightnonnsap,omitempty"` + InsightOnlyToDirector string `json:"insightonlytodirector,omitempty"` + L7LatencyFrequency int `json:"l7latencyfrequency,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type IcapolicyIcaglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ICAPolicyICAGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Icapolicy struct { +type ICAPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type IcapolicyBinding struct { - IcapolicyCrvserverBinding []interface{} `json:"icapolicy_crvserver_binding,omitempty"` - IcapolicyIcaglobalBinding []interface{} `json:"icapolicy_icaglobal_binding,omitempty"` - IcapolicyVpnvserverBinding []interface{} `json:"icapolicy_vpnvserver_binding,omitempty"` +type ICAPolicyBinding struct { + ICAPolicyCRVServerBinding []interface{} `json:"icapolicy_crvserver_binding,omitempty"` + ICAPolicyICAGlobalBinding []interface{} `json:"icapolicy_icaglobal_binding,omitempty"` + ICAPolicyVPNVServerBinding []interface{} `json:"icapolicy_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Icaaccessprofile struct { +type ICAAccessProfile struct { Builtin []string `json:"builtin,omitempty"` - Clientaudioredirection string `json:"clientaudioredirection,omitempty"` - Clientclipboardredirection string `json:"clientclipboardredirection,omitempty"` - Clientcomportredirection string `json:"clientcomportredirection,omitempty"` - Clientdriveredirection string `json:"clientdriveredirection,omitempty"` - Clientprinterredirection string `json:"clientprinterredirection,omitempty"` - Clienttwaindeviceredirection string `json:"clienttwaindeviceredirection,omitempty"` - Clientusbdriveredirection string `json:"clientusbdriveredirection,omitempty"` - Connectclientlptports string `json:"connectclientlptports,omitempty"` + ClientAudioRedirection string `json:"clientaudioredirection,omitempty"` + ClientClipboardRedirection string `json:"clientclipboardredirection,omitempty"` + ClientCOMPortRedirection string `json:"clientcomportredirection,omitempty"` + ClientDriveRedirection string `json:"clientdriveredirection,omitempty"` + ClientPrinterRedirection string `json:"clientprinterredirection,omitempty"` + ClientTwainDeviceRedirection string `json:"clienttwaindeviceredirection,omitempty"` + ClientUSBDriveRedirection string `json:"clientusbdriveredirection,omitempty"` + ConnectClientLPTPorts string `json:"connectclientlptports,omitempty"` Count float64 `json:"__count,omitempty"` - Draganddrop string `json:"draganddrop,omitempty"` + DragAndDrop string `json:"draganddrop,omitempty"` Feature string `json:"feature,omitempty"` - Fido2redirection string `json:"fido2redirection,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Localremotedatasharing string `json:"localremotedatasharing,omitempty"` - Multistream string `json:"multistream,omitempty"` + FIDO2Redirection string `json:"fido2redirection,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LocalRemoteDataSharing string `json:"localremotedatasharing,omitempty"` + MultiStream string `json:"multistream,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Smartcardredirection string `json:"smartcardredirection,omitempty"` - Wiaredirection string `json:"wiaredirection,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + SmartCardRedirection string `json:"smartcardredirection,omitempty"` + WIARedirection string `json:"wiaredirection,omitempty"` } diff --git a/nitrogo/models/ipsec.go b/nitrogo/models/ipsec.go index 6af73d9..60a1d72 100644 --- a/nitrogo/models/ipsec.go +++ b/nitrogo/models/ipsec.go @@ -1,38 +1,38 @@ package models // ipsec configuration structs -type Ipsecparameter struct { - Encalgo []string `json:"encalgo,omitempty"` - Hashalgo []string `json:"hashalgo,omitempty"` - Ikeretryinterval int `json:"ikeretryinterval,omitempty"` - Ikeversion string `json:"ikeversion,omitempty"` +type IPSECParameter struct { + EncAlgo []string `json:"encalgo,omitempty"` + HashAlgo []string `json:"hashalgo,omitempty"` + IKERetryInterval int `json:"ikeretryinterval,omitempty"` + IKEVersion string `json:"ikeversion,omitempty"` Lifetime int `json:"lifetime,omitempty"` - Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` - Replaywindowsize int `json:"replaywindowsize,omitempty"` - Responderonly string `json:"responderonly,omitempty"` - Retransmissiontime int `json:"retransmissiontime,omitempty"` + LivenessCheckInterval int `json:"livenesscheckinterval,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PerfectForwardSecrecy string `json:"perfectforwardsecrecy,omitempty"` + ReplayWindowSize int `json:"replaywindowsize,omitempty"` + ResponderOnly string `json:"responderonly,omitempty"` + RetransmissionTime int `json:"retransmissiontime,omitempty"` } -type Ipsecprofile struct { +type IPSECProfile struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Encalgo []string `json:"encalgo,omitempty"` + EncAlgo []string `json:"encalgo,omitempty"` Feature string `json:"feature,omitempty"` - Hashalgo []string `json:"hashalgo,omitempty"` - Ikeretryinterval int `json:"ikeretryinterval,omitempty"` - Ikeversion string `json:"ikeversion,omitempty"` + HashAlgo []string `json:"hashalgo,omitempty"` + IKERetryInterval int `json:"ikeretryinterval,omitempty"` + IKEVersion string `json:"ikeversion,omitempty"` Lifetime int `json:"lifetime,omitempty"` - Livenesscheckinterval int `json:"livenesscheckinterval,omitempty"` + LivenessCheckInterval int `json:"livenesscheckinterval,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Peerpublickey string `json:"peerpublickey,omitempty"` - Perfectforwardsecrecy string `json:"perfectforwardsecrecy,omitempty"` - Privatekey string `json:"privatekey,omitempty"` - Psk string `json:"psk,omitempty"` - Publickey string `json:"publickey,omitempty"` - Replaywindowsize int `json:"replaywindowsize,omitempty"` - Responderonly string `json:"responderonly,omitempty"` - Retransmissiontime int `json:"retransmissiontime,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PeerPublicKey string `json:"peerpublickey,omitempty"` + PerfectForwardSecrecy string `json:"perfectforwardsecrecy,omitempty"` + PrivateKey string `json:"privatekey,omitempty"` + PSK string `json:"psk,omitempty"` + PublicKey string `json:"publickey,omitempty"` + ReplayWindowSize int `json:"replaywindowsize,omitempty"` + ResponderOnly string `json:"responderonly,omitempty"` + RetransmissionTime int `json:"retransmissiontime,omitempty"` } diff --git a/nitrogo/models/ipsecalg.go b/nitrogo/models/ipsecalg.go index 9836d92..6b70a9d 100644 --- a/nitrogo/models/ipsecalg.go +++ b/nitrogo/models/ipsecalg.go @@ -1,25 +1,25 @@ package models // ipsecalg configuration structs -type Ipsecalgsession struct { +type IPSECALGSession struct { Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - DestipAlg string `json:"destip_alg,omitempty"` - Natip string `json:"natip,omitempty"` - NatipAlg string `json:"natip_alg,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sourceip string `json:"sourceip,omitempty"` - SourceipAlg string `json:"sourceip_alg,omitempty"` - Spiin int `json:"spiin,omitempty"` - Spiout int `json:"spiout,omitempty"` + DestIP string `json:"destip,omitempty"` + DestIPAlg string `json:"destip_alg,omitempty"` + NATIP string `json:"natip,omitempty"` + NATIPAlg string `json:"natip_alg,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SourceIP string `json:"sourceip,omitempty"` + SourceIPAlg string `json:"sourceip_alg,omitempty"` + SPIIn int `json:"spiin,omitempty"` + SPIOut int `json:"spiout,omitempty"` } -type Ipsecalgprofile struct { - Connfailover string `json:"connfailover,omitempty"` +type IPSECALGProfile struct { + ConnFailover string `json:"connfailover,omitempty"` Count float64 `json:"__count,omitempty"` - Espgatetimeout int `json:"espgatetimeout,omitempty"` - Espsessiontimeout int `json:"espsessiontimeout,omitempty"` - Ikesessiontimeout int `json:"ikesessiontimeout,omitempty"` + ESPGateTimeout int `json:"espgatetimeout,omitempty"` + ESPSessionTimeout int `json:"espsessiontimeout,omitempty"` + IKESessionTimeout int `json:"ikesessiontimeout,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } diff --git a/nitrogo/models/kafka.go b/nitrogo/models/kafka.go index e3c056a..9df8c7d 100644 --- a/nitrogo/models/kafka.go +++ b/nitrogo/models/kafka.go @@ -1,22 +1,22 @@ package models // kafka configuration structs -type Kafkacluster struct { - Activesvc int `json:"activesvc,omitempty"` +type KafkaCluster struct { + ActiveSvc int `json:"activesvc,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numtopics int `json:"numtopics,omitempty"` - Topicname string `json:"topicname,omitempty"` - Totalsvc int `json:"totalsvc,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumTopics int `json:"numtopics,omitempty"` + TopicName string `json:"topicname,omitempty"` + TotalSvc int `json:"totalsvc,omitempty"` } -type KafkaclusterBinding struct { - KafkaclusterServicegroupBinding []interface{} `json:"kafkacluster_servicegroup_binding,omitempty"` +type KafkaClusterBinding struct { + KafkaClusterServiceGroupBinding []interface{} `json:"kafkacluster_servicegroup_binding,omitempty"` Name string `json:"name,omitempty"` } -type KafkaclusterServicegroupBinding struct { +type KafkaClusterServiceGroupBinding struct { Name string `json:"name,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } diff --git a/nitrogo/models/lb.go b/nitrogo/models/lb.go index 51102d6..2bb4cc5 100644 --- a/nitrogo/models/lb.go +++ b/nitrogo/models/lb.go @@ -1,1006 +1,1006 @@ package models // lb configuration structs -type LbvserverRewritepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerRewritePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverFeopolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerFEOPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbmonbindings struct { - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` +type LBMonBindings struct { + BoundServiceGroupSvrState string `json:"boundservicegroupsvrstate,omitempty"` Count float64 `json:"__count,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` TypeField string `json:"type,omitempty"` } -type LbvserverCsvserverBinding struct { - Cachetype string `json:"cachetype,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` +type LBVServerCSVServerBinding struct { + CacheType string `json:"cachetype,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Pipolicyhits int `json:"pipolicyhits,omitempty"` - Policyname string `json:"policyname,omitempty"` - Policysubtype int `json:"policysubtype,omitempty"` + PIPolicyHits int `json:"pipolicyhits,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolicySubType int `json:"policysubtype,omitempty"` Priority int `json:"priority,omitempty"` } -type LbmonitorBinding struct { - LbmonitorMetricBinding []interface{} `json:"lbmonitor_metric_binding,omitempty"` - LbmonitorSslcertkeyBinding []interface{} `json:"lbmonitor_sslcertkey_binding,omitempty"` - Monitorname string `json:"monitorname,omitempty"` +type LBMonitorBinding struct { + LBMonitorMetricBinding []interface{} `json:"lbmonitor_metric_binding,omitempty"` + LBMonitorSSLCertKeyBinding []interface{} `json:"lbmonitor_sslcertkey_binding,omitempty"` + MonitorName string `json:"monitorname,omitempty"` } -type LbmonbindingsBinding struct { - LbmonbindingsGslbservicegroupBinding []interface{} `json:"lbmonbindings_gslbservicegroup_binding,omitempty"` - LbmonbindingsServiceBinding []interface{} `json:"lbmonbindings_service_binding,omitempty"` - LbmonbindingsServicegroupBinding []interface{} `json:"lbmonbindings_servicegroup_binding,omitempty"` - Monitorname string `json:"monitorname,omitempty"` +type LBMonBindingsBinding struct { + LBMonBindingsGSLBServiceGroupBinding []interface{} `json:"lbmonbindings_gslbservicegroup_binding,omitempty"` + LBMonBindingsServiceBinding []interface{} `json:"lbmonbindings_service_binding,omitempty"` + LBMonBindingsServiceGroupBinding []interface{} `json:"lbmonbindings_servicegroup_binding,omitempty"` + MonitorName string `json:"monitorname,omitempty"` } -type LbvserverBotpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerBotPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbroute6 struct { +type LBRoute6 struct { Count float64 `json:"__count,omitempty"` Flags string `json:"flags,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` + GatewayName string `json:"gatewayname,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TD int `json:"td,omitempty"` } -type LbpolicyGslbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBPolicyGSLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverResponderpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerResponderPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbmonbindingsServiceBinding struct { - Ipaddress string `json:"ipaddress,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Monsvcstate string `json:"monsvcstate,omitempty"` +type LBMonBindingsServiceBinding struct { + IPAddress string `json:"ipaddress,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MonSvcState string `json:"monsvcstate,omitempty"` Port int `json:"port,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Svrstate string `json:"svrstate,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SvrState string `json:"svrstate,omitempty"` } -type LbvserverTransformpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerTransformPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbaction struct { +type LBAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` Value []interface{} `json:"value,omitempty"` } -type LbvserverAuditsyslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAuditSyslogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbglobalBinding struct { - LbglobalLbpolicyBinding []interface{} `json:"lbglobal_lbpolicy_binding,omitempty"` +type LBGlobalBinding struct { + LBGlobalLBPolicyBinding []interface{} `json:"lbglobal_lbpolicy_binding,omitempty"` } -type LbvserverAppflowpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAppFlowPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbroute struct { +type LBRoute struct { Count float64 `json:"__count,omitempty"` Flags string `json:"flags,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` + GatewayName string `json:"gatewayname,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TD int `json:"td,omitempty"` } -type LbmonitorServiceBinding struct { +type LBMonitorServiceBinding struct { DupState string `json:"dup_state,omitempty"` DupWeight int `json:"dup_weight,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } -type LbvserverAppfwpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAppFWPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverCachepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerCachePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverBinding struct { - LbvserverAnalyticsprofileBinding []interface{} `json:"lbvserver_analyticsprofile_binding,omitempty"` - LbvserverAppflowpolicyBinding []interface{} `json:"lbvserver_appflowpolicy_binding,omitempty"` - LbvserverAppfwpolicyBinding []interface{} `json:"lbvserver_appfwpolicy_binding,omitempty"` - LbvserverAppqoepolicyBinding []interface{} `json:"lbvserver_appqoepolicy_binding,omitempty"` - LbvserverAuditnslogpolicyBinding []interface{} `json:"lbvserver_auditnslogpolicy_binding,omitempty"` - LbvserverAuditsyslogpolicyBinding []interface{} `json:"lbvserver_auditsyslogpolicy_binding,omitempty"` - LbvserverAuthorizationpolicyBinding []interface{} `json:"lbvserver_authorizationpolicy_binding,omitempty"` - LbvserverBotpolicyBinding []interface{} `json:"lbvserver_botpolicy_binding,omitempty"` - LbvserverCachepolicyBinding []interface{} `json:"lbvserver_cachepolicy_binding,omitempty"` - LbvserverCmppolicyBinding []interface{} `json:"lbvserver_cmppolicy_binding,omitempty"` - LbvserverContentinspectionpolicyBinding []interface{} `json:"lbvserver_contentinspectionpolicy_binding,omitempty"` - LbvserverCsvserverBinding []interface{} `json:"lbvserver_csvserver_binding,omitempty"` - LbvserverDnspolicy64Binding []interface{} `json:"lbvserver_dnspolicy64_binding,omitempty"` - LbvserverFeopolicyBinding []interface{} `json:"lbvserver_feopolicy_binding,omitempty"` - LbvserverLbpolicyBinding []interface{} `json:"lbvserver_lbpolicy_binding,omitempty"` - LbvserverResponderpolicyBinding []interface{} `json:"lbvserver_responderpolicy_binding,omitempty"` - LbvserverRewritepolicyBinding []interface{} `json:"lbvserver_rewritepolicy_binding,omitempty"` - LbvserverServiceBinding []interface{} `json:"lbvserver_service_binding,omitempty"` - LbvserverServicegroupBinding []interface{} `json:"lbvserver_servicegroup_binding,omitempty"` - LbvserverServicegroupmemberBinding []interface{} `json:"lbvserver_servicegroupmember_binding,omitempty"` - LbvserverSpilloverpolicyBinding []interface{} `json:"lbvserver_spilloverpolicy_binding,omitempty"` - LbvserverTmtrafficpolicyBinding []interface{} `json:"lbvserver_tmtrafficpolicy_binding,omitempty"` - LbvserverTransformpolicyBinding []interface{} `json:"lbvserver_transformpolicy_binding,omitempty"` - LbvserverVideooptimizationdetectionpolicyBinding []interface{} `json:"lbvserver_videooptimizationdetectionpolicy_binding,omitempty"` - LbvserverVideooptimizationpacingpolicyBinding []interface{} `json:"lbvserver_videooptimizationpacingpolicy_binding,omitempty"` +type LBVServerBinding struct { + LBVServerAnalyticsProfileBinding []interface{} `json:"lbvserver_analyticsprofile_binding,omitempty"` + LBVServerAppFlowPolicyBinding []interface{} `json:"lbvserver_appflowpolicy_binding,omitempty"` + LBVServerAppFWPolicyBinding []interface{} `json:"lbvserver_appfwpolicy_binding,omitempty"` + LBVServerAppQOEPolicyBinding []interface{} `json:"lbvserver_appqoepolicy_binding,omitempty"` + LBVServerAuditNSLogPolicyBinding []interface{} `json:"lbvserver_auditnslogpolicy_binding,omitempty"` + LBVServerAuditSyslogPolicyBinding []interface{} `json:"lbvserver_auditsyslogpolicy_binding,omitempty"` + LBVServerAuthorizationPolicyBinding []interface{} `json:"lbvserver_authorizationpolicy_binding,omitempty"` + LBVServerBotPolicyBinding []interface{} `json:"lbvserver_botpolicy_binding,omitempty"` + LBVServerCachePolicyBinding []interface{} `json:"lbvserver_cachepolicy_binding,omitempty"` + LBVServerCMPPolicyBinding []interface{} `json:"lbvserver_cmppolicy_binding,omitempty"` + LBVServerContentInspectionPolicyBinding []interface{} `json:"lbvserver_contentinspectionpolicy_binding,omitempty"` + LBVServerCSVServerBinding []interface{} `json:"lbvserver_csvserver_binding,omitempty"` + LBVServerDNSPolicy64Binding []interface{} `json:"lbvserver_dnspolicy64_binding,omitempty"` + LBVServerFEOPolicyBinding []interface{} `json:"lbvserver_feopolicy_binding,omitempty"` + LBVServerLBPolicyBinding []interface{} `json:"lbvserver_lbpolicy_binding,omitempty"` + LBVServerResponderPolicyBinding []interface{} `json:"lbvserver_responderpolicy_binding,omitempty"` + LBVServerRewritePolicyBinding []interface{} `json:"lbvserver_rewritepolicy_binding,omitempty"` + LBVServerServiceBinding []interface{} `json:"lbvserver_service_binding,omitempty"` + LBVServerServiceGroupBinding []interface{} `json:"lbvserver_servicegroup_binding,omitempty"` + LBVServerServiceGroupMemberBinding []interface{} `json:"lbvserver_servicegroupmember_binding,omitempty"` + LBVServerSpilloverPolicyBinding []interface{} `json:"lbvserver_spilloverpolicy_binding,omitempty"` + LBVServerTMTrafficPolicyBinding []interface{} `json:"lbvserver_tmtrafficpolicy_binding,omitempty"` + LBVServerTransformPolicyBinding []interface{} `json:"lbvserver_transformpolicy_binding,omitempty"` + LBVServerVideoOptimizationDetectionPolicyBinding []interface{} `json:"lbvserver_videooptimizationdetectionpolicy_binding,omitempty"` + LBVServerVideoOptimizationPacingPolicyBinding []interface{} `json:"lbvserver_videooptimizationpacingpolicy_binding,omitempty"` Name string `json:"name,omitempty"` } -type LbpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverContentinspectionpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerContentInspectionPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbglobalLbpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBGlobalLBPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type LbvserverServiceBinding struct { - Cookieipport string `json:"cookieipport,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Curstate string `json:"curstate,omitempty"` - Dynamicweight int `json:"dynamicweight,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` +type LBVServerServiceBinding struct { + CookieIPPort string `json:"cookieipport,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CurState string `json:"curstate,omitempty"` + DynamicWeight int `json:"dynamicweight,omitempty"` + IPv46 string `json:"ipv46,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Vserverid string `json:"vserverid,omitempty"` - Vsvrbindsvcip string `json:"vsvrbindsvcip,omitempty"` - Vsvrbindsvcport int `json:"vsvrbindsvcport,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + VServerID string `json:"vserverid,omitempty"` + VSvrBindSvcIP string `json:"vsvrbindsvcip,omitempty"` + VSvrBindSvcPort int `json:"vsvrbindsvcport,omitempty"` Weight int `json:"weight,omitempty"` } -type LbvserverAppqoepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAppQOEPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbpolicyLbglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type LBPolicyLBGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbgroup struct { - Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookiename string `json:"cookiename,omitempty"` +type LBGroup struct { + BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieName string `json:"cookiename,omitempty"` Count float64 `json:"__count,omitempty"` - Mastervserver string `json:"mastervserver,omitempty"` + MasterVServer string `json:"mastervserver,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Persistencebackup string `json:"persistencebackup,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PersistenceBackup string `json:"persistencebackup,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` Rule string `json:"rule,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` Timeout int `json:"timeout,omitempty"` - Usevserverpersistency string `json:"usevserverpersistency,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` + UseVServerPersistency string `json:"usevserverpersistency,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` } -type LbpolicylabelLbpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBPolicyLabelLBPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbsipparameters struct { - Addrportvip string `json:"addrportvip,omitempty"` +type LBSIPParameters struct { + AddrPortVIP string `json:"addrportvip,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Retrydur int `json:"retrydur,omitempty"` - Rnatdstport int `json:"rnatdstport,omitempty"` - Rnatsecuredstport int `json:"rnatsecuredstport,omitempty"` - Rnatsecuresrcport int `json:"rnatsecuresrcport,omitempty"` - Rnatsrcport int `json:"rnatsrcport,omitempty"` - Sip503ratethreshold int `json:"sip503ratethreshold,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RetryDur int `json:"retrydur,omitempty"` + RNATDstPort int `json:"rnatdstport,omitempty"` + RNATSecureDstPort int `json:"rnatsecuredstport,omitempty"` + RNATSecureSrcPort int `json:"rnatsecuresrcport,omitempty"` + RNATSrcPort int `json:"rnatsrcport,omitempty"` + SIP503RateThreshold int `json:"sip503ratethreshold,omitempty"` } -type LbvserverAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type LBVServerAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` } -type LbwlmLbvserverBinding struct { - Vservername string `json:"vservername,omitempty"` - Wlmname string `json:"wlmname,omitempty"` +type LBWLMLBVServerBinding struct { + VServerName string `json:"vservername,omitempty"` + WLMName string `json:"wlmname,omitempty"` } -type LbvserverCmppolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerCMPPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } type LBVServer struct { - Activeservices int `json:"activeservices,omitempty"` - Adfsproxyprofile string `json:"adfsproxyprofile,omitempty"` - Apiprofile string `json:"apiprofile,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` + ActiveServices int `json:"activeservices,omitempty"` + ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` + APIProfile string `json:"apiprofile,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` Authentication string `json:"authentication,omitempty"` - Authenticationhost string `json:"authenticationhost,omitempty"` + AuthenticationHost string `json:"authenticationhost,omitempty"` Authn401 string `json:"authn401,omitempty"` - Authnprofile string `json:"authnprofile,omitempty"` - Authnvsname string `json:"authnvsname,omitempty"` - Backuplbmethod string `json:"backuplbmethod,omitempty"` - Backuppersistencetimeout int `json:"backuppersistencetimeout,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Backupvserverstatus string `json:"backupvserverstatus,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Bypassaaaa string `json:"bypassaaaa,omitempty"` + AuthnProfile string `json:"authnprofile,omitempty"` + AuthnVSName string `json:"authnvsname,omitempty"` + BackupLBMethod string `json:"backuplbmethod,omitempty"` + BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BackupVServerStatus string `json:"backupvserverstatus,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + BypassAAAA string `json:"bypassaaaa,omitempty"` Cacheable string `json:"cacheable,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` - Connfailover string `json:"connfailover,omitempty"` - Consolidatedlconn string `json:"consolidatedlconn,omitempty"` - Consolidatedlconngbl string `json:"consolidatedlconngbl,omitempty"` - Cookiedomain string `json:"cookiedomain,omitempty"` - Cookiename string `json:"cookiename,omitempty"` + ConnFailover string `json:"connfailover,omitempty"` + ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` + ConsolidatedLConnGbl string `json:"consolidatedlconngbl,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieName string `json:"cookiename,omitempty"` Count float64 `json:"__count,omitempty"` - Currentactiveorder string `json:"currentactiveorder,omitempty"` - Curstate string `json:"curstate,omitempty"` - Datalength int `json:"datalength,omitempty"` - Dataoffset int `json:"dataoffset,omitempty"` - Dbprofilename string `json:"dbprofilename,omitempty"` - Dbslb string `json:"dbslb,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` - Dns64 string `json:"dns64,omitempty"` - Dnsoverhttps string `json:"dnsoverhttps,omitempty"` - Dnsprofilename string `json:"dnsprofilename,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` + CurrentActiveOrder string `json:"currentactiveorder,omitempty"` + CurState string `json:"curstate,omitempty"` + DataLength int `json:"datalength,omitempty"` + DataOffset int `json:"dataoffset,omitempty"` + DBProfileName string `json:"dbprofilename,omitempty"` + DBSLB string `json:"dbslb,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DNS64 string `json:"dns64,omitempty"` + DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` Domain string `json:"domain,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Groupname string `json:"groupname,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + GroupName string `json:"groupname,omitempty"` Gt2gb string `json:"gt2gb,omitempty"` - Hashlength int `json:"hashlength,omitempty"` + HashLength int `json:"hashlength,omitempty"` Health int `json:"health,omitempty"` - Healththreshold int `json:"healththreshold,omitempty"` - Homepage string `json:"homepage,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Httpsredirecturl string `json:"httpsredirecturl,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Insertvserveripport string `json:"insertvserveripport,omitempty"` - Ipmapping string `json:"ipmapping,omitempty"` - Ipmask string `json:"ipmask,omitempty"` - Ippattern string `json:"ippattern,omitempty"` - Ipset string `json:"ipset,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - Isgslb bool `json:"isgslb,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Lbmethod string `json:"lbmethod,omitempty"` - Lbprofilename string `json:"lbprofilename,omitempty"` - Lbrrreason int `json:"lbrrreason,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` + HealthThreshold int `json:"healththreshold,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` + ICMPVsrResponse string `json:"icmpvsrresponse,omitempty"` + InsertVServerIPPort string `json:"insertvserveripport,omitempty"` + IPMapping string `json:"ipmapping,omitempty"` + IPMask string `json:"ipmask,omitempty"` + IPPattern string `json:"ippattern,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + IsGSLB bool `json:"isgslb,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LBMethod string `json:"lbmethod,omitempty"` + LBProfileName string `json:"lbprofilename,omitempty"` + LBRRReason int `json:"lbrrreason,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` M string `json:"m,omitempty"` - Macmoderetainvlan string `json:"macmoderetainvlan,omitempty"` + MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` MapField string `json:"map,omitempty"` - Maxautoscalemembers int `json:"maxautoscalemembers,omitempty"` - Minautoscalemembers int `json:"minautoscalemembers,omitempty"` - Mssqlserverversion string `json:"mssqlserverversion,omitempty"` - Mysqlcharacterset int `json:"mysqlcharacterset,omitempty"` - Mysqlprotocolversion int `json:"mysqlprotocolversion,omitempty"` - Mysqlservercapabilities int `json:"mysqlservercapabilities,omitempty"` - Mysqlserverversion string `json:"mysqlserverversion,omitempty"` + MaxAutoscaleMembers int `json:"maxautoscalemembers,omitempty"` + MinAutoscaleMembers int `json:"minautoscalemembers,omitempty"` + MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` + MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` + MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` + MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` + MySQLServerVersion string `json:"mysqlserverversion,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Newservicerequest int `json:"newservicerequest,omitempty"` - Newservicerequestincrementinterval int `json:"newservicerequestincrementinterval,omitempty"` - Newservicerequestunit string `json:"newservicerequestunit,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Oracleserverversion string `json:"oracleserverversion,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NewServiceRequest int `json:"newservicerequest,omitempty"` + NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` + NewServiceRequestUnit string `json:"newservicerequestunit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NgName string `json:"ngname,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + OracleServerVersion string `json:"oracleserverversion,omitempty"` Order int `json:"order,omitempty"` - Orderthreshold int `json:"orderthreshold,omitempty"` - Persistavpno []interface{} `json:"persistavpno,omitempty"` - Persistencebackup string `json:"persistencebackup,omitempty"` - Persistencetype string `json:"persistencetype,omitempty"` - Persistmask string `json:"persistmask,omitempty"` + OrderThreshold int `json:"orderthreshold,omitempty"` + PersistAVPNo []interface{} `json:"persistavpno,omitempty"` + PersistenceBackup string `json:"persistencebackup,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` Port int `json:"port,omitempty"` Precedence string `json:"precedence,omitempty"` - Probeport int `json:"probeport,omitempty"` - Probeprotocol string `json:"probeprotocol,omitempty"` - Probesuccessresponsecode string `json:"probesuccessresponsecode,omitempty"` - Processlocal string `json:"processlocal,omitempty"` + ProbePort int `json:"probeport,omitempty"` + ProbeProtocol string `json:"probeprotocol,omitempty"` + ProbeSuccessResponseCode string `json:"probesuccessresponsecode,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` Push string `json:"push,omitempty"` - Pushlabel string `json:"pushlabel,omitempty"` - Pushmulticlients string `json:"pushmulticlients,omitempty"` - Pushvserver string `json:"pushvserver,omitempty"` - Quicbridgeprofilename string `json:"quicbridgeprofilename,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` + PushLabel string `json:"pushlabel,omitempty"` + PushMultiClients string `json:"pushmulticlients,omitempty"` + PushVServer string `json:"pushvserver,omitempty"` + QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` Range int `json:"range,omitempty"` - Recursionavailable string `json:"recursionavailable,omitempty"` + RecursionAvailable string `json:"recursionavailable,omitempty"` Redirect string `json:"redirect,omitempty"` - Redirectfromport int `json:"redirectfromport,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Redirurl string `json:"redirurl,omitempty"` - Redirurlflags bool `json:"redirurlflags,omitempty"` - Resrule string `json:"resrule,omitempty"` - Retainconnectionsoncluster string `json:"retainconnectionsoncluster,omitempty"` - Rhistate string `json:"rhistate,omitempty"` - Rtspnat string `json:"rtspnat,omitempty"` + RedirectFromPort int `json:"redirectfromport,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + RedirURL string `json:"redirurl,omitempty"` + RedirURLFlags bool `json:"redirurlflags,omitempty"` + ResRule string `json:"resrule,omitempty"` + RetainConnectionsOnCluster string `json:"retainconnectionsoncluster,omitempty"` + RHIState string `json:"rhistate,omitempty"` + RTSPNAT string `json:"rtspnat,omitempty"` Rule string `json:"rule,omitempty"` - Ruletype int `json:"ruletype,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` + RuleType int `json:"ruletype,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` Sessionless string `json:"sessionless,omitempty"` - Skippersistency string `json:"skippersistency,omitempty"` - Sobackupaction string `json:"sobackupaction,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + SkipPersistency string `json:"skippersistency,omitempty"` + SOBackupAction string `json:"sobackupaction,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Statechangetimeseconds int `json:"statechangetimeseconds,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + StateChangeTimeSeconds int `json:"statechangetimeseconds,omitempty"` Status int `json:"status,omitempty"` - Tcpprobeport int `json:"tcpprobeport,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` - Td int `json:"td,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` + TCPProbePort int `json:"tcpprobeport,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` Timeout int `json:"timeout,omitempty"` - Toggleorder string `json:"toggleorder,omitempty"` - Tosid int `json:"tosid,omitempty"` - Totalservices int `json:"totalservices,omitempty"` - Trofspersistence string `json:"trofspersistence,omitempty"` + ToggleOrder string `json:"toggleorder,omitempty"` + TOSID int `json:"tosid,omitempty"` + TotalServices int `json:"totalservices,omitempty"` + TROFSPersistence string `json:"trofspersistence,omitempty"` TypeField string `json:"type,omitempty"` - V6netmasklen int `json:"v6netmasklen,omitempty"` - V6persistmasklen int `json:"v6persistmasklen,omitempty"` + V6NetmaskLen int `json:"v6netmasklen,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` Value string `json:"value,omitempty"` Version int `json:"version,omitempty"` - Vipheader string `json:"vipheader,omitempty"` - Vsvrdynconnsothreshold int `json:"vsvrdynconnsothreshold,omitempty"` + VIPHeader string `json:"vipheader,omitempty"` + VSvrDynConnSOThreshold int `json:"vsvrdynconnsothreshold,omitempty"` Weight int `json:"weight,omitempty"` } -type LbvserverTmtrafficpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerTMTrafficPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbmonitor struct { - Acctapplicationid []interface{} `json:"acctapplicationid,omitempty"` +type LBMonitor struct { + AcctApplicationID []interface{} `json:"acctapplicationid,omitempty"` Action string `json:"action,omitempty"` - Alertretries int `json:"alertretries,omitempty"` + AlertRetries int `json:"alertretries,omitempty"` Application string `json:"application,omitempty"` Attribute string `json:"attribute,omitempty"` - Authapplicationid []interface{} `json:"authapplicationid,omitempty"` - Basedn string `json:"basedn,omitempty"` - Binddn string `json:"binddn,omitempty"` + AuthApplicationID []interface{} `json:"authapplicationid,omitempty"` + BaseDN string `json:"basedn,omitempty"` + BindDN string `json:"binddn,omitempty"` Count float64 `json:"__count,omitempty"` - Customheaders string `json:"customheaders,omitempty"` + CustomHeaders string `json:"customheaders,omitempty"` Database string `json:"database,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` Deviation int `json:"deviation,omitempty"` - Dispatcherip string `json:"dispatcherip,omitempty"` - Dispatcherport int `json:"dispatcherport,omitempty"` + DispatcherIP string `json:"dispatcherip,omitempty"` + DispatcherPort int `json:"dispatcherport,omitempty"` Domain string `json:"domain,omitempty"` Downtime int `json:"downtime,omitempty"` DupState string `json:"dup_state,omitempty"` DupWeight int `json:"dup_weight,omitempty"` - Dynamicinterval int `json:"dynamicinterval,omitempty"` - Dynamicresponsetimeout int `json:"dynamicresponsetimeout,omitempty"` - Evalrule string `json:"evalrule,omitempty"` - Failureretries int `json:"failureretries,omitempty"` - Filename string `json:"filename,omitempty"` + DynamicInterval int `json:"dynamicinterval,omitempty"` + DynamicResponseTimeout int `json:"dynamicresponsetimeout,omitempty"` + EvalRule string `json:"evalrule,omitempty"` + FailureRetries int `json:"failureretries,omitempty"` + FileName string `json:"filename,omitempty"` Filter string `json:"filter,omitempty"` - Firmwarerevision int `json:"firmwarerevision,omitempty"` + FirmwareRevision int `json:"firmwarerevision,omitempty"` Group string `json:"group,omitempty"` - Grpchealthcheck string `json:"grpchealthcheck,omitempty"` - Grpcservicename string `json:"grpcservicename,omitempty"` - Grpcstatuscode []interface{} `json:"grpcstatuscode,omitempty"` - Hostipaddress string `json:"hostipaddress,omitempty"` - Hostname string `json:"hostname,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Inbandsecurityid string `json:"inbandsecurityid,omitempty"` + GRPCHealthCheck string `json:"grpchealthcheck,omitempty"` + GRPCServiceName string `json:"grpcservicename,omitempty"` + GRPCStatusCode []interface{} `json:"grpcstatuscode,omitempty"` + HostIPAddress string `json:"hostipaddress,omitempty"` + HostName string `json:"hostname,omitempty"` + HTTPRequest string `json:"httprequest,omitempty"` + InBandSecurityID string `json:"inbandsecurityid,omitempty"` Interval int `json:"interval,omitempty"` - Ipaddress []string `json:"ipaddress,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Lasversion string `json:"lasversion,omitempty"` - Logonpointname string `json:"logonpointname,omitempty"` - Lrtm string `json:"lrtm,omitempty"` - Lrtmconf int `json:"lrtmconf,omitempty"` - Lrtmconfstr string `json:"lrtmconfstr,omitempty"` - Maxforwards int `json:"maxforwards,omitempty"` + IPAddress []string `json:"ipaddress,omitempty"` + IPTunnel string `json:"iptunnel,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + LASVersion string `json:"lasversion,omitempty"` + LogonPointName string `json:"logonpointname,omitempty"` + LRTM string `json:"lrtm,omitempty"` + LRTMConf int `json:"lrtmconf,omitempty"` + LRTMConfStr string `json:"lrtmconfstr,omitempty"` + MaxForwards int `json:"maxforwards,omitempty"` Metric string `json:"metric,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Metricthreshold int `json:"metricthreshold,omitempty"` - Metricweight int `json:"metricweight,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Mqttclientidentifier string `json:"mqttclientidentifier,omitempty"` - Mqttversion int `json:"mqttversion,omitempty"` - Mssqlprotocolversion string `json:"mssqlprotocolversion,omitempty"` - Multimetrictable []string `json:"multimetrictable,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oraclesid string `json:"oraclesid,omitempty"` - Originhost string `json:"originhost,omitempty"` - Originrealm string `json:"originrealm,omitempty"` + MetricTable string `json:"metrictable,omitempty"` + MetricThreshold int `json:"metricthreshold,omitempty"` + MetricWeight int `json:"metricweight,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MQTTClientIdentifier string `json:"mqttclientidentifier,omitempty"` + MQTTVersion int `json:"mqttversion,omitempty"` + MSSQLProtocolVersion string `json:"mssqlprotocolversion,omitempty"` + MultiMetricTable []string `json:"multimetrictable,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OracleSID string `json:"oraclesid,omitempty"` + OriginHost string `json:"originhost,omitempty"` + OriginRealm string `json:"originrealm,omitempty"` Password string `json:"password,omitempty"` - Productname string `json:"productname,omitempty"` + ProductName string `json:"productname,omitempty"` Query string `json:"query,omitempty"` - Querytype string `json:"querytype,omitempty"` - Radaccountsession string `json:"radaccountsession,omitempty"` - Radaccounttype int `json:"radaccounttype,omitempty"` - Radapn string `json:"radapn,omitempty"` - Radframedip string `json:"radframedip,omitempty"` - Radkey string `json:"radkey,omitempty"` - Radmsisdn string `json:"radmsisdn,omitempty"` - Radnasid string `json:"radnasid,omitempty"` - Radnasip string `json:"radnasip,omitempty"` + QueryType string `json:"querytype,omitempty"` + RADAccountSession string `json:"radaccountsession,omitempty"` + RADAccountType int `json:"radaccounttype,omitempty"` + RADAPN string `json:"radapn,omitempty"` + RADFramedIP string `json:"radframedip,omitempty"` + RADKey string `json:"radkey,omitempty"` + RADMSISDN string `json:"radmsisdn,omitempty"` + RADNASID string `json:"radnasid,omitempty"` + RADNASIP string `json:"radnasip,omitempty"` Recv string `json:"recv,omitempty"` - Respcode []string `json:"respcode,omitempty"` - Resptimeout int `json:"resptimeout,omitempty"` - Resptimeoutthresh int `json:"resptimeoutthresh,omitempty"` + RespCode []string `json:"respcode,omitempty"` + RespTimeout int `json:"resptimeout,omitempty"` + RespTimeoutThresh int `json:"resptimeoutthresh,omitempty"` Retries int `json:"retries,omitempty"` Reverse string `json:"reverse,omitempty"` - Rtsprequest string `json:"rtsprequest,omitempty"` - Scriptargs string `json:"scriptargs,omitempty"` - Scriptname string `json:"scriptname,omitempty"` - Secondarypassword string `json:"secondarypassword,omitempty"` + RTSPRequest string `json:"rtsprequest,omitempty"` + ScriptArgs string `json:"scriptargs,omitempty"` + ScriptName string `json:"scriptname,omitempty"` + SecondaryPassword string `json:"secondarypassword,omitempty"` Secure string `json:"secure,omitempty"` - Secureargs string `json:"secureargs,omitempty"` + SecureArgs string `json:"secureargs,omitempty"` Send string `json:"send,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Sipmethod string `json:"sipmethod,omitempty"` - Sipreguri string `json:"sipreguri,omitempty"` - Sipuri string `json:"sipuri,omitempty"` - Sitepath string `json:"sitepath,omitempty"` - Snmpcommunity string `json:"snmpcommunity,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` - Snmpthreshold string `json:"snmpthreshold,omitempty"` - Snmpversion string `json:"snmpversion,omitempty"` - Sqlquery string `json:"sqlquery,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SIPMethod string `json:"sipmethod,omitempty"` + SIPRegURI string `json:"sipreguri,omitempty"` + SIPURI string `json:"sipuri,omitempty"` + SitePath string `json:"sitepath,omitempty"` + SNMPCommunity string `json:"snmpcommunity,omitempty"` + SNMPOID string `json:"Snmpoid,omitempty"` + SNMPThreshold string `json:"snmpthreshold,omitempty"` + SNMPVersion string `json:"snmpversion,omitempty"` + SQLQuery string `json:"sqlquery,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` State string `json:"state,omitempty"` - Storedb string `json:"storedb,omitempty"` - Storefrontacctservice string `json:"storefrontacctservice,omitempty"` - Storefrontcheckbackendservices string `json:"storefrontcheckbackendservices,omitempty"` - Storename string `json:"storename,omitempty"` - Successretries int `json:"successretries,omitempty"` - Supportedvendorids []interface{} `json:"supportedvendorids,omitempty"` - Tos string `json:"tos,omitempty"` - Tosid int `json:"tosid,omitempty"` + StoreDB string `json:"storedb,omitempty"` + StoreFrontAcctService string `json:"storefrontacctservice,omitempty"` + StoreFrontCheckBackendServices string `json:"storefrontcheckbackendservices,omitempty"` + StoreName string `json:"storename,omitempty"` + SuccessRetries int `json:"successretries,omitempty"` + SupportedVendorIDs []interface{} `json:"supportedvendorids,omitempty"` + TOS string `json:"tos,omitempty"` + TOSID int `json:"tosid,omitempty"` Transparent string `json:"transparent,omitempty"` - Trofscode int `json:"trofscode,omitempty"` - Trofsstring string `json:"trofsstring,omitempty"` + TROFSCode int `json:"trofscode,omitempty"` + TROFSString string `json:"trofsstring,omitempty"` TypeField string `json:"type,omitempty"` Units1 string `json:"units1,omitempty"` Units2 string `json:"units2,omitempty"` Units3 string `json:"units3,omitempty"` Units4 string `json:"units4,omitempty"` Username string `json:"username,omitempty"` - Validatecred string `json:"validatecred,omitempty"` - Vendorid int `json:"vendorid,omitempty"` - Vendorspecificacctapplicationids []interface{} `json:"vendorspecificacctapplicationids,omitempty"` - Vendorspecificauthapplicationids []interface{} `json:"vendorspecificauthapplicationids,omitempty"` - Vendorspecificvendorid int `json:"vendorspecificvendorid,omitempty"` + ValidateCred string `json:"validatecred,omitempty"` + VendorID int `json:"vendorid,omitempty"` + VendorSpecificAcctApplicationIDs []interface{} `json:"vendorspecificacctapplicationids,omitempty"` + VendorSpecificAuthApplicationIDs []interface{} `json:"vendorspecificauthapplicationids,omitempty"` + VendorSpecificVendorID int `json:"vendorspecificvendorid,omitempty"` Weight int `json:"weight,omitempty"` } -type Lbprofile struct { - Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` - Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` - Cookiepassphrase string `json:"cookiepassphrase,omitempty"` +type LBProfile struct { + ADCCookieAttributeWarningMsg string `json:"adccookieattributewarningmsg,omitempty"` + ComputedADCCookieAttribute string `json:"computedadccookieattribute,omitempty"` + CookiePassphrase string `json:"cookiepassphrase,omitempty"` Count float64 `json:"__count,omitempty"` - Dbslb string `json:"dbslb,omitempty"` - Httponlycookieflag string `json:"httponlycookieflag,omitempty"` - Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` - Lbhashalgowinsize int `json:"lbhashalgowinsize,omitempty"` - Lbhashfingers int `json:"lbhashfingers,omitempty"` - Lbprofilename string `json:"lbprofilename,omitempty"` - Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Proximityfromself string `json:"proximityfromself,omitempty"` - Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` - Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` - Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` - Vsvrcount int `json:"vsvrcount,omitempty"` -} - -type LbvserverServicegroupBinding struct { + DBSLB string `json:"dbslb,omitempty"` + HTTPOnlyCookieFlag string `json:"httponlycookieflag,omitempty"` + LBHashAlgorithm string `json:"lbhashalgorithm,omitempty"` + LBHashAlgoWinSize int `json:"lbhashalgowinsize,omitempty"` + LBHashFingers int `json:"lbhashfingers,omitempty"` + LBProfileName string `json:"lbprofilename,omitempty"` + LiteralADCCookieAttribute string `json:"literaladccookieattribute,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + ProximityFromSelf string `json:"proximityfromself,omitempty"` + StoreMQTTClientIDAndUsername string `json:"storemqttclientidandusername,omitempty"` + UseEncryptedPersistenceCookie string `json:"useencryptedpersistencecookie,omitempty"` + UseSecuredPersistenceCookie string `json:"usesecuredpersistencecookie,omitempty"` + VSvrCount int `json:"vsvrcount,omitempty"` +} + +type LBVServerServiceGroupBinding struct { Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` Weight int `json:"weight,omitempty"` } -type LbwlmBinding struct { - LbwlmLbvserverBinding []interface{} `json:"lbwlm_lbvserver_binding,omitempty"` - Wlmname string `json:"wlmname,omitempty"` +type LBWLMBinding struct { + LBWLMLBVServerBinding []interface{} `json:"lbwlm_lbvserver_binding,omitempty"` + WLMName string `json:"wlmname,omitempty"` } -type LbmonbindingsGslbservicegroupBinding struct { - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Monstate string `json:"monstate,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` +type LBMonBindingsGSLBServiceGroupBinding struct { + BoundServiceGroupSvrState string `json:"boundservicegroupsvrstate,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MonState string `json:"monstate,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` } -type Lbpolicy struct { +type LBPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type LbmonitorServicegroupBinding struct { +type LBMonitorServiceGroupBinding struct { DupState string `json:"dup_state,omitempty"` DupWeight int `json:"dup_weight,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` State string `json:"state,omitempty"` Weight int `json:"weight,omitempty"` } -type LbvserverSpilloverpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerSpilloverPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbwlm struct { +type LBWLM struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Katimeout int `json:"katimeout,omitempty"` - Lbuid string `json:"lbuid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + KATimeout int `json:"katimeout,omitempty"` + LBUID string `json:"lbuid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` Secure string `json:"secure,omitempty"` State string `json:"state,omitempty"` - Wlmname string `json:"wlmname,omitempty"` + WLMName string `json:"wlmname,omitempty"` } -type LbgroupLbvserverBinding struct { +type LBGroupLBVServerBinding struct { Name string `json:"name,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type LbmetrictableBinding struct { - LbmetrictableMetricBinding []interface{} `json:"lbmetrictable_metric_binding,omitempty"` - Metrictable string `json:"metrictable,omitempty"` +type LBMetricTableBinding struct { + LBMetricTableMetricBinding []interface{} `json:"lbmetrictable_metric_binding,omitempty"` + MetricTable string `json:"metrictable,omitempty"` } -type Lbpersistentsessions struct { - Cnamepersparam string `json:"cnamepersparam,omitempty"` +type LBPersistentSessions struct { + CNamePersParam string `json:"cnamepersparam,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destipv6 string `json:"destipv6,omitempty"` - Destport int `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestIPv6 string `json:"destipv6,omitempty"` + DestPort int `json:"destport,omitempty"` Flags bool `json:"flags,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Persistenceparam string `json:"persistenceparam,omitempty"` - Persistenceparameter string `json:"persistenceparameter,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcipv6 string `json:"srcipv6,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PersistenceParam string `json:"persistenceparam,omitempty"` + PersistenceParameter string `json:"persistenceparameter,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcIPv6 string `json:"srcipv6,omitempty"` Timeout int `json:"timeout,omitempty"` TypeField int `json:"type,omitempty"` - Typestring string `json:"typestring,omitempty"` - Vserver string `json:"vserver,omitempty"` - Vservername string `json:"vservername,omitempty"` + TypeString string `json:"typestring,omitempty"` + VServer string `json:"vserver,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type LbpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type LBPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverAuditnslogpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAuditNSLogPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - LbpolicylabelLbpolicyBinding []interface{} `json:"lbpolicylabel_lbpolicy_binding,omitempty"` - LbpolicylabelPolicybindingBinding []interface{} `json:"lbpolicylabel_policybinding_binding,omitempty"` +type LBPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + LBPolicyLabelLBPolicyBinding []interface{} `json:"lbpolicylabel_lbpolicy_binding,omitempty"` + LBPolicyLabelPolicyBindingBinding []interface{} `json:"lbpolicylabel_policybinding_binding,omitempty"` } -type LbmetrictableMetricBinding struct { +type LBMetricTableMetricBinding struct { Metric string `json:"metric,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Metrictype string `json:"metrictype,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` + MetricTable string `json:"metrictable,omitempty"` + MetricType string `json:"metrictype,omitempty"` + SNMPOID string `json:"Snmpoid,omitempty"` } -type LbvserverDnspolicy64Binding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerDNSPolicy64Binding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverVideooptimizationpacingpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerVideoOptimizationPacingPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbpolicyLbpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type LBPolicyLBPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type LbmonbindingsServicegroupBinding struct { - Boundservicegroupsvrstate string `json:"boundservicegroupsvrstate,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Monstate string `json:"monstate,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` +type LBMonBindingsServiceGroupBinding struct { + BoundServiceGroupSvrState string `json:"boundservicegroupsvrstate,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MonState string `json:"monstate,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` } -type LbmonitorSslcertkeyBinding struct { - Ca bool `json:"ca,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Monitorname string `json:"monitorname,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` +type LBMonitorSSLCertKeyBinding struct { + CA bool `json:"ca,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` } -type LbvserverAuthorizationpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerAuthorizationPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbvserverVideooptimizationdetectionpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerVideoOptimizationDetectionPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Lbpolicylabel struct { +type LBPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` -} - -type LbpolicyBinding struct { - LbpolicyGslbvserverBinding []interface{} `json:"lbpolicy_gslbvserver_binding,omitempty"` - LbpolicyLbglobalBinding []interface{} `json:"lbpolicy_lbglobal_binding,omitempty"` - LbpolicyLbpolicylabelBinding []interface{} `json:"lbpolicy_lbpolicylabel_binding,omitempty"` - LbpolicyLbvserverBinding []interface{} `json:"lbpolicy_lbvserver_binding,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` +} + +type LBPolicyBinding struct { + LBPolicyGSLBVServerBinding []interface{} `json:"lbpolicy_gslbvserver_binding,omitempty"` + LBPolicyLBGlobalBinding []interface{} `json:"lbpolicy_lbglobal_binding,omitempty"` + LBPolicyLBPolicyLabelBinding []interface{} `json:"lbpolicy_lbpolicylabel_binding,omitempty"` + LBPolicyLBVServerBinding []interface{} `json:"lbpolicy_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type LbmonitorMetricBinding struct { +type LBMonitorMetricBinding struct { Metric string `json:"metric,omitempty"` MetricUnit string `json:"metric_unit,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Metricthreshold int `json:"metricthreshold,omitempty"` - Metricweight int `json:"metricweight,omitempty"` - Monitorname string `json:"monitorname,omitempty"` + MetricTable string `json:"metrictable,omitempty"` + MetricThreshold int `json:"metricthreshold,omitempty"` + MetricWeight int `json:"metricweight,omitempty"` + MonitorName string `json:"monitorname,omitempty"` } -type LbvserverLbpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type LBVServerLBPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type LbgroupBinding struct { - LbgroupLbvserverBinding []interface{} `json:"lbgroup_lbvserver_binding,omitempty"` +type LBGroupBinding struct { + LBGroupLBVServerBinding []interface{} `json:"lbgroup_lbvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Lbparameter struct { - Adccookieattributewarningmsg string `json:"adccookieattributewarningmsg,omitempty"` - Allowboundsvcremoval string `json:"allowboundsvcremoval,omitempty"` +type LBParameter struct { + ADCCookieAttributeWarningMsg string `json:"adccookieattributewarningmsg,omitempty"` + AllowBoundSvcRemoval string `json:"allowboundsvcremoval,omitempty"` Builtin []string `json:"builtin,omitempty"` - Computedadccookieattribute string `json:"computedadccookieattribute,omitempty"` - Consolidatedlconn string `json:"consolidatedlconn,omitempty"` - Cookiepassphrase string `json:"cookiepassphrase,omitempty"` - Dbsttl int `json:"dbsttl,omitempty"` - Dropmqttjumbomessage string `json:"dropmqttjumbomessage,omitempty"` + ComputedADCCookieAttribute string `json:"computedadccookieattribute,omitempty"` + ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` + CookiePassphrase string `json:"cookiepassphrase,omitempty"` + DBSTTL int `json:"dbsttl,omitempty"` + DropMQTTJumboMessage string `json:"dropmqttjumbomessage,omitempty"` Feature string `json:"feature,omitempty"` - Httponlycookieflag string `json:"httponlycookieflag,omitempty"` - Lbhashalgorithm string `json:"lbhashalgorithm,omitempty"` - Lbhashalgowinsize int `json:"lbhashalgowinsize,omitempty"` - Lbhashfingers int `json:"lbhashfingers,omitempty"` - Literaladccookieattribute string `json:"literaladccookieattribute,omitempty"` - Maxpipelinenat int `json:"maxpipelinenat,omitempty"` - Monitorconnectionclose string `json:"monitorconnectionclose,omitempty"` - Monitorskipmaxclient string `json:"monitorskipmaxclient,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overridepersistencyfororder string `json:"overridepersistencyfororder,omitempty"` - Preferdirectroute string `json:"preferdirectroute,omitempty"` - Proximityfromself string `json:"proximityfromself,omitempty"` - Radiusmessageauthenticator string `json:"radiusmessageauthenticator,omitempty"` - Retainservicestate string `json:"retainservicestate,omitempty"` - Sessionsthreshold int `json:"sessionsthreshold,omitempty"` - Startuprrfactor int `json:"startuprrfactor,omitempty"` - Storemqttclientidandusername string `json:"storemqttclientidandusername,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Useencryptedpersistencecookie string `json:"useencryptedpersistencecookie,omitempty"` - Useportforhashlb string `json:"useportforhashlb,omitempty"` - Usesecuredpersistencecookie string `json:"usesecuredpersistencecookie,omitempty"` - Vserverspecificmac string `json:"vserverspecificmac,omitempty"` + HTTPOnlyCookieFlag string `json:"httponlycookieflag,omitempty"` + LBHashAlgorithm string `json:"lbhashalgorithm,omitempty"` + LBHashAlgoWinSize int `json:"lbhashalgowinsize,omitempty"` + LBHashFingers int `json:"lbhashfingers,omitempty"` + LiteralADCCookieAttribute string `json:"literaladccookieattribute,omitempty"` + MaxPipelineNAT int `json:"maxpipelinenat,omitempty"` + MonitorConnectionClose string `json:"monitorconnectionclose,omitempty"` + MonitorSkipMaxClient string `json:"monitorskipmaxclient,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OverridePersistencyForOrder string `json:"overridepersistencyfororder,omitempty"` + PreferDirectRoute string `json:"preferdirectroute,omitempty"` + ProximityFromSelf string `json:"proximityfromself,omitempty"` + RADIUSMessageAuthenticator string `json:"radiusmessageauthenticator,omitempty"` + RetainServiceState string `json:"retainservicestate,omitempty"` + SessionsThreshold int `json:"sessionsthreshold,omitempty"` + StartupRRFactor int `json:"startuprrfactor,omitempty"` + StoreMQTTClientIDAndUsername string `json:"storemqttclientidandusername,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UseEncryptedPersistenceCookie string `json:"useencryptedpersistencecookie,omitempty"` + UsePortForHashLB string `json:"useportforhashlb,omitempty"` + UseSecuredPersistenceCookie string `json:"usesecuredpersistencecookie,omitempty"` + VServerSpecificMAC string `json:"vserverspecificmac,omitempty"` } type LBVServerServiceGroupMemberBinding struct { - Cookieipport string `json:"cookieipport,omitempty"` - Cookiename string `json:"cookiename,omitempty"` - Curstate string `json:"curstate,omitempty"` - Dynamicweight int `json:"dynamicweight,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` + CookieIPPort string `json:"cookieipport,omitempty"` + CookieName string `json:"cookiename,omitempty"` + CurState string `json:"curstate,omitempty"` + DynamicWeight int `json:"dynamicweight,omitempty"` + IPv46 string `json:"ipv46,omitempty"` Name string `json:"name,omitempty"` Order int `json:"order,omitempty"` - Orderstr string `json:"orderstr,omitempty"` + OrderStr string `json:"orderstr,omitempty"` Port int `json:"port,omitempty"` - Preferredlocation string `json:"preferredlocation,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Vserverid string `json:"vserverid,omitempty"` + PreferredLocation string `json:"preferredlocation,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + VServerID string `json:"vserverid,omitempty"` Weight int `json:"weight,omitempty"` } -type Lbmetrictable struct { +type LBMetricTable struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Metric string `json:"metric,omitempty"` - Metrictable string `json:"metrictable,omitempty"` - Metrictype string `json:"metrictype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` + MetricTable string `json:"metrictable,omitempty"` + MetricType string `json:"metrictype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SNMPOID string `json:"Snmpoid,omitempty"` } diff --git a/nitrogo/models/lldp.go b/nitrogo/models/lldp.go index 7420705..2675d90 100644 --- a/nitrogo/models/lldp.go +++ b/nitrogo/models/lldp.go @@ -1,46 +1,46 @@ package models // lldp configuration structs -type Lldpparam struct { - Holdtimetxmult int `json:"holdtimetxmult,omitempty"` +type LLDPParam struct { + HoldTimeTxMult int `json:"holdtimetxmult,omitempty"` Mode string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Timer int `json:"timer,omitempty"` } -type Lldpneighbors struct { - Autonegadvertised string `json:"autonegadvertised,omitempty"` - Autonegenabled string `json:"autonegenabled,omitempty"` - Autonegmautype string `json:"autonegmautype,omitempty"` - Autonegsupport string `json:"autonegsupport,omitempty"` - Chassisid string `json:"chassisid,omitempty"` - Chassisidsubtype string `json:"chassisidsubtype,omitempty"` +type LLDPNeighbors struct { + AutonegAdvertised string `json:"autonegadvertised,omitempty"` + AutonegEnabled string `json:"autonegenabled,omitempty"` + AutonegMauType string `json:"autonegmautype,omitempty"` + AutonegSupport string `json:"autonegsupport,omitempty"` + ChassisID string `json:"chassisid,omitempty"` + ChassisIDSubtype string `json:"chassisidsubtype,omitempty"` Count float64 `json:"__count,omitempty"` Flag int `json:"flag,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ifnumber int `json:"ifnumber,omitempty"` - Iftype string `json:"iftype,omitempty"` - Linkaggrcapable string `json:"linkaggrcapable,omitempty"` - Linkaggrenabled string `json:"linkaggrenabled,omitempty"` - Linkaggrid int `json:"linkaggrid,omitempty"` - Mgmtaddress string `json:"mgmtaddress,omitempty"` - Mgmtaddresssubtype string `json:"mgmtaddresssubtype,omitempty"` - Mtu int `json:"mtu,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Portdescription string `json:"portdescription,omitempty"` - Portid string `json:"portid,omitempty"` - Portidsubtype string `json:"portidsubtype,omitempty"` - Portprotoenabled int `json:"portprotoenabled,omitempty"` - Portprotoid int `json:"portprotoid,omitempty"` - Portprotosupported int `json:"portprotosupported,omitempty"` - Portvlanid int `json:"portvlanid,omitempty"` - Protocolid string `json:"protocolid,omitempty"` + IFNum string `json:"ifnum,omitempty"` + IFNumber int `json:"ifnumber,omitempty"` + IFType string `json:"iftype,omitempty"` + LinkAggrCapable string `json:"linkaggrcapable,omitempty"` + LinkAggrEnabled string `json:"linkaggrenabled,omitempty"` + LinkAggrID int `json:"linkaggrid,omitempty"` + MgmtAddress string `json:"mgmtaddress,omitempty"` + MgmtAddressSubtype string `json:"mgmtaddresssubtype,omitempty"` + MTU int `json:"mtu,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PortDescription string `json:"portdescription,omitempty"` + PortID string `json:"portid,omitempty"` + PortIDSubtype string `json:"portidsubtype,omitempty"` + PortProtoEnabled int `json:"portprotoenabled,omitempty"` + PortProtoID int `json:"portprotoid,omitempty"` + PortProtoSupported int `json:"portprotosupported,omitempty"` + PortVLANID int `json:"portvlanid,omitempty"` + ProtocolID string `json:"protocolid,omitempty"` Sys string `json:"sys,omitempty"` - Syscapabilities string `json:"syscapabilities,omitempty"` - Syscapenabled string `json:"syscapenabled,omitempty"` - Sysdesc string `json:"sysdesc,omitempty"` - Ttl int `json:"ttl,omitempty"` - Vlan string `json:"vlan,omitempty"` - Vlanid int `json:"vlanid,omitempty"` + SysCapabilities string `json:"syscapabilities,omitempty"` + SysCapEnabled string `json:"syscapenabled,omitempty"` + SysDesc string `json:"sysdesc,omitempty"` + TTL int `json:"ttl,omitempty"` + VLAN string `json:"vlan,omitempty"` + VLANID int `json:"vlanid,omitempty"` } diff --git a/nitrogo/models/lsn.go b/nitrogo/models/lsn.go index 24436c0..b174e8f 100644 --- a/nitrogo/models/lsn.go +++ b/nitrogo/models/lsn.go @@ -1,389 +1,389 @@ package models // lsn configuration structs -type LsngroupLsnlogprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Logprofilename string `json:"logprofilename,omitempty"` +type LSNGroupLSNLogProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + LogProfileName string `json:"logprofilename,omitempty"` } -type LsnclientNsaclBinding struct { - Aclname string `json:"aclname,omitempty"` - Clientname string `json:"clientname,omitempty"` - Td int `json:"td,omitempty"` +type LSNClientNSACLBinding struct { + ACLName string `json:"aclname,omitempty"` + ClientName string `json:"clientname,omitempty"` + TD int `json:"td,omitempty"` } -type Lsnip6profile struct { +type LSNIP6Profile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Natprefix string `json:"natprefix,omitempty"` + NatPrefix string `json:"natprefix,omitempty"` Network6 string `json:"network6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` TypeField string `json:"type,omitempty"` } -type LsngroupLsnhttphdrlogprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` +type LSNGroupLSNHTTPHdrLogProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + HTTPHdrLogProfileName string `json:"httphdrlogprofilename,omitempty"` } -type LsngroupLsntransportprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Transportprofilename string `json:"transportprofilename,omitempty"` +type LSNGroupLSNTransportProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + TransportProfileName string `json:"transportprofilename,omitempty"` } -type Lsnappsattributes struct { +type LSNAppsAttributes struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port string `json:"port,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` + SessionTimeout int `json:"sessiontimeout,omitempty"` + TransportProtocol string `json:"transportprotocol,omitempty"` } -type LsngroupLsnrtspalgprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` +type LSNGroupLSNRTSPALGProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + RTSPALGProfileName string `json:"rtspalgprofilename,omitempty"` } -type Lsnclient struct { - Clientname string `json:"clientname,omitempty"` +type LSNClient struct { + ClientName string `json:"clientname,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type LsnclientNsacl6Binding struct { - Acl6name string `json:"acl6name,omitempty"` - Clientname string `json:"clientname,omitempty"` - Td int `json:"td,omitempty"` +type LSNClientNSACL6Binding struct { + ACL6Name string `json:"acl6name,omitempty"` + ClientName string `json:"clientname,omitempty"` + TD int `json:"td,omitempty"` } -type Lsnparameter struct { - Maxmemlimit int `json:"maxmemlimit,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Memlimitactive int `json:"memlimitactive,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sessionsync string `json:"sessionsync,omitempty"` - Subscrsessionremoval string `json:"subscrsessionremoval,omitempty"` +type LSNParameter struct { + MaxMemLimit int `json:"maxmemlimit,omitempty"` + MemLimit int `json:"memlimit,omitempty"` + MemLimitActive int `json:"memlimitactive,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SessionSync string `json:"sessionsync,omitempty"` + SubscrSessionRemoval string `json:"subscrsessionremoval,omitempty"` } -type LsnclientNetworkBinding struct { - Clientname string `json:"clientname,omitempty"` +type LSNClientNetworkBinding struct { + ClientName string `json:"clientname,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` } -type LsnclientNetwork6Binding struct { - Clientname string `json:"clientname,omitempty"` +type LSNClientNetwork6Binding struct { + ClientName string `json:"clientname,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` Network6 string `json:"network6,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` } -type LsnappsprofilePortBinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - Lsnport string `json:"lsnport,omitempty"` +type LSNAppsProfilePortBinding struct { + AppsProfileName string `json:"appsprofilename,omitempty"` + LSNPort string `json:"lsnport,omitempty"` } -type Lsnsession struct { - Clientname string `json:"clientname,omitempty"` +type LSNSession struct { + ClientName string `json:"clientname,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Dsttd int `json:"dsttd,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` - Natip string `json:"natip,omitempty"` - Natport int `json:"natport,omitempty"` - Natport2 int `json:"natport2,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Nattype string `json:"nattype,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + DstTD int `json:"dsttd,omitempty"` + IPv6Address string `json:"ipv6address,omitempty"` + NatIP string `json:"natip,omitempty"` + NatPort int `json:"natport,omitempty"` + NatPort2 int `json:"natport2,omitempty"` + NatPrefix string `json:"natprefix,omitempty"` + NatType string `json:"nattype,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` Network6 string `json:"network6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Sessionestdir string `json:"sessionestdir,omitempty"` - Srctd int `json:"srctd,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Subscrport int `json:"subscrport,omitempty"` - Td int `json:"td,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + SessionEstDir string `json:"sessionestdir,omitempty"` + SrcTD int `json:"srctd,omitempty"` + SubscrIP string `json:"subscrip,omitempty"` + SubscrPort int `json:"subscrport,omitempty"` + TD int `json:"td,omitempty"` + TransportProtocol string `json:"transportprotocol,omitempty"` } -type Lsnsipalgprofile struct { +type LSNSIPALGProfile struct { Count float64 `json:"__count,omitempty"` - Datasessionidletimeout int `json:"datasessionidletimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Opencontactpinhole string `json:"opencontactpinhole,omitempty"` - Openrecordroutepinhole string `json:"openrecordroutepinhole,omitempty"` - Openregisterpinhole string `json:"openregisterpinhole,omitempty"` - Openroutepinhole string `json:"openroutepinhole,omitempty"` - Openviapinhole string `json:"openviapinhole,omitempty"` - Registrationtimeout int `json:"registrationtimeout,omitempty"` - Rport string `json:"rport,omitempty"` - Sipalgprofilename string `json:"sipalgprofilename,omitempty"` - Sipdstportrange string `json:"sipdstportrange,omitempty"` - Sipsessiontimeout int `json:"sipsessiontimeout,omitempty"` - Sipsrcportrange string `json:"sipsrcportrange,omitempty"` - Siptransportprotocol string `json:"siptransportprotocol,omitempty"` -} - -type LsnrtspalgsessionBinding struct { - LsnrtspalgsessionDatachannelBinding []interface{} `json:"lsnrtspalgsession_datachannel_binding,omitempty"` - Sessionid string `json:"sessionid,omitempty"` -} - -type Lsnlogprofile struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` + DataSessionIdleTimeout int `json:"datasessionidletimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OpenContactPinhole string `json:"opencontactpinhole,omitempty"` + OpenRecordRoutePinhole string `json:"openrecordroutepinhole,omitempty"` + OpenRegisterPinhole string `json:"openregisterpinhole,omitempty"` + OpenRoutePinhole string `json:"openroutepinhole,omitempty"` + OpenViaPinhole string `json:"openviapinhole,omitempty"` + RegistrationTimeout int `json:"registrationtimeout,omitempty"` + RPort string `json:"rport,omitempty"` + SIPALGProfileName string `json:"sipalgprofilename,omitempty"` + SIPDstPortRange string `json:"sipdstportrange,omitempty"` + SIPSessionTimeout int `json:"sipsessiontimeout,omitempty"` + SIPSrcPortRange string `json:"sipsrcportrange,omitempty"` + SIPTransportProtocol string `json:"siptransportprotocol,omitempty"` +} + +type LSNRTSPALGSessionBinding struct { + LSNRTSPALGSessionDataChannelBinding []interface{} `json:"lsnrtspalgsession_datachannel_binding,omitempty"` + SessionID string `json:"sessionid,omitempty"` +} + +type LSNLogProfile struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Count float64 `json:"__count,omitempty"` - Logcompact string `json:"logcompact,omitempty"` - Logipfix string `json:"logipfix,omitempty"` - Logprofilename string `json:"logprofilename,omitempty"` - Logsessdeletion string `json:"logsessdeletion,omitempty"` - Logsubscrinfo string `json:"logsubscrinfo,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + LogCompact string `json:"logcompact,omitempty"` + LogIPFIX string `json:"logipfix,omitempty"` + LogProfileName string `json:"logprofilename,omitempty"` + LogSessDeletion string `json:"logsessdeletion,omitempty"` + LogSubscrInfo string `json:"logsubscrinfo,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type LsngroupIpsecalgprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Ipsecalgprofile string `json:"ipsecalgprofile,omitempty"` +type LSNGroupIPSECALGProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + IPSECALGProfile string `json:"ipsecalgprofile,omitempty"` } -type Lsngroup struct { - Allocpolicy string `json:"allocpolicy,omitempty"` - Clientname string `json:"clientname,omitempty"` +type LSNGroup struct { + AllocPolicy string `json:"allocpolicy,omitempty"` + ClientName string `json:"clientname,omitempty"` Count float64 `json:"__count,omitempty"` - Ftp string `json:"ftp,omitempty"` - Ftpcm string `json:"ftpcm,omitempty"` - Groupid int `json:"groupid,omitempty"` - Groupname string `json:"groupname,omitempty"` - Ip6profile string `json:"ip6profile,omitempty"` + FTP string `json:"ftp,omitempty"` + FTPCM string `json:"ftpcm,omitempty"` + GroupID int `json:"groupid,omitempty"` + GroupName string `json:"groupname,omitempty"` + IP6Profile string `json:"ip6profile,omitempty"` Logging string `json:"logging,omitempty"` - Nattype string `json:"nattype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Portblocksize int `json:"portblocksize,omitempty"` - Pptp string `json:"pptp,omitempty"` - Rtspalg string `json:"rtspalg,omitempty"` - Sessionlogging string `json:"sessionlogging,omitempty"` - Sessionsync string `json:"sessionsync,omitempty"` - Sipalg string `json:"sipalg,omitempty"` - Snmptraplimit int `json:"snmptraplimit,omitempty"` -} - -type Lsnstatic struct { + NatType string `json:"nattype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PortBlockSize int `json:"portblocksize,omitempty"` + PPTP string `json:"pptp,omitempty"` + RTSPALG string `json:"rtspalg,omitempty"` + SessionLogging string `json:"sessionlogging,omitempty"` + SessionSync string `json:"sessionsync,omitempty"` + SIPALG string `json:"sipalg,omitempty"` + SNMPTrapLimit int `json:"snmptraplimit,omitempty"` +} + +type LSNStatic struct { Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Dsttd int `json:"dsttd,omitempty"` + DestIP string `json:"destip,omitempty"` + DstTD int `json:"dsttd,omitempty"` Name string `json:"name,omitempty"` - Natip string `json:"natip,omitempty"` - Natport int `json:"natport,omitempty"` - Nattype string `json:"nattype,omitempty"` + NatIP string `json:"natip,omitempty"` + NatPort int `json:"natport,omitempty"` + NatType string `json:"nattype,omitempty"` Network6 string `json:"network6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Status string `json:"status,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Subscrport int `json:"subscrport,omitempty"` - Td int `json:"td,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` + SubscrIP string `json:"subscrip,omitempty"` + SubscrPort int `json:"subscrport,omitempty"` + TD int `json:"td,omitempty"` + TransportProtocol string `json:"transportprotocol,omitempty"` } -type Lsntransportprofile struct { +type LSNTransportProfile struct { Count float64 `json:"__count,omitempty"` - Finrsttimeout int `json:"finrsttimeout,omitempty"` - Groupsessionlimit int `json:"groupsessionlimit,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Portpreserveparity string `json:"portpreserveparity,omitempty"` - Portpreserverange string `json:"portpreserverange,omitempty"` - Portquota int `json:"portquota,omitempty"` - Sessionquota int `json:"sessionquota,omitempty"` - Sessiontimeout int `json:"sessiontimeout,omitempty"` - Stuntimeout int `json:"stuntimeout,omitempty"` - Syncheck string `json:"syncheck,omitempty"` - Synidletimeout int `json:"synidletimeout,omitempty"` - Transportprofilename string `json:"transportprofilename,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` -} - -type LsnsipalgcallDatachannelBinding struct { - Callid string `json:"callid,omitempty"` - Channelflags int `json:"channelflags,omitempty"` - Channelip string `json:"channelip,omitempty"` - Channelnatip string `json:"channelnatip,omitempty"` - Channelnatport int `json:"channelnatport,omitempty"` - Channelport int `json:"channelport,omitempty"` - Channelprotocol string `json:"channelprotocol,omitempty"` - Channeltimeout int `json:"channeltimeout,omitempty"` -} - -type LsnappsprofileBinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - LsnappsprofileLsnappsattributesBinding []interface{} `json:"lsnappsprofile_lsnappsattributes_binding,omitempty"` - LsnappsprofilePortBinding []interface{} `json:"lsnappsprofile_port_binding,omitempty"` -} - -type Lsnpool struct { + FinRstTimeout int `json:"finrsttimeout,omitempty"` + GroupSessionLimit int `json:"groupsessionlimit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PortPreserveParity string `json:"portpreserveparity,omitempty"` + PortPreserveRange string `json:"portpreserverange,omitempty"` + PortQuota int `json:"portquota,omitempty"` + SessionQuota int `json:"sessionquota,omitempty"` + SessionTimeout int `json:"sessiontimeout,omitempty"` + STUNTimeout int `json:"stuntimeout,omitempty"` + SynCheck string `json:"syncheck,omitempty"` + SynIdleTimeout int `json:"synidletimeout,omitempty"` + TransportProfileName string `json:"transportprofilename,omitempty"` + TransportProtocol string `json:"transportprotocol,omitempty"` +} + +type LSNSIPALGCallDataChannelBinding struct { + CallID string `json:"callid,omitempty"` + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` +} + +type LSNAppsProfileBinding struct { + AppsProfileName string `json:"appsprofilename,omitempty"` + LSNAppsProfileLSNAppsAttributesBinding []interface{} `json:"lsnappsprofile_lsnappsattributes_binding,omitempty"` + LSNAppsProfilePortBinding []interface{} `json:"lsnappsprofile_port_binding,omitempty"` +} + +type LSNPool struct { Count float64 `json:"__count,omitempty"` - Maxportrealloctmq int `json:"maxportrealloctmq,omitempty"` - Nattype string `json:"nattype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Poolname string `json:"poolname,omitempty"` - Portblockallocation string `json:"portblockallocation,omitempty"` - Portrealloctimeout int `json:"portrealloctimeout,omitempty"` + MaxPortReallocTMQ int `json:"maxportrealloctmq,omitempty"` + NatType string `json:"nattype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PoolName string `json:"poolname,omitempty"` + PortBlockAllocation string `json:"portblockallocation,omitempty"` + PortReallocTimeout int `json:"portrealloctimeout,omitempty"` } -type LsnappsprofileLsnappsattributesBinding struct { - Appsattributesname string `json:"appsattributesname,omitempty"` - Appsprofilename string `json:"appsprofilename,omitempty"` +type LSNAppsProfileLSNAppsAttributesBinding struct { + AppsAttributesName string `json:"appsattributesname,omitempty"` + AppsProfileName string `json:"appsprofilename,omitempty"` } -type LsngroupBinding struct { - Groupname string `json:"groupname,omitempty"` - LsngroupIpsecalgprofileBinding []interface{} `json:"lsngroup_ipsecalgprofile_binding,omitempty"` - LsngroupLsnappsprofileBinding []interface{} `json:"lsngroup_lsnappsprofile_binding,omitempty"` - LsngroupLsnhttphdrlogprofileBinding []interface{} `json:"lsngroup_lsnhttphdrlogprofile_binding,omitempty"` - LsngroupLsnlogprofileBinding []interface{} `json:"lsngroup_lsnlogprofile_binding,omitempty"` - LsngroupLsnpoolBinding []interface{} `json:"lsngroup_lsnpool_binding,omitempty"` - LsngroupLsnrtspalgprofileBinding []interface{} `json:"lsngroup_lsnrtspalgprofile_binding,omitempty"` - LsngroupLsnsipalgprofileBinding []interface{} `json:"lsngroup_lsnsipalgprofile_binding,omitempty"` - LsngroupLsntransportprofileBinding []interface{} `json:"lsngroup_lsntransportprofile_binding,omitempty"` - LsngroupPcpserverBinding []interface{} `json:"lsngroup_pcpserver_binding,omitempty"` +type LSNGroupBinding struct { + GroupName string `json:"groupname,omitempty"` + LSNGroupIPSECALGProfileBinding []interface{} `json:"lsngroup_ipsecalgprofile_binding,omitempty"` + LSNGroupLSNAppsProfileBinding []interface{} `json:"lsngroup_lsnappsprofile_binding,omitempty"` + LSNGroupLSNHTTPHdrLogProfileBinding []interface{} `json:"lsngroup_lsnhttphdrlogprofile_binding,omitempty"` + LSNGroupLSNLogProfileBinding []interface{} `json:"lsngroup_lsnlogprofile_binding,omitempty"` + LSNGroupLSNPoolBinding []interface{} `json:"lsngroup_lsnpool_binding,omitempty"` + LSNGroupLSNRTSPALGProfileBinding []interface{} `json:"lsngroup_lsnrtspalgprofile_binding,omitempty"` + LSNGroupLSNSIPALGProfileBinding []interface{} `json:"lsngroup_lsnsipalgprofile_binding,omitempty"` + LSNGroupLSNTransportProfileBinding []interface{} `json:"lsngroup_lsntransportprofile_binding,omitempty"` + LSNGroupPCPServerBinding []interface{} `json:"lsngroup_pcpserver_binding,omitempty"` } -type LsnpoolBinding struct { - LsnpoolLsnipBinding []interface{} `json:"lsnpool_lsnip_binding,omitempty"` - Poolname string `json:"poolname,omitempty"` +type LSNPoolBinding struct { + LSNPoolLSNIPBinding []interface{} `json:"lsnpool_lsnip_binding,omitempty"` + PoolName string `json:"poolname,omitempty"` } -type Lsndeterministicnat struct { - Clientname string `json:"clientname,omitempty"` +type LSNDeterministicNAT struct { + ClientName string `json:"clientname,omitempty"` Count float64 `json:"__count,omitempty"` - Firstport int `json:"firstport,omitempty"` - Lastport int `json:"lastport,omitempty"` - Natip string `json:"natip,omitempty"` - Natip2 string `json:"natip2,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Nattype string `json:"nattype,omitempty"` + FirstPort int `json:"firstport,omitempty"` + LastPort int `json:"lastport,omitempty"` + NatIP string `json:"natip,omitempty"` + NatIP2 string `json:"natip2,omitempty"` + NatPrefix string `json:"natprefix,omitempty"` + NatType string `json:"nattype,omitempty"` Network6 string `json:"network6,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Srctd int `json:"srctd,omitempty"` - Subscrip string `json:"subscrip,omitempty"` - Subscrip2 string `json:"subscrip2,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SrcTD int `json:"srctd,omitempty"` + SubscrIP string `json:"subscrip,omitempty"` + SubscrIP2 string `json:"subscrip2,omitempty"` + TD int `json:"td,omitempty"` } -type LsngroupLsnappsprofileBinding struct { - Appsprofilename string `json:"appsprofilename,omitempty"` - Groupname string `json:"groupname,omitempty"` +type LSNGroupLSNAppsProfileBinding struct { + AppsProfileName string `json:"appsprofilename,omitempty"` + GroupName string `json:"groupname,omitempty"` } -type LsnsipalgcallBinding struct { - Callid string `json:"callid,omitempty"` - LsnsipalgcallControlchannelBinding []interface{} `json:"lsnsipalgcall_controlchannel_binding,omitempty"` - LsnsipalgcallDatachannelBinding []interface{} `json:"lsnsipalgcall_datachannel_binding,omitempty"` +type LSNSIPALGCallBinding struct { + CallID string `json:"callid,omitempty"` + LSNSIPALGCallControlChannelBinding []interface{} `json:"lsnsipalgcall_controlchannel_binding,omitempty"` + LSNSIPALGCallDataChannelBinding []interface{} `json:"lsnsipalgcall_datachannel_binding,omitempty"` } -type Lsnappsprofile struct { - Appsprofilename string `json:"appsprofilename,omitempty"` +type LSNAppsProfile struct { + AppsProfileName string `json:"appsprofilename,omitempty"` Count float64 `json:"__count,omitempty"` Filtering string `json:"filtering,omitempty"` - Ippooling string `json:"ippooling,omitempty"` - L2info string `json:"l2info,omitempty"` + IPPooling string `json:"ippooling,omitempty"` + L2Info string `json:"l2info,omitempty"` Mapping string `json:"mapping,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Tcpproxy string `json:"tcpproxy,omitempty"` - Td int `json:"td,omitempty"` - Transportprotocol string `json:"transportprotocol,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TCPProxy string `json:"tcpproxy,omitempty"` + TD int `json:"td,omitempty"` + TransportProtocol string `json:"transportprotocol,omitempty"` } -type Lsnhttphdrlogprofile struct { +type LSNHTTPHdrLogProfile struct { Count float64 `json:"__count,omitempty"` - Httphdrlogprofilename string `json:"httphdrlogprofilename,omitempty"` - Loghost string `json:"loghost,omitempty"` - Logmethod string `json:"logmethod,omitempty"` - Logurl string `json:"logurl,omitempty"` - Logversion string `json:"logversion,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type LsnsipalgcallControlchannelBinding struct { - Callid string `json:"callid,omitempty"` - Channelflags int `json:"channelflags,omitempty"` - Channelip string `json:"channelip,omitempty"` - Channelnatip string `json:"channelnatip,omitempty"` - Channelnatport int `json:"channelnatport,omitempty"` - Channelport int `json:"channelport,omitempty"` - Channelprotocol string `json:"channelprotocol,omitempty"` - Channeltimeout int `json:"channeltimeout,omitempty"` -} - -type LsngroupLsnpoolBinding struct { - Groupname string `json:"groupname,omitempty"` - Poolname string `json:"poolname,omitempty"` -} - -type Lsnsipalgcall struct { - Callflags int `json:"callflags,omitempty"` - Callid string `json:"callid,omitempty"` - Callrefcount int `json:"callrefcount,omitempty"` - Calltimer int `json:"calltimer,omitempty"` + HTTPHdrLogProfileName string `json:"httphdrlogprofilename,omitempty"` + LogHost string `json:"loghost,omitempty"` + LogMethod string `json:"logmethod,omitempty"` + LogURL string `json:"logurl,omitempty"` + LogVersion string `json:"logversion,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type LSNSIPALGCallControlChannelBinding struct { + CallID string `json:"callid,omitempty"` + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` +} + +type LSNGroupLSNPoolBinding struct { + GroupName string `json:"groupname,omitempty"` + PoolName string `json:"poolname,omitempty"` +} + +type LSNSIPALGCall struct { + CallFlags int `json:"callflags,omitempty"` + CallID string `json:"callid,omitempty"` + CallRefCount int `json:"callrefcount,omitempty"` + CallTimer int `json:"calltimer,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Xlatip string `json:"xlatip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + XlatIP string `json:"xlatip,omitempty"` } -type LsnpoolLsnipBinding struct { - Lsnip string `json:"lsnip,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Poolname string `json:"poolname,omitempty"` +type LSNPoolLSNIPBinding struct { + LSNIP string `json:"lsnip,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + PoolName string `json:"poolname,omitempty"` } -type Lsnrtspalgsession struct { - Callflags int `json:"callflags,omitempty"` - Callrefcount int `json:"callrefcount,omitempty"` - Calltimer int `json:"calltimer,omitempty"` +type LSNRTSPALGSession struct { + CallFlags int `json:"callflags,omitempty"` + CallRefCount int `json:"callrefcount,omitempty"` + CallTimer int `json:"calltimer,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Sessionid string `json:"sessionid,omitempty"` - Xlatip string `json:"xlatip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + SessionID string `json:"sessionid,omitempty"` + XlatIP string `json:"xlatip,omitempty"` } -type Lsnrtspalgprofile struct { +type LSNRTSPALGProfile struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Rtspalgprofilename string `json:"rtspalgprofilename,omitempty"` - Rtspidletimeout int `json:"rtspidletimeout,omitempty"` - Rtspportrange string `json:"rtspportrange,omitempty"` - Rtsptransportprotocol string `json:"rtsptransportprotocol,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RTSPALGProfileName string `json:"rtspalgprofilename,omitempty"` + RTSPIdleTimeout int `json:"rtspidletimeout,omitempty"` + RTSPPortRange string `json:"rtspportrange,omitempty"` + RTSPTransportProtocol string `json:"rtsptransportprotocol,omitempty"` } -type LsngroupPcpserverBinding struct { - Groupname string `json:"groupname,omitempty"` - Pcpserver string `json:"pcpserver,omitempty"` +type LSNGroupPCPServerBinding struct { + GroupName string `json:"groupname,omitempty"` + PCPServer string `json:"pcpserver,omitempty"` } -type LsnclientBinding struct { - Clientname string `json:"clientname,omitempty"` - LsnclientNetwork6Binding []interface{} `json:"lsnclient_network6_binding,omitempty"` - LsnclientNetworkBinding []interface{} `json:"lsnclient_network_binding,omitempty"` - LsnclientNsacl6Binding []interface{} `json:"lsnclient_nsacl6_binding,omitempty"` - LsnclientNsaclBinding []interface{} `json:"lsnclient_nsacl_binding,omitempty"` +type LSNClientBinding struct { + ClientName string `json:"clientname,omitempty"` + LSNClientNetwork6Binding []interface{} `json:"lsnclient_network6_binding,omitempty"` + LSNClientNetworkBinding []interface{} `json:"lsnclient_network_binding,omitempty"` + LSNClientNSACL6Binding []interface{} `json:"lsnclient_nsacl6_binding,omitempty"` + LSNClientNSACLBinding []interface{} `json:"lsnclient_nsacl_binding,omitempty"` } -type LsnrtspalgsessionDatachannelBinding struct { - Channelflags int `json:"channelflags,omitempty"` - Channelip string `json:"channelip,omitempty"` - Channelnatip string `json:"channelnatip,omitempty"` - Channelnatport int `json:"channelnatport,omitempty"` - Channelport int `json:"channelport,omitempty"` - Channelprotocol string `json:"channelprotocol,omitempty"` - Channeltimeout int `json:"channeltimeout,omitempty"` - Sessionid string `json:"sessionid,omitempty"` +type LSNRTSPALGSessionDataChannelBinding struct { + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` + SessionID string `json:"sessionid,omitempty"` } -type LsngroupLsnsipalgprofileBinding struct { - Groupname string `json:"groupname,omitempty"` - Sipalgprofilename string `json:"sipalgprofilename,omitempty"` +type LSNGroupLSNSIPALGProfileBinding struct { + GroupName string `json:"groupname,omitempty"` + SIPALGProfileName string `json:"sipalgprofilename,omitempty"` } diff --git a/nitrogo/models/metrics.go b/nitrogo/models/metrics.go index 23486a2..f81e486 100644 --- a/nitrogo/models/metrics.go +++ b/nitrogo/models/metrics.go @@ -1,84 +1,84 @@ package models // metrics configuration structs -type MetricsprofileAuthenticationvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileAuthenticationVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileVpnvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileVPNVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileGslbvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileGSLBVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileBinding struct { - MetricsprofileAuthenticationvserverBinding []interface{} `json:"metricsprofile_authenticationvserver_binding,omitempty"` - MetricsprofileCrvserverBinding []interface{} `json:"metricsprofile_crvserver_binding,omitempty"` - MetricsprofileCsvserverBinding []interface{} `json:"metricsprofile_csvserver_binding,omitempty"` - MetricsprofileGslbvserverBinding []interface{} `json:"metricsprofile_gslbvserver_binding,omitempty"` - MetricsprofileLbvserverBinding []interface{} `json:"metricsprofile_lbvserver_binding,omitempty"` - MetricsprofileServiceBinding []interface{} `json:"metricsprofile_service_binding,omitempty"` - MetricsprofileServicegroupBinding []interface{} `json:"metricsprofile_servicegroup_binding,omitempty"` - MetricsprofileUservserverBinding []interface{} `json:"metricsprofile_uservserver_binding,omitempty"` - MetricsprofileVpnvserverBinding []interface{} `json:"metricsprofile_vpnvserver_binding,omitempty"` +type MetricsProfileBinding struct { + MetricsProfileAuthenticationVServerBinding []interface{} `json:"metricsprofile_authenticationvserver_binding,omitempty"` + MetricsProfileCRVServerBinding []interface{} `json:"metricsprofile_crvserver_binding,omitempty"` + MetricsProfileCSVServerBinding []interface{} `json:"metricsprofile_csvserver_binding,omitempty"` + MetricsProfileGSLBVServerBinding []interface{} `json:"metricsprofile_gslbvserver_binding,omitempty"` + MetricsProfileLBVServerBinding []interface{} `json:"metricsprofile_lbvserver_binding,omitempty"` + MetricsProfileServiceBinding []interface{} `json:"metricsprofile_service_binding,omitempty"` + MetricsProfileServiceGroupBinding []interface{} `json:"metricsprofile_servicegroup_binding,omitempty"` + MetricsProfileUserVServerBinding []interface{} `json:"metricsprofile_uservserver_binding,omitempty"` + MetricsProfileVPNVServerBinding []interface{} `json:"metricsprofile_vpnvserver_binding,omitempty"` Name string `json:"name,omitempty"` } -type Metricsprofile struct { +type MetricsProfile struct { Collector string `json:"collector,omitempty"` Count float64 `json:"__count,omitempty"` Metrics string `json:"metrics,omitempty"` - Metricsauthtoken string `json:"metricsauthtoken,omitempty"` - Metricsendpointurl string `json:"metricsendpointurl,omitempty"` - Metricsexportfrequency int `json:"metricsexportfrequency,omitempty"` + MetricsAuthToken string `json:"metricsauthtoken,omitempty"` + MetricsEndpointURL string `json:"metricsendpointurl,omitempty"` + MetricsExportFrequency int `json:"metricsexportfrequency,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Outputmode string `json:"outputmode,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Schemafile string `json:"schemafile,omitempty"` - Servemode string `json:"servemode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OutputMode string `json:"outputmode,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + SchemaFile string `json:"schemafile,omitempty"` + ServeMode string `json:"servemode,omitempty"` } -type MetricsprofileCrvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileCRVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileLbvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileLBVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileCsvserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileCSVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileServicegroupBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileServiceGroupBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileServiceBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileServiceBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } -type MetricsprofileUservserverBinding struct { - Entityname string `json:"entityname,omitempty"` - Entitytype string `json:"entitytype,omitempty"` +type MetricsProfileUserVServerBinding struct { + EntityName string `json:"entityname,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/network.go b/nitrogo/models/network.go index ae16891..9b88be2 100644 --- a/nitrogo/models/network.go +++ b/nitrogo/models/network.go @@ -2,535 +2,535 @@ package models // network configuration structs type ChannelInterfaceBinding struct { - Id string `json:"id,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Lamode string `json:"lamode,omitempty"` - Lractiveintf int `json:"lractiveintf,omitempty"` - Slaveduplex int `json:"slaveduplex,omitempty"` - Slaveflowctl int `json:"slaveflowctl,omitempty"` - Slavemedia int `json:"slavemedia,omitempty"` - Slavespeed int `json:"slavespeed,omitempty"` - Slavestate int `json:"slavestate,omitempty"` - Slavetime int `json:"slavetime,omitempty"` - Svmcmd int `json:"svmcmd,omitempty"` -} - -type Mapdmr struct { - Bripv6prefix string `json:"bripv6prefix,omitempty"` + ID string `json:"id,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + LAMode string `json:"lamode,omitempty"` + LRActiveIntf int `json:"lractiveintf,omitempty"` + SlaveDuplex int `json:"slaveduplex,omitempty"` + SlaveFlowCtl int `json:"slaveflowctl,omitempty"` + SlaveMedia int `json:"slavemedia,omitempty"` + SlaveSpeed int `json:"slavespeed,omitempty"` + SlaveState int `json:"slavestate,omitempty"` + SlaveTime int `json:"slavetime,omitempty"` + SVMCmd int `json:"svmcmd,omitempty"` +} + +type MapDMR struct { + BRIPv6Prefix string `json:"bripv6prefix,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Rnat6Binding struct { +type RNAT6Binding struct { Name string `json:"name,omitempty"` - Rnat6Nsip6Binding []interface{} `json:"rnat6_nsip6_binding,omitempty"` + RNAT6NSIP6Binding []interface{} `json:"rnat6_nsip6_binding,omitempty"` } -type VlanNsip6Binding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type VLANNSIP6Binding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Td int `json:"td,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } -type Nd6ravariablesOnlinkipv6prefixBinding struct { - Ipv6prefix string `json:"ipv6prefix,omitempty"` - Vlan int `json:"vlan,omitempty"` +type ND6RAVariablesOnLinkIPv6PrefixBinding struct { + IPv6Prefix string `json:"ipv6prefix,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Ptp struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type PTP struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } -type RnatNsipBinding struct { +type RNATNSIPBinding struct { Name string `json:"name,omitempty"` - Natip string `json:"natip,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Td int `json:"td,omitempty"` + NatIP string `json:"natip,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } -type Vrid6 struct { +type VRID6 struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Effectivepriority int `json:"effectivepriority,omitempty"` + EffectivePriority int `json:"effectivepriority,omitempty"` Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Operationalownernode int `json:"operationalownernode,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + IFNum string `json:"ifnum,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OperationalOwnerNode int `json:"operationalownernode,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` Preemption string `json:"preemption,omitempty"` - Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + PreemptionDelayTimer int `json:"preemptiondelaytimer,omitempty"` Priority int `json:"priority,omitempty"` Sharing string `json:"sharing,omitempty"` State int `json:"state,omitempty"` - Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + TrackIFNumPriority int `json:"trackifnumpriority,omitempty"` Tracking string `json:"tracking,omitempty"` TypeField string `json:"type,omitempty"` } -type NetprofileNatruleBinding struct { +type NetProfileNATRuleBinding struct { Name string `json:"name,omitempty"` - Natrule string `json:"natrule,omitempty"` + NATRule string `json:"natrule,omitempty"` Netmask string `json:"netmask,omitempty"` - Rewriteip string `json:"rewriteip,omitempty"` + RewriteIP string `json:"rewriteip,omitempty"` } -type Iptunnel struct { +type IPTunnel struct { Channel int `json:"channel,omitempty"` Count float64 `json:"__count,omitempty"` - Destport int `json:"destport,omitempty"` - Encapip string `json:"encapip,omitempty"` - Grepayload string `json:"grepayload,omitempty"` - Ipsecprofilename string `json:"ipsecprofilename,omitempty"` - Ipsectunnelstatus string `json:"ipsectunnelstatus,omitempty"` + DestPort int `json:"destport,omitempty"` + EncapIP string `json:"encapip,omitempty"` + GREPayload string `json:"grepayload,omitempty"` + IPSECProfileName string `json:"ipsecprofilename,omitempty"` + IPSECTunnelStatus string `json:"ipsectunnelstatus,omitempty"` Local string `json:"local,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Protocol string `json:"protocol,omitempty"` - Refcnt int `json:"refcnt,omitempty"` + RefCnt int `json:"refcnt,omitempty"` Remote string `json:"remote,omitempty"` - Remotesubnetmask string `json:"remotesubnetmask,omitempty"` - Sysname string `json:"sysname,omitempty"` - Tosinherit string `json:"tosinherit,omitempty"` - Tunneltype []string `json:"tunneltype,omitempty"` + RemoteSubnetMask string `json:"remotesubnetmask,omitempty"` + SysName string `json:"sysname,omitempty"` + TOSInherit string `json:"tosinherit,omitempty"` + TunnelType []string `json:"tunneltype,omitempty"` TypeField int `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vlantagging string `json:"vlantagging,omitempty"` - Vnid int `json:"vnid,omitempty"` + VLAN int `json:"vlan,omitempty"` + VLANTagging string `json:"vlantagging,omitempty"` + VNID int `json:"vnid,omitempty"` } -type NetprofileSrcportsetBinding struct { +type NetProfileSrcPortSetBinding struct { Name string `json:"name,omitempty"` - Srcportrange string `json:"srcportrange,omitempty"` -} - -type L2param struct { - Bdggrpproxyarp string `json:"bdggrpproxyarp,omitempty"` - Bdgsetting string `json:"bdgsetting,omitempty"` - Bridgeagetimeout int `json:"bridgeagetimeout,omitempty"` - Garponvridintf string `json:"garponvridintf,omitempty"` - Garpreply string `json:"garpreply,omitempty"` - Macmodefwdmypkt string `json:"macmodefwdmypkt,omitempty"` - Maxbridgecollision int `json:"maxbridgecollision,omitempty"` - Mbfinstlearning string `json:"mbfinstlearning,omitempty"` - Mbfpeermacupdate int `json:"mbfpeermacupdate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Proxyarp string `json:"proxyarp,omitempty"` - Returntoethernetsender string `json:"returntoethernetsender,omitempty"` - Rstintfonhafo string `json:"rstintfonhafo,omitempty"` - Skipproxyingbsdtraffic string `json:"skipproxyingbsdtraffic,omitempty"` - Stopmacmoveupdate string `json:"stopmacmoveupdate,omitempty"` - Usemymac string `json:"usemymac,omitempty"` - Usenetprofilebsdtraffic string `json:"usenetprofilebsdtraffic,omitempty"` -} - -type Nd6ravariablesBinding struct { - Nd6ravariablesOnlinkipv6prefixBinding []interface{} `json:"nd6ravariables_onlinkipv6prefix_binding,omitempty"` - Vlan int `json:"vlan,omitempty"` -} - -type Bridgegroup struct { + SrcPortRange string `json:"srcportrange,omitempty"` +} + +type L2Param struct { + BdgGrpProxyARP string `json:"bdggrpproxyarp,omitempty"` + BdgSetting string `json:"bdgsetting,omitempty"` + BridgeAgeTimeout int `json:"bridgeagetimeout,omitempty"` + GARPOnVRIDIntf string `json:"garponvridintf,omitempty"` + GARPReply string `json:"garpreply,omitempty"` + MacModeFwdMyPkt string `json:"macmodefwdmypkt,omitempty"` + MaxBridgeCollision int `json:"maxbridgecollision,omitempty"` + MBFInstLearning string `json:"mbfinstlearning,omitempty"` + MBFPeerMACUpdate int `json:"mbfpeermacupdate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProxyARP string `json:"proxyarp,omitempty"` + ReturnToEthernetSender string `json:"returntoethernetsender,omitempty"` + RstIntfOnHAFO string `json:"rstintfonhafo,omitempty"` + SkipProxyingBSDTraffic string `json:"skipproxyingbsdtraffic,omitempty"` + StopMACMoveUpdate string `json:"stopmacmoveupdate,omitempty"` + UseMyMAC string `json:"usemymac,omitempty"` + UseNetProfileBSDTraffic string `json:"usenetprofilebsdtraffic,omitempty"` +} + +type ND6RAVariablesBinding struct { + ND6RAVariablesOnLinkIPv6PrefixBinding []interface{} `json:"nd6ravariables_onlinkipv6prefix_binding,omitempty"` + VLAN int `json:"vlan,omitempty"` +} + +type BridgeGroup struct { Count float64 `json:"__count,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` Flags bool `json:"flags,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Portbitmap int `json:"portbitmap,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Tagbitmap int `json:"tagbitmap,omitempty"` - Tagifaces string `json:"tagifaces,omitempty"` + IPv6DynamicRouting string `json:"ipv6dynamicrouting,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + PortBitmap int `json:"portbitmap,omitempty"` + RNAT bool `json:"rnat,omitempty"` + TagBitmap int `json:"tagbitmap,omitempty"` + TagIfaces string `json:"tagifaces,omitempty"` } -type IpsetNsip6Binding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type IPSetNSIP6Binding struct { + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` } -type Vrid6ChannelBinding struct { +type VRID6ChannelBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } type ChannelBinding struct { ChannelInterfaceBinding []interface{} `json:"channel_interface_binding,omitempty"` - Id string `json:"id,omitempty"` + ID string `json:"id,omitempty"` } -type Rnat6 struct { - Acl6name string `json:"acl6name,omitempty"` +type RNAT6 struct { + ACL6Name string `json:"acl6name,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Redirectport int `json:"redirectport,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RedirectPort int `json:"redirectport,omitempty"` + SrcIPPersistency string `json:"srcippersistency,omitempty"` + TD int `json:"td,omitempty"` } -type BridgegroupNsip6Binding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type BridgeGroupNSIP6Binding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Td int `json:"td,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RNAT bool `json:"rnat,omitempty"` + TD int `json:"td,omitempty"` } -type BridgegroupVlanBinding struct { - Id int `json:"id,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Vlan int `json:"vlan,omitempty"` +type BridgeGroupVLANBinding struct { + ID int `json:"id,omitempty"` + RNAT bool `json:"rnat,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Nd6ravariables struct { - Ceaserouteradv string `json:"ceaserouteradv,omitempty"` +type ND6RAVariables struct { + CeaseRouterAdv string `json:"ceaserouteradv,omitempty"` Count float64 `json:"__count,omitempty"` - Currhoplimit int `json:"currhoplimit,omitempty"` - Defaultlifetime int `json:"defaultlifetime,omitempty"` - Lastrtadvtime int `json:"lastrtadvtime,omitempty"` - Linkmtu int `json:"linkmtu,omitempty"` - Managedaddrconfig string `json:"managedaddrconfig,omitempty"` - Maxrtadvinterval int `json:"maxrtadvinterval,omitempty"` - Minrtadvinterval int `json:"minrtadvinterval,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nextrtadvdelay int `json:"nextrtadvdelay,omitempty"` - Onlyunicastrtadvresponse string `json:"onlyunicastrtadvresponse,omitempty"` - Otheraddrconfig string `json:"otheraddrconfig,omitempty"` - Reachabletime int `json:"reachabletime,omitempty"` - Retranstime int `json:"retranstime,omitempty"` - Sendrouteradv string `json:"sendrouteradv,omitempty"` - Srclinklayeraddroption string `json:"srclinklayeraddroption,omitempty"` - Vlan int `json:"vlan,omitempty"` -} - -type VridNsipBinding struct { + CurrHopLimit int `json:"currhoplimit,omitempty"` + DefaultLifetime int `json:"defaultlifetime,omitempty"` + LastRtAdvTime int `json:"lastrtadvtime,omitempty"` + LinkMTU int `json:"linkmtu,omitempty"` + ManagedAddrConfig string `json:"managedaddrconfig,omitempty"` + MaxRtAdvInterval int `json:"maxrtadvinterval,omitempty"` + MinRtAdvInterval int `json:"minrtadvinterval,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextRtAdvDelay int `json:"nextrtadvdelay,omitempty"` + OnlyUnicastRtAdvResponse string `json:"onlyunicastrtadvresponse,omitempty"` + OtherAddrConfig string `json:"otheraddrconfig,omitempty"` + ReachableTime int `json:"reachabletime,omitempty"` + RetransTime int `json:"retranstime,omitempty"` + SendRouterAdv string `json:"sendrouteradv,omitempty"` + SrcLinkLayerAddrOption string `json:"srclinklayeraddroption,omitempty"` + VLAN int `json:"vlan,omitempty"` +} + +type VRIDNSIPBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } -type VlanInterfaceBinding struct { - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` +type VLANInterfaceBinding struct { + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Tagged bool `json:"tagged,omitempty"` } -type Ip6tunnelparam struct { - Dropfrag string `json:"dropfrag,omitempty"` - Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srciproundrobin string `json:"srciproundrobin,omitempty"` - Useclientsourceipv6 string `json:"useclientsourceipv6,omitempty"` +type IP6TunnelParam struct { + DropFrag string `json:"dropfrag,omitempty"` + DropFragCPUThreshold int `json:"dropfragcputhreshold,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcIPRoundRobin string `json:"srciproundrobin,omitempty"` + UseClientSourceIP string `json:"useclientsourceipv6,omitempty"` } -type Vrid6TrackinterfaceBinding struct { +type VRID6TrackInterfaceBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Trackifnum string `json:"trackifnum,omitempty"` + ID int `json:"id,omitempty"` + TrackIFNum string `json:"trackifnum,omitempty"` } -type RnatglobalAuditsyslogpolicyBinding struct { +type RNATGlobalAuditSyslogPolicyBinding struct { All bool `json:"all,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` } -type Arpparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Spoofvalidation string `json:"spoofvalidation,omitempty"` +type ARPParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SpoofValidation string `json:"spoofvalidation,omitempty"` Timeout int `json:"timeout,omitempty"` } type Channel struct { - Actflowctl string `json:"actflowctl,omitempty"` - Actspeed string `json:"actspeed,omitempty"` - Actthroughput int `json:"actthroughput,omitempty"` - Actualmtu int `json:"actualmtu,omitempty"` + ActFlowCtl string `json:"actflowctl,omitempty"` + ActSpeed string `json:"actspeed,omitempty"` + ActThroughput int `json:"actthroughput,omitempty"` + ActualMTU int `json:"actualmtu,omitempty"` Autoneg int `json:"autoneg,omitempty"` - Autonegresult int `json:"autonegresult,omitempty"` + AutonegResult int `json:"autonegresult,omitempty"` Backplane string `json:"backplane,omitempty"` - Bandwidthhigh int `json:"bandwidthhigh,omitempty"` - Bandwidthnormal int `json:"bandwidthnormal,omitempty"` - Bdgmuted int `json:"bdgmuted,omitempty"` - Cleartime int `json:"cleartime,omitempty"` - Conndistr string `json:"conndistr,omitempty"` + BandwidthHigh int `json:"bandwidthhigh,omitempty"` + BandwidthNormal int `json:"bandwidthnormal,omitempty"` + BdgMuted int `json:"bdgmuted,omitempty"` + ClearTime int `json:"cleartime,omitempty"` + ConnDistr string `json:"conndistr,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Devicename string `json:"devicename,omitempty"` + DeviceName string `json:"devicename,omitempty"` Downtime int `json:"downtime,omitempty"` Duplex string `json:"duplex,omitempty"` - Fctls int `json:"fctls,omitempty"` + FCtls int `json:"fctls,omitempty"` Flags int `json:"flags,omitempty"` - Flowctl string `json:"flowctl,omitempty"` - Haheartbeat string `json:"haheartbeat,omitempty"` - Hamonitor string `json:"hamonitor,omitempty"` - Hangdetect int `json:"hangdetect,omitempty"` - Hangreset int `json:"hangreset,omitempty"` + FlowCtl string `json:"flowctl,omitempty"` + HAHeartbeat string `json:"haheartbeat,omitempty"` + HAMonitor string `json:"hamonitor,omitempty"` + HangDetect int `json:"hangdetect,omitempty"` + HangReset int `json:"hangreset,omitempty"` Hangs int `json:"hangs,omitempty"` - Id string `json:"id,omitempty"` - Ifalias string `json:"ifalias,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Indisc int `json:"indisc,omitempty"` - Intfstate int `json:"intfstate,omitempty"` - Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` - Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` - Lacpactordistributing string `json:"lacpactordistributing,omitempty"` - Lacpactorinsync string `json:"lacpactorinsync,omitempty"` - Lacpactorportno int `json:"lacpactorportno,omitempty"` - Lacpactorpriority int `json:"lacpactorpriority,omitempty"` - Lacpmode string `json:"lacpmode,omitempty"` - Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` - Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` - Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` - Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` - Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` - Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` - Lacppartnerkey int `json:"lacppartnerkey,omitempty"` - Lacppartnerportno int `json:"lacppartnerportno,omitempty"` - Lacppartnerpriority int `json:"lacppartnerpriority,omitempty"` - Lacppartnerstate string `json:"lacppartnerstate,omitempty"` - Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` - Lacppartnersystempriority int `json:"lacppartnersystempriority,omitempty"` - Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` - Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` - Lacpportrxstat string `json:"lacpportrxstat,omitempty"` - Lacpportselectstate string `json:"lacpportselectstate,omitempty"` - Lacptimeout string `json:"lacptimeout,omitempty"` - Lamac string `json:"lamac,omitempty"` - Lamode string `json:"lamode,omitempty"` - Linkredundancy string `json:"linkredundancy,omitempty"` - Linkstate int `json:"linkstate,omitempty"` - Lldpmode string `json:"lldpmode,omitempty"` - Lrminthroughput int `json:"lrminthroughput,omitempty"` - Mac string `json:"mac,omitempty"` - Macdistr string `json:"macdistr,omitempty"` + ID string `json:"id,omitempty"` + IFAlias string `json:"ifalias,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + InDisc int `json:"indisc,omitempty"` + IntfState int `json:"intfstate,omitempty"` + LACPActorAggregation string `json:"lacpactoraggregation,omitempty"` + LACPActorCollecting string `json:"lacpactorcollecting,omitempty"` + LACPActorDistributing string `json:"lacpactordistributing,omitempty"` + LACPActorInSync string `json:"lacpactorinsync,omitempty"` + LACPActorPortNo int `json:"lacpactorportno,omitempty"` + LACPActorPriority int `json:"lacpactorpriority,omitempty"` + LACPMode string `json:"lacpmode,omitempty"` + LACPPartnerAggregation string `json:"lacppartneraggregation,omitempty"` + LACPPartnerCollecting string `json:"lacppartnercollecting,omitempty"` + LACPPartnerDefaulted string `json:"lacppartnerdefaulted,omitempty"` + LACPPartnerDistributing string `json:"lacppartnerdistributing,omitempty"` + LACPPartnerExpired string `json:"lacppartnerexpired,omitempty"` + LACPPartnerInSync string `json:"lacppartnerinsync,omitempty"` + LACPPartnerKey int `json:"lacppartnerkey,omitempty"` + LACPPartnerPortNo int `json:"lacppartnerportno,omitempty"` + LACPPartnerPriority int `json:"lacppartnerpriority,omitempty"` + LACPPartnerState string `json:"lacppartnerstate,omitempty"` + LACPPartnerSystemMAC string `json:"lacppartnersystemmac,omitempty"` + LACPPartnerSystemPriority int `json:"lacppartnersystempriority,omitempty"` + LACPPartnerTimeout string `json:"lacppartnertimeout,omitempty"` + LACPPortMuxState string `json:"lacpportmuxstate,omitempty"` + LACPPortRxStat string `json:"lacpportrxstat,omitempty"` + LACPPortSelectState string `json:"lacpportselectstate,omitempty"` + LACPTimeout string `json:"lacptimeout,omitempty"` + LAMAC string `json:"lamac,omitempty"` + LAMode string `json:"lamode,omitempty"` + LinkRedundancy string `json:"linkredundancy,omitempty"` + LinkState int `json:"linkstate,omitempty"` + LLDPMode string `json:"lldpmode,omitempty"` + LRMinThroughput int `json:"lrminthroughput,omitempty"` + MAC string `json:"mac,omitempty"` + MACDistr string `json:"macdistr,omitempty"` Media string `json:"media,omitempty"` Mode string `json:"mode,omitempty"` - Mtu int `json:"mtu,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Outdisc int `json:"outdisc,omitempty"` - Reqduplex string `json:"reqduplex,omitempty"` - Reqflowcontrol string `json:"reqflowcontrol,omitempty"` - Reqmedia string `json:"reqmedia,omitempty"` - Reqspeed string `json:"reqspeed,omitempty"` - Reqthroughput int `json:"reqthroughput,omitempty"` - Rxbytes int `json:"rxbytes,omitempty"` - Rxdrops int `json:"rxdrops,omitempty"` - Rxerrors int `json:"rxerrors,omitempty"` - Rxpackets int `json:"rxpackets,omitempty"` - Rxstalls int `json:"rxstalls,omitempty"` + MTU int `json:"mtu,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OutDisc int `json:"outdisc,omitempty"` + ReqDuplex string `json:"reqduplex,omitempty"` + ReqFlowControl string `json:"reqflowcontrol,omitempty"` + ReqMedia string `json:"reqmedia,omitempty"` + ReqSpeed string `json:"reqspeed,omitempty"` + ReqThroughput int `json:"reqthroughput,omitempty"` + RxBytes int `json:"rxbytes,omitempty"` + RxDrops int `json:"rxdrops,omitempty"` + RxErrors int `json:"rxerrors,omitempty"` + RxPackets int `json:"rxpackets,omitempty"` + RxStalls int `json:"rxstalls,omitempty"` Speed string `json:"speed,omitempty"` State string `json:"state,omitempty"` - Stsstalls int `json:"stsstalls,omitempty"` - Tagall string `json:"tagall,omitempty"` + StsStalls int `json:"stsstalls,omitempty"` + TagAll string `json:"tagall,omitempty"` Tagged int `json:"tagged,omitempty"` - Taggedany int `json:"taggedany,omitempty"` - Taggedautolearn int `json:"taggedautolearn,omitempty"` + TaggedAny int `json:"taggedany,omitempty"` + TaggedAutoLearn int `json:"taggedautolearn,omitempty"` Throughput int `json:"throughput,omitempty"` Trunk string `json:"trunk,omitempty"` - Txbytes int `json:"txbytes,omitempty"` - Txdrops int `json:"txdrops,omitempty"` - Txerrors int `json:"txerrors,omitempty"` - Txpackets int `json:"txpackets,omitempty"` - Txstalls int `json:"txstalls,omitempty"` + TxBytes int `json:"txbytes,omitempty"` + TxDrops int `json:"txdrops,omitempty"` + TxErrors int `json:"txerrors,omitempty"` + TxPackets int `json:"txpackets,omitempty"` + TxStalls int `json:"txstalls,omitempty"` Unit int `json:"unit,omitempty"` Uptime int `json:"uptime,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vmac string `json:"vmac,omitempty"` - Vmac6 string `json:"vmac6,omitempty"` + VLAN int `json:"vlan,omitempty"` + VMAC string `json:"vmac,omitempty"` + VMAC6 string `json:"vmac6,omitempty"` } -type Netprofile struct { - Badipactionthreshold int `json:"badipactionthreshold,omitempty"` +type NetProfile struct { + BadIPActionThreshold int `json:"badipactionthreshold,omitempty"` Count float64 `json:"__count,omitempty"` - Mbf string `json:"mbf,omitempty"` + MBF string `json:"mbf,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overridelsn string `json:"overridelsn,omitempty"` - Proxyprotocol string `json:"proxyprotocol,omitempty"` - Proxyprotocolaftertlshandshake string `json:"proxyprotocolaftertlshandshake,omitempty"` - Proxyprotocoltlvoptions []string `json:"proxyprotocoltlvoptions,omitempty"` - Proxyprotocoltxversion string `json:"proxyprotocoltxversion,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Td int `json:"td,omitempty"` -} - -type VxlanNsipBinding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OverrideLSN string `json:"overridelsn,omitempty"` + ProxyProtocol string `json:"proxyprotocol,omitempty"` + ProxyProtocolAfterTLSHandshake string `json:"proxyprotocolaftertlshandshake,omitempty"` + ProxyProtocolTLVOptions []string `json:"proxyprotocoltlvoptions,omitempty"` + ProxyProtocolTxVersion string `json:"proxyprotocoltxversion,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcIPPersistency string `json:"srcippersistency,omitempty"` + TD int `json:"td,omitempty"` +} + +type VXLANNSIPBinding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` } -type Rnat struct { - Aclname string `json:"aclname,omitempty"` - Connfailover string `json:"connfailover,omitempty"` +type RNAT struct { + ACLName string `json:"aclname,omitempty"` + ConnFailover string `json:"connfailover,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Natip string `json:"natip,omitempty"` + NatIP string `json:"natip,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Redirectport int `json:"redirectport,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Td int `json:"td,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RedirectPort int `json:"redirectport,omitempty"` + SrcIPPersistency string `json:"srcippersistency,omitempty"` + TD int `json:"td,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` } -type Appalgparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pptpgreidletimeout int `json:"pptpgreidletimeout,omitempty"` +type AppALGParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PPTPGREIdleTimeout int `json:"pptpgreidletimeout,omitempty"` } -type Iptunnelparam struct { - Dropfrag string `json:"dropfrag,omitempty"` - Dropfragcputhreshold int `json:"dropfragcputhreshold,omitempty"` - Enablestrictrx string `json:"enablestrictrx,omitempty"` - Enablestricttx string `json:"enablestricttx,omitempty"` - Mac string `json:"mac,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srciproundrobin string `json:"srciproundrobin,omitempty"` - Useclientsourceip string `json:"useclientsourceip,omitempty"` +type IPTunnelParam struct { + DropFrag string `json:"dropfrag,omitempty"` + DropFragCPUThreshold int `json:"dropfragcputhreshold,omitempty"` + EnableStrictRx string `json:"enablestrictrx,omitempty"` + EnableStrictTx string `json:"enablestricttx,omitempty"` + MAC string `json:"mac,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcIPRoundRobin string `json:"srciproundrobin,omitempty"` + UseClientSourceIP string `json:"useclientsourceip,omitempty"` } -type VridNsip6Binding struct { +type VRIDNSIP6Binding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } -type BridgegroupBinding struct { - BridgegroupNsip6Binding []interface{} `json:"bridgegroup_nsip6_binding,omitempty"` - BridgegroupNsipBinding []interface{} `json:"bridgegroup_nsip_binding,omitempty"` - BridgegroupVlanBinding []interface{} `json:"bridgegroup_vlan_binding,omitempty"` - Id int `json:"id,omitempty"` +type BridgeGroupBinding struct { + BridgeGroupNSIP6Binding []interface{} `json:"bridgegroup_nsip6_binding,omitempty"` + BridgeGroupNSIPBinding []interface{} `json:"bridgegroup_nsip_binding,omitempty"` + BridgeGroupVLANBinding []interface{} `json:"bridgegroup_vlan_binding,omitempty"` + ID int `json:"id,omitempty"` } -type Ipset struct { +type IPSet struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TD int `json:"td,omitempty"` } -type Arp struct { +type ARP struct { All bool `json:"all,omitempty"` Channel int `json:"channel,omitempty"` - Controlplane bool `json:"controlplane,omitempty"` + ControlPlane bool `json:"controlplane,omitempty"` Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Mac string `json:"mac,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + IFNum string `json:"ifnum,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + MAC string `json:"mac,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` State int `json:"state,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` Timeout int `json:"timeout,omitempty"` TypeField string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vtep string `json:"vtep,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VTEP string `json:"vtep,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Inatparam struct { +type INATParam struct { Count float64 `json:"__count,omitempty"` - Nat46fragheader string `json:"nat46fragheader,omitempty"` - Nat46ignoretos string `json:"nat46ignoretos,omitempty"` - Nat46v6mtu int `json:"nat46v6mtu,omitempty"` - Nat46v6prefix string `json:"nat46v6prefix,omitempty"` - Nat46zerochecksum string `json:"nat46zerochecksum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Td int `json:"td,omitempty"` -} - -type L3param struct { - Acllogtime int `json:"acllogtime,omitempty"` - Allowclasseipv4 string `json:"allowclasseipv4,omitempty"` - Dropdfflag string `json:"dropdfflag,omitempty"` - Dropipfragments string `json:"dropipfragments,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Externalloopback string `json:"externalloopback,omitempty"` - Forwardicmpfragments string `json:"forwardicmpfragments,omitempty"` - Icmpgenratethreshold int `json:"icmpgenratethreshold,omitempty"` - Implicitaclallow string `json:"implicitaclallow,omitempty"` - Implicitpbr string `json:"implicitpbr,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Miproundrobin string `json:"miproundrobin,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Overridernat string `json:"overridernat,omitempty"` - Srcnat string `json:"srcnat,omitempty"` - Tnlpmtuwoconn string `json:"tnlpmtuwoconn,omitempty"` - Usipserverstraypkt string `json:"usipserverstraypkt,omitempty"` -} - -type Nat64param struct { + Nat46FragHeader string `json:"nat46fragheader,omitempty"` + Nat46IgnoreTOS string `json:"nat46ignoretos,omitempty"` + Nat46V6MTU int `json:"nat46v6mtu,omitempty"` + Nat46V6Prefix string `json:"nat46v6prefix,omitempty"` + Nat46ZeroChecksum string `json:"nat46zerochecksum,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TD int `json:"td,omitempty"` +} + +type L3Param struct { + ACLLogTime int `json:"acllogtime,omitempty"` + AllowClassEIPv4 string `json:"allowclasseipv4,omitempty"` + DropDFFlag string `json:"dropdfflag,omitempty"` + DropIPFragments string `json:"dropipfragments,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` + ExternalLoopback string `json:"externalloopback,omitempty"` + ForwardICMPFragments string `json:"forwardicmpfragments,omitempty"` + ICMPGenRateThreshold int `json:"icmpgenratethreshold,omitempty"` + ImplicitACLAllow string `json:"implicitaclallow,omitempty"` + ImplicitPBR string `json:"implicitpbr,omitempty"` + IPv6DynamicRouting string `json:"ipv6dynamicrouting,omitempty"` + MIPRoundRobin string `json:"miproundrobin,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OverrideRNAT string `json:"overridernat,omitempty"` + SrcNat string `json:"srcnat,omitempty"` + TNLPmtuWOConn string `json:"tnlpmtuwoconn,omitempty"` + USIPServerStrayPkt string `json:"usipserverstraypkt,omitempty"` +} + +type NAT64Param struct { Count float64 `json:"__count,omitempty"` - Nat64fragheader string `json:"nat64fragheader,omitempty"` - Nat64ignoretos string `json:"nat64ignoretos,omitempty"` - Nat64v6mtu int `json:"nat64v6mtu,omitempty"` - Nat64zerochecksum string `json:"nat64zerochecksum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Td int `json:"td,omitempty"` + Nat64FragHeader string `json:"nat64fragheader,omitempty"` + Nat64IgnoreTOS string `json:"nat64ignoretos,omitempty"` + Nat64V6MTU int `json:"nat64v6mtu,omitempty"` + Nat64ZeroChecksum string `json:"nat64zerochecksum,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TD int `json:"td,omitempty"` } -type Lacp struct { - Clustermac string `json:"clustermac,omitempty"` - Clustersyspriority int `json:"clustersyspriority,omitempty"` +type LACP struct { + ClusterMAC string `json:"clustermac,omitempty"` + ClusterSysPriority int `json:"clustersyspriority,omitempty"` Count float64 `json:"__count,omitempty"` - Devicename string `json:"devicename,omitempty"` + DeviceName string `json:"devicename,omitempty"` Flags int `json:"flags,omitempty"` - Lacpkey int `json:"lacpkey,omitempty"` - Mac string `json:"mac,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Syspriority int `json:"syspriority,omitempty"` + LACPKey int `json:"lacpkey,omitempty"` + MAC string `json:"mac,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + SysPriority int `json:"syspriority,omitempty"` } -type Mapdomain struct { +type MapDomain struct { Count float64 `json:"__count,omitempty"` - Mapdmrname string `json:"mapdmrname,omitempty"` + MapDMRName string `json:"mapdmrname,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Forwardingsession struct { - Acl6name string `json:"acl6name,omitempty"` - Aclname string `json:"aclname,omitempty"` - Connfailover string `json:"connfailover,omitempty"` +type ForwardingSession struct { + ACL6Name string `json:"acl6name,omitempty"` + ACLName string `json:"aclname,omitempty"` + ConnFailover string `json:"connfailover,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Processlocal string `json:"processlocal,omitempty"` - Sourceroutecache string `json:"sourceroutecache,omitempty"` - Td int `json:"td,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + SourceRouteCache string `json:"sourceroutecache,omitempty"` + TD int `json:"td,omitempty"` } type Route6 struct { Active bool `json:"active,omitempty"` Advertise string `json:"advertise,omitempty"` - Bgp bool `json:"bgp,omitempty"` + BGP bool `json:"bgp,omitempty"` Connected bool `json:"connected,omitempty"` Cost int `json:"cost,omitempty"` Count float64 `json:"__count,omitempty"` @@ -539,721 +539,723 @@ type Route6 struct { Detail bool `json:"detail,omitempty"` Distance int `json:"distance,omitempty"` Dynamic bool `json:"dynamic,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` + FailedProbes int `json:"failedprobes,omitempty"` Flags bool `json:"flags,omitempty"` Gateway string `json:"gateway,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Isis bool `json:"isis,omitempty"` + GatewayName string `json:"gatewayname,omitempty"` + ISIS bool `json:"isis,omitempty"` Mgmt bool `json:"mgmt,omitempty"` Monitor string `json:"monitor,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Msr string `json:"msr,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MSR string `json:"msr,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ospfv3 bool `json:"ospfv3,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OSPFv3 bool `json:"ospfv3,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Permanent bool `json:"permanent,omitempty"` - Raroute bool `json:"raroute,omitempty"` + RARoute bool `json:"raroute,omitempty"` Retain int `json:"retain,omitempty"` - Rip bool `json:"rip,omitempty"` - Routeowners []string `json:"routeowners,omitempty"` - Routetype string `json:"routetype,omitempty"` + RIP bool `json:"rip,omitempty"` + RouteOwners []string `json:"routeowners,omitempty"` + RouteType string `json:"routetype,omitempty"` State int `json:"state,omitempty"` Static bool `json:"Static,omitempty"` - Td int `json:"td,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Totalprobes int `json:"totalprobes,omitempty"` + TD int `json:"td,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` + TotalProbes int `json:"totalprobes,omitempty"` TypeField bool `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` Weight int `json:"weight,omitempty"` } -type VlanLinksetBinding struct { - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` +type VLANLinkSetBinding struct { + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Tagged bool `json:"tagged,omitempty"` } -type VlanChannelBinding struct { - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` +type VLANChannelBinding struct { + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Tagged bool `json:"tagged,omitempty"` } -type FisBinding struct { - FisChannelBinding []interface{} `json:"fis_channel_binding,omitempty"` +type FISBinding struct { + FISChannelBinding []interface{} `json:"fis_channel_binding,omitempty"` Name string `json:"name,omitempty"` } -type VxlanIptunnelBinding struct { - Id int `json:"id,omitempty"` +type VXLANIPTunnelBinding struct { + ID int `json:"id,omitempty"` Tunnel string `json:"tunnel,omitempty"` } -type NetprofileBinding struct { +type NetProfileBinding struct { Name string `json:"name,omitempty"` - NetprofileNatruleBinding []interface{} `json:"netprofile_natrule_binding,omitempty"` - NetprofileSrcportsetBinding []interface{} `json:"netprofile_srcportset_binding,omitempty"` + NetProfileNATRuleBinding []interface{} `json:"netprofile_natrule_binding,omitempty"` + NetProfileSrcPortSetBinding []interface{} `json:"netprofile_srcportset_binding,omitempty"` } -type VxlanvlanmapVxlanBinding struct { +type VXLANVLANMapVXLANBinding struct { Name string `json:"name,omitempty"` - Vlan []string `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN []string `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Netbridge struct { +type NetBridge struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + VXLANVLANMap string `json:"vxlanvlanmap,omitempty"` } -type Vridparam struct { - Deadinterval int `json:"deadinterval,omitempty"` - Hellointerval int `json:"hellointerval,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sendtomaster string `json:"sendtomaster,omitempty"` +type VRIDParam struct { + DeadInterval int `json:"deadinterval,omitempty"` + HelloInterval int `json:"hellointerval,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SendToMaster string `json:"sendtomaster,omitempty"` } -type VxlanSrcipBinding struct { - Id int `json:"id,omitempty"` - Srcip string `json:"srcip,omitempty"` +type VXLANSrcIPBinding struct { + ID int `json:"id,omitempty"` + SrcIP string `json:"srcip,omitempty"` } -type IpsetBinding struct { - IpsetNsip6Binding []interface{} `json:"ipset_nsip6_binding,omitempty"` - IpsetNsipBinding []interface{} `json:"ipset_nsip_binding,omitempty"` +type IPSetBinding struct { + IPSetNSIP6Binding []interface{} `json:"ipset_nsip6_binding,omitempty"` + IPSetNSIPBinding []interface{} `json:"ipset_nsip_binding,omitempty"` Name string `json:"name,omitempty"` } -type Nat64 struct { - Acl6name string `json:"acl6name,omitempty"` +type NAT64 struct { + ACL6Name string `json:"acl6name,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Rnatsession struct { - Aclname string `json:"aclname,omitempty"` - Natip string `json:"natip,omitempty"` +type RNATSession struct { + ACLName string `json:"aclname,omitempty"` + NatIP string `json:"natip,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` } -type Vxlan struct { +type VXLAN struct { Count float64 `json:"__count,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Id int `json:"id,omitempty"` - Innervlantagging string `json:"innervlantagging,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionname string `json:"partitionname,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` + ID int `json:"id,omitempty"` + InnerVLANTagging string `json:"innervlantagging,omitempty"` + IPv6DynamicRouting string `json:"ipv6dynamicrouting,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionName string `json:"partitionname,omitempty"` Port int `json:"port,omitempty"` Protocol string `json:"protocol,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` TypeField string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type FisInterfaceBinding struct { - Ifnum string `json:"ifnum,omitempty"` +type FISInterfaceBinding struct { + IFNum string `json:"ifnum,omitempty"` Name string `json:"name,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } -type VridChannelBinding struct { +type VRIDChannelBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type VridBinding struct { - Id int `json:"id,omitempty"` - VridChannelBinding []interface{} `json:"vrid_channel_binding,omitempty"` - VridInterfaceBinding []interface{} `json:"vrid_interface_binding,omitempty"` - VridNsip6Binding []interface{} `json:"vrid_nsip6_binding,omitempty"` - VridNsipBinding []interface{} `json:"vrid_nsip_binding,omitempty"` - VridTrackinterfaceBinding []interface{} `json:"vrid_trackinterface_binding,omitempty"` +type VRIDBinding struct { + ID int `json:"id,omitempty"` + VRIDChannelBinding []interface{} `json:"vrid_channel_binding,omitempty"` + VRIDInterfaceBinding []interface{} `json:"vrid_interface_binding,omitempty"` + VRIDNSIP6Binding []interface{} `json:"vrid_nsip6_binding,omitempty"` + VRIDNSIPBinding []interface{} `json:"vrid_nsip_binding,omitempty"` + VRIDTrackInterfaceBinding []interface{} `json:"vrid_trackinterface_binding,omitempty"` } -type NetbridgeIptunnelBinding struct { +type NetBridgeIPTunnelBinding struct { Name string `json:"name,omitempty"` Tunnel string `json:"tunnel,omitempty"` } -type IpsetNsipBinding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type IPSetNSIPBinding struct { + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` } -type VlanNsipBinding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type VLANNSIPBinding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Td int `json:"td,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } -type LinksetInterfaceBinding struct { - Id string `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` +type LinkSetInterfaceBinding struct { + ID string `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` } -type VridTrackinterfaceBinding struct { +type VRIDTrackInterfaceBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Trackifnum string `json:"trackifnum,omitempty"` + ID int `json:"id,omitempty"` + TrackIFNum string `json:"trackifnum,omitempty"` } -type Vrid6Binding struct { - Id int `json:"id,omitempty"` - Vrid6ChannelBinding []interface{} `json:"vrid6_channel_binding,omitempty"` - Vrid6InterfaceBinding []interface{} `json:"vrid6_interface_binding,omitempty"` - Vrid6Nsip6Binding []interface{} `json:"vrid6_nsip6_binding,omitempty"` - Vrid6NsipBinding []interface{} `json:"vrid6_nsip_binding,omitempty"` - Vrid6TrackinterfaceBinding []interface{} `json:"vrid6_trackinterface_binding,omitempty"` +type VRID6Binding struct { + ID int `json:"id,omitempty"` + VRID6ChannelBinding []interface{} `json:"vrid6_channel_binding,omitempty"` + VRID6InterfaceBinding []interface{} `json:"vrid6_interface_binding,omitempty"` + VRID6NSIP6Binding []interface{} `json:"vrid6_nsip6_binding,omitempty"` + VRID6NSIPBinding []interface{} `json:"vrid6_nsip_binding,omitempty"` + VRID6TrackInterfaceBinding []interface{} `json:"vrid6_trackinterface_binding,omitempty"` } -type NetbridgeNsipBinding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type NetBridgeNSIPBinding struct { + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` } -type Rsskeytype struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Rsstype string `json:"rsstype,omitempty"` +type RSSKeyType struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RSSType string `json:"rsstype,omitempty"` } -type MapbmrBmrv4networkBinding struct { +type MapBMRBMRV4NetworkBinding struct { Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` } -type Rnat6Nsip6Binding struct { +type RNAT6NSIP6Binding struct { Name string `json:"name,omitempty"` - Natip6 string `json:"natip6,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Td int `json:"td,omitempty"` + NatIP6 string `json:"natip6,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } type Route struct { Adv bool `json:"adv,omitempty"` - Advbgp bool `json:"advbgp,omitempty"` + AdvBGP bool `json:"advbgp,omitempty"` Advertise string `json:"advertise,omitempty"` - Advisis bool `json:"advisis,omitempty"` - Advospf bool `json:"advospf,omitempty"` - Advrip bool `json:"advrip,omitempty"` - Bgp bool `json:"bgp,omitempty"` + AdvISIS bool `json:"advisis,omitempty"` + AdvOSPF bool `json:"advospf,omitempty"` + AdvRIP bool `json:"advrip,omitempty"` + BGP bool `json:"bgp,omitempty"` Cost int `json:"cost,omitempty"` Cost1 int `json:"cost1,omitempty"` Count float64 `json:"__count,omitempty"` Data bool `json:"data,omitempty"` Data0 bool `json:"data0,omitempty"` Detail bool `json:"detail,omitempty"` - Dhcp bool `json:"dhcp,omitempty"` + DHCP bool `json:"dhcp,omitempty"` Direct bool `json:"direct,omitempty"` Distance int `json:"distance,omitempty"` Dynamic bool `json:"dynamic,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` + FailedProbes int `json:"failedprobes,omitempty"` Flags bool `json:"flags,omitempty"` Gateway string `json:"gateway,omitempty"` - Gatewayname string `json:"gatewayname,omitempty"` - Isis bool `json:"isis,omitempty"` - Lbroute bool `json:"lbroute,omitempty"` + GatewayName string `json:"gatewayname,omitempty"` + ISIS bool `json:"isis,omitempty"` + LBRoute bool `json:"lbroute,omitempty"` Mgmt bool `json:"mgmt,omitempty"` Monitor string `json:"monitor,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Msr string `json:"msr,omitempty"` - Nat bool `json:"nat,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MSR string `json:"msr,omitempty"` + NAT bool `json:"nat,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ospf bool `json:"ospf,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OSPF bool `json:"ospf,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Permanent bool `json:"permanent,omitempty"` Protocol []string `json:"protocol,omitempty"` Retain int `json:"retain,omitempty"` - Rip bool `json:"rip,omitempty"` - Routeowners []string `json:"routeowners,omitempty"` - Routetype string `json:"routetype,omitempty"` + RIP bool `json:"rip,omitempty"` + RouteOwners []string `json:"routeowners,omitempty"` + RouteType string `json:"routetype,omitempty"` State int `json:"state,omitempty"` Static bool `json:"Static,omitempty"` - Td int `json:"td,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Totalprobes int `json:"totalprobes,omitempty"` + TD int `json:"td,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` + TotalProbes int `json:"totalprobes,omitempty"` Tunnel bool `json:"tunnel,omitempty"` TypeField bool `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` + VLAN int `json:"vlan,omitempty"` Weight int `json:"weight,omitempty"` } -type NetbridgeBinding struct { +type NetBridgeBinding struct { Name string `json:"name,omitempty"` - NetbridgeIptunnelBinding []interface{} `json:"netbridge_iptunnel_binding,omitempty"` - NetbridgeNsip6Binding []interface{} `json:"netbridge_nsip6_binding,omitempty"` - NetbridgeNsipBinding []interface{} `json:"netbridge_nsip_binding,omitempty"` - NetbridgeVlanBinding []interface{} `json:"netbridge_vlan_binding,omitempty"` + NetBridgeIPTunnelBinding []interface{} `json:"netbridge_iptunnel_binding,omitempty"` + NetBridgeNSIP6Binding []interface{} `json:"netbridge_nsip6_binding,omitempty"` + NetBridgeNSIPBinding []interface{} `json:"netbridge_nsip_binding,omitempty"` + NetBridgeVLANBinding []interface{} `json:"netbridge_vlan_binding,omitempty"` } -type LinksetChannelBinding struct { - Id string `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` +type LinkSetChannelBinding struct { + ID string `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` } -type Ip6tunnel struct { +type IP6Tunnel struct { Count float64 `json:"__count,omitempty"` - Encapip string `json:"encapip,omitempty"` + EncapIP string `json:"encapip,omitempty"` Local string `json:"local,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Remote string `json:"remote,omitempty"` - Remoteip string `json:"remoteip,omitempty"` + RemoteIP string `json:"remoteip,omitempty"` TypeField int `json:"type,omitempty"` } -type L4param struct { - L2connmethod string `json:"l2connmethod,omitempty"` - L4switch string `json:"l4switch,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type L4Param struct { + L2ConnMethod string `json:"l2connmethod,omitempty"` + L4Switch string `json:"l4switch,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Vxlanvlanmap struct { +type VXLANVLANMap struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type MapbmrBinding struct { - MapbmrBmrv4networkBinding []interface{} `json:"mapbmr_bmrv4network_binding,omitempty"` +type MapBMRBinding struct { + MapBMRBMRV4NetworkBinding []interface{} `json:"mapbmr_bmrv4network_binding,omitempty"` Name string `json:"name,omitempty"` } -type VridInterfaceBinding struct { +type VRIDInterfaceBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Bridgetable struct { - Bridgeage int `json:"bridgeage,omitempty"` +type BridgeTable struct { + BridgeAge int `json:"bridgeage,omitempty"` Channel int `json:"channel,omitempty"` - Controlplane bool `json:"controlplane,omitempty"` + ControlPlane bool `json:"controlplane,omitempty"` Count float64 `json:"__count,omitempty"` - Devicevlan int `json:"devicevlan,omitempty"` + DeviceVLAN int `json:"devicevlan,omitempty"` Flags int `json:"flags,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Mac string `json:"mac,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + IFNum string `json:"ifnum,omitempty"` + MAC string `json:"mac,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` TypeField string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vni int `json:"vni,omitempty"` - Vtep string `json:"vtep,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VNI int `json:"vni,omitempty"` + VTEP string `json:"vtep,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type VxlanvlanmapBinding struct { +type VXLANVLANMapBinding struct { Name string `json:"name,omitempty"` - VxlanvlanmapVxlanBinding []interface{} `json:"vxlanvlanmap_vxlan_binding,omitempty"` + VXLANVLANMapVXLANBinding []interface{} `json:"vxlanvlanmap_vxlan_binding,omitempty"` } -type Vrid struct { +type VRID struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Effectivepriority int `json:"effectivepriority,omitempty"` + EffectivePriority int `json:"effectivepriority,omitempty"` Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Operationalownernode int `json:"operationalownernode,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OperationalOwnerNode int `json:"operationalownernode,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` Preemption string `json:"preemption,omitempty"` - Preemptiondelaytimer int `json:"preemptiondelaytimer,omitempty"` + PreemptionDelayTimer int `json:"preemptiondelaytimer,omitempty"` Priority int `json:"priority,omitempty"` Sharing string `json:"sharing,omitempty"` State int `json:"state,omitempty"` - Trackifnumpriority int `json:"trackifnumpriority,omitempty"` + TrackIFNumPriority int `json:"trackifnumpriority,omitempty"` Tracking string `json:"tracking,omitempty"` TypeField string `json:"type,omitempty"` } -type NetbridgeNsip6Binding struct { - Ipaddress string `json:"ipaddress,omitempty"` +type NetBridgeNSIP6Binding struct { + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` } -type Inat struct { - Connfailover string `json:"connfailover,omitempty"` +type INAT struct { + ConnFailover string `json:"connfailover,omitempty"` Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Ftp string `json:"ftp,omitempty"` + FTP string `json:"ftp,omitempty"` Mode string `json:"mode,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Privateip string `json:"privateip,omitempty"` - Proxyip string `json:"proxyip,omitempty"` - Publicip string `json:"publicip,omitempty"` - Tcpproxy string `json:"tcpproxy,omitempty"` - Td int `json:"td,omitempty"` - Tftp string `json:"tftp,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` - Usip string `json:"usip,omitempty"` - Usnip string `json:"usnip,omitempty"` -} - -type RnatRetainsourceportsetBinding struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PrivateIP string `json:"privateip,omitempty"` + ProxyIP string `json:"proxyip,omitempty"` + PublicIP string `json:"publicip,omitempty"` + TCPProxy string `json:"tcpproxy,omitempty"` + TD int `json:"td,omitempty"` + TFTP string `json:"tftp,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` + USIP string `json:"usip,omitempty"` + USNIP string `json:"usnip,omitempty"` +} + +type RNATRetainSourcePortSetBinding struct { Name string `json:"name,omitempty"` - Retainsourceportrange string `json:"retainsourceportrange,omitempty"` + RetainSourcePortRange string `json:"retainsourceportrange,omitempty"` } -type Vlan struct { - Aliasname string `json:"aliasname,omitempty"` +type VLAN struct { + AliasName string `json:"aliasname,omitempty"` Count float64 `json:"__count,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Id int `json:"id,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Ipv6dynamicrouting string `json:"ipv6dynamicrouting,omitempty"` - Linklocalipv6addr string `json:"linklocalipv6addr,omitempty"` - Lsbitmap int `json:"lsbitmap,omitempty"` - Lstagbitmap int `json:"lstagbitmap,omitempty"` - Mtu int `json:"mtu,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Portbitmap int `json:"portbitmap,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Sdxvlan string `json:"sdxvlan,omitempty"` + IFNum string `json:"ifnum,omitempty"` + IPv6DynamicRouting string `json:"ipv6dynamicrouting,omitempty"` + LinkLocalIPv6Addr string `json:"linklocalipv6addr,omitempty"` + LSBitmap int `json:"lsbitmap,omitempty"` + LSTagBitmap int `json:"lstagbitmap,omitempty"` + MTU int `json:"mtu,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + PortBitmap int `json:"portbitmap,omitempty"` + RNAT bool `json:"rnat,omitempty"` + SDXVLAN string `json:"sdxvlan,omitempty"` Sharing string `json:"sharing,omitempty"` - Tagbitmap int `json:"tagbitmap,omitempty"` + TagBitmap int `json:"tagbitmap,omitempty"` Tagged bool `json:"tagged,omitempty"` - Tagifaces string `json:"tagifaces,omitempty"` - Vlantd int `json:"vlantd,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + TagIfaces string `json:"tagifaces,omitempty"` + VLANTD int `json:"vlantd,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Portallocation struct { +type PortAllocation struct { Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Freeports int `json:"freeports,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + FreePorts int `json:"freeports,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Protocol int `json:"protocol,omitempty"` - Srcip string `json:"srcip,omitempty"` + SrcIP string `json:"srcip,omitempty"` } -type Rnatparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Srcippersistency string `json:"srcippersistency,omitempty"` - Tcpproxy string `json:"tcpproxy,omitempty"` +type RNATParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SrcIPPersistency string `json:"srcippersistency,omitempty"` + TCPProxy string `json:"tcpproxy,omitempty"` } -type Vrid6Nsip6Binding struct { +type VRID6NSIP6Binding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } -type VxlanNsip6Binding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type VXLANNSIP6Binding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` } -type VlanBinding struct { - Id int `json:"id,omitempty"` - VlanChannelBinding []interface{} `json:"vlan_channel_binding,omitempty"` - VlanInterfaceBinding []interface{} `json:"vlan_interface_binding,omitempty"` - VlanLinksetBinding []interface{} `json:"vlan_linkset_binding,omitempty"` - VlanNsip6Binding []interface{} `json:"vlan_nsip6_binding,omitempty"` - VlanNsipBinding []interface{} `json:"vlan_nsip_binding,omitempty"` +type VLANBinding struct { + ID int `json:"id,omitempty"` + VLANChannelBinding []interface{} `json:"vlan_channel_binding,omitempty"` + VLANInterfaceBinding []interface{} `json:"vlan_interface_binding,omitempty"` + VLANLinkSetBinding []interface{} `json:"vlan_linkset_binding,omitempty"` + VLANNSIP6Binding []interface{} `json:"vlan_nsip6_binding,omitempty"` + VLANNSIPBinding []interface{} `json:"vlan_nsip_binding,omitempty"` } -type RnatBinding struct { +type RNATBinding struct { Name string `json:"name,omitempty"` - RnatNsipBinding []interface{} `json:"rnat_nsip_binding,omitempty"` - RnatRetainsourceportsetBinding []interface{} `json:"rnat_retainsourceportset_binding,omitempty"` + RNATNSIPBinding []interface{} `json:"rnat_nsip_binding,omitempty"` + RNATRetainSourcePortSetBinding []interface{} `json:"rnat_retainsourceportset_binding,omitempty"` } -type NetbridgeVlanBinding struct { +type NetBridgeVLANBinding struct { Name string `json:"name,omitempty"` - Vlan int `json:"vlan,omitempty"` + VLAN int `json:"vlan,omitempty"` } type Interface struct { - Actduplex string `json:"actduplex,omitempty"` - Actflowctl string `json:"actflowctl,omitempty"` - Actmedia string `json:"actmedia,omitempty"` - Actspeed string `json:"actspeed,omitempty"` - Actthroughput int `json:"actthroughput,omitempty"` - Actualmtu int `json:"actualmtu,omitempty"` - Actualringsize int `json:"actualringsize,omitempty"` + ActDuplex string `json:"actduplex,omitempty"` + ActFlowCtl string `json:"actflowctl,omitempty"` + ActMedia string `json:"actmedia,omitempty"` + ActSpeed string `json:"actspeed,omitempty"` + ActThroughput int `json:"actthroughput,omitempty"` + ActualMTU int `json:"actualmtu,omitempty"` + ActualRingSize int `json:"actualringsize,omitempty"` Autoneg string `json:"autoneg,omitempty"` - Autonegresult int `json:"autonegresult,omitempty"` + AutonegResult int `json:"autonegresult,omitempty"` Backplane string `json:"backplane,omitempty"` - Bandwidthhigh int `json:"bandwidthhigh,omitempty"` - Bandwidthnormal int `json:"bandwidthnormal,omitempty"` - Bdgmacmoved int `json:"bdgmacmoved,omitempty"` - Bdgmuted int `json:"bdgmuted,omitempty"` - Cleartime int `json:"cleartime,omitempty"` + BandwidthHigh int `json:"bandwidthhigh,omitempty"` + BandwidthNormal int `json:"bandwidthnormal,omitempty"` + BdgMacMoved int `json:"bdgmacmoved,omitempty"` + BdgMuted int `json:"bdgmuted,omitempty"` + ClearTime int `json:"cleartime,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Devicename string `json:"devicename,omitempty"` + DeviceName string `json:"devicename,omitempty"` Downtime int `json:"downtime,omitempty"` Duplex string `json:"duplex,omitempty"` - Fctls int `json:"fctls,omitempty"` + FCtls int `json:"fctls,omitempty"` Flags int `json:"flags,omitempty"` - Flowctl string `json:"flowctl,omitempty"` - Haheartbeat string `json:"haheartbeat,omitempty"` - Hamonitor string `json:"hamonitor,omitempty"` - Hangdetect int `json:"hangdetect,omitempty"` - Hangreset int `json:"hangreset,omitempty"` + FlowCtl string `json:"flowctl,omitempty"` + HAHeartbeat string `json:"haheartbeat,omitempty"` + HAMonitor string `json:"hamonitor,omitempty"` + HangDetect int `json:"hangdetect,omitempty"` + HangReset int `json:"hangreset,omitempty"` Hangs int `json:"hangs,omitempty"` - Id string `json:"id,omitempty"` - Ifalias string `json:"ifalias,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Indisc int `json:"indisc,omitempty"` - Intfstate int `json:"intfstate,omitempty"` - Intftype string `json:"intftype,omitempty"` - Lacpactoraggregation string `json:"lacpactoraggregation,omitempty"` - Lacpactorcollecting string `json:"lacpactorcollecting,omitempty"` - Lacpactordistributing string `json:"lacpactordistributing,omitempty"` - Lacpactorinsync string `json:"lacpactorinsync,omitempty"` - Lacpactormode string `json:"lacpactormode,omitempty"` - Lacpactorportno int `json:"lacpactorportno,omitempty"` - Lacpactorpriority int `json:"lacpactorpriority,omitempty"` - Lacpactortimeout string `json:"lacpactortimeout,omitempty"` - Lacpkey int `json:"lacpkey,omitempty"` - Lacpmode string `json:"lacpmode,omitempty"` - Lacppartneraggregation string `json:"lacppartneraggregation,omitempty"` - Lacppartnercollecting string `json:"lacppartnercollecting,omitempty"` - Lacppartnerdefaulted string `json:"lacppartnerdefaulted,omitempty"` - Lacppartnerdistributing string `json:"lacppartnerdistributing,omitempty"` - Lacppartnerexpired string `json:"lacppartnerexpired,omitempty"` - Lacppartnerinsync string `json:"lacppartnerinsync,omitempty"` - Lacppartnerkey int `json:"lacppartnerkey,omitempty"` - Lacppartnerportno int `json:"lacppartnerportno,omitempty"` - Lacppartnerpriority int `json:"lacppartnerpriority,omitempty"` - Lacppartnerstate string `json:"lacppartnerstate,omitempty"` - Lacppartnersystemmac string `json:"lacppartnersystemmac,omitempty"` - Lacppartnersystempriority int `json:"lacppartnersystempriority,omitempty"` - Lacppartnertimeout string `json:"lacppartnertimeout,omitempty"` - Lacpportmuxstate string `json:"lacpportmuxstate,omitempty"` - Lacpportrxstat string `json:"lacpportrxstat,omitempty"` - Lacpportselectstate string `json:"lacpportselectstate,omitempty"` - Lacppriority int `json:"lacppriority,omitempty"` - Lacptimeout string `json:"lacptimeout,omitempty"` - Lagtype string `json:"lagtype,omitempty"` - Linkredundancy string `json:"linkredundancy,omitempty"` - Linkstate int `json:"linkstate,omitempty"` - Lldpmode string `json:"lldpmode,omitempty"` - Lractiveintf int `json:"lractiveintf,omitempty"` - Lrsetpriority int `json:"lrsetpriority,omitempty"` - Mac string `json:"mac,omitempty"` + ID string `json:"id,omitempty"` + IFAlias string `json:"ifalias,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + InDisc int `json:"indisc,omitempty"` + IntfState int `json:"intfstate,omitempty"` + IntfType string `json:"intftype,omitempty"` + LACPActorAggregation string `json:"lacpactoraggregation,omitempty"` + LACPActorCollecting string `json:"lacpactorcollecting,omitempty"` + LACPActorDistributing string `json:"lacpactordistributing,omitempty"` + LACPActorInSync string `json:"lacpactorinsync,omitempty"` + LACPActorMode string `json:"lacpactormode,omitempty"` + LACPActorPortNo int `json:"lacpactorportno,omitempty"` + LACPActorPriority int `json:"lacpactorpriority,omitempty"` + LACPActorTimeout string `json:"lacpactortimeout,omitempty"` + LACPKey int `json:"lacpkey,omitempty"` + LACPMode string `json:"lacpmode,omitempty"` + LACPPartnerAggregation string `json:"lacppartneraggregation,omitempty"` + LACPPartnerCollecting string `json:"lacppartnercollecting,omitempty"` + LACPPartnerDefaulted string `json:"lacppartnerdefaulted,omitempty"` + LACPPartnerDistributing string `json:"lacppartnerdistributing,omitempty"` + LACPPartnerExpired string `json:"lacppartnerexpired,omitempty"` + LACPPartnerInSync string `json:"lacppartnerinsync,omitempty"` + LACPPartnerKey int `json:"lacppartnerkey,omitempty"` + LACPPartnerPortNo int `json:"lacppartnerportno,omitempty"` + LACPPartnerPriority int `json:"lacppartnerpriority,omitempty"` + LACPPartnerState string `json:"lacppartnerstate,omitempty"` + LACPPartnerSystemMAC string `json:"lacppartnersystemmac,omitempty"` + LACPPartnerSystemPriority int `json:"lacppartnersystempriority,omitempty"` + LACPPartnerTimeout string `json:"lacppartnertimeout,omitempty"` + LACPPortMuxState string `json:"lacpportmuxstate,omitempty"` + LACPPortRxStat string `json:"lacpportrxstat,omitempty"` + LACPPortSelectState string `json:"lacpportselectstate,omitempty"` + LACPPriority int `json:"lacppriority,omitempty"` + LACPTimeout string `json:"lacptimeout,omitempty"` + LAGType string `json:"lagtype,omitempty"` + LinkRedundancy string `json:"linkredundancy,omitempty"` + LinkState int `json:"linkstate,omitempty"` + LLDPMode string `json:"lldpmode,omitempty"` + LRActiveIntf int `json:"lractiveintf,omitempty"` + LRSetPriority int `json:"lrsetpriority,omitempty"` + MAC string `json:"mac,omitempty"` + MACDistr string `json:"macdistr,omitempty"` + Media string `json:"media,omitempty"` Mode string `json:"mode,omitempty"` - Mtu int `json:"mtu,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Outdisc int `json:"outdisc,omitempty"` - Reqduplex string `json:"reqduplex,omitempty"` - Reqflowcontrol string `json:"reqflowcontrol,omitempty"` - Reqmedia string `json:"reqmedia,omitempty"` - Reqspeed string `json:"reqspeed,omitempty"` - Reqthroughput int `json:"reqthroughput,omitempty"` - Ringsize int `json:"ringsize,omitempty"` - Ringtype string `json:"ringtype,omitempty"` - Rxbytes int `json:"rxbytes,omitempty"` - Rxdrops int `json:"rxdrops,omitempty"` - Rxerrors int `json:"rxerrors,omitempty"` - Rxpackets int `json:"rxpackets,omitempty"` - Rxstalls int `json:"rxstalls,omitempty"` - Slaveduplex int `json:"slaveduplex,omitempty"` - Slaveflowctl int `json:"slaveflowctl,omitempty"` - Slavemedia int `json:"slavemedia,omitempty"` - Slavespeed int `json:"slavespeed,omitempty"` - Slavestate int `json:"slavestate,omitempty"` - Slavetime int `json:"slavetime,omitempty"` + MTU int `json:"mtu,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OutDisc int `json:"outdisc,omitempty"` + ReqDuplex string `json:"reqduplex,omitempty"` + ReqFlowControl string `json:"reqflowcontrol,omitempty"` + ReqMedia string `json:"reqmedia,omitempty"` + ReqSpeed string `json:"reqspeed,omitempty"` + ReqThroughput int `json:"reqthroughput,omitempty"` + RingSize int `json:"ringsize,omitempty"` + RingType string `json:"ringtype,omitempty"` + RxBytes int `json:"rxbytes,omitempty"` + RxDrops int `json:"rxdrops,omitempty"` + RxErrors int `json:"rxerrors,omitempty"` + RxPackets int `json:"rxpackets,omitempty"` + RxStalls int `json:"rxstalls,omitempty"` + SlaveDuplex int `json:"slaveduplex,omitempty"` + SlaveFlowCtl int `json:"slaveflowctl,omitempty"` + SlaveMedia int `json:"slavemedia,omitempty"` + SlaveSpeed int `json:"slavespeed,omitempty"` + SlaveState int `json:"slavestate,omitempty"` + SlaveTime int `json:"slavetime,omitempty"` Speed string `json:"speed,omitempty"` State string `json:"state,omitempty"` - Stsstalls int `json:"stsstalls,omitempty"` - Svmcmd int `json:"svmcmd,omitempty"` - Tagall string `json:"tagall,omitempty"` + StsStalls int `json:"stsstalls,omitempty"` + SVMCmd int `json:"svmcmd,omitempty"` + TagAll string `json:"tagall,omitempty"` Tagged int `json:"tagged,omitempty"` - Taggedany int `json:"taggedany,omitempty"` - Taggedautolearn int `json:"taggedautolearn,omitempty"` + TaggedAny int `json:"taggedany,omitempty"` + TaggedAutoLearn int `json:"taggedautolearn,omitempty"` Throughput int `json:"throughput,omitempty"` Trunk string `json:"trunk,omitempty"` - Trunkallowedvlan []string `json:"trunkallowedvlan,omitempty"` - Trunkmode string `json:"trunkmode,omitempty"` - Txbytes int `json:"txbytes,omitempty"` - Txdrops int `json:"txdrops,omitempty"` - Txerrors int `json:"txerrors,omitempty"` - Txpackets int `json:"txpackets,omitempty"` - Txstalls int `json:"txstalls,omitempty"` + TrunkAllowedVLAN []string `json:"trunkallowedvlan,omitempty"` + TrunkMode string `json:"trunkmode,omitempty"` + TxBytes int `json:"txbytes,omitempty"` + TxDrops int `json:"txdrops,omitempty"` + TxErrors int `json:"txerrors,omitempty"` + TxPackets int `json:"txpackets,omitempty"` + TxStalls int `json:"txstalls,omitempty"` Unit int `json:"unit,omitempty"` Uptime int `json:"uptime,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vmac string `json:"vmac,omitempty"` - Vmac6 string `json:"vmac6,omitempty"` + VLAN int `json:"vlan,omitempty"` + VMAC string `json:"vmac,omitempty"` + VMAC6 string `json:"vmac6,omitempty"` } -type Nd6 struct { +type ND6 struct { Channel int `json:"channel,omitempty"` - Controlplane bool `json:"controlplane,omitempty"` + ControlPlane bool `json:"controlplane,omitempty"` Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Mac string `json:"mac,omitempty"` + IFNum string `json:"ifnum,omitempty"` + MAC string `json:"mac,omitempty"` Neighbor string `json:"neighbor,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` State string `json:"state,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` Timeout int `json:"timeout,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vtep string `json:"vtep,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VTEP string `json:"vtep,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Interfacepair struct { +type InterfacePair struct { Count float64 `json:"__count,omitempty"` - Id int `json:"id,omitempty"` + ID int `json:"id,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Mapbmr struct { +type MapBMR struct { Count float64 `json:"__count,omitempty"` - Eabitlength int `json:"eabitlength,omitempty"` + EABitLength int `json:"eabitlength,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Psidlength int `json:"psidlength,omitempty"` - Psidoffset int `json:"psidoffset,omitempty"` - Ruleipv6prefix string `json:"ruleipv6prefix,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PSIDLength int `json:"psidlength,omitempty"` + PSIDOffset int `json:"psidoffset,omitempty"` + RuleIPv6Prefix string `json:"ruleipv6prefix,omitempty"` } type VxlanBinding struct { - Id int `json:"id,omitempty"` - VxlanIptunnelBinding []interface{} `json:"vxlan_iptunnel_binding,omitempty"` - VxlanNsip6Binding []interface{} `json:"vxlan_nsip6_binding,omitempty"` - VxlanNsipBinding []interface{} `json:"vxlan_nsip_binding,omitempty"` - VxlanSrcipBinding []interface{} `json:"vxlan_srcip_binding,omitempty"` + ID int `json:"id,omitempty"` + VxlanIPTunnelBinding []interface{} `json:"vxlan_iptunnel_binding,omitempty"` + VxlanNSIP6Binding []interface{} `json:"vxlan_nsip6_binding,omitempty"` + VxlanNSIPBinding []interface{} `json:"vxlan_nsip_binding,omitempty"` + VxlanSrcIPBinding []interface{} `json:"vxlan_srcip_binding,omitempty"` } -type Fis struct { +type FIS struct { Count float64 `json:"__count,omitempty"` Ifaces string `json:"ifaces,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } -type Linkset struct { +type LinkSet struct { Count float64 `json:"__count,omitempty"` - Id string `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + ID string `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type BridgegroupNsipBinding struct { - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type BridgeGroupNSIPBinding struct { + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` - Rnat bool `json:"rnat,omitempty"` - Td int `json:"td,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RNAT bool `json:"rnat,omitempty"` + TD int `json:"td,omitempty"` } -type Onlinkipv6prefix struct { - Autonomusprefix string `json:"autonomusprefix,omitempty"` +type OnLinkIPv6Prefix struct { + AutonomusPrefix string `json:"autonomusprefix,omitempty"` Count float64 `json:"__count,omitempty"` - Decrementprefixlifetimes string `json:"decrementprefixlifetimes,omitempty"` - Depricateprefix string `json:"depricateprefix,omitempty"` - Ipv6prefix string `json:"ipv6prefix,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Onlinkprefix string `json:"onlinkprefix,omitempty"` - Prefixcurrpreferredlft int `json:"prefixcurrpreferredlft,omitempty"` - Prefixcurrvalidelft int `json:"prefixcurrvalidelft,omitempty"` - Prefixpreferredlifetime int `json:"prefixpreferredlifetime,omitempty"` - Prefixvalidelifetime int `json:"prefixvalidelifetime,omitempty"` -} - -type Vrid6NsipBinding struct { + DecrementPrefixLifetimes string `json:"decrementprefixlifetimes,omitempty"` + DepricatePrefix string `json:"depricateprefix,omitempty"` + IPv6Prefix string `json:"ipv6prefix,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OnLinkPrefix string `json:"onlinkprefix,omitempty"` + PrefixCurrPreferredLft int `json:"prefixcurrpreferredlft,omitempty"` + PrefixCurrValidLft int `json:"prefixcurrvalidelft,omitempty"` + PrefixPreferredLifetime int `json:"prefixpreferredlifetime,omitempty"` + PrefixValidLifetime int `json:"prefixvalidelifetime,omitempty"` +} + +type VRID6NSIPBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } -type Ci struct { +type CI struct { Count float64 `json:"__count,omitempty"` Ifaces string `json:"ifaces,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Ipv6 struct { - Basereachtime int `json:"basereachtime,omitempty"` +type IPv6 struct { + BaseReachTime int `json:"basereachtime,omitempty"` Count float64 `json:"__count,omitempty"` - Dodad string `json:"dodad,omitempty"` - Natprefix string `json:"natprefix,omitempty"` - Ndbasereachtime int `json:"ndbasereachtime,omitempty"` - Ndreachtime int `json:"ndreachtime,omitempty"` - Ndretransmissiontime int `json:"ndretransmissiontime,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ralearning string `json:"ralearning,omitempty"` - Reachtime int `json:"reachtime,omitempty"` - Retransmissiontime int `json:"retransmissiontime,omitempty"` - Routerredirection string `json:"routerredirection,omitempty"` - Td int `json:"td,omitempty"` - Usipnatprefix string `json:"usipnatprefix,omitempty"` -} - -type LinksetBinding struct { - Id string `json:"id,omitempty"` - LinksetChannelBinding []interface{} `json:"linkset_channel_binding,omitempty"` - LinksetInterfaceBinding []interface{} `json:"linkset_interface_binding,omitempty"` -} - -type Vrid6InterfaceBinding struct { + DODAD string `json:"dodad,omitempty"` + NatPrefix string `json:"natprefix,omitempty"` + NDBaseReachTime int `json:"ndbasereachtime,omitempty"` + NDReachTime int `json:"ndreachtime,omitempty"` + NDRetransmissionTime int `json:"ndretransmissiontime,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RALearning string `json:"ralearning,omitempty"` + ReachTime int `json:"reachtime,omitempty"` + RetransmissionTime int `json:"retransmissiontime,omitempty"` + RouterRedirection string `json:"routerredirection,omitempty"` + TD int `json:"td,omitempty"` + USIPNatPrefix string `json:"usipnatprefix,omitempty"` +} + +type LinkSetBinding struct { + ID string `json:"id,omitempty"` + LinkSetChannelBinding []interface{} `json:"linkset_channel_binding,omitempty"` + LinkSetInterfaceBinding []interface{} `json:"linkset_interface_binding,omitempty"` +} + +type VRID6InterfaceBinding struct { Flags int `json:"flags,omitempty"` - Id int `json:"id,omitempty"` - Ifnum string `json:"ifnum,omitempty"` - Vlan int `json:"vlan,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type RnatglobalBinding struct { - RnatglobalAuditsyslogpolicyBinding []interface{} `json:"rnatglobal_auditsyslogpolicy_binding,omitempty"` +type RNATGlobalBinding struct { + RNATGlobalAuditSyslogPolicyBinding []interface{} `json:"rnatglobal_auditsyslogpolicy_binding,omitempty"` } -type FisChannelBinding struct { - Ifnum string `json:"ifnum,omitempty"` +type FISChannelBinding struct { + IFNum string `json:"ifnum,omitempty"` Name string `json:"name,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } -type MapdomainBinding struct { - MapdomainMapbmrBinding []interface{} `json:"mapdomain_mapbmr_binding,omitempty"` +type MapDomainBinding struct { + MapDomainMapBMRBinding []interface{} `json:"mapdomain_mapbmr_binding,omitempty"` Name string `json:"name,omitempty"` } -type MapdomainMapbmrBinding struct { - Mapbmrname string `json:"mapbmrname,omitempty"` +type MapDomainMapBMRBinding struct { + MapBMRName string `json:"mapbmrname,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/ns.go b/nitrogo/models/ns.go index 73eb53f..b564297 100644 --- a/nitrogo/models/ns.go +++ b/nitrogo/models/ns.go @@ -1,775 +1,775 @@ package models // ns configuration structs -type Nspbr struct { +type NSPBR struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate int `json:"curstate,omitempty"` + CurState int `json:"curstate,omitempty"` Data bool `json:"data,omitempty"` - Destip bool `json:"destip,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipval string `json:"destipval,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` + DestIP bool `json:"destip,omitempty"` + DestIPOp string `json:"destipop,omitempty"` + DestIPVal string `json:"destipval,omitempty"` + DestPort bool `json:"destport,omitempty"` + DestPortOp string `json:"destportop,omitempty"` + DestPortVal string `json:"destportval,omitempty"` Detail bool `json:"detail,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` + FailedProbes int `json:"failedprobes,omitempty"` Hits int `json:"hits,omitempty"` - InterfaceField string `json:"Interface,omitempty"` - Iptunnel bool `json:"iptunnel,omitempty"` - Iptunnelname string `json:"iptunnelname,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` + Interface string `json:"Interface,omitempty"` + IPTunnel bool `json:"iptunnel,omitempty"` + IPTunnelName string `json:"iptunnelname,omitempty"` + KernelState string `json:"kernelstate,omitempty"` Monitor string `json:"monitor,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Msr string `json:"msr,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MSR string `json:"msr,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nexthop bool `json:"nexthop,omitempty"` - Nexthopval string `json:"nexthopval,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextHop bool `json:"nexthop,omitempty"` + NextHopVal string `json:"nexthopval,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Priority int `json:"priority,omitempty"` Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Srcip bool `json:"srcip,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipval string `json:"srcipval,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` + ProtocolNumber int `json:"protocolnumber,omitempty"` + SrcIP bool `json:"srcip,omitempty"` + SrcIPOp string `json:"srcipop,omitempty"` + SrcIPVal string `json:"srcipval,omitempty"` + SrcMac string `json:"srcmac,omitempty"` + SrcMacMask string `json:"srcmacmask,omitempty"` + SrcPort bool `json:"srcport,omitempty"` + SrcPortOp string `json:"srcportop,omitempty"` + SrcPortVal string `json:"srcportval,omitempty"` State string `json:"state,omitempty"` - Targettd int `json:"targettd,omitempty"` - Td int `json:"td,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Totalprobes int `json:"totalprobes,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + TargetTD int `json:"targettd,omitempty"` + TD int `json:"td,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` + TotalProbes int `json:"totalprobes,omitempty"` + VLAN int `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` + VXLANVLANMap string `json:"vxlanvlanmap,omitempty"` } -type NstrafficdomainVxlanBinding struct { - Td int `json:"td,omitempty"` - Vxlan int `json:"vxlan,omitempty"` +type NSTrafficDomainVXLANBinding struct { + TD int `json:"td,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Nspartition struct { +type NSPartition struct { Count float64 `json:"__count,omitempty"` Force bool `json:"force,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxconn int `json:"maxconn,omitempty"` - Maxmemlimit int `json:"maxmemlimit,omitempty"` - Minbandwidth int `json:"minbandwidth,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionid int `json:"partitionid,omitempty"` - Partitionmac string `json:"partitionmac,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Partitiontype string `json:"partitiontype,omitempty"` - Pmacinternal bool `json:"pmacinternal,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxConn int `json:"maxconn,omitempty"` + MaxMemLimit int `json:"maxmemlimit,omitempty"` + MinBandwidth int `json:"minbandwidth,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionID int `json:"partitionid,omitempty"` + PartitionMAC string `json:"partitionmac,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + PartitionType string `json:"partitiontype,omitempty"` + PMACInternal bool `json:"pmacinternal,omitempty"` Save bool `json:"save,omitempty"` } -type NsextensionBinding struct { +type NSExtensionBinding struct { Name string `json:"name,omitempty"` - NsextensionExtensionfunctionBinding []interface{} `json:"nsextension_extensionfunction_binding,omitempty"` -} - -type Nslicense struct { - Aaa bool `json:"aaa,omitempty"` - Adaptivetcp bool `json:"adaptivetcp,omitempty"` - Agee bool `json:"agee,omitempty"` - Apigateway bool `json:"apigateway,omitempty"` - Appflow bool `json:"appflow,omitempty"` - Appflowica bool `json:"appflowica,omitempty"` - Appfw bool `json:"appfw,omitempty"` - Appqoe bool `json:"appqoe,omitempty"` - Bgp bool `json:"bgp,omitempty"` + NSExtensionExtensionFunctionBinding []interface{} `json:"nsextension_extensionfunction_binding,omitempty"` +} + +type NSLicense struct { + AAA bool `json:"aaa,omitempty"` + AdaptiveTCP bool `json:"adaptivetcp,omitempty"` + AGEE bool `json:"agee,omitempty"` + APIGateway bool `json:"apigateway,omitempty"` + AppFlow bool `json:"appflow,omitempty"` + AppFlowICA bool `json:"appflowica,omitempty"` + AppFW bool `json:"appfw,omitempty"` + AppQOE bool `json:"appqoe,omitempty"` + BGP bool `json:"bgp,omitempty"` Bot bool `json:"bot,omitempty"` - Cf bool `json:"cf,omitempty"` - Ch bool `json:"ch,omitempty"` - Cloudbridge bool `json:"cloudbridge,omitempty"` - Cloudbridgeappliance bool `json:"cloudbridgeappliance,omitempty"` - Cloudextenderappliance bool `json:"cloudextenderappliance,omitempty"` - Cloudsubscriptionimage string `json:"cloudsubscriptionimage,omitempty"` + CF bool `json:"cf,omitempty"` + CH bool `json:"ch,omitempty"` + CloudBridge bool `json:"cloudbridge,omitempty"` + CloudBridgeAppliance bool `json:"cloudbridgeappliance,omitempty"` + CloudExtenderAppliance bool `json:"cloudextenderappliance,omitempty"` + CloudSubscriptionImage string `json:"cloudsubscriptionimage,omitempty"` Cluster bool `json:"cluster,omitempty"` - Cmp bool `json:"cmp,omitempty"` - Contentaccelerator bool `json:"contentaccelerator,omitempty"` - Cqa bool `json:"cqa,omitempty"` - Cr bool `json:"cr,omitempty"` - Cs bool `json:"cs,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` - Daystolasenforcement int `json:"daystolasenforcement,omitempty"` + CMP bool `json:"cmp,omitempty"` + ContentAccelerator bool `json:"contentaccelerator,omitempty"` + CQA bool `json:"cqa,omitempty"` + CR bool `json:"cr,omitempty"` + CS bool `json:"cs,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` + DaysToLASEnforcement int `json:"daystolasenforcement,omitempty"` Delta bool `json:"delta,omitempty"` - FIcaUsers int `json:"f_ica_users,omitempty"` - FSslvpnUsers int `json:"f_sslvpn_users,omitempty"` - Feo bool `json:"feo,omitempty"` - Forwardproxy bool `json:"forwardproxy,omitempty"` - Gslb bool `json:"gslb,omitempty"` - Gslbp bool `json:"gslbp,omitempty"` - Ic bool `json:"ic,omitempty"` - Ipv6pt bool `json:"ipv6pt,omitempty"` - Isenterpriselic bool `json:"isenterpriselic,omitempty"` - Isis bool `json:"isis,omitempty"` - Isplatinumlic bool `json:"isplatinumlic,omitempty"` - Issgwylic bool `json:"issgwylic,omitempty"` - Isstandardlic bool `json:"isstandardlic,omitempty"` - Isswglic bool `json:"isswglic,omitempty"` - Lb bool `json:"lb,omitempty"` - Licensingmode string `json:"licensingmode,omitempty"` - Lsn bool `json:"lsn,omitempty"` - Modelid int `json:"modelid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nsxn bool `json:"nsxn,omitempty"` - Ospf bool `json:"ospf,omitempty"` + FICAUsers int `json:"f_ica_users,omitempty"` + FSSLVPNUsers int `json:"f_sslvpn_users,omitempty"` + FEO bool `json:"feo,omitempty"` + ForwardProxy bool `json:"forwardproxy,omitempty"` + GSLB bool `json:"gslb,omitempty"` + GSLBP bool `json:"gslbp,omitempty"` + IC bool `json:"ic,omitempty"` + IPv6PT bool `json:"ipv6pt,omitempty"` + IsEnterpriseLic bool `json:"isenterpriselic,omitempty"` + ISIS bool `json:"isis,omitempty"` + IsPlatinumLic bool `json:"isplatinumlic,omitempty"` + IsSGWYLic bool `json:"issgwylic,omitempty"` + IsStandardLic bool `json:"isstandardlic,omitempty"` + IsSWGLic bool `json:"isswglic,omitempty"` + LB bool `json:"lb,omitempty"` + LicensingMode string `json:"licensingmode,omitempty"` + LSN bool `json:"lsn,omitempty"` + ModelID int `json:"modelid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSXN bool `json:"nsxn,omitempty"` + OSPF bool `json:"ospf,omitempty"` Push bool `json:"push,omitempty"` - Rdpproxy bool `json:"rdpproxy,omitempty"` - Remotecontentinspection bool `json:"remotecontentinspection,omitempty"` + RDPProxy bool `json:"rdpproxy,omitempty"` + RemoteContentInspection bool `json:"remotecontentinspection,omitempty"` Rep bool `json:"rep,omitempty"` Responder bool `json:"responder,omitempty"` Rewrite bool `json:"rewrite,omitempty"` - Rip bool `json:"rip,omitempty"` + RIP bool `json:"rip,omitempty"` Routing bool `json:"routing,omitempty"` - Sp bool `json:"sp,omitempty"` - Ssl bool `json:"ssl,omitempty"` - Sslinterception bool `json:"sslinterception,omitempty"` - Sslvpn bool `json:"sslvpn,omitempty"` - Urlfiltering bool `json:"urlfiltering,omitempty"` - Videooptimization bool `json:"videooptimization,omitempty"` - Wl bool `json:"wl,omitempty"` -} - -type Nstestlicense struct { - Aaa bool `json:"aaa,omitempty"` - Adaptivetcp bool `json:"adaptivetcp,omitempty"` - Agee bool `json:"agee,omitempty"` - Apigateway bool `json:"apigateway,omitempty"` - Appflow bool `json:"appflow,omitempty"` - Appflowica bool `json:"appflowica,omitempty"` - Appfw bool `json:"appfw,omitempty"` - Appqoe bool `json:"appqoe,omitempty"` - Bgp bool `json:"bgp,omitempty"` + SP bool `json:"sp,omitempty"` + SSL bool `json:"ssl,omitempty"` + SSLInterception bool `json:"sslinterception,omitempty"` + SSLVPN bool `json:"sslvpn,omitempty"` + URLFiltering bool `json:"urlfiltering,omitempty"` + VideoOptimization bool `json:"videooptimization,omitempty"` + WL bool `json:"wl,omitempty"` +} + +type NSTestLicense struct { + AAA bool `json:"aaa,omitempty"` + AdaptiveTCP bool `json:"adaptivetcp,omitempty"` + AGEE bool `json:"agee,omitempty"` + APIGateway bool `json:"apigateway,omitempty"` + AppFlow bool `json:"appflow,omitempty"` + AppFlowICA bool `json:"appflowica,omitempty"` + AppFW bool `json:"appfw,omitempty"` + AppQOE bool `json:"appqoe,omitempty"` + BGP bool `json:"bgp,omitempty"` Bot bool `json:"bot,omitempty"` - Cf bool `json:"cf,omitempty"` - Ch bool `json:"ch,omitempty"` - Cloudbridge bool `json:"cloudbridge,omitempty"` - Cloudbridgeappliance bool `json:"cloudbridgeappliance,omitempty"` - Cloudextenderappliance bool `json:"cloudextenderappliance,omitempty"` + CF bool `json:"cf,omitempty"` + CH bool `json:"ch,omitempty"` + CloudBridge bool `json:"cloudbridge,omitempty"` + CloudBridgeAppliance bool `json:"cloudbridgeappliance,omitempty"` + CloudExtenderAppliance bool `json:"cloudextenderappliance,omitempty"` Cluster bool `json:"cluster,omitempty"` - Cmp bool `json:"cmp,omitempty"` - Contentaccelerator bool `json:"contentaccelerator,omitempty"` - Cqa bool `json:"cqa,omitempty"` - Cr bool `json:"cr,omitempty"` - Cs bool `json:"cs,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` + CMP bool `json:"cmp,omitempty"` + ContentAccelerator bool `json:"contentaccelerator,omitempty"` + CQA bool `json:"cqa,omitempty"` + CR bool `json:"cr,omitempty"` + CS bool `json:"cs,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` Delta bool `json:"delta,omitempty"` - FIcaUsers int `json:"f_ica_users,omitempty"` - FSslvpnUsers int `json:"f_sslvpn_users,omitempty"` - Feo bool `json:"feo,omitempty"` - Forwardproxy bool `json:"forwardproxy,omitempty"` - Gslb bool `json:"gslb,omitempty"` - Gslbp bool `json:"gslbp,omitempty"` - Ic bool `json:"ic,omitempty"` - Ipv6pt bool `json:"ipv6pt,omitempty"` - Isenterpriselic bool `json:"isenterpriselic,omitempty"` - Isis bool `json:"isis,omitempty"` - Isplatinumlic bool `json:"isplatinumlic,omitempty"` - Issgwylic bool `json:"issgwylic,omitempty"` - Isstandardlic bool `json:"isstandardlic,omitempty"` - Isswglic bool `json:"isswglic,omitempty"` - Lb bool `json:"lb,omitempty"` - Licensingmode string `json:"licensingmode,omitempty"` - Lsn bool `json:"lsn,omitempty"` - Modelid int `json:"modelid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nsxn bool `json:"nsxn,omitempty"` - Ospf bool `json:"ospf,omitempty"` + FICAUsers int `json:"f_ica_users,omitempty"` + FSSLVPNUsers int `json:"f_sslvpn_users,omitempty"` + FEO bool `json:"feo,omitempty"` + ForwardProxy bool `json:"forwardproxy,omitempty"` + GSLB bool `json:"gslb,omitempty"` + GSLBP bool `json:"gslbp,omitempty"` + IC bool `json:"ic,omitempty"` + IPv6PT bool `json:"ipv6pt,omitempty"` + IsEnterpriseLic bool `json:"isenterpriselic,omitempty"` + ISIS bool `json:"isis,omitempty"` + IsPlatinumLic bool `json:"isplatinumlic,omitempty"` + IsSGWYLic bool `json:"issgwylic,omitempty"` + IsStandardLic bool `json:"isstandardlic,omitempty"` + IsSWGLic bool `json:"isswglic,omitempty"` + LB bool `json:"lb,omitempty"` + LicensingMode string `json:"licensingmode,omitempty"` + LSN bool `json:"lsn,omitempty"` + ModelID int `json:"modelid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSXN bool `json:"nsxn,omitempty"` + OSPF bool `json:"ospf,omitempty"` Push bool `json:"push,omitempty"` - Rdpproxy bool `json:"rdpproxy,omitempty"` - Remotecontentinspection bool `json:"remotecontentinspection,omitempty"` + RDPProxy bool `json:"rdpproxy,omitempty"` + RemoteContentInspection bool `json:"remotecontentinspection,omitempty"` Rep bool `json:"rep,omitempty"` Responder bool `json:"responder,omitempty"` Rewrite bool `json:"rewrite,omitempty"` - Rip bool `json:"rip,omitempty"` + RIP bool `json:"rip,omitempty"` Routing bool `json:"routing,omitempty"` - Sp bool `json:"sp,omitempty"` - Ssl bool `json:"ssl,omitempty"` - Sslinterception bool `json:"sslinterception,omitempty"` - Sslvpn bool `json:"sslvpn,omitempty"` - Urlfiltering bool `json:"urlfiltering,omitempty"` - Videooptimization bool `json:"videooptimization,omitempty"` - Wl bool `json:"wl,omitempty"` -} - -type Nslicenseserverpool struct { - Cpxinstanceavailable int `json:"cpxinstanceavailable,omitempty"` - Cpxinstancetotal int `json:"cpxinstancetotal,omitempty"` - Enterprisebandwidthavailable int `json:"enterprisebandwidthavailable,omitempty"` - Enterprisebandwidthtotal int `json:"enterprisebandwidthtotal,omitempty"` - Enterprisecpuavailable int `json:"enterprisecpuavailable,omitempty"` - Enterprisecputotal int `json:"enterprisecputotal,omitempty"` - Getalllicenses bool `json:"getalllicenses,omitempty"` - Instanceavailable int `json:"instanceavailable,omitempty"` - Instancetotal int `json:"instancetotal,omitempty"` - Licensemode string `json:"licensemode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Platinumbandwidthavailable int `json:"platinumbandwidthavailable,omitempty"` - Platinumbandwidthtotal int `json:"platinumbandwidthtotal,omitempty"` - Platinumcpuavailable int `json:"platinumcpuavailable,omitempty"` - Platinumcputotal int `json:"platinumcputotal,omitempty"` - Standardbandwidthavailable int `json:"standardbandwidthavailable,omitempty"` - Standardbandwidthtotal int `json:"standardbandwidthtotal,omitempty"` - Standardcpuavailable int `json:"standardcpuavailable,omitempty"` - Standardcputotal int `json:"standardcputotal,omitempty"` - Vpx100000eavailable int `json:"vpx100000eavailable,omitempty"` - Vpx100000etotal int `json:"vpx100000etotal,omitempty"` - Vpx100000pavailable int `json:"vpx100000pavailable,omitempty"` - Vpx100000ptotal int `json:"vpx100000ptotal,omitempty"` - Vpx100000savailable int `json:"vpx100000savailable,omitempty"` - Vpx100000stotal int `json:"vpx100000stotal,omitempty"` - Vpx10000eavailable int `json:"vpx10000eavailable,omitempty"` - Vpx10000etotal int `json:"vpx10000etotal,omitempty"` - Vpx10000pavailable int `json:"vpx10000pavailable,omitempty"` - Vpx10000ptotal int `json:"vpx10000ptotal,omitempty"` - Vpx10000savailable int `json:"vpx10000savailable,omitempty"` - Vpx10000stotal int `json:"vpx10000stotal,omitempty"` - Vpx1000eavailable int `json:"vpx1000eavailable,omitempty"` - Vpx1000etotal int `json:"vpx1000etotal,omitempty"` - Vpx1000pavailable int `json:"vpx1000pavailable,omitempty"` - Vpx1000ptotal int `json:"vpx1000ptotal,omitempty"` - Vpx1000savailable int `json:"vpx1000savailable,omitempty"` - Vpx1000stotal int `json:"vpx1000stotal,omitempty"` - Vpx100eavailable int `json:"vpx100eavailable,omitempty"` - Vpx100etotal int `json:"vpx100etotal,omitempty"` - Vpx100pavailable int `json:"vpx100pavailable,omitempty"` - Vpx100ptotal int `json:"vpx100ptotal,omitempty"` - Vpx100savailable int `json:"vpx100savailable,omitempty"` - Vpx100stotal int `json:"vpx100stotal,omitempty"` - Vpx10eavailable int `json:"vpx10eavailable,omitempty"` - Vpx10etotal int `json:"vpx10etotal,omitempty"` - Vpx10pavailable int `json:"vpx10pavailable,omitempty"` - Vpx10ptotal int `json:"vpx10ptotal,omitempty"` - Vpx10savailable int `json:"vpx10savailable,omitempty"` - Vpx10stotal int `json:"vpx10stotal,omitempty"` - Vpx15000eavailable int `json:"vpx15000eavailable,omitempty"` - Vpx15000etotal int `json:"vpx15000etotal,omitempty"` - Vpx15000pavailable int `json:"vpx15000pavailable,omitempty"` - Vpx15000ptotal int `json:"vpx15000ptotal,omitempty"` - Vpx15000savailable int `json:"vpx15000savailable,omitempty"` - Vpx15000stotal int `json:"vpx15000stotal,omitempty"` - Vpx1pavailable int `json:"vpx1pavailable,omitempty"` - Vpx1ptotal int `json:"vpx1ptotal,omitempty"` - Vpx1savailable int `json:"vpx1savailable,omitempty"` - Vpx1stotal int `json:"vpx1stotal,omitempty"` - Vpx2000pavailable int `json:"vpx2000pavailable,omitempty"` - Vpx2000ptotal int `json:"vpx2000ptotal,omitempty"` - Vpx200eavailable int `json:"vpx200eavailable,omitempty"` - Vpx200etotal int `json:"vpx200etotal,omitempty"` - Vpx200pavailable int `json:"vpx200pavailable,omitempty"` - Vpx200ptotal int `json:"vpx200ptotal,omitempty"` - Vpx200savailable int `json:"vpx200savailable,omitempty"` - Vpx200stotal int `json:"vpx200stotal,omitempty"` - Vpx25000eavailable int `json:"vpx25000eavailable,omitempty"` - Vpx25000etotal int `json:"vpx25000etotal,omitempty"` - Vpx25000pavailable int `json:"vpx25000pavailable,omitempty"` - Vpx25000ptotal int `json:"vpx25000ptotal,omitempty"` - Vpx25000savailable int `json:"vpx25000savailable,omitempty"` - Vpx25000stotal int `json:"vpx25000stotal,omitempty"` - Vpx25eavailable int `json:"vpx25eavailable,omitempty"` - Vpx25etotal int `json:"vpx25etotal,omitempty"` - Vpx25pavailable int `json:"vpx25pavailable,omitempty"` - Vpx25ptotal int `json:"vpx25ptotal,omitempty"` - Vpx25savailable int `json:"vpx25savailable,omitempty"` - Vpx25stotal int `json:"vpx25stotal,omitempty"` - Vpx3000eavailable int `json:"vpx3000eavailable,omitempty"` - Vpx3000etotal int `json:"vpx3000etotal,omitempty"` - Vpx3000pavailable int `json:"vpx3000pavailable,omitempty"` - Vpx3000ptotal int `json:"vpx3000ptotal,omitempty"` - Vpx3000savailable int `json:"vpx3000savailable,omitempty"` - Vpx3000stotal int `json:"vpx3000stotal,omitempty"` - Vpx40000eavailable int `json:"vpx40000eavailable,omitempty"` - Vpx40000etotal int `json:"vpx40000etotal,omitempty"` - Vpx40000pavailable int `json:"vpx40000pavailable,omitempty"` - Vpx40000ptotal int `json:"vpx40000ptotal,omitempty"` - Vpx40000savailable int `json:"vpx40000savailable,omitempty"` - Vpx40000stotal int `json:"vpx40000stotal,omitempty"` - Vpx4000pavailable int `json:"vpx4000pavailable,omitempty"` - Vpx4000ptotal int `json:"vpx4000ptotal,omitempty"` - Vpx5000eavailable int `json:"vpx5000eavailable,omitempty"` - Vpx5000etotal int `json:"vpx5000etotal,omitempty"` - Vpx5000pavailable int `json:"vpx5000pavailable,omitempty"` - Vpx5000ptotal int `json:"vpx5000ptotal,omitempty"` - Vpx5000savailable int `json:"vpx5000savailable,omitempty"` - Vpx5000stotal int `json:"vpx5000stotal,omitempty"` - Vpx500eavailable int `json:"vpx500eavailable,omitempty"` - Vpx500etotal int `json:"vpx500etotal,omitempty"` - Vpx500pavailable int `json:"vpx500pavailable,omitempty"` - Vpx500ptotal int `json:"vpx500ptotal,omitempty"` - Vpx500savailable int `json:"vpx500savailable,omitempty"` - Vpx500stotal int `json:"vpx500stotal,omitempty"` - Vpx50eavailable int `json:"vpx50eavailable,omitempty"` - Vpx50etotal int `json:"vpx50etotal,omitempty"` - Vpx50pavailable int `json:"vpx50pavailable,omitempty"` - Vpx50ptotal int `json:"vpx50ptotal,omitempty"` - Vpx50savailable int `json:"vpx50savailable,omitempty"` - Vpx50stotal int `json:"vpx50stotal,omitempty"` - Vpx5pavailable int `json:"vpx5pavailable,omitempty"` - Vpx5ptotal int `json:"vpx5ptotal,omitempty"` - Vpx5savailable int `json:"vpx5savailable,omitempty"` - Vpx5stotal int `json:"vpx5stotal,omitempty"` - Vpx8000eavailable int `json:"vpx8000eavailable,omitempty"` - Vpx8000etotal int `json:"vpx8000etotal,omitempty"` - Vpx8000pavailable int `json:"vpx8000pavailable,omitempty"` - Vpx8000ptotal int `json:"vpx8000ptotal,omitempty"` - Vpx8000savailable int `json:"vpx8000savailable,omitempty"` - Vpx8000stotal int `json:"vpx8000stotal,omitempty"` -} - -type Nsconfigview struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + SP bool `json:"sp,omitempty"` + SSL bool `json:"ssl,omitempty"` + SSLInterception bool `json:"sslinterception,omitempty"` + SSLVPN bool `json:"sslvpn,omitempty"` + URLFiltering bool `json:"urlfiltering,omitempty"` + VideoOptimization bool `json:"videooptimization,omitempty"` + WL bool `json:"wl,omitempty"` +} + +type NSLicenseServerPool struct { + CPXInstanceAvailable int `json:"cpxinstanceavailable,omitempty"` + CPXInstanceTotal int `json:"cpxinstancetotal,omitempty"` + EnterpriseBandwidthAvailable int `json:"enterprisebandwidthavailable,omitempty"` + EnterpriseBandwidthTotal int `json:"enterprisebandwidthtotal,omitempty"` + EnterpriseCPUAvailable int `json:"enterprisecpuavailable,omitempty"` + EnterpriseCPUTotal int `json:"enterprisecputotal,omitempty"` + GetAllLicenses bool `json:"getalllicenses,omitempty"` + InstanceAvailable int `json:"instanceavailable,omitempty"` + InstanceTotal int `json:"instancetotal,omitempty"` + LicenseMode string `json:"licensemode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PlatinumBandwidthAvailable int `json:"platinumbandwidthavailable,omitempty"` + PlatinumBandwidthTotal int `json:"platinumbandwidthtotal,omitempty"` + PlatinumCPUAvailable int `json:"platinumcpuavailable,omitempty"` + PlatinumCPUTotal int `json:"platinumcputotal,omitempty"` + StandardBandwidthAvailable int `json:"standardbandwidthavailable,omitempty"` + StandardBandwidthTotal int `json:"standardbandwidthtotal,omitempty"` + StandardCPUAvailable int `json:"standardcpuavailable,omitempty"` + StandardCPUTotal int `json:"standardcputotal,omitempty"` + VPX100000EAvailable int `json:"vpx100000eavailable,omitempty"` + VPX100000ETotal int `json:"vpx100000etotal,omitempty"` + VPX100000PAvailable int `json:"vpx100000pavailable,omitempty"` + VPX100000PTotal int `json:"vpx100000ptotal,omitempty"` + VPX100000SAvailable int `json:"vpx100000savailable,omitempty"` + VPX100000STotal int `json:"vpx100000stotal,omitempty"` + VPX10000EAvailable int `json:"vpx10000eavailable,omitempty"` + VPX10000ETotal int `json:"vpx10000etotal,omitempty"` + VPX10000PAvailable int `json:"vpx10000pavailable,omitempty"` + VPX10000PTotal int `json:"vpx10000ptotal,omitempty"` + VPX10000SAvailable int `json:"vpx10000savailable,omitempty"` + VPX10000STotal int `json:"vpx10000stotal,omitempty"` + VPX1000EAvailable int `json:"vpx1000eavailable,omitempty"` + VPX1000ETotal int `json:"vpx1000etotal,omitempty"` + VPX1000PAvailable int `json:"vpx1000pavailable,omitempty"` + VPX1000PTotal int `json:"vpx1000ptotal,omitempty"` + VPX1000SAvailable int `json:"vpx1000savailable,omitempty"` + VPX1000STotal int `json:"vpx1000stotal,omitempty"` + VPX100EAvailable int `json:"vpx100eavailable,omitempty"` + VPX100ETotal int `json:"vpx100etotal,omitempty"` + VPX100PAvailable int `json:"vpx100pavailable,omitempty"` + VPX100PTotal int `json:"vpx100ptotal,omitempty"` + VPX100SAvailable int `json:"vpx100savailable,omitempty"` + VPX100STotal int `json:"vpx100stotal,omitempty"` + VPX10EAvailable int `json:"vpx10eavailable,omitempty"` + VPX10ETotal int `json:"vpx10etotal,omitempty"` + VPX10PAvailable int `json:"vpx10pavailable,omitempty"` + VPX10PTotal int `json:"vpx10ptotal,omitempty"` + VPX10SAvailable int `json:"vpx10savailable,omitempty"` + VPX10STotal int `json:"vpx10stotal,omitempty"` + VPX15000EAvailable int `json:"vpx15000eavailable,omitempty"` + VPX15000ETotal int `json:"vpx15000etotal,omitempty"` + VPX15000PAvailable int `json:"vpx15000pavailable,omitempty"` + VPX15000PTotal int `json:"vpx15000ptotal,omitempty"` + VPX15000SAvailable int `json:"vpx15000savailable,omitempty"` + VPX15000STotal int `json:"vpx15000stotal,omitempty"` + VPX1PAvailable int `json:"vpx1pavailable,omitempty"` + VPX1PTotal int `json:"vpx1ptotal,omitempty"` + VPX1SAvailable int `json:"vpx1savailable,omitempty"` + VPX1STotal int `json:"vpx1stotal,omitempty"` + VPX2000PAvailable int `json:"vpx2000pavailable,omitempty"` + VPX2000PTotal int `json:"vpx2000ptotal,omitempty"` + VPX200EAvailable int `json:"vpx200eavailable,omitempty"` + VPX200ETotal int `json:"vpx200etotal,omitempty"` + VPX200PAvailable int `json:"vpx200pavailable,omitempty"` + VPX200PTotal int `json:"vpx200ptotal,omitempty"` + VPX200SAvailable int `json:"vpx200savailable,omitempty"` + VPX200STotal int `json:"vpx200stotal,omitempty"` + VPX25000EAvailable int `json:"vpx25000eavailable,omitempty"` + VPX25000ETotal int `json:"vpx25000etotal,omitempty"` + VPX25000PAvailable int `json:"vpx25000pavailable,omitempty"` + VPX25000PTotal int `json:"vpx25000ptotal,omitempty"` + VPX25000SAvailable int `json:"vpx25000savailable,omitempty"` + VPX25000STotal int `json:"vpx25000stotal,omitempty"` + VPX25EAvailable int `json:"vpx25eavailable,omitempty"` + VPX25ETotal int `json:"vpx25etotal,omitempty"` + VPX25PAvailable int `json:"vpx25pavailable,omitempty"` + VPX25PTotal int `json:"vpx25ptotal,omitempty"` + VPX25SAvailable int `json:"vpx25savailable,omitempty"` + VPX25STotal int `json:"vpx25stotal,omitempty"` + VPX3000EAvailable int `json:"vpx3000eavailable,omitempty"` + VPX3000ETotal int `json:"vpx3000etotal,omitempty"` + VPX3000PAvailable int `json:"vpx3000pavailable,omitempty"` + VPX3000PTotal int `json:"vpx3000ptotal,omitempty"` + VPX3000SAvailable int `json:"vpx3000savailable,omitempty"` + VPX3000STotal int `json:"vpx3000stotal,omitempty"` + VPX40000EAvailable int `json:"vpx40000eavailable,omitempty"` + VPX40000ETotal int `json:"vpx40000etotal,omitempty"` + VPX40000PAvailable int `json:"vpx40000pavailable,omitempty"` + VPX40000PTotal int `json:"vpx40000ptotal,omitempty"` + VPX40000SAvailable int `json:"vpx40000savailable,omitempty"` + VPX40000STotal int `json:"vpx40000stotal,omitempty"` + VPX4000PAvailable int `json:"vpx4000pavailable,omitempty"` + VPX4000PTotal int `json:"vpx4000ptotal,omitempty"` + VPX5000EAvailable int `json:"vpx5000eavailable,omitempty"` + VPX5000ETotal int `json:"vpx5000etotal,omitempty"` + VPX5000PAvailable int `json:"vpx5000pavailable,omitempty"` + VPX5000PTotal int `json:"vpx5000ptotal,omitempty"` + VPX5000SAvailable int `json:"vpx5000savailable,omitempty"` + VPX5000STotal int `json:"vpx5000stotal,omitempty"` + VPX500EAvailable int `json:"vpx500eavailable,omitempty"` + VPX500ETotal int `json:"vpx500etotal,omitempty"` + VPX500PAvailable int `json:"vpx500pavailable,omitempty"` + VPX500PTotal int `json:"vpx500ptotal,omitempty"` + VPX500SAvailable int `json:"vpx500savailable,omitempty"` + VPX500STotal int `json:"vpx500stotal,omitempty"` + VPX50EAvailable int `json:"vpx50eavailable,omitempty"` + VPX50ETotal int `json:"vpx50etotal,omitempty"` + VPX50PAvailable int `json:"vpx50pavailable,omitempty"` + VPX50PTotal int `json:"vpx50ptotal,omitempty"` + VPX50SAvailable int `json:"vpx50savailable,omitempty"` + VPX50STotal int `json:"vpx50stotal,omitempty"` + VPX5PAvailable int `json:"vpx5pavailable,omitempty"` + VPX5PTotal int `json:"vpx5ptotal,omitempty"` + VPX5SAvailable int `json:"vpx5savailable,omitempty"` + VPX5STotal int `json:"vpx5stotal,omitempty"` + VPX8000EAvailable int `json:"vpx8000eavailable,omitempty"` + VPX8000ETotal int `json:"vpx8000etotal,omitempty"` + VPX8000PAvailable int `json:"vpx8000pavailable,omitempty"` + VPX8000PTotal int `json:"vpx8000ptotal,omitempty"` + VPX8000SAvailable int `json:"vpx8000savailable,omitempty"` + VPX8000STotal int `json:"vpx8000stotal,omitempty"` +} + +type NSConfigView struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } -type NstimerBinding struct { +type NSTimerBinding struct { Name string `json:"name,omitempty"` - NstimerAutoscalepolicyBinding []interface{} `json:"nstimer_autoscalepolicy_binding,omitempty"` + NSTimerAutoScalePolicyBinding []interface{} `json:"nstimer_autoscalepolicy_binding,omitempty"` } -type Nsdiameter struct { +type NSDiameter struct { Count float64 `json:"__count,omitempty"` Identity string `json:"identity,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` Realm string `json:"realm,omitempty"` - Serverclosepropagation string `json:"serverclosepropagation,omitempty"` + ServerClosePropagation string `json:"serverclosepropagation,omitempty"` } -type NstrafficdomainBridgegroupBinding struct { - Bridgegroup int `json:"bridgegroup,omitempty"` - Td int `json:"td,omitempty"` +type NSTrafficDomainBridgeGroupBinding struct { + BridgeGroup int `json:"bridgegroup,omitempty"` + TD int `json:"td,omitempty"` } -type Nsrollbackcmd struct { +type NSRollbackCmd struct { Filename string `json:"filename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Outtype string `json:"outtype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OutType string `json:"outtype,omitempty"` } -type Nsvpxparam struct { - Cloudproductcode string `json:"cloudproductcode,omitempty"` +type NSVPXParam struct { + CloudProductCode string `json:"cloudproductcode,omitempty"` Count float64 `json:"__count,omitempty"` - Cpuyield string `json:"cpuyield,omitempty"` - Kvmvirtiomultiqueue string `json:"kvmvirtiomultiqueue,omitempty"` - Masterclockcpu1 string `json:"masterclockcpu1,omitempty"` - Memorystatus string `json:"memorystatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Technicalsupportpin string `json:"technicalsupportpin,omitempty"` - Vpxenvironment string `json:"vpxenvironment,omitempty"` - Vpxoemcode int `json:"vpxoemcode,omitempty"` -} - -type Nslicenseproxyserver struct { + CPUYield string `json:"cpuyield,omitempty"` + KVMVirtioMultiQueue string `json:"kvmvirtiomultiqueue,omitempty"` + MasterClockCPU1 string `json:"masterclockcpu1,omitempty"` + MemoryStatus string `json:"memorystatus,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + TechnicalSupportPIN string `json:"technicalsupportpin,omitempty"` + VPXEnvironment string `json:"vpxenvironment,omitempty"` + VPXOEMCode int `json:"vpxoemcode,omitempty"` +} + +type NSLicenseProxyServer struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` } -type NslimitidentifierNslimitsessionsBinding struct { - Limitidentifier string `json:"limitidentifier,omitempty"` +type NSLimitIdentifierNSLimitSessionsBinding struct { + LimitIdentifier string `json:"limitidentifier,omitempty"` } -type Nspartitionmac struct { +type NSPartitionMac struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionmac string `json:"partitionmac,omitempty"` - Partitionname string `json:"partitionname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionMAC string `json:"partitionmac,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } -type Nsservicepath struct { +type NSServicePath struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Servicepathname string `json:"servicepathname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServicePathName string `json:"servicepathname,omitempty"` } -type NspartitionBinding struct { - NspartitionBridgegroupBinding []interface{} `json:"nspartition_bridgegroup_binding,omitempty"` - NspartitionVlanBinding []interface{} `json:"nspartition_vlan_binding,omitempty"` - NspartitionVxlanBinding []interface{} `json:"nspartition_vxlan_binding,omitempty"` - Partitionname string `json:"partitionname,omitempty"` +type NSPartitionBinding struct { + NSPartitionBridgeGroupBinding []interface{} `json:"nspartition_bridgegroup_binding,omitempty"` + NSPartitionVlanBinding []interface{} `json:"nspartition_vlan_binding,omitempty"` + NSPartitionVxlanBinding []interface{} `json:"nspartition_vxlan_binding,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } -type NspartitionBridgegroupBinding struct { - Bridgegroup int `json:"bridgegroup,omitempty"` - Partitionname string `json:"partitionname,omitempty"` +type NSPartitionBridgeGroupBinding struct { + BridgeGroup int `json:"bridgegroup,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } -type Nsconnectiontable struct { - Adaptivetcpprofname string `json:"adaptivetcpprofname,omitempty"` - Advwnd int `json:"advwnd,omitempty"` - Burstratecontrol string `json:"burstratecontrol,omitempty"` - Bwestimate int `json:"bwestimate,omitempty"` - Channelidnnm int `json:"channelidnnm,omitempty"` - Congstate string `json:"congstate,omitempty"` - Connid int `json:"connid,omitempty"` - Connproperties []string `json:"connproperties,omitempty"` +type NSConnectionTable struct { + AdaptiveTCPProfName string `json:"adaptivetcpprofname,omitempty"` + AdvWnd int `json:"advwnd,omitempty"` + BurstRateControl string `json:"burstratecontrol,omitempty"` + BWEstimate int `json:"bwestimate,omitempty"` + ChannelIDNNM int `json:"channelidnnm,omitempty"` + CongState string `json:"congstate,omitempty"` + ConnID int `json:"connid,omitempty"` + ConnProperties []string `json:"connproperties,omitempty"` Count float64 `json:"__count,omitempty"` - Cqabifavg int `json:"cqabifavg,omitempty"` - Cqaccl int `json:"cqaccl,omitempty"` - Cqacsq int `json:"cqacsq,omitempty"` - Cqaiai1mspct int `json:"cqaiai1mspct,omitempty"` - Cqaiai2mspct int `json:"cqaiai2mspct,omitempty"` - Cqaiaiavg int `json:"cqaiaiavg,omitempty"` - Cqaiaisamples int `json:"cqaiaisamples,omitempty"` - Cqaisiavg int `json:"cqaisiavg,omitempty"` - Cqaloaddelayavg int `json:"cqaloaddelayavg,omitempty"` - Cqanetclass string `json:"cqanetclass,omitempty"` - Cqanoisedelayavg int `json:"cqanoisedelayavg,omitempty"` - Cqarcvwndavg int `json:"cqarcvwndavg,omitempty"` - Cqarcvwndmin int `json:"cqarcvwndmin,omitempty"` - Cqaretxcong int `json:"cqaretxcong,omitempty"` - Cqaretxcorr int `json:"cqaretxcorr,omitempty"` - Cqaretxpackets int `json:"cqaretxpackets,omitempty"` - Cqarttavg int `json:"cqarttavg,omitempty"` - Cqarttmax int `json:"cqarttmax,omitempty"` - Cqarttmin int `json:"cqarttmin,omitempty"` - Cqasamples int `json:"cqasamples,omitempty"` - Cqathruputavg int `json:"cqathruputavg,omitempty"` - Creditsinbytes int `json:"creditsinbytes,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Entityname string `json:"entityname,omitempty"` - Filterexpression string `json:"filterexpression,omitempty"` - Filtername bool `json:"filtername,omitempty"` + CQABifAvg int `json:"cqabifavg,omitempty"` + CQACCL int `json:"cqaccl,omitempty"` + CQACSQ int `json:"cqacsq,omitempty"` + CQAAIAI1MSPct int `json:"cqaiai1mspct,omitempty"` + CQAAIAI2MSPct int `json:"cqaiai2mspct,omitempty"` + CQAAIAIAvg int `json:"cqaiaiavg,omitempty"` + CQAAIAISamples int `json:"cqaiaisamples,omitempty"` + CQAISIAvg int `json:"cqaisiavg,omitempty"` + CQALoadDelayAvg int `json:"cqaloaddelayavg,omitempty"` + CQANetClass string `json:"cqanetclass,omitempty"` + CQANoiseDelayAvg int `json:"cqanoisedelayavg,omitempty"` + CQARcvWndAvg int `json:"cqarcvwndavg,omitempty"` + CQARcvWndMin int `json:"cqarcvwndmin,omitempty"` + CQARetxCong int `json:"cqaretxcong,omitempty"` + CQARetxCorr int `json:"cqaretxcorr,omitempty"` + CQARetxPackets int `json:"cqaretxpackets,omitempty"` + CQARTTAvg int `json:"cqarttavg,omitempty"` + CQARTTMax int `json:"cqarttmax,omitempty"` + CQARTTMin int `json:"cqarttmin,omitempty"` + CQASamples int `json:"cqasamples,omitempty"` + CQAThruputAvg int `json:"cqathruputavg,omitempty"` + CreditsInBytes int `json:"creditsinbytes,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + EntityName string `json:"entityname,omitempty"` + FilterExpression string `json:"filterexpression,omitempty"` + FilterName bool `json:"filtername,omitempty"` Flavor string `json:"flavor,omitempty"` - Httpendseq int `json:"httpendseq,omitempty"` - Httprequest string `json:"httprequest,omitempty"` - Httpreqver string `json:"httpreqver,omitempty"` - Httprspcode int `json:"httprspcode,omitempty"` - Httpstate string `json:"httpstate,omitempty"` - Idletime int `json:"idletime,omitempty"` - Irs int `json:"irs,omitempty"` - Iss int `json:"iss,omitempty"` + HTTPEndSeq int `json:"httpendseq,omitempty"` + HTTPRequest string `json:"httprequest,omitempty"` + HTTPReqVer string `json:"httpreqver,omitempty"` + HTTPRspCode int `json:"httprspcode,omitempty"` + HTTPState string `json:"httpstate,omitempty"` + IdleTime int `json:"idletime,omitempty"` + IRS int `json:"irs,omitempty"` + ISS int `json:"iss,omitempty"` Link bool `json:"link,omitempty"` - Linkburstratecontrol string `json:"linkburstratecontrol,omitempty"` - Linkbwestimate int `json:"linkbwestimate,omitempty"` - Linkcongstate string `json:"linkcongstate,omitempty"` - Linkconnid int `json:"linkconnid,omitempty"` - Linkcredits int `json:"linkcredits,omitempty"` - Linkdestip string `json:"linkdestip,omitempty"` - Linkdestport int `json:"linkdestport,omitempty"` - Linkentityname string `json:"linkentityname,omitempty"` - Linkflavor string `json:"linkflavor,omitempty"` - Linkidletime int `json:"linkidletime,omitempty"` - Linkmaxrcvbuf int `json:"linkmaxrcvbuf,omitempty"` - Linkmaxsndbuf int `json:"linkmaxsndbuf,omitempty"` - Linkname string `json:"linkname,omitempty"` - Linknsbretxq int `json:"linknsbretxq,omitempty"` - Linknsbtcpwaitq int `json:"linknsbtcpwaitq,omitempty"` - Linknswsvalue int `json:"linknswsvalue,omitempty"` - Linkoptionflag []string `json:"linkoptionflag,omitempty"` - Linkpeerwsvalue int `json:"linkpeerwsvalue,omitempty"` - Linkrateinbytes int `json:"linkrateinbytes,omitempty"` - Linkrateschedulerqueue int `json:"linkrateschedulerqueue,omitempty"` - Linkrealtimertt int `json:"linkrealtimertt,omitempty"` - Linkrttmin int `json:"linkrttmin,omitempty"` - Linkrxqsize int `json:"linkrxqsize,omitempty"` - Linksackblocks int `json:"linksackblocks,omitempty"` - Linkservicetype string `json:"linkservicetype,omitempty"` - Linksndbuf int `json:"linksndbuf,omitempty"` - Linksndrecoverle int `json:"linksndrecoverle,omitempty"` - Linksourceip string `json:"linksourceip,omitempty"` - Linksourceport int `json:"linksourceport,omitempty"` - Linkstate string `json:"linkstate,omitempty"` - Linktcpmode string `json:"linktcpmode,omitempty"` - Linktxqsize int `json:"linktxqsize,omitempty"` + LinkBurstRateControl string `json:"linkburstratecontrol,omitempty"` + LinkBWEstimate int `json:"linkbwestimate,omitempty"` + LinkCongState string `json:"linkcongstate,omitempty"` + LinkConnID int `json:"linkconnid,omitempty"` + LinkCredits int `json:"linkcredits,omitempty"` + LinkDestIP string `json:"linkdestip,omitempty"` + LinkDestPort int `json:"linkdestport,omitempty"` + LinkEntityName string `json:"linkentityname,omitempty"` + LinkFlavor string `json:"linkflavor,omitempty"` + LinkIdleTime int `json:"linkidletime,omitempty"` + LinkMaxRcvBuf int `json:"linkmaxrcvbuf,omitempty"` + LinkMaxSndBuf int `json:"linkmaxsndbuf,omitempty"` + LinkName string `json:"linkname,omitempty"` + LinkNSBRetxQ int `json:"linknsbretxq,omitempty"` + LinkNSBTCPWaitQ int `json:"linknsbtcpwaitq,omitempty"` + LinkNSWSValue int `json:"linknswsvalue,omitempty"` + LinkOptionFlag []string `json:"linkoptionflag,omitempty"` + LinkPeerWSValue int `json:"linkpeerwsvalue,omitempty"` + LinkRateInBytes int `json:"linkrateinbytes,omitempty"` + LinkRateSchedulerQueue int `json:"linkrateschedulerqueue,omitempty"` + LinkRealTimeRTT int `json:"linkrealtimertt,omitempty"` + LinkRTTMin int `json:"linkrttmin,omitempty"` + LinkRxQSize int `json:"linkrxqsize,omitempty"` + LinkSackBlocks int `json:"linksackblocks,omitempty"` + LinkServiceType string `json:"linkservicetype,omitempty"` + LinkSndBuf int `json:"linksndbuf,omitempty"` + LinkSndRecoverLe int `json:"linksndrecoverle,omitempty"` + LinkSourceIP string `json:"linksourceip,omitempty"` + LinkSourcePort int `json:"linksourceport,omitempty"` + LinkState string `json:"linkstate,omitempty"` + LinkTCPMode string `json:"linktcpmode,omitempty"` + LinkTxQSize int `json:"linktxqsize,omitempty"` Listen bool `json:"listen,omitempty"` - Maxack int `json:"maxack,omitempty"` - Maxrcvbuf int `json:"maxrcvbuf,omitempty"` - Maxsndbuf int `json:"maxsndbuf,omitempty"` - Msgversionnnm int `json:"msgversionnnm,omitempty"` - Mss int `json:"mss,omitempty"` + MaxAck int `json:"maxack,omitempty"` + MaxRcvBuf int `json:"maxrcvbuf,omitempty"` + MaxSndBuf int `json:"maxsndbuf,omitempty"` + MsgVersionNNM int `json:"msgversionnnm,omitempty"` + MSS int `json:"mss,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Nsbretxq int `json:"nsbretxq,omitempty"` - Nsbtcpwaitq int `json:"nsbtcpwaitq,omitempty"` - Nswsvalue int `json:"nswsvalue,omitempty"` - Optionflags []string `json:"optionflags,omitempty"` - Outoforderblocks int `json:"outoforderblocks,omitempty"` - Outoforderbytes int `json:"outoforderbytes,omitempty"` - Outoforderflushedcount int `json:"outoforderflushedcount,omitempty"` - Outoforderpkts int `json:"outoforderpkts,omitempty"` - Peerwsvalue int `json:"peerwsvalue,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NSBRetxQ int `json:"nsbretxq,omitempty"` + NSBTCPWaitQ int `json:"nsbtcpwaitq,omitempty"` + NSWSValue int `json:"nswsvalue,omitempty"` + OptionFlags []string `json:"optionflags,omitempty"` + OutOfOrderBlocks int `json:"outoforderblocks,omitempty"` + OutOfOrderBytes int `json:"outoforderbytes,omitempty"` + OutOfOrderFlushedCount int `json:"outoforderflushedcount,omitempty"` + OutOfOrderPkts int `json:"outoforderpkts,omitempty"` + PeerWSValue int `json:"peerwsvalue,omitempty"` Priority string `json:"priority,omitempty"` - Rateinbytes int `json:"rateinbytes,omitempty"` - Rateschedulerqueue int `json:"rateschedulerqueue,omitempty"` - Rcvnxt int `json:"rcvnxt,omitempty"` - Rcvwnd int `json:"rcvwnd,omitempty"` - Realtimertt int `json:"realtimertt,omitempty"` - Retxretrycnt int `json:"retxretrycnt,omitempty"` - Rttmin int `json:"rttmin,omitempty"` - Rttsmoothed int `json:"rttsmoothed,omitempty"` - Rttvariance int `json:"rttvariance,omitempty"` - Rxqsize int `json:"rxqsize,omitempty"` - Sackblocks int `json:"sackblocks,omitempty"` - Sndbuf int `json:"sndbuf,omitempty"` - Sndcwnd int `json:"sndcwnd,omitempty"` - Sndnxt int `json:"sndnxt,omitempty"` - Sndrecoverle int `json:"sndrecoverle,omitempty"` - Sndunack int `json:"sndunack,omitempty"` - Sourceip string `json:"sourceip,omitempty"` - Sourcenodeidnnm int `json:"sourcenodeidnnm,omitempty"` - Sourceport int `json:"sourceport,omitempty"` + RateInBytes int `json:"rateinbytes,omitempty"` + RateSchedulerQueue int `json:"rateschedulerqueue,omitempty"` + RcvNxt int `json:"rcvnxt,omitempty"` + RcvWnd int `json:"rcvwnd,omitempty"` + RealTimeRTT int `json:"realtimertt,omitempty"` + RetxRetryCnt int `json:"retxretrycnt,omitempty"` + RTTMin int `json:"rttmin,omitempty"` + RTTSmoothed int `json:"rttsmoothed,omitempty"` + RTTVariance int `json:"rttvariance,omitempty"` + RxQSize int `json:"rxqsize,omitempty"` + SackBlocks int `json:"sackblocks,omitempty"` + SndBuf int `json:"sndbuf,omitempty"` + SndCwnd int `json:"sndcwnd,omitempty"` + SndNxt int `json:"sndnxt,omitempty"` + SndRecoverLe int `json:"sndrecoverle,omitempty"` + SndUnack int `json:"sndunack,omitempty"` + SourceIP string `json:"sourceip,omitempty"` + SourceNodeIDNNM int `json:"sourcenodeidnnm,omitempty"` + SourcePort int `json:"sourceport,omitempty"` State string `json:"state,omitempty"` - Svctype string `json:"svctype,omitempty"` - Targetnodeidnnm int `json:"targetnodeidnnm,omitempty"` - Tcpmode string `json:"tcpmode,omitempty"` - Td int `json:"td,omitempty"` - Trcount int `json:"trcount,omitempty"` - Txqsize int `json:"txqsize,omitempty"` + SvcType string `json:"svctype,omitempty"` + TargetNodeIDNNM int `json:"targetnodeidnnm,omitempty"` + TCPMode string `json:"tcpmode,omitempty"` + TD int `json:"td,omitempty"` + TRCount int `json:"trcount,omitempty"` + TxQSize int `json:"txqsize,omitempty"` } -type NsservicepathNsservicefunctionBinding struct { +type NSServicePathNSServiceFunctionBinding struct { Index int `json:"index,omitempty"` - Servicefunction string `json:"servicefunction,omitempty"` - Servicepathname string `json:"servicepathname,omitempty"` -} - -type Nsparam struct { - Advancedanalyticsstats string `json:"advancedanalyticsstats,omitempty"` - Aftpallowrandomsourceport string `json:"aftpallowrandomsourceport,omitempty"` - Autoscaleoption int `json:"autoscaleoption,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` - Cookieversion string `json:"cookieversion,omitempty"` - Crportrange string `json:"crportrange,omitempty"` - Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` - Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` - Ftpportrange string `json:"ftpportrange,omitempty"` - Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` - Grantquotaspillover int `json:"grantquotaspillover,omitempty"` - Httpport []interface{} `json:"httpport,omitempty"` - Icaports []interface{} `json:"icaports,omitempty"` - Internaluserlogin string `json:"internaluserlogin,omitempty"` - Ipttl int `json:"ipttl,omitempty"` - Maxconn int `json:"maxconn,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Mgmthttpport int `json:"mgmthttpport,omitempty"` - Mgmthttpsport int `json:"mgmthttpsport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pmtumin int `json:"pmtumin,omitempty"` - Pmtutimeout int `json:"pmtutimeout,omitempty"` - Proxyprotocol string `json:"proxyprotocol,omitempty"` - Securecookie string `json:"securecookie,omitempty"` - Secureicaports []interface{} `json:"secureicaports,omitempty"` - Servicepathingressvlan int `json:"servicepathingressvlan,omitempty"` - Tcpcip string `json:"tcpcip,omitempty"` - Timezone string `json:"timezone,omitempty"` - Useproxyport string `json:"useproxyport,omitempty"` -} - -type NsextensionExtensionfunctionBinding struct { - Activeextensionfunction int `json:"activeextensionfunction,omitempty"` - Extensionfuncdescription string `json:"extensionfuncdescription,omitempty"` - Extensionfunctionallparams []string `json:"extensionfunctionallparams,omitempty"` - Extensionfunctionallparamscount int `json:"extensionfunctionallparamscount,omitempty"` - Extensionfunctionargcount int `json:"extensionfunctionargcount,omitempty"` - Extensionfunctionargtype []string `json:"extensionfunctionargtype,omitempty"` - Extensionfunctionclasses []string `json:"extensionfunctionclasses,omitempty"` - Extensionfunctionclassescount int `json:"extensionfunctionclassescount,omitempty"` - Extensionfunctionclasstype string `json:"extensionfunctionclasstype,omitempty"` - Extensionfunctionlinenumber int `json:"extensionfunctionlinenumber,omitempty"` - Extensionfunctionname string `json:"extensionfunctionname,omitempty"` - Extensionfunctionreturntype string `json:"extensionfunctionreturntype,omitempty"` + ServiceFunction string `json:"servicefunction,omitempty"` + ServicePathName string `json:"servicepathname,omitempty"` +} + +type NSParam struct { + AdvancedAnalyticsStats string `json:"advancedanalyticsstats,omitempty"` + AFTPAllowRandomSourcePort string `json:"aftpallowrandomsourceport,omitempty"` + AutoScaleOption int `json:"autoscaleoption,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CookieVersion string `json:"cookieversion,omitempty"` + CRPortRange string `json:"crportrange,omitempty"` + ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` + ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` + FTPPortRange string `json:"ftpportrange,omitempty"` + GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` + GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` + HTTPPort []interface{} `json:"httpport,omitempty"` + ICAPorts []interface{} `json:"icaports,omitempty"` + InternalUserLogin string `json:"internaluserlogin,omitempty"` + IPTTL int `json:"ipttl,omitempty"` + MaxConn int `json:"maxconn,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MgmtHTTPPort int `json:"mgmthttpport,omitempty"` + MgmtHTTPSPort int `json:"mgmthttpsport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PMTUMin int `json:"pmtumin,omitempty"` + PMTUTimeout int `json:"pmtutimeout,omitempty"` + ProxyProtocol string `json:"proxyprotocol,omitempty"` + SecureCookie string `json:"securecookie,omitempty"` + SecureICAPorts []interface{} `json:"secureicaports,omitempty"` + ServicePathIngressVlan int `json:"servicepathingressvlan,omitempty"` + TCPCIP string `json:"tcpcip,omitempty"` + TimeZone string `json:"timezone,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` +} + +type NSExtensionExtensionFunctionBinding struct { + ActiveExtensionFunction int `json:"activeextensionfunction,omitempty"` + ExtensionFuncDescription string `json:"extensionfuncdescription,omitempty"` + ExtensionFunctionAllParams []string `json:"extensionfunctionallparams,omitempty"` + ExtensionFunctionAllParamsCount int `json:"extensionfunctionallparamscount,omitempty"` + ExtensionFunctionArgCount int `json:"extensionfunctionargcount,omitempty"` + ExtensionFunctionArgType []string `json:"extensionfunctionargtype,omitempty"` + ExtensionFunctionClasses []string `json:"extensionfunctionclasses,omitempty"` + ExtensionFunctionClassesCount int `json:"extensionfunctionclassescount,omitempty"` + ExtensionFunctionClassType string `json:"extensionfunctionclasstype,omitempty"` + ExtensionFunctionLineNumber int `json:"extensionfunctionlinenumber,omitempty"` + ExtensionFunctionName string `json:"extensionfunctionname,omitempty"` + ExtensionFunctionReturnType string `json:"extensionfunctionreturntype,omitempty"` Name string `json:"name,omitempty"` } -type Nsversion struct { - Installedversion bool `json:"installedversion,omitempty"` +type NSVersion struct { + InstalledVersion bool `json:"installedversion,omitempty"` Mode int `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Version string `json:"version,omitempty"` } -type Nshttpparam struct { +type NSHTTPParam struct { Builtin []string `json:"builtin,omitempty"` - Conmultiplex string `json:"conmultiplex,omitempty"` - Dropinvalreqs string `json:"dropinvalreqs,omitempty"` + ConMultiplex string `json:"conmultiplex,omitempty"` + DropInvalReqs string `json:"dropinvalreqs,omitempty"` Feature string `json:"feature,omitempty"` - Http2serverside string `json:"http2serverside,omitempty"` - Ignoreconnectcodingscheme string `json:"ignoreconnectcodingscheme,omitempty"` - Insnssrvrhdr string `json:"insnssrvrhdr,omitempty"` - Logerrresp string `json:"logerrresp,omitempty"` - Markconnreqinval string `json:"markconnreqinval,omitempty"` - Markhttp09inval string `json:"markhttp09inval,omitempty"` - Maxreusepool int `json:"maxreusepool,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nssrvrhdr string `json:"nssrvrhdr,omitempty"` -} - -type Nsip6 struct { - Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` + HTTP2ServerSide string `json:"http2serverside,omitempty"` + IgnoreConnectCodingScheme string `json:"ignoreconnectcodingscheme,omitempty"` + InsNSSrvrHdr string `json:"insnssrvrhdr,omitempty"` + LogErrResp string `json:"logerrresp,omitempty"` + MarkConnReqInval string `json:"markconnreqinval,omitempty"` + MarkHTTP09Inval string `json:"markhttp09inval,omitempty"` + MaxReusePool int `json:"maxreusepool,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSSrvrHdr string `json:"nssrvrhdr,omitempty"` +} + +type NSIP6 struct { + AdvertiseOnDefaultPartition string `json:"advertiseondefaultpartition,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate string `json:"curstate,omitempty"` - Decrementhoplimit string `json:"decrementhoplimit,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` - Ftp string `json:"ftp,omitempty"` - Gui string `json:"gui,omitempty"` - Hostroute string `json:"hostroute,omitempty"` - Icmp string `json:"icmp,omitempty"` - Icmpresponse string `json:"icmpresponse,omitempty"` - Ip6hostrtgw string `json:"ip6hostrtgw,omitempty"` - Iptype []string `json:"iptype,omitempty"` - Ipv6address string `json:"ipv6address,omitempty"` + CurState string `json:"curstate,omitempty"` + DecrementHopLimit string `json:"decrementhoplimit,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` + FTP string `json:"ftp,omitempty"` + GUI string `json:"gui,omitempty"` + HostRoute string `json:"hostroute,omitempty"` + ICMP string `json:"icmp,omitempty"` + ICMPResponse string `json:"icmpresponse,omitempty"` + IP6HostRtGw string `json:"ip6hostrtgw,omitempty"` + IPType []string `json:"iptype,omitempty"` + IPv6Address string `json:"ipv6address,omitempty"` MapField string `json:"map,omitempty"` Metric int `json:"metric,omitempty"` - Mgmtaccess string `json:"mgmtaccess,omitempty"` - Mptcpadvertise string `json:"mptcpadvertise,omitempty"` - Nd string `json:"nd,omitempty"` - Ndowner int `json:"ndowner,omitempty"` - Networkroute string `json:"networkroute,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Operationalndowner int `json:"operationalndowner,omitempty"` - Ospf6lsatype string `json:"ospf6lsatype,omitempty"` - Ospfarea int `json:"ospfarea,omitempty"` - Ownerdownresponse string `json:"ownerdownresponse,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Restrictaccess string `json:"restrictaccess,omitempty"` + MgmtAccess string `json:"mgmtaccess,omitempty"` + MPTCPAdvertise string `json:"mptcpadvertise,omitempty"` + ND string `json:"nd,omitempty"` + NDOwner int `json:"ndowner,omitempty"` + NetworkRoute string `json:"networkroute,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OperationalNDOwner int `json:"operationalndowner,omitempty"` + OSPF6LSAType string `json:"ospf6lsatype,omitempty"` + OSPFArea int `json:"ospfarea,omitempty"` + OwnerDownResponse string `json:"ownerdownresponse,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + RestrictAccess string `json:"restrictaccess,omitempty"` Scope string `json:"scope,omitempty"` - Snmp string `json:"snmp,omitempty"` - Ssh string `json:"ssh,omitempty"` + SNMP string `json:"snmp,omitempty"` + SSH string `json:"ssh,omitempty"` State string `json:"state,omitempty"` - Systemtype string `json:"systemtype,omitempty"` + SystemType string `json:"systemtype,omitempty"` Tag int `json:"tag,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` Telnet string `json:"telnet,omitempty"` TypeField string `json:"type,omitempty"` - Viprtadv2bsd bool `json:"viprtadv2bsd,omitempty"` - Vipvsercount int `json:"vipvsercount,omitempty"` - Vipvserdowncount int `json:"vipvserdowncount,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vrid6 int `json:"vrid6,omitempty"` - Vserver string `json:"vserver,omitempty"` - Vserverrhilevel string `json:"vserverrhilevel,omitempty"` -} - -type NspartitionVxlanBinding struct { - Partitionname string `json:"partitionname,omitempty"` - Vxlan int `json:"vxlan,omitempty"` -} - -type Nsip struct { - Advertiseondefaultpartition string `json:"advertiseondefaultpartition,omitempty"` - Arp string `json:"arp,omitempty"` - Arpowner int `json:"arpowner,omitempty"` - Arpresponse string `json:"arpresponse,omitempty"` - Bgp string `json:"bgp,omitempty"` + VIPRtAdv2BSD bool `json:"viprtadv2bsd,omitempty"` + VIPVSerCount int `json:"vipvsercount,omitempty"` + VIPVSerDownCount int `json:"vipvserdowncount,omitempty"` + VLAN int `json:"vlan,omitempty"` + VRID6 int `json:"vrid6,omitempty"` + VServer string `json:"vserver,omitempty"` + VServerRHILevel string `json:"vserverrhilevel,omitempty"` +} + +type NSPartitionVXLANBinding struct { + PartitionName string `json:"partitionname,omitempty"` + VXLAN int `json:"vxlan,omitempty"` +} + +type NSIP struct { + AdvertiseOnDefaultPartition string `json:"advertiseondefaultpartition,omitempty"` + ARP string `json:"arp,omitempty"` + ARPOwner int `json:"arpowner,omitempty"` + ARPResponse string `json:"arpresponse,omitempty"` + BGP string `json:"bgp,omitempty"` Count float64 `json:"__count,omitempty"` - Decrementttl string `json:"decrementttl,omitempty"` - Dynamicrouting string `json:"dynamicrouting,omitempty"` + DecrementTTL string `json:"decrementttl,omitempty"` + DynamicRouting string `json:"dynamicrouting,omitempty"` Flags int `json:"flags,omitempty"` - Freeports int `json:"freeports,omitempty"` - Ftp string `json:"ftp,omitempty"` - Gui string `json:"gui,omitempty"` - Hostroute string `json:"hostroute,omitempty"` - Hostrtgw string `json:"hostrtgw,omitempty"` - Hostrtgwact string `json:"hostrtgwact,omitempty"` - Icmp string `json:"icmp,omitempty"` - Icmpresponse string `json:"icmpresponse,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Iptype []string `json:"iptype,omitempty"` + FreePorts int `json:"freeports,omitempty"` + FTP string `json:"ftp,omitempty"` + GUI string `json:"gui,omitempty"` + HostRoute string `json:"hostroute,omitempty"` + HostRtGw string `json:"hostrtgw,omitempty"` + HostRtGwAct string `json:"hostrtgwact,omitempty"` + ICMP string `json:"icmp,omitempty"` + ICMPResponse string `json:"icmpresponse,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPType []string `json:"iptype,omitempty"` Metric int `json:"metric,omitempty"` - Mgmtaccess string `json:"mgmtaccess,omitempty"` - Mptcpadvertise string `json:"mptcpadvertise,omitempty"` + MgmtAccess string `json:"mgmtaccess,omitempty"` + MPTCPAdvertise string `json:"mptcpadvertise,omitempty"` Netmask string `json:"netmask,omitempty"` - Networkroute string `json:"networkroute,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Operationalarpowner int `json:"operationalarpowner,omitempty"` - Ospf string `json:"ospf,omitempty"` - Ospfarea int `json:"ospfarea,omitempty"` - Ospfareaval int `json:"ospfareaval,omitempty"` - Ospflsatype string `json:"ospflsatype,omitempty"` - Ownerdownresponse string `json:"ownerdownresponse,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Restrictaccess string `json:"restrictaccess,omitempty"` - Rip string `json:"rip,omitempty"` - Snmp string `json:"snmp,omitempty"` - Ssh string `json:"ssh,omitempty"` + NetworkRoute string `json:"networkroute,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OperationalARPOwner int `json:"operationalarpowner,omitempty"` + OSPF string `json:"ospf,omitempty"` + OSPFArea int `json:"ospfarea,omitempty"` + OSPFAreaVal int `json:"ospfareaval,omitempty"` + OSPFLSAType string `json:"ospflsatype,omitempty"` + OwnerDownResponse string `json:"ownerdownresponse,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + RestrictAccess string `json:"restrictaccess,omitempty"` + RIP string `json:"rip,omitempty"` + SNMP string `json:"snmp,omitempty"` + SSH string `json:"ssh,omitempty"` State string `json:"state,omitempty"` Tag int `json:"tag,omitempty"` - Td int `json:"td,omitempty"` + TD int `json:"td,omitempty"` Telnet string `json:"telnet,omitempty"` TypeField string `json:"type,omitempty"` - Viprtadv2bsd bool `json:"viprtadv2bsd,omitempty"` - Vipvsercount int `json:"vipvsercount,omitempty"` - Vipvserdowncount int `json:"vipvserdowncount,omitempty"` - Vipvsrvrrhiactivecount int `json:"vipvsrvrrhiactivecount,omitempty"` - Vipvsrvrrhiactiveupcount int `json:"vipvsrvrrhiactiveupcount,omitempty"` - Vrid int `json:"vrid,omitempty"` - Vserver string `json:"vserver,omitempty"` - Vserverrhilevel string `json:"vserverrhilevel,omitempty"` + VIPRtAdv2BSD bool `json:"viprtadv2bsd,omitempty"` + VIPVSerCount int `json:"vipvsercount,omitempty"` + VIPVSerDownCount int `json:"vipvserdowncount,omitempty"` + VIPVSrvrRHIActiveCount int `json:"vipvsrvrrhiactivecount,omitempty"` + VIPVSrvrRHIActiveUpCount int `json:"vipvsrvrrhiactiveupcount,omitempty"` + VRID int `json:"vrid,omitempty"` + VServer string `json:"vserver,omitempty"` + VServerRHILevel string `json:"vserverrhilevel,omitempty"` } -type Nsextension struct { +type NSExtension struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Detail string `json:"detail,omitempty"` - Functionhaltcount int `json:"functionhaltcount,omitempty"` - Functionhits int `json:"functionhits,omitempty"` - Functionundefhits int `json:"functionundefhits,omitempty"` + FunctionHaltCount int `json:"functionhaltcount,omitempty"` + FunctionHits int `json:"functionhits,omitempty"` + FunctionUndefHits int `json:"functionundefhits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` Src string `json:"src,omitempty"` Trace string `json:"trace,omitempty"` - Tracefunctions string `json:"tracefunctions,omitempty"` - Tracevariables string `json:"tracevariables,omitempty"` + TraceFunctions string `json:"tracefunctions,omitempty"` + TraceVariables string `json:"tracevariables,omitempty"` TypeField string `json:"type,omitempty"` } type Shutdown struct { } -type Nscapacity struct { - Actualbandwidth int `json:"actualbandwidth,omitempty"` +type NSCapacity struct { + ActualBandwidth int `json:"actualbandwidth,omitempty"` Bandwidth int `json:"bandwidth,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` Edition string `json:"edition,omitempty"` - Instancecount int `json:"instancecount,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` - Maxvcpucount int `json:"maxvcpucount,omitempty"` - Minbandwidth int `json:"minbandwidth,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + InstanceCount int `json:"instancecount,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + MaxVCPUCount int `json:"maxvcpucount,omitempty"` + MinBandwidth int `json:"minbandwidth,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Password string `json:"password,omitempty"` Platform string `json:"platform,omitempty"` Unit string `json:"unit,omitempty"` Username string `json:"username,omitempty"` - Vcpu bool `json:"vcpu,omitempty"` - Vcpucount int `json:"vcpucount,omitempty"` + VCPU bool `json:"vcpu,omitempty"` + VCPUCount int `json:"vcpucount,omitempty"` } -type Nssavedconfig struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Textblob string `json:"textblob,omitempty"` +type NSSavedConfig struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TextBlob string `json:"textblob,omitempty"` } -type Nsrpcnode struct { +type NSRPCNode struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Secure string `json:"secure,omitempty"` - Srcip string `json:"srcip,omitempty"` - Validatecert string `json:"validatecert,omitempty"` + SrcIP string `json:"srcip,omitempty"` + ValidateCert string `json:"validatecert,omitempty"` } -type Nsassignment struct { +type NSAssignment struct { Add string `json:"Add,omitempty"` Append string `json:"append,omitempty"` Clear bool `json:"clear,omitempty"` @@ -777,1041 +777,1041 @@ type Nsassignment struct { Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` Set string `json:"set,omitempty"` Sub string `json:"sub,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` Variable string `json:"variable,omitempty"` } -type Nstcpbufparam struct { +type NSTCPBufParam struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Memlimit int `json:"memlimit,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + MemLimit int `json:"memlimit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Size int `json:"size,omitempty"` } -type Nsratecontrol struct { - Icmpthreshold int `json:"icmpthreshold,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Tcprstthreshold int `json:"tcprstthreshold,omitempty"` - Tcpthreshold int `json:"tcpthreshold,omitempty"` - Udpthreshold int `json:"udpthreshold,omitempty"` +type NSRateControl struct { + ICMPThreshold int `json:"icmpthreshold,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TCPRstThreshold int `json:"tcprstthreshold,omitempty"` + TCPThreshold int `json:"tcpthreshold,omitempty"` + UDPThreshold int `json:"udpthreshold,omitempty"` } -type Nslimitsessions struct { +type NSLimitSessions struct { Count float64 `json:"__count,omitempty"` Detail bool `json:"detail,omitempty"` Drop int `json:"drop,omitempty"` Flag int `json:"flag,omitempty"` Flags int `json:"flags,omitempty"` Hits int `json:"hits,omitempty"` - Limitidentifier string `json:"limitidentifier,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` + LimitIdentifier string `json:"limitidentifier,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Number []interface{} `json:"number,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Selectoripv61 string `json:"selectoripv61,omitempty"` - Selectoripv62 string `json:"selectoripv62,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + SelectorIPv61 string `json:"selectoripv61,omitempty"` + SelectorIPv62 string `json:"selectoripv62,omitempty"` Timeout int `json:"timeout,omitempty"` Unit int `json:"unit,omitempty"` } -type NstrafficdomainVlanBinding struct { - Td int `json:"td,omitempty"` - Vlan int `json:"vlan,omitempty"` +type NSTrafficDomainVLANBinding struct { + TD int `json:"td,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Nsspparams struct { - Basethreshold int `json:"basethreshold,omitempty"` +type NSSPParams struct { + BaseThreshold int `json:"basethreshold,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Table0 []interface{} `json:"table0,omitempty"` Throttle string `json:"throttle,omitempty"` } -type Nsacls6 struct { +type NSACLs6 struct { TypeField string `json:"type,omitempty"` } -type Nsrunningconfig struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NSRunningConfig struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Response string `json:"response,omitempty"` - Withdefaults bool `json:"withdefaults,omitempty"` + WithDefaults bool `json:"withdefaults,omitempty"` } type Reboot struct { Warm bool `json:"warm,omitempty"` } -type Nstimer struct { +type NSTimer struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Interval int `json:"interval,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Unit string `json:"unit,omitempty"` } -type Nscentralmanagementserver struct { - Activationcode string `json:"activationcode,omitempty"` - Adcpassword string `json:"adcpassword,omitempty"` - Adcusername string `json:"adcusername,omitempty"` - Admserviceconnectionstatus string `json:"admserviceconnectionstatus,omitempty"` - Admserviceenvironment string `json:"admserviceenvironment,omitempty"` +type NSCentralManagementServer struct { + ActivationCode string `json:"activationcode,omitempty"` + ADCPassword string `json:"adcpassword,omitempty"` + ADCUsername string `json:"adcusername,omitempty"` + ADMServiceConnectionStatus string `json:"admserviceconnectionstatus,omitempty"` + ADMServiceEnvironment string `json:"admserviceenvironment,omitempty"` Count float64 `json:"__count,omitempty"` - Customerid string `json:"customerid,omitempty"` - Deviceprofilename string `json:"deviceprofilename,omitempty"` - Instanceid string `json:"instanceid,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + CustomerID string `json:"customerid,omitempty"` + DeviceProfileName string `json:"deviceprofilename,omitempty"` + InstanceID string `json:"instanceid,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` - Servername string `json:"servername,omitempty"` + ServerName string `json:"servername,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` - Validatecert string `json:"validatecert,omitempty"` + ValidateCert string `json:"validatecert,omitempty"` } -type Nsencryptionparams struct { - Keyvalue string `json:"keyvalue,omitempty"` +type NSEncryptionParams struct { + KeyValue string `json:"keyvalue,omitempty"` Method string `json:"method,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nssourceroutecachetable struct { +type NSSourceRouteCacheTable struct { Count float64 `json:"__count,omitempty"` InterfaceField string `json:"Interface,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sourceip string `json:"sourceip,omitempty"` - Sourcemac string `json:"sourcemac,omitempty"` - Vlan int `json:"vlan,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SourceIP string `json:"sourceip,omitempty"` + SourceMAC string `json:"sourcemac,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Nstimezone struct { +type NSTimeZone struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Value string `json:"value,omitempty"` } -type Nsacl6 struct { - Acl6action string `json:"acl6action,omitempty"` - Acl6name string `json:"acl6name,omitempty"` - Aclaction string `json:"aclaction,omitempty"` - Aclassociate []string `json:"aclassociate,omitempty"` +type NSACL6 struct { + ACL6Action string `json:"acl6action,omitempty"` + ACL6Name string `json:"acl6name,omitempty"` + ACLAction string `json:"aclaction,omitempty"` + ACLAssociate []string `json:"aclassociate,omitempty"` Count float64 `json:"__count,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipv6 bool `json:"destipv6,omitempty"` - Destipv6val string `json:"destipv6val,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Dfdhash string `json:"dfdhash,omitempty"` - Dfdprefix int `json:"dfdprefix,omitempty"` + DestIPOp string `json:"destipop,omitempty"` + DestIPv6 bool `json:"destipv6,omitempty"` + DestIPv6Val string `json:"destipv6val,omitempty"` + DestPort bool `json:"destport,omitempty"` + DestPortOp string `json:"destportop,omitempty"` + DestPortVal string `json:"destportval,omitempty"` + DFDHash string `json:"dfdhash,omitempty"` + DFDPrefix int `json:"dfdprefix,omitempty"` Established bool `json:"established,omitempty"` Hits int `json:"hits,omitempty"` - Icmpcode int `json:"icmpcode,omitempty"` - Icmptype int `json:"icmptype,omitempty"` + ICMPCode int `json:"icmpcode,omitempty"` + ICMPType int `json:"icmptype,omitempty"` InterfaceField string `json:"Interface,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Logstate string `json:"logstate,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + KernelState string `json:"kernelstate,omitempty"` + LogState string `json:"logstate,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Priority int `json:"priority,omitempty"` Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Ratelimit int `json:"ratelimit,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipv6 bool `json:"srcipv6,omitempty"` - Srcipv6val string `json:"srcipv6val,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` + ProtocolNumber int `json:"protocolnumber,omitempty"` + RateLimit int `json:"ratelimit,omitempty"` + SrcIPOp string `json:"srcipop,omitempty"` + SrcIPv6 bool `json:"srcipv6,omitempty"` + SrcIPv6Val string `json:"srcipv6val,omitempty"` + SrcMAC string `json:"srcmac,omitempty"` + SrcMACMask string `json:"srcmacmask,omitempty"` + SrcPort bool `json:"srcport,omitempty"` + SrcPortOp string `json:"srcportop,omitempty"` + SrcPortVal string `json:"srcportval,omitempty"` State string `json:"state,omitempty"` Stateful string `json:"stateful,omitempty"` - Td int `json:"td,omitempty"` - Ttl int `json:"ttl,omitempty"` + TD int `json:"td,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Nsappflowparam struct { - Clienttrafficonly string `json:"clienttrafficonly,omitempty"` - Httpcookie string `json:"httpcookie,omitempty"` - Httphost string `json:"httphost,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Httpreferer string `json:"httpreferer,omitempty"` - Httpurl string `json:"httpurl,omitempty"` - Httpuseragent string `json:"httpuseragent,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Templaterefresh int `json:"templaterefresh,omitempty"` - Udppmtu int `json:"udppmtu,omitempty"` +type NSAppFlowParam struct { + ClientTrafficOnly string `json:"clienttrafficonly,omitempty"` + HTTPCookie string `json:"httpcookie,omitempty"` + HTTPHost string `json:"httphost,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + HTTPReferer string `json:"httpreferer,omitempty"` + HTTPURL string `json:"httpurl,omitempty"` + HTTPUserAgent string `json:"httpuseragent,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TemplateRefresh int `json:"templaterefresh,omitempty"` + UDPPMTU int `json:"udppmtu,omitempty"` } -type Nsvariable struct { +type NSVariable struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Expires int `json:"expires,omitempty"` - Iffull string `json:"iffull,omitempty"` - Ifnovalue string `json:"ifnovalue,omitempty"` - Ifvaluetoobig string `json:"ifvaluetoobig,omitempty"` + IfFull string `json:"iffull,omitempty"` + IfNoValue string `json:"ifnovalue,omitempty"` + IfValueTooBig string `json:"ifvaluetoobig,omitempty"` Init string `json:"init,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` Scope string `json:"scope,omitempty"` TypeField string `json:"type,omitempty"` } -type Nsconsoleloginprompt struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Promptstring string `json:"promptstring,omitempty"` +type NSConsoleLoginPrompt struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PromptString string `json:"promptstring,omitempty"` } -type Nshostname struct { +type NSHostname struct { Count float64 `json:"__count,omitempty"` Hostname string `json:"hostname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } -type Nsjob struct { +type NSJob struct { Count float64 `json:"__count,omitempty"` - Errorcode int `json:"errorcode,omitempty"` - Id int `json:"id,omitempty"` + ErrorCode int `json:"errorcode,omitempty"` + ID int `json:"id,omitempty"` Message string `json:"message,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Progress string `json:"progress,omitempty"` Response string `json:"response,omitempty"` Status string `json:"status,omitempty"` - Timeelapsed int `json:"timeelapsed,omitempty"` + TimeElapsed int `json:"timeelapsed,omitempty"` } -type Nsappflowcollector struct { +type NSAppFlowCollector struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Port int `json:"port,omitempty"` } -type Nslimitselector struct { +type NSLimitSelector struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule []string `json:"rule,omitempty"` - Selectorname string `json:"selectorname,omitempty"` + SelectorName string `json:"selectorname,omitempty"` } -type Nstimeout struct { - Anyclient int `json:"anyclient,omitempty"` - Anyserver int `json:"anyserver,omitempty"` - Anytcpclient int `json:"anytcpclient,omitempty"` - Anytcpserver int `json:"anytcpserver,omitempty"` +type NSTimeout struct { + AnyClient int `json:"anyclient,omitempty"` + AnyServer int `json:"anyserver,omitempty"` + AnyTCPClient int `json:"anytcpclient,omitempty"` + AnyTCPServer int `json:"anytcpserver,omitempty"` Client int `json:"client,omitempty"` - Halfclose int `json:"halfclose,omitempty"` - Httpclient int `json:"httpclient,omitempty"` - Httpserver int `json:"httpserver,omitempty"` - Newconnidletimeout int `json:"newconnidletimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nontcpzombie int `json:"nontcpzombie,omitempty"` - Reducedfintimeout int `json:"reducedfintimeout,omitempty"` - Reducedrsttimeout int `json:"reducedrsttimeout,omitempty"` + HalfClose int `json:"halfclose,omitempty"` + HTTPClient int `json:"httpclient,omitempty"` + HTTPServer int `json:"httpserver,omitempty"` + NewConnIdleTimeout int `json:"newconnidletimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NonTCPZombie int `json:"nontcpzombie,omitempty"` + ReducedFinTimeout int `json:"reducedfintimeout,omitempty"` + ReducedRstTimeout int `json:"reducedrsttimeout,omitempty"` Server int `json:"server,omitempty"` - Tcpclient int `json:"tcpclient,omitempty"` - Tcpserver int `json:"tcpserver,omitempty"` + TCPClient int `json:"tcpclient,omitempty"` + TCPServer int `json:"tcpserver,omitempty"` Zombie int `json:"zombie,omitempty"` } -type Nstcpparam struct { - Ackonpush string `json:"ackonpush,omitempty"` - Autosyncookietimeout int `json:"autosyncookietimeout,omitempty"` +type NSTCPParam struct { + AckOnPush string `json:"ackonpush,omitempty"` + AutoSynCookieTimeout int `json:"autosyncookietimeout,omitempty"` Builtin []string `json:"builtin,omitempty"` - Compacttcpoptionnoop string `json:"compacttcpoptionnoop,omitempty"` - Connflushifnomem string `json:"connflushifnomem,omitempty"` - Connflushthres int `json:"connflushthres,omitempty"` - Delayedack int `json:"delayedack,omitempty"` - Delinkclientserveronrst string `json:"delinkclientserveronrst,omitempty"` - Downstaterst string `json:"downstaterst,omitempty"` - Enhancedisngeneration string `json:"enhancedisngeneration,omitempty"` + CompactTCPOptionNoOp string `json:"compacttcpoptionnoop,omitempty"` + ConnFlushIfNoMem string `json:"connflushifnomem,omitempty"` + ConnFlushThres int `json:"connflushthres,omitempty"` + DelayedAck int `json:"delayedack,omitempty"` + DelinkClientServerOnRst string `json:"delinkclientserveronrst,omitempty"` + DownStateRst string `json:"downstaterst,omitempty"` + EnhancedISNGeneration string `json:"enhancedisngeneration,omitempty"` Feature string `json:"feature,omitempty"` - Initialcwnd int `json:"initialcwnd,omitempty"` - Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` - Learnvsvrmss string `json:"learnvsvrmss,omitempty"` - Limitedpersist string `json:"limitedpersist,omitempty"` - Maxburst int `json:"maxburst,omitempty"` - Maxdynserverprobes int `json:"maxdynserverprobes,omitempty"` - Maxpktpermss int `json:"maxpktpermss,omitempty"` - Maxsynackretx int `json:"maxsynackretx,omitempty"` - Maxsynhold int `json:"maxsynhold,omitempty"` - Maxsynholdperprobe int `json:"maxsynholdperprobe,omitempty"` - Maxtimewaitconn int `json:"maxtimewaitconn,omitempty"` - Minrto int `json:"minrto,omitempty"` - Mptcpchecksum string `json:"mptcpchecksum,omitempty"` - Mptcpclosemptcpsessiononlastsfclose string `json:"mptcpclosemptcpsessiononlastsfclose,omitempty"` - Mptcpconcloseonpassivesf string `json:"mptcpconcloseonpassivesf,omitempty"` - Mptcpfastcloseoption string `json:"mptcpfastcloseoption,omitempty"` - Mptcpimmediatesfcloseonfin string `json:"mptcpimmediatesfcloseonfin,omitempty"` - Mptcpmaxpendingsf int `json:"mptcpmaxpendingsf,omitempty"` - Mptcpmaxsf int `json:"mptcpmaxsf,omitempty"` - Mptcppendingjointhreshold int `json:"mptcppendingjointhreshold,omitempty"` - Mptcpreliableaddaddr string `json:"mptcpreliableaddaddr,omitempty"` - Mptcprtostoswitchsf int `json:"mptcprtostoswitchsf,omitempty"` - Mptcpsendsfresetoption string `json:"mptcpsendsfresetoption,omitempty"` - Mptcpsfreplacetimeout int `json:"mptcpsfreplacetimeout,omitempty"` - Mptcpsftimeout int `json:"mptcpsftimeout,omitempty"` - Mptcpusebackupondss string `json:"mptcpusebackupondss,omitempty"` - Msslearndelay int `json:"msslearndelay,omitempty"` - Msslearninterval int `json:"msslearninterval,omitempty"` + InitialCwnd int `json:"initialcwnd,omitempty"` + KAProbeUpdateLastActivity string `json:"kaprobeupdatelastactivity,omitempty"` + LearnVSvrMSS string `json:"learnvsvrmss,omitempty"` + LimitedPersist string `json:"limitedpersist,omitempty"` + MaxBurst int `json:"maxburst,omitempty"` + MaxDynServerProbes int `json:"maxdynserverprobes,omitempty"` + MaxPktPerMSS int `json:"maxpktpermss,omitempty"` + MaxSynAckRetx int `json:"maxsynackretx,omitempty"` + MaxSynHold int `json:"maxsynhold,omitempty"` + MaxSynHoldPerProbe int `json:"maxsynholdperprobe,omitempty"` + MaxTimeWaitConn int `json:"maxtimewaitconn,omitempty"` + MinRTO int `json:"minrto,omitempty"` + MPTCPChecksum string `json:"mptcpchecksum,omitempty"` + MPTCPCloseMPTCPSessionOnLastSFClose string `json:"mptcpclosemptcpsessiononlastsfclose,omitempty"` + MPTCPConCloseOnPassiveSF string `json:"mptcpconcloseonpassivesf,omitempty"` + MPTCPFastCloseOption string `json:"mptcpfastcloseoption,omitempty"` + MPTCPImmediateSFCloseOnFin string `json:"mptcpimmediatesfcloseonfin,omitempty"` + MPTCPMaxPendingSF int `json:"mptcpmaxpendingsf,omitempty"` + MPTCPMaxSF int `json:"mptcpmaxsf,omitempty"` + MPTCPPendingJoinThreshold int `json:"mptcppendingjointhreshold,omitempty"` + MPTCPReliableAddAddr string `json:"mptcpreliableaddaddr,omitempty"` + MPTCPRTOsToSwitchSF int `json:"mptcprtostoswitchsf,omitempty"` + MPTCPSendSFResetOption string `json:"mptcpsendsfresetoption,omitempty"` + MPTCPSFReplaceTimeout int `json:"mptcpsfreplacetimeout,omitempty"` + MPTCPSFTimeout int `json:"mptcpsftimeout,omitempty"` + MPTCPUseBackupOnDSS string `json:"mptcpusebackupondss,omitempty"` + MSSLearnDelay int `json:"msslearndelay,omitempty"` + MSSLearnInterval int `json:"msslearninterval,omitempty"` Nagle string `json:"nagle,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oooqsize int `json:"oooqsize,omitempty"` - Pktperretx int `json:"pktperretx,omitempty"` - Recvbuffsize int `json:"recvbuffsize,omitempty"` - Rfc5961chlgacklimit int `json:"rfc5961chlgacklimit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OOOQSize int `json:"oooqsize,omitempty"` + PktPerRetx int `json:"pktperretx,omitempty"` + RecvBuffSize int `json:"recvbuffsize,omitempty"` + RFC5961ChlgAckLimit int `json:"rfc5961chlgacklimit,omitempty"` Sack string `json:"sack,omitempty"` - Sendresetreasoncode string `json:"sendresetreasoncode,omitempty"` - Slowstartincr int `json:"slowstartincr,omitempty"` - Synattackdetection string `json:"synattackdetection,omitempty"` - Synholdfastgiveup int `json:"synholdfastgiveup,omitempty"` - Tcpfastopencookietimeout int `json:"tcpfastopencookietimeout,omitempty"` - Tcpfintimeout int `json:"tcpfintimeout,omitempty"` - Tcpmaxretries int `json:"tcpmaxretries,omitempty"` + SendResetReasonCode string `json:"sendresetreasoncode,omitempty"` + SlowStartIncr int `json:"slowstartincr,omitempty"` + SynAttackDetection string `json:"synattackdetection,omitempty"` + SynHoldFastGiveUp int `json:"synholdfastgiveup,omitempty"` + TCPFastOpenCookieTimeout int `json:"tcpfastopencookietimeout,omitempty"` + TCPFinTimeout int `json:"tcpfintimeout,omitempty"` + TCPMaxRetries int `json:"tcpmaxretries,omitempty"` Ws string `json:"ws,omitempty"` - Wsval int `json:"wsval,omitempty"` + WSVal int `json:"wsval,omitempty"` } -type Nsservicefunction struct { +type NSServiceFunction struct { Count float64 `json:"__count,omitempty"` - Ingressvlan int `json:"ingressvlan,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Servicefunctionname string `json:"servicefunctionname,omitempty"` + IngressVLAN int `json:"ingressvlan,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServiceFunctionName string `json:"servicefunctionname,omitempty"` } -type Nschannelparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Vfautorecover string `json:"vfautorecover,omitempty"` +type NSChannelParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + VFAutoRecover string `json:"vfautorecover,omitempty"` } -type Nsencryptionkey struct { +type NSEncryptionKey struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Iv string `json:"iv,omitempty"` - Keyvalue string `json:"keyvalue,omitempty"` + IV string `json:"iv,omitempty"` + KeyValue string `json:"keyvalue,omitempty"` Method string `json:"method,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Padding string `json:"padding,omitempty"` } -type Nskeymanagerproxy struct { +type NSKeyManagerProxy struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Port int `json:"port,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` Status int `json:"status,omitempty"` } -type Nsicapprofile struct { +type NSICAPProfile struct { Allow204 string `json:"allow204,omitempty"` - Connectionkeepalive string `json:"connectionkeepalive,omitempty"` + ConnectionKeepAlive string `json:"connectionkeepalive,omitempty"` Count float64 `json:"__count,omitempty"` - Hostheader string `json:"hostheader,omitempty"` - Inserthttprequest string `json:"inserthttprequest,omitempty"` - Inserticapheaders string `json:"inserticapheaders,omitempty"` - Inspecthttp2 string `json:"inspecthttp2,omitempty"` - Logaction string `json:"logaction,omitempty"` + HostHeader string `json:"hostheader,omitempty"` + InsertHTTPRequest string `json:"inserthttprequest,omitempty"` + InsertICAPHeaders string `json:"inserticapheaders,omitempty"` + InspectHTTP2 string `json:"inspecthttp2,omitempty"` + LogAction string `json:"logaction,omitempty"` Mode string `json:"mode,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Preview string `json:"preview,omitempty"` - Previewlength int `json:"previewlength,omitempty"` - Queryparams string `json:"queryparams,omitempty"` - Reqtimeout int `json:"reqtimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Uri string `json:"uri,omitempty"` - Useragent string `json:"useragent,omitempty"` + PreviewLength int `json:"previewlength,omitempty"` + QueryParams string `json:"queryparams,omitempty"` + ReqTimeout int `json:"reqtimeout,omitempty"` + ReqTimeoutAction string `json:"reqtimeoutaction,omitempty"` + URI string `json:"uri,omitempty"` + UserAgent string `json:"useragent,omitempty"` } -type Nssimpleacl struct { - Aclaction string `json:"aclaction,omitempty"` - Aclname string `json:"aclname,omitempty"` +type NSSimpleACL struct { + ACLAction string `json:"aclaction,omitempty"` + ACLName string `json:"aclname,omitempty"` Count float64 `json:"__count,omitempty"` - Destport int `json:"destport,omitempty"` - Estsessions bool `json:"estsessions,omitempty"` + DestPort int `json:"destport,omitempty"` + EstSessions bool `json:"estsessions,omitempty"` Hits int `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Protocol string `json:"protocol,omitempty"` - Srcip string `json:"srcip,omitempty"` - Td int `json:"td,omitempty"` - Ttl int `json:"ttl,omitempty"` + SrcIP string `json:"srcip,omitempty"` + TD int `json:"td,omitempty"` + TTL int `json:"ttl,omitempty"` } -type Nsvariablevalues struct { +type NSVariableValues struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Variabledata string `json:"variabledata,omitempty"` - Variablekey string `json:"variablekey,omitempty"` - Variablevalue string `json:"variablevalue,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + VariableData string `json:"variabledata,omitempty"` + VariableKey string `json:"variablekey,omitempty"` + VariableValue string `json:"variablevalue,omitempty"` } -type Nspbrs struct { +type NSPBRs struct { } -type Nsweblogparam struct { - Buffersizemb int `json:"buffersizemb,omitempty"` +type NSWebLogParam struct { + BufferSizeMB int `json:"buffersizemb,omitempty"` Builtin []string `json:"builtin,omitempty"` - Customreqhdrs []string `json:"customreqhdrs,omitempty"` - Customrsphdrs []string `json:"customrsphdrs,omitempty"` + CustomReqHdrs []string `json:"customreqhdrs,omitempty"` + CustomRspHdrs []string `json:"customrsphdrs,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nslicenseactivationdata struct { +type NSLicenseActivationData struct { Filename string `json:"filename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nsevents struct { +type NSEvents struct { Count float64 `json:"__count,omitempty"` Data0 int `json:"data0,omitempty"` Data1 int `json:"data1,omitempty"` Data2 int `json:"data2,omitempty"` Data3 int `json:"data3,omitempty"` - Devid int `json:"devid,omitempty"` - Devname string `json:"devname,omitempty"` - Eventcode int `json:"eventcode,omitempty"` - Eventno int `json:"eventno,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + DevID int `json:"devid,omitempty"` + DevName string `json:"devname,omitempty"` + EventCode int `json:"eventcode,omitempty"` + EventNo int `json:"eventno,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Text string `json:"text,omitempty"` Time int `json:"time,omitempty"` } -type Nsmigration struct { +type NSMigration struct { Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Dumpsession string `json:"dumpsession,omitempty"` - Migdfdsessionsactive int `json:"migdfdsessionsactive,omitempty"` - Migdfdsessionsactiverollback int `json:"migdfdsessionsactiverollback,omitempty"` - Migdfdsessionsallocated int `json:"migdfdsessionsallocated,omitempty"` - Migdfdsessionsallocatedrollback int `json:"migdfdsessionsallocatedrollback,omitempty"` - Mighastateflag int `json:"mighastateflag,omitempty"` - Migl4sessionsactive int `json:"migl4sessionsactive,omitempty"` - Migl4sessionsactiverollback int `json:"migl4sessionsactiverollback,omitempty"` - Migl4sessionsallocated int `json:"migl4sessionsallocated,omitempty"` - Migl4sessionsallocatedrollback int `json:"migl4sessionsallocatedrollback,omitempty"` - Migrationendtime string `json:"migrationendtime,omitempty"` - Migrationrollbackstarttime string `json:"migrationrollbackstarttime,omitempty"` - Migrationstarttime string `json:"migrationstarttime,omitempty"` - Migrationstatus string `json:"migrationstatus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + DumpSession string `json:"dumpsession,omitempty"` + MigDFDSessionsActive int `json:"migdfdsessionsactive,omitempty"` + MigDFDSessionsActiveRollback int `json:"migdfdsessionsactiverollback,omitempty"` + MigDFDSessionsAllocated int `json:"migdfdsessionsallocated,omitempty"` + MigDFDSessionsAllocatedRollback int `json:"migdfdsessionsallocatedrollback,omitempty"` + MigHAStateFlag int `json:"mighastateflag,omitempty"` + MigL4SessionsActive int `json:"migl4sessionsactive,omitempty"` + MigL4SessionsActiveRollback int `json:"migl4sessionsactiverollback,omitempty"` + MigL4SessionsAllocated int `json:"migl4sessionsallocated,omitempty"` + MigL4SessionsAllocatedRollback int `json:"migl4sessionsallocatedrollback,omitempty"` + MigrationEndTime string `json:"migrationendtime,omitempty"` + MigrationRollbackStartTime string `json:"migrationrollbackstarttime,omitempty"` + MigrationStartTime string `json:"migrationstarttime,omitempty"` + MigrationStatus string `json:"migrationstatus,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcPort int `json:"srcport,omitempty"` Timeout int `json:"timeout,omitempty"` } -type Nshmackey struct { +type NSHMACKey struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Digest string `json:"digest,omitempty"` - Keyvalue string `json:"keyvalue,omitempty"` + KeyValue string `json:"keyvalue,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nspbr6 struct { +type NSPBR6 struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate int `json:"curstate,omitempty"` + CurState int `json:"curstate,omitempty"` Data bool `json:"data,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipv6 bool `json:"destipv6,omitempty"` - Destipv6val string `json:"destipv6val,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` + DestIPOp string `json:"destipop,omitempty"` + DestIPv6 bool `json:"destipv6,omitempty"` + DestIPv6Val string `json:"destipv6val,omitempty"` + DestPort bool `json:"destport,omitempty"` + DestPortOp string `json:"destportop,omitempty"` + DestPortVal string `json:"destportval,omitempty"` Detail bool `json:"detail,omitempty"` - Failedprobes int `json:"failedprobes,omitempty"` + FailedProbes int `json:"failedprobes,omitempty"` Hits int `json:"hits,omitempty"` - InterfaceField string `json:"Interface,omitempty"` - Iptunnel string `json:"iptunnel,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` + Interface string `json:"Interface,omitempty"` + IPTunnel string `json:"iptunnel,omitempty"` + KernelState string `json:"kernelstate,omitempty"` Monitor string `json:"monitor,omitempty"` - Monstatcode int `json:"monstatcode,omitempty"` - Monstatparam1 int `json:"monstatparam1,omitempty"` - Monstatparam2 int `json:"monstatparam2,omitempty"` - Monstatparam3 int `json:"monstatparam3,omitempty"` - Msr string `json:"msr,omitempty"` + MonStatCode int `json:"monstatcode,omitempty"` + MonStatParam1 int `json:"monstatparam1,omitempty"` + MonStatParam2 int `json:"monstatparam2,omitempty"` + MonStatParam3 int `json:"monstatparam3,omitempty"` + MSR string `json:"msr,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nexthop bool `json:"nexthop,omitempty"` - Nexthopval string `json:"nexthopval,omitempty"` - Nexthopvlan int `json:"nexthopvlan,omitempty"` - Ownergroup string `json:"ownergroup,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextHop bool `json:"nexthop,omitempty"` + NextHopVal string `json:"nexthopval,omitempty"` + NextHopVLAN int `json:"nexthopvlan,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` Priority int `json:"priority,omitempty"` Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipv6 bool `json:"srcipv6,omitempty"` - Srcipv6val string `json:"srcipv6val,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` + ProtocolNumber int `json:"protocolnumber,omitempty"` + SrcIPOp string `json:"srcipop,omitempty"` + SrcIPv6 bool `json:"srcipv6,omitempty"` + SrcIPv6Val string `json:"srcipv6val,omitempty"` + SrcMAC string `json:"srcmac,omitempty"` + SrcMACMask string `json:"srcmacmask,omitempty"` + SrcPort bool `json:"srcport,omitempty"` + SrcPortOp string `json:"srcportop,omitempty"` + SrcPortVal string `json:"srcportval,omitempty"` State string `json:"state,omitempty"` - Td int `json:"td,omitempty"` - Totalfailedprobes int `json:"totalfailedprobes,omitempty"` - Totalprobes int `json:"totalprobes,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` - Vxlanvlanmap string `json:"vxlanvlanmap,omitempty"` + TD int `json:"td,omitempty"` + TotalFailedProbes int `json:"totalfailedprobes,omitempty"` + TotalProbes int `json:"totalprobes,omitempty"` + VLAN int `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` + VXLANVLANMap string `json:"vxlanvlanmap,omitempty"` } -type Nsacls struct { +type NSACLs struct { TypeField string `json:"type,omitempty"` } -type Nsdhcpparams struct { - Dhcpclient string `json:"dhcpclient,omitempty"` - Hostrtgw string `json:"hostrtgw,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` +type NSDHCPParams struct { + DHCPClient string `json:"dhcpclient,omitempty"` + HostRtGw string `json:"hostrtgw,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Running bool `json:"running,omitempty"` - Saveroute string `json:"saveroute,omitempty"` + SaveRoute string `json:"saveroute,omitempty"` } -type Nssurgeq struct { +type NSSurgeQ struct { Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` - Servername string `json:"servername,omitempty"` + ServerName string `json:"servername,omitempty"` } -type Nsnextgenapi struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NSNextGenAPI struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } -type Nsxmlnamespace struct { +type NSXMLNamespace struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Namespace string `json:"Namespace,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Prefix string `json:"prefix,omitempty"` } -type Nsacl struct { - Aclaction string `json:"aclaction,omitempty"` - Aclassociate []string `json:"aclassociate,omitempty"` - Aclchildcount int `json:"aclchildcount,omitempty"` - Aclname string `json:"aclname,omitempty"` +type NSACL struct { + ACLAction string `json:"aclaction,omitempty"` + ACLAssociate []string `json:"aclassociate,omitempty"` + ACLChildCount int `json:"aclchildcount,omitempty"` + ACLName string `json:"aclname,omitempty"` Count float64 `json:"__count,omitempty"` - Destip bool `json:"destip,omitempty"` - Destipdataset string `json:"destipdataset,omitempty"` - Destipop string `json:"destipop,omitempty"` - Destipval string `json:"destipval,omitempty"` - Destport bool `json:"destport,omitempty"` - Destportdataset string `json:"destportdataset,omitempty"` - Destportop string `json:"destportop,omitempty"` - Destportval string `json:"destportval,omitempty"` - Dfdhash string `json:"dfdhash,omitempty"` + DestIP bool `json:"destip,omitempty"` + DestIPDataset string `json:"destipdataset,omitempty"` + DestIPOp string `json:"destipop,omitempty"` + DestIPVal string `json:"destipval,omitempty"` + DestPort bool `json:"destport,omitempty"` + DestPortDataset string `json:"destportdataset,omitempty"` + DestPortOp string `json:"destportop,omitempty"` + DestPortVal string `json:"destportval,omitempty"` + DFDHash string `json:"dfdhash,omitempty"` Established bool `json:"established,omitempty"` Hits int `json:"hits,omitempty"` - Icmpcode int `json:"icmpcode,omitempty"` - Icmptype int `json:"icmptype,omitempty"` - InterfaceField string `json:"Interface,omitempty"` - Kernelstate string `json:"kernelstate,omitempty"` - Logstate string `json:"logstate,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + ICMPCode int `json:"icmpcode,omitempty"` + ICMPType int `json:"icmptype,omitempty"` + Interface string `json:"Interface,omitempty"` + KernelState string `json:"kernelstate,omitempty"` + LogState string `json:"logstate,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Priority int `json:"priority,omitempty"` Protocol string `json:"protocol,omitempty"` - Protocolnumber int `json:"protocolnumber,omitempty"` - Ratelimit int `json:"ratelimit,omitempty"` - Srcip bool `json:"srcip,omitempty"` - Srcipdataset string `json:"srcipdataset,omitempty"` - Srcipop string `json:"srcipop,omitempty"` - Srcipval string `json:"srcipval,omitempty"` - Srcmac string `json:"srcmac,omitempty"` - Srcmacmask string `json:"srcmacmask,omitempty"` - Srcport bool `json:"srcport,omitempty"` - Srcportdataset string `json:"srcportdataset,omitempty"` - Srcportop string `json:"srcportop,omitempty"` - Srcportval string `json:"srcportval,omitempty"` + ProtocolNumber int `json:"protocolnumber,omitempty"` + RateLimit int `json:"ratelimit,omitempty"` + SrcIP bool `json:"srcip,omitempty"` + SrcIPDataset string `json:"srcipdataset,omitempty"` + SrcIPOp string `json:"srcipop,omitempty"` + SrcIPVal string `json:"srcipval,omitempty"` + SrcMAC string `json:"srcmac,omitempty"` + SrcMACMask string `json:"srcmacmask,omitempty"` + SrcPort bool `json:"srcport,omitempty"` + SrcPortDataset string `json:"srcportdataset,omitempty"` + SrcPortOp string `json:"srcportop,omitempty"` + SrcPortVal string `json:"srcportval,omitempty"` State string `json:"state,omitempty"` Stateful string `json:"stateful,omitempty"` - Td int `json:"td,omitempty"` - Ttl int `json:"ttl,omitempty"` + TD int `json:"td,omitempty"` + TTL int `json:"ttl,omitempty"` TypeField string `json:"type,omitempty"` - Vlan int `json:"vlan,omitempty"` - Vxlan int `json:"vxlan,omitempty"` + VLAN int `json:"vlan,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } -type Nslicenseserver struct { +type NSLicenseServer struct { Count float64 `json:"__count,omitempty"` - Deviceprofilename string `json:"deviceprofilename,omitempty"` - Forceupdateip bool `json:"forceupdateip,omitempty"` - Gptimeleft int `json:"gptimeleft,omitempty"` + DeviceProfileName string `json:"deviceprofilename,omitempty"` + ForceUpdateIP bool `json:"forceupdateip,omitempty"` + GPTimeLeft int `json:"gptimeleft,omitempty"` Grace int `json:"grace,omitempty"` - Licensemode string `json:"licensemode,omitempty"` - Licenseserverip string `json:"licenseserverip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + LicenseMode string `json:"licensemode,omitempty"` + LicenseServerIP string `json:"licenseserverip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Password string `json:"password,omitempty"` Port int `json:"port,omitempty"` - Servername string `json:"servername,omitempty"` + ServerName string `json:"servername,omitempty"` Status int `json:"status,omitempty"` TypeField string `json:"type,omitempty"` Username string `json:"username,omitempty"` } -type Nsmgmtparam struct { - Httpdmaxclients int `json:"httpdmaxclients,omitempty"` - Httpdmaxreqworkers int `json:"httpdmaxreqworkers,omitempty"` - Mgmthttpport int `json:"mgmthttpport,omitempty"` - Mgmthttpsport int `json:"mgmthttpsport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NSMgmtParam struct { + HTTPDMaxClients int `json:"httpdmaxclients,omitempty"` + HTTPDMaxReqWorkers int `json:"httpdmaxreqworkers,omitempty"` + MgmtHTTPPort int `json:"mgmthttpport,omitempty"` + MgmtHTTPSPort int `json:"mgmthttpsport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nsdhcpip struct { +type NSDHCPIP struct { } -type Nstcpprofile struct { - Ackaggregation string `json:"ackaggregation,omitempty"` - Ackonpush string `json:"ackonpush,omitempty"` - Applyadaptivetcp string `json:"applyadaptivetcp,omitempty"` - Buffersize int `json:"buffersize,omitempty"` +type NSTCPProfile struct { + AckAggregation string `json:"ackaggregation,omitempty"` + AckOnPush string `json:"ackonpush,omitempty"` + ApplyAdaptiveTCP string `json:"applyadaptivetcp,omitempty"` + BufferSize int `json:"buffersize,omitempty"` Builtin []string `json:"builtin,omitempty"` - Burstratecontrol string `json:"burstratecontrol,omitempty"` - Clientiptcpoption string `json:"clientiptcpoption,omitempty"` - Clientiptcpoptionnumber int `json:"clientiptcpoptionnumber,omitempty"` + BurstRateControl string `json:"burstratecontrol,omitempty"` + ClientIPTCPOption string `json:"clientiptcpoption,omitempty"` + ClientIPTCPOptionNumber int `json:"clientiptcpoptionnumber,omitempty"` Count float64 `json:"__count,omitempty"` - Delayedack int `json:"delayedack,omitempty"` - Dropestconnontimeout string `json:"dropestconnontimeout,omitempty"` - Drophalfclosedconnontimeout string `json:"drophalfclosedconnontimeout,omitempty"` - Dsack string `json:"dsack,omitempty"` - Dupackthresh int `json:"dupackthresh,omitempty"` - Dynamicreceivebuffering string `json:"dynamicreceivebuffering,omitempty"` + DelayedAck int `json:"delayedack,omitempty"` + DropEstConnOnTimeout string `json:"dropestconnontimeout,omitempty"` + DropHalfClosedConnOnTimeout string `json:"drophalfclosedconnontimeout,omitempty"` + DSack string `json:"dsack,omitempty"` + DupAckThresh int `json:"dupackthresh,omitempty"` + DynamicReceiveBuffering string `json:"dynamicreceivebuffering,omitempty"` Ecn string `json:"ecn,omitempty"` - Establishclientconn string `json:"establishclientconn,omitempty"` + EstablishClientConn string `json:"establishclientconn,omitempty"` Fack string `json:"fack,omitempty"` Feature string `json:"feature,omitempty"` Flavor string `json:"flavor,omitempty"` - Frto string `json:"frto,omitempty"` + FRTO string `json:"frto,omitempty"` Hystart string `json:"hystart,omitempty"` - Initialcwnd int `json:"initialcwnd,omitempty"` - Ka string `json:"ka,omitempty"` - Kaconnidletime int `json:"kaconnidletime,omitempty"` - Kamaxprobes int `json:"kamaxprobes,omitempty"` - Kaprobeinterval int `json:"kaprobeinterval,omitempty"` - Kaprobeupdatelastactivity string `json:"kaprobeupdatelastactivity,omitempty"` - Maxburst int `json:"maxburst,omitempty"` - Maxcwnd int `json:"maxcwnd,omitempty"` - Maxpktpermss int `json:"maxpktpermss,omitempty"` - Minrto int `json:"minrto,omitempty"` - Mpcapablecbit string `json:"mpcapablecbit,omitempty"` - Mptcp string `json:"mptcp,omitempty"` - Mptcpdropdataonpreestsf string `json:"mptcpdropdataonpreestsf,omitempty"` - Mptcpfastopen string `json:"mptcpfastopen,omitempty"` - Mptcpsessiontimeout int `json:"mptcpsessiontimeout,omitempty"` - Mss int `json:"mss,omitempty"` + InitialCwnd int `json:"initialcwnd,omitempty"` + KA string `json:"ka,omitempty"` + KAConnIdleTime int `json:"kaconnidletime,omitempty"` + KAMaxProbes int `json:"kamaxprobes,omitempty"` + KAProbeInterval int `json:"kaprobeinterval,omitempty"` + KAProbeUpdateLastActivity string `json:"kaprobeupdatelastactivity,omitempty"` + MaxBurst int `json:"maxburst,omitempty"` + MaxCwnd int `json:"maxcwnd,omitempty"` + MaxPktPerMSS int `json:"maxpktpermss,omitempty"` + MinRTO int `json:"minrto,omitempty"` + MPCapableCBit string `json:"mpcapablecbit,omitempty"` + MPTCP string `json:"mptcp,omitempty"` + MPTCPDropDataOnPreEstSF string `json:"mptcpdropdataonpreestsf,omitempty"` + MPTCPFastOpen string `json:"mptcpfastopen,omitempty"` + MPTCPSessionTimeout int `json:"mptcpsessiontimeout,omitempty"` + MSS int `json:"mss,omitempty"` Nagle string `json:"nagle,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oooqsize int `json:"oooqsize,omitempty"` - Pktperretx int `json:"pktperretx,omitempty"` - Rateqmax int `json:"rateqmax,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Rfc5961compliance string `json:"rfc5961compliance,omitempty"` - Rstmaxack string `json:"rstmaxack,omitempty"` - Rstwindowattenuate string `json:"rstwindowattenuate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OOOQSize int `json:"oooqsize,omitempty"` + PktPerRetx int `json:"pktperretx,omitempty"` + RateQMax int `json:"rateqmax,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + RFC5961Compliance string `json:"rfc5961compliance,omitempty"` + RstMaxAck string `json:"rstmaxack,omitempty"` + RstWindowAttenuate string `json:"rstwindowattenuate,omitempty"` Sack string `json:"sack,omitempty"` - Sendbuffsize int `json:"sendbuffsize,omitempty"` - Sendclientportintcpoption string `json:"sendclientportintcpoption,omitempty"` - Slowstartincr int `json:"slowstartincr,omitempty"` - Slowstartthreshold int `json:"slowstartthreshold,omitempty"` - Spoofsyndrop string `json:"spoofsyndrop,omitempty"` - Syncookie string `json:"syncookie,omitempty"` - Taillossprobe string `json:"taillossprobe,omitempty"` - Tcpfastopen string `json:"tcpfastopen,omitempty"` - Tcpfastopencookiesize int `json:"tcpfastopencookiesize,omitempty"` - Tcpmode string `json:"tcpmode,omitempty"` - Tcprate int `json:"tcprate,omitempty"` - Tcpsegoffload string `json:"tcpsegoffload,omitempty"` + SendBuffSize int `json:"sendbuffsize,omitempty"` + SendClientPortInTCPOption string `json:"sendclientportintcpoption,omitempty"` + SlowStartIncr int `json:"slowstartincr,omitempty"` + SlowStartThreshold int `json:"slowstartthreshold,omitempty"` + SpoofSynDrop string `json:"spoofsyndrop,omitempty"` + SynCookie string `json:"syncookie,omitempty"` + TailLossProbe string `json:"taillossprobe,omitempty"` + TCPFastOpen string `json:"tcpfastopen,omitempty"` + TCPFastOpenCookieSize int `json:"tcpfastopencookiesize,omitempty"` + TCPMode string `json:"tcpmode,omitempty"` + TCPRate int `json:"tcprate,omitempty"` + TCPSegOffload string `json:"tcpsegoffload,omitempty"` Timestamp string `json:"timestamp,omitempty"` Ws string `json:"ws,omitempty"` - Wsval int `json:"wsval,omitempty"` + WSVal int `json:"wsval,omitempty"` } -type NstrafficdomainBinding struct { - NstrafficdomainBridgegroupBinding []interface{} `json:"nstrafficdomain_bridgegroup_binding,omitempty"` - NstrafficdomainVlanBinding []interface{} `json:"nstrafficdomain_vlan_binding,omitempty"` - NstrafficdomainVxlanBinding []interface{} `json:"nstrafficdomain_vxlan_binding,omitempty"` - Td int `json:"td,omitempty"` +type NSTrafficDomainBinding struct { + NSTrafficDomainBridgeGroupBinding []interface{} `json:"nstrafficdomain_bridgegroup_binding,omitempty"` + NSTrafficDomainVlanBinding []interface{} `json:"nstrafficdomain_vlan_binding,omitempty"` + NSTrafficDomainVxlanBinding []interface{} `json:"nstrafficdomain_vxlan_binding,omitempty"` + TD int `json:"td,omitempty"` } -type NstimerAutoscalepolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type NSTimerAutoScalePolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` - Policyname string `json:"policyname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` - Samplesize int `json:"samplesize,omitempty"` + SampleSize int `json:"samplesize,omitempty"` Threshold int `json:"threshold,omitempty"` - Vserver string `json:"vserver,omitempty"` + VServer string `json:"vserver,omitempty"` } -type Nsmode struct { - Bridgebpdus bool `json:"bridgebpdus,omitempty"` - Cka bool `json:"cka,omitempty"` - Dradv bool `json:"dradv,omitempty"` - Dradv6 bool `json:"dradv6,omitempty"` +type NSMode struct { + BridgeBPDUs bool `json:"bridgebpdus,omitempty"` + CKA bool `json:"cka,omitempty"` + DRAdv bool `json:"dradv,omitempty"` + DRAdv6 bool `json:"dradv6,omitempty"` Edge bool `json:"edge,omitempty"` - Fr bool `json:"fr,omitempty"` - Iradv bool `json:"iradv,omitempty"` + FR bool `json:"fr,omitempty"` + IRAdv bool `json:"iradv,omitempty"` L2 bool `json:"l2,omitempty"` L3 bool `json:"l3,omitempty"` - Mbf bool `json:"mbf,omitempty"` - Mediaclassification bool `json:"mediaclassification,omitempty"` + MBF bool `json:"mbf,omitempty"` + MediaClassification bool `json:"mediaclassification,omitempty"` Mode []string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pmtud bool `json:"pmtud,omitempty"` - SingleIp bool `json:"single_ip,omitempty"` - Sradv bool `json:"sradv,omitempty"` - Sradv6 bool `json:"sradv6,omitempty"` - Tcpb bool `json:"tcpb,omitempty"` - Ulfd bool `json:"ulfd,omitempty"` - Usip bool `json:"usip,omitempty"` - Usnip bool `json:"usnip,omitempty"` -} - -type Nssimpleacl6 struct { - Aclaction string `json:"aclaction,omitempty"` - Aclname string `json:"aclname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PMTUD bool `json:"pmtud,omitempty"` + SingleIP bool `json:"single_ip,omitempty"` + SRAdv bool `json:"sradv,omitempty"` + SRAdv6 bool `json:"sradv6,omitempty"` + TCPB bool `json:"tcpb,omitempty"` + ULFD bool `json:"ulfd,omitempty"` + USIP bool `json:"usip,omitempty"` + USNIP bool `json:"usnip,omitempty"` +} + +type NSSimpleACL6 struct { + ACLAction string `json:"aclaction,omitempty"` + ACLName string `json:"aclname,omitempty"` Count float64 `json:"__count,omitempty"` - Destport int `json:"destport,omitempty"` - Estsessions bool `json:"estsessions,omitempty"` + DestPort int `json:"destport,omitempty"` + EstSessions bool `json:"estsessions,omitempty"` Hits int `json:"hits,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Protocol string `json:"protocol,omitempty"` - Srcipv6 string `json:"srcipv6,omitempty"` - Td int `json:"td,omitempty"` - Ttl int `json:"ttl,omitempty"` + SrcIPv6 string `json:"srcipv6,omitempty"` + TD int `json:"td,omitempty"` + TTL int `json:"ttl,omitempty"` } -type Nslaslicense struct { - Daystoexpiration int `json:"daystoexpiration,omitempty"` - Filelocation string `json:"filelocation,omitempty"` +type NSLASLicense struct { + DaysToExpiration int `json:"daystoexpiration,omitempty"` + FileLocation string `json:"filelocation,omitempty"` Filename string `json:"filename,omitempty"` - Fixedbandwidth bool `json:"fixedbandwidth,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Renewalnext int `json:"renewalnext,omitempty"` - Renewalnextdate string `json:"renewalnextdate,omitempty"` - Renewalprev int `json:"renewalprev,omitempty"` - Renewalprevdate string `json:"renewalprevdate,omitempty"` + FixedBandwidth bool `json:"fixedbandwidth,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RenewalNext int `json:"renewalnext,omitempty"` + RenewalNextDate string `json:"renewalnextdate,omitempty"` + RenewalPrev int `json:"renewalprev,omitempty"` + RenewalPrevDate string `json:"renewalprevdate,omitempty"` Status string `json:"status,omitempty"` } -type Nsconfig struct { +type NSConfig struct { All bool `json:"all,omitempty"` Async bool `json:"Async,omitempty"` - Changedpassword bool `json:"changedpassword,omitempty"` - Cip string `json:"cip,omitempty"` - Cipheader string `json:"cipheader,omitempty"` + ChangedPassword bool `json:"changedpassword,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` Config string `json:"config,omitempty"` Config1 string `json:"config1,omitempty"` Config2 string `json:"config2,omitempty"` - Configchanged bool `json:"configchanged,omitempty"` - Configfile string `json:"configfile,omitempty"` - Cookieversion string `json:"cookieversion,omitempty"` - Crportrange string `json:"crportrange,omitempty"` - Currentsytemtime string `json:"currentsytemtime,omitempty"` - Exclusivequotamaxclient int `json:"exclusivequotamaxclient,omitempty"` - Exclusivequotaspillover int `json:"exclusivequotaspillover,omitempty"` + ConfigChanged bool `json:"configchanged,omitempty"` + ConfigFile string `json:"configfile,omitempty"` + CookieVersion string `json:"cookieversion,omitempty"` + CRPortRange string `json:"crportrange,omitempty"` + CurrentSystemTime string `json:"currentsytemtime,omitempty"` + ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` + ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` Flags int `json:"flags,omitempty"` Force bool `json:"force,omitempty"` - Ftpportrange string `json:"ftpportrange,omitempty"` - Grantquotamaxclient int `json:"grantquotamaxclient,omitempty"` - Grantquotaspillover int `json:"grantquotaspillover,omitempty"` - Httpport []interface{} `json:"httpport,omitempty"` - Id int `json:"id,omitempty"` - Ifnum []string `json:"ifnum,omitempty"` - Ignoredevicespecific bool `json:"ignoredevicespecific,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Lastconfigchangedtime string `json:"lastconfigchangedtime,omitempty"` - Lastconfigsavetime string `json:"lastconfigsavetime,omitempty"` + FTPPortRange string `json:"ftpportrange,omitempty"` + GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` + GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` + HTTPPort []interface{} `json:"httpport,omitempty"` + ID int `json:"id,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + IgnoreDeviceSpecific bool `json:"ignoredevicespecific,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + LastConfigChangedTime string `json:"lastconfigchangedtime,omitempty"` + LastConfigSaveTime string `json:"lastconfigsavetime,omitempty"` Level string `json:"level,omitempty"` - Mappedip string `json:"mappedip,omitempty"` - Maxconn int `json:"maxconn,omitempty"` - Maxreq int `json:"maxreq,omitempty"` + MappedIP string `json:"mappedip,omitempty"` + MaxConn int `json:"maxconn,omitempty"` + MaxReq int `json:"maxreq,omitempty"` Message string `json:"message,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nsvlan int `json:"nsvlan,omitempty"` - Outtype string `json:"outtype,omitempty"` - Pmtumin int `json:"pmtumin,omitempty"` - Pmtutimeout int `json:"pmtutimeout,omitempty"` - Primaryip string `json:"primaryip,omitempty"` - Primaryip6 string `json:"primaryip6,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSVLAN int `json:"nsvlan,omitempty"` + OutType string `json:"outtype,omitempty"` + PMTUMin int `json:"pmtumin,omitempty"` + PMTUTimeout int `json:"pmtutimeout,omitempty"` + PrimaryIP string `json:"primaryip,omitempty"` + PrimaryIP6 string `json:"primaryip6,omitempty"` Range int `json:"range,omitempty"` - Rbaconfig string `json:"rbaconfig,omitempty"` + RBAConfig string `json:"rbaconfig,omitempty"` Response string `json:"response,omitempty"` - Responsefile string `json:"responsefile,omitempty"` - Securecookie string `json:"securecookie,omitempty"` - Securemanagementtd int `json:"securemanagementtd,omitempty"` - Securemanagementtraffic string `json:"securemanagementtraffic,omitempty"` - Svmcmd int `json:"svmcmd,omitempty"` - Systemtime int `json:"systemtime,omitempty"` - Systemtype string `json:"systemtype,omitempty"` + ResponseFile string `json:"responsefile,omitempty"` + SecureCookie string `json:"securecookie,omitempty"` + SecureManagementTD int `json:"securemanagementtd,omitempty"` + SecureManagementTraffic string `json:"securemanagementtraffic,omitempty"` + SVMCmd int `json:"svmcmd,omitempty"` + SystemTime int `json:"systemtime,omitempty"` + SystemType string `json:"systemtype,omitempty"` Tagged string `json:"tagged,omitempty"` Template bool `json:"template,omitempty"` - Timezone string `json:"timezone,omitempty"` - Weakpassword bool `json:"weakpassword,omitempty"` + TimeZone string `json:"timezone,omitempty"` + WeakPassword bool `json:"weakpassword,omitempty"` } -type Nsaptlicense struct { - Bindtype string `json:"bindtype,omitempty"` +type NSAPTLicense struct { + BindType string `json:"bindtype,omitempty"` Count float64 `json:"__count,omitempty"` - Countavailable string `json:"countavailable,omitempty"` - Counttotal string `json:"counttotal,omitempty"` - Dateexp string `json:"dateexp,omitempty"` - Datepurchased string `json:"datepurchased,omitempty"` - Datesa string `json:"datesa,omitempty"` + CountAvailable string `json:"countavailable,omitempty"` + CountTotal string `json:"counttotal,omitempty"` + DateExp string `json:"dateexp,omitempty"` + DatePurchased string `json:"datepurchased,omitempty"` + DateSA string `json:"datesa,omitempty"` Features []string `json:"features,omitempty"` - Id string `json:"id,omitempty"` - Licensedir string `json:"licensedir,omitempty"` + ID string `json:"id,omitempty"` + LicenseDir string `json:"licensedir,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Relevance string `json:"relevance,omitempty"` Response string `json:"response,omitempty"` - Serialno string `json:"serialno,omitempty"` - Sessionid string `json:"sessionid,omitempty"` - Useproxy string `json:"useproxy,omitempty"` -} - -type Nshttpprofile struct { - Adpttimeout string `json:"adpttimeout,omitempty"` - Allowonlywordcharactersandhyphen string `json:"allowonlywordcharactersandhyphen,omitempty"` - Altsvc string `json:"altsvc,omitempty"` - Altsvcvalue string `json:"altsvcvalue,omitempty"` - Apdexcltresptimethreshold int `json:"apdexcltresptimethreshold,omitempty"` - Apdexsvrresptimethreshold int `json:"apdexsvrresptimethreshold,omitempty"` + SerialNo string `json:"serialno,omitempty"` + SessionID string `json:"sessionid,omitempty"` + UseProxy string `json:"useproxy,omitempty"` +} + +type NSHTTPProfile struct { + AdptTimeout string `json:"adpttimeout,omitempty"` + AllowOnlyWordCharactersAndHyphen string `json:"allowonlywordcharactersandhyphen,omitempty"` + AltSvc string `json:"altsvc,omitempty"` + AltSvcValue string `json:"altsvcvalue,omitempty"` + ApdexCltRespTimeThreshold int `json:"apdexcltresptimethreshold,omitempty"` + ApdexSvrRespTimeThreshold int `json:"apdexsvrresptimethreshold,omitempty"` Builtin []string `json:"builtin,omitempty"` - Clientiphdrexpr string `json:"clientiphdrexpr,omitempty"` - Cmponpush string `json:"cmponpush,omitempty"` - Conmultiplex string `json:"conmultiplex,omitempty"` + ClientIPHdrExpr string `json:"clientiphdrexpr,omitempty"` + CmpOnPush string `json:"cmponpush,omitempty"` + ConMultiplex string `json:"conmultiplex,omitempty"` Count float64 `json:"__count,omitempty"` - Dropextracrlf string `json:"dropextracrlf,omitempty"` - Dropextradata string `json:"dropextradata,omitempty"` - Dropinvalreqs string `json:"dropinvalreqs,omitempty"` - Dropinvalreqswarning string `json:"dropinvalreqswarning,omitempty"` + DropExtraCRLF string `json:"dropextracrlf,omitempty"` + DropExtraData string `json:"dropextradata,omitempty"` + DropInvalReqs string `json:"dropinvalreqs,omitempty"` + DropInvalReqsWarning string `json:"dropinvalreqswarning,omitempty"` Feature string `json:"feature,omitempty"` - Grpcholdlimit int `json:"grpcholdlimit,omitempty"` - Grpcholdtimeout int `json:"grpcholdtimeout,omitempty"` - Grpclengthdelimitation string `json:"grpclengthdelimitation,omitempty"` - Hostheadervalidation string `json:"hostheadervalidation,omitempty"` - Http2 string `json:"http2,omitempty"` - Http2altsvcframe string `json:"http2altsvcframe,omitempty"` - Http2direct string `json:"http2direct,omitempty"` - Http2extendedconnect string `json:"http2extendedconnect,omitempty"` - Http2headertablesize int `json:"http2headertablesize,omitempty"` - Http2initialconnwindowsize int `json:"http2initialconnwindowsize,omitempty"` - Http2initialwindowsize int `json:"http2initialwindowsize,omitempty"` - Http2maxconcurrentstreams int `json:"http2maxconcurrentstreams,omitempty"` - Http2maxemptyframespermin int `json:"http2maxemptyframespermin,omitempty"` - Http2maxframesize int `json:"http2maxframesize,omitempty"` - Http2maxheaderlistsize int `json:"http2maxheaderlistsize,omitempty"` - Http2maxpingframespermin int `json:"http2maxpingframespermin,omitempty"` - Http2maxresetframespermin int `json:"http2maxresetframespermin,omitempty"` - Http2maxrxresetframespermin int `json:"http2maxrxresetframespermin,omitempty"` - Http2maxsettingsframespermin int `json:"http2maxsettingsframespermin,omitempty"` - Http2minseverconn int `json:"http2minseverconn,omitempty"` - Http2strictcipher string `json:"http2strictcipher,omitempty"` - Http3 string `json:"http3,omitempty"` - Http3maxheaderblockedstreams int `json:"http3maxheaderblockedstreams,omitempty"` - Http3maxheaderfieldsectionsize int `json:"http3maxheaderfieldsectionsize,omitempty"` - Http3maxheadertablesize int `json:"http3maxheadertablesize,omitempty"` - Http3minseverconn int `json:"http3minseverconn,omitempty"` - Http3webtransport string `json:"http3webtransport,omitempty"` - Httppipelinebuffsize int `json:"httppipelinebuffsize,omitempty"` - Incomphdrdelay int `json:"incomphdrdelay,omitempty"` - Markconnreqinval string `json:"markconnreqinval,omitempty"` - Markhttp09inval string `json:"markhttp09inval,omitempty"` - Markhttpheaderextrawserror string `json:"markhttpheaderextrawserror,omitempty"` - Markrfc7230noncompliantinval string `json:"markrfc7230noncompliantinval,omitempty"` - Marktracereqinval string `json:"marktracereqinval,omitempty"` - Maxduplicateheaderfields int `json:"maxduplicateheaderfields,omitempty"` - Maxheaderfieldlen int `json:"maxheaderfieldlen,omitempty"` - Maxheaderlen int `json:"maxheaderlen,omitempty"` - Maxreq int `json:"maxreq,omitempty"` - Maxreusepool int `json:"maxreusepool,omitempty"` - Minreusepool int `json:"minreusepool,omitempty"` + GRPCHoldLimit int `json:"grpcholdlimit,omitempty"` + GRPCHoldTimeout int `json:"grpcholdtimeout,omitempty"` + GRPCLengthDelimitation string `json:"grpclengthdelimitation,omitempty"` + HostHeaderValidation string `json:"hostheadervalidation,omitempty"` + HTTP2 string `json:"http2,omitempty"` + HTTP2AltSvcFrame string `json:"http2altsvcframe,omitempty"` + HTTP2Direct string `json:"http2direct,omitempty"` + HTTP2ExtendedConnect string `json:"http2extendedconnect,omitempty"` + HTTP2HeaderTableSize int `json:"http2headertablesize,omitempty"` + HTTP2InitialConnWindowSize int `json:"http2initialconnwindowsize,omitempty"` + HTTP2InitialWindowSize int `json:"http2initialwindowsize,omitempty"` + HTTP2MaxConcurrentStreams int `json:"http2maxconcurrentstreams,omitempty"` + HTTP2MaxEmptyFramesPerMin int `json:"http2maxemptyframespermin,omitempty"` + HTTP2MaxFrameSize int `json:"http2maxframesize,omitempty"` + HTTP2MaxHeaderListSize int `json:"http2maxheaderlistsize,omitempty"` + HTTP2MaxPingFramesPerMin int `json:"http2maxpingframespermin,omitempty"` + HTTP2MaxResetFramesPerMin int `json:"http2maxresetframespermin,omitempty"` + HTTP2MaxRxResetFramesPerMin int `json:"http2maxrxresetframespermin,omitempty"` + HTTP2MaxSettingsFramesPerMin int `json:"http2maxsettingsframespermin,omitempty"` + HTTP2MinSeverConn int `json:"http2minseverconn,omitempty"` + HTTP2StrictCipher string `json:"http2strictcipher,omitempty"` + HTTP3 string `json:"http3,omitempty"` + HTTP3MaxHeaderBlockedStreams int `json:"http3maxheaderblockedstreams,omitempty"` + HTTP3MaxHeaderFieldSectionSize int `json:"http3maxheaderfieldsectionsize,omitempty"` + HTTP3MaxHeaderTableSize int `json:"http3maxheadertablesize,omitempty"` + HTTP3MinSeverConn int `json:"http3minseverconn,omitempty"` + HTTP3WebTransport string `json:"http3webtransport,omitempty"` + HTTPPipelineBuffSize int `json:"httppipelinebuffsize,omitempty"` + IncompHdrDelay int `json:"incomphdrdelay,omitempty"` + MarkConnReqInval string `json:"markconnreqinval,omitempty"` + MarkHTTP09Inval string `json:"markhttp09inval,omitempty"` + MarkHTTPHeaderExtraWSError string `json:"markhttpheaderextrawserror,omitempty"` + MarkRFC7230NonCompliantInval string `json:"markrfc7230noncompliantinval,omitempty"` + MarkTraceReqInval string `json:"marktracereqinval,omitempty"` + MaxDuplicateHeaderFields int `json:"maxduplicateheaderfields,omitempty"` + MaxHeaderFieldLen int `json:"maxheaderfieldlen,omitempty"` + MaxHeaderLen int `json:"maxheaderlen,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MaxReusePool int `json:"maxreusepool,omitempty"` + MinReusePool int `json:"minreusepool,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passprotocolupgrade string `json:"passprotocolupgrade,omitempty"` - Persistentetag string `json:"persistentetag,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Reqtimeout int `json:"reqtimeout,omitempty"` - Reqtimeoutaction string `json:"reqtimeoutaction,omitempty"` - Reusepooltimeout int `json:"reusepooltimeout,omitempty"` - Rtsptunnel string `json:"rtsptunnel,omitempty"` - Weblog string `json:"weblog,omitempty"` - Websocket string `json:"websocket,omitempty"` -} - -type Nsfeature struct { - Aaa bool `json:"aaa,omitempty"` - Adaptivetcp bool `json:"adaptivetcp,omitempty"` - Apigateway bool `json:"apigateway,omitempty"` - Appflow bool `json:"appflow,omitempty"` - Appfw bool `json:"appfw,omitempty"` - Appqoe bool `json:"appqoe,omitempty"` - Bgp bool `json:"bgp,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PassProtocolUpgrade string `json:"passprotocolupgrade,omitempty"` + PersistentETag string `json:"persistentetag,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + ReqTimeout int `json:"reqtimeout,omitempty"` + ReqTimeoutAction string `json:"reqtimeoutaction,omitempty"` + ReusePoolTimeout int `json:"reusepooltimeout,omitempty"` + RTSPTunnel string `json:"rtsptunnel,omitempty"` + WebLog string `json:"weblog,omitempty"` + WebSocket string `json:"websocket,omitempty"` +} + +type NSFeature struct { + AAA bool `json:"aaa,omitempty"` + AdaptiveTCP bool `json:"adaptivetcp,omitempty"` + APIGateway bool `json:"apigateway,omitempty"` + AppFlow bool `json:"appflow,omitempty"` + AppFW bool `json:"appfw,omitempty"` + AppQOE bool `json:"appqoe,omitempty"` + BGP bool `json:"bgp,omitempty"` Bot bool `json:"bot,omitempty"` - Cf bool `json:"cf,omitempty"` - Ch bool `json:"ch,omitempty"` - Ci bool `json:"ci,omitempty"` - Cloudbridge bool `json:"cloudbridge,omitempty"` - Cmp bool `json:"cmp,omitempty"` - Contentaccelerator bool `json:"contentaccelerator,omitempty"` - Cqa bool `json:"cqa,omitempty"` - Cr bool `json:"cr,omitempty"` - Cs bool `json:"cs,omitempty"` + CF bool `json:"cf,omitempty"` + CH bool `json:"ch,omitempty"` + CI bool `json:"ci,omitempty"` + CloudBridge bool `json:"cloudbridge,omitempty"` + CMP bool `json:"cmp,omitempty"` + ContentAccelerator bool `json:"contentaccelerator,omitempty"` + CQA bool `json:"cqa,omitempty"` + CR bool `json:"cr,omitempty"` + CS bool `json:"cs,omitempty"` Feature []string `json:"feature,omitempty"` - Feo bool `json:"feo,omitempty"` - Forwardproxy bool `json:"forwardproxy,omitempty"` - Gslb bool `json:"gslb,omitempty"` - Ic bool `json:"ic,omitempty"` - Ipv6pt bool `json:"ipv6pt,omitempty"` - Isis bool `json:"isis,omitempty"` - Lb bool `json:"lb,omitempty"` - Lsn bool `json:"lsn,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ospf bool `json:"ospf,omitempty"` + FEO bool `json:"feo,omitempty"` + ForwardProxy bool `json:"forwardproxy,omitempty"` + GSLB bool `json:"gslb,omitempty"` + IC bool `json:"ic,omitempty"` + IPv6PT bool `json:"ipv6pt,omitempty"` + ISIS bool `json:"isis,omitempty"` + LB bool `json:"lb,omitempty"` + LSN bool `json:"lsn,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OSPF bool `json:"ospf,omitempty"` Push bool `json:"push,omitempty"` - Rdpproxy bool `json:"rdpproxy,omitempty"` + RDPProxy bool `json:"rdpproxy,omitempty"` Rep bool `json:"rep,omitempty"` Responder bool `json:"responder,omitempty"` Rewrite bool `json:"rewrite,omitempty"` - Rip bool `json:"rip,omitempty"` - Sp bool `json:"sp,omitempty"` - Ssl bool `json:"ssl,omitempty"` - Sslinterception bool `json:"sslinterception,omitempty"` - Sslvpn bool `json:"sslvpn,omitempty"` - Videooptimization bool `json:"videooptimization,omitempty"` - Wl bool `json:"wl,omitempty"` + RIP bool `json:"rip,omitempty"` + SP bool `json:"sp,omitempty"` + SSL bool `json:"ssl,omitempty"` + SSLInterception bool `json:"sslinterception,omitempty"` + SSLVPN bool `json:"sslvpn,omitempty"` + VideoOptimization bool `json:"videooptimization,omitempty"` + WL bool `json:"wl,omitempty"` } -type NsservicepathBinding struct { - NsservicepathNsservicefunctionBinding []interface{} `json:"nsservicepath_nsservicefunction_binding,omitempty"` - Servicepathname string `json:"servicepathname,omitempty"` +type NSServicePathBinding struct { + NSServicePathNSServiceFunctionBinding []interface{} `json:"nsservicepath_nsservicefunction_binding,omitempty"` + ServicePathName string `json:"servicepathname,omitempty"` } -type Nslicenseparameters struct { - Alert1gracetimeout int `json:"alert1gracetimeout,omitempty"` - Alert2gracetimeout int `json:"alert2gracetimeout,omitempty"` - Heartbeatinterval int `json:"heartbeatinterval,omitempty"` - Inventoryrefreshinterval int `json:"inventoryrefreshinterval,omitempty"` - Licenseexpiryalerttime int `json:"licenseexpiryalerttime,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NSLicenseParameters struct { + Alert1GraceTimeout int `json:"alert1gracetimeout,omitempty"` + Alert2GraceTimeout int `json:"alert2gracetimeout,omitempty"` + HeartbeatInterval int `json:"heartbeatinterval,omitempty"` + InventoryRefreshInterval int `json:"inventoryrefreshinterval,omitempty"` + LicenseExpiryAlertTime int `json:"licenseexpiryalerttime,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Nslimitidentifier struct { - Computedtraptimeslice int `json:"computedtraptimeslice,omitempty"` +type NSLimitIdentifier struct { + ComputedTrapTimeSlice int `json:"computedtraptimeslice,omitempty"` Count float64 `json:"__count,omitempty"` Drop int `json:"drop,omitempty"` Hits int `json:"hits,omitempty"` - Limitidentifier string `json:"limitidentifier,omitempty"` - Limittype string `json:"limittype,omitempty"` - Maxbandwidth int `json:"maxbandwidth,omitempty"` + LimitIdentifier string `json:"limitidentifier,omitempty"` + LimitType string `json:"limittype,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` Mode string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` - Referencecount int `json:"referencecount,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NGName string `json:"ngname,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` Rule []string `json:"rule,omitempty"` - Selectorname string `json:"selectorname,omitempty"` + SelectorName string `json:"selectorname,omitempty"` Threshold int `json:"threshold,omitempty"` Time int `json:"time,omitempty"` - Timeslice int `json:"timeslice,omitempty"` + TimeSlice int `json:"timeslice,omitempty"` Total int `json:"total,omitempty"` - Trapscomputedintimeslice int `json:"trapscomputedintimeslice,omitempty"` - Trapsintimeslice int `json:"trapsintimeslice,omitempty"` + TrapsComputedInTimeSlice int `json:"trapscomputedintimeslice,omitempty"` + TrapsInTimeSlice int `json:"trapsintimeslice,omitempty"` } -type Nshardware struct { - Bmcrevision string `json:"bmcrevision,omitempty"` - Cpufrequncy int `json:"cpufrequncy,omitempty"` - Encodedserialno string `json:"encodedserialno,omitempty"` +type NSHardware struct { + BMCRevision string `json:"bmcrevision,omitempty"` + CPUFrequency int `json:"cpufrequncy,omitempty"` + EncodedSerialNo string `json:"encodedserialno,omitempty"` Host string `json:"host,omitempty"` - Hostid int `json:"hostid,omitempty"` - Hwdescription string `json:"hwdescription,omitempty"` - Manufactureday int `json:"manufactureday,omitempty"` - Manufacturemonth int `json:"manufacturemonth,omitempty"` - Manufactureyear int `json:"manufactureyear,omitempty"` - Netscaleruuid string `json:"netscaleruuid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Serialno string `json:"serialno,omitempty"` - Sysid int `json:"sysid,omitempty"` -} - -type Nstrafficdomain struct { - Aliasname string `json:"aliasname,omitempty"` + HostID int `json:"hostid,omitempty"` + HWDescription string `json:"hwdescription,omitempty"` + ManufactureDay int `json:"manufactureday,omitempty"` + ManufactureMonth int `json:"manufacturemonth,omitempty"` + ManufactureYear int `json:"manufactureyear,omitempty"` + NetScalerUUID string `json:"netscaleruuid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SerialNo string `json:"serialno,omitempty"` + SysID int `json:"sysid,omitempty"` +} + +type NSTrafficDomain struct { + AliasName string `json:"aliasname,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` - Td int `json:"td,omitempty"` - Vmac string `json:"vmac,omitempty"` -} - -type NspartitionVlanBinding struct { - Partitionname string `json:"partitionname,omitempty"` - Vlan int `json:"vlan,omitempty"` -} - -type Nscqaparam struct { - Harqretxdelay int `json:"harqretxdelay,omitempty"` - Lr1coeflist string `json:"lr1coeflist,omitempty"` - Lr1probthresh float64 `json:"lr1probthresh,omitempty"` - Lr2coeflist string `json:"lr2coeflist,omitempty"` - Lr2probthresh float64 `json:"lr2probthresh,omitempty"` - Minrttnet1 int `json:"minrttnet1,omitempty"` - Minrttnet2 int `json:"minrttnet2,omitempty"` - Minrttnet3 int `json:"minrttnet3,omitempty"` - Net1cclscale string `json:"net1cclscale,omitempty"` - Net1csqscale string `json:"net1csqscale,omitempty"` - Net1label string `json:"net1label,omitempty"` - Net1logcoef string `json:"net1logcoef,omitempty"` - Net2cclscale string `json:"net2cclscale,omitempty"` - Net2csqscale string `json:"net2csqscale,omitempty"` - Net2label string `json:"net2label,omitempty"` - Net2logcoef string `json:"net2logcoef,omitempty"` - Net3cclscale string `json:"net3cclscale,omitempty"` - Net3csqscale string `json:"net3csqscale,omitempty"` - Net3label string `json:"net3label,omitempty"` - Net3logcoef string `json:"net3logcoef,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type Nsstats struct { - Cleanuplevel string `json:"cleanuplevel,omitempty"` -} - -type NslimitidentifierBinding struct { - Limitidentifier string `json:"limitidentifier,omitempty"` - NslimitidentifierNslimitsessionsBinding []interface{} `json:"nslimitidentifier_nslimitsessions_binding,omitempty"` + TD int `json:"td,omitempty"` + VMAC string `json:"vmac,omitempty"` +} + +type NSPartitionVlanBinding struct { + PartitionName string `json:"partitionname,omitempty"` + VLAN int `json:"vlan,omitempty"` +} + +type NSCQAParam struct { + HarqRetxDelay int `json:"harqretxdelay,omitempty"` + LR1CoefList string `json:"lr1coeflist,omitempty"` + LR1ProbThresh float64 `json:"lr1probthresh,omitempty"` + LR2CoefList string `json:"lr2coeflist,omitempty"` + LR2ProbThresh float64 `json:"lr2probthresh,omitempty"` + MinRTTNet1 int `json:"minrttnet1,omitempty"` + MinRTTNet2 int `json:"minrttnet2,omitempty"` + MinRTTNet3 int `json:"minrttnet3,omitempty"` + Net1CCLScale string `json:"net1cclscale,omitempty"` + Net1CSQScale string `json:"net1csqscale,omitempty"` + Net1Label string `json:"net1label,omitempty"` + Net1LogCoef string `json:"net1logcoef,omitempty"` + Net2CCLScale string `json:"net2cclscale,omitempty"` + Net2CSQScale string `json:"net2csqscale,omitempty"` + Net2Label string `json:"net2label,omitempty"` + Net2LogCoef string `json:"net2logcoef,omitempty"` + Net3CCLScale string `json:"net3cclscale,omitempty"` + Net3CSQScale string `json:"net3csqscale,omitempty"` + Net3Label string `json:"net3label,omitempty"` + Net3LogCoef string `json:"net3logcoef,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type NSStats struct { + CleanupLevel string `json:"cleanuplevel,omitempty"` +} + +type NSLimitIdentifierBinding struct { + LimitIdentifier string `json:"limitidentifier,omitempty"` + NSLimitIdentifierNSLimitSessionsBinding []interface{} `json:"nslimitidentifier_nslimitsessions_binding,omitempty"` } diff --git a/nitrogo/models/ntp.go b/nitrogo/models/ntp.go index 023c450..a7e585f 100644 --- a/nitrogo/models/ntp.go +++ b/nitrogo/models/ntp.go @@ -1,32 +1,32 @@ package models // ntp configuration structs -type Ntpserver struct { - Autokey bool `json:"autokey,omitempty"` +type NTPServer struct { + AutoKey bool `json:"autokey,omitempty"` Count float64 `json:"__count,omitempty"` Key int `json:"key,omitempty"` - Maxpoll int `json:"maxpoll,omitempty"` - Minpoll int `json:"minpoll,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Preferredntpserver string `json:"preferredntpserver,omitempty"` - Serverip string `json:"serverip,omitempty"` - Servername string `json:"servername,omitempty"` + MaxPoll int `json:"maxpoll,omitempty"` + MinPoll int `json:"minpoll,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PreferredNTPServer string `json:"preferredntpserver,omitempty"` + ServerIP string `json:"serverip,omitempty"` + ServerName string `json:"servername,omitempty"` } -type Ntpparam struct { +type NTPParam struct { Authentication string `json:"authentication,omitempty"` - Autokeylogsec int `json:"autokeylogsec,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Revokelogsec int `json:"revokelogsec,omitempty"` - Trustedkey []interface{} `json:"trustedkey,omitempty"` + AutoKeyLogSec int `json:"autokeylogsec,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RevokeLogSec int `json:"revokelogsec,omitempty"` + TrustedKey []interface{} `json:"trustedkey,omitempty"` } -type Ntpsync struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NTPSync struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } -type Ntpstatus struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type NTPStatus struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Response string `json:"response,omitempty"` } diff --git a/nitrogo/models/pcp.go b/nitrogo/models/pcp.go index f692b45..24bb7a2 100644 --- a/nitrogo/models/pcp.go +++ b/nitrogo/models/pcp.go @@ -1,41 +1,41 @@ package models // pcp configuration structs -type Pcpserver struct { +type PCPServer struct { Count float64 `json:"__count,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pcpprofile string `json:"pcpprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PCPProfile string `json:"pcpprofile,omitempty"` Port int `json:"port,omitempty"` } -type Pcpmap struct { +type PCPMap struct { Count float64 `json:"__count,omitempty"` - Nattype string `json:"nattype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pcpaddr int `json:"pcpaddr,omitempty"` - Pcpdstip string `json:"pcpdstip,omitempty"` - Pcpdstport int `json:"pcpdstport,omitempty"` - Pcplifetime int `json:"pcplifetime,omitempty"` - Pcpnatip string `json:"pcpnatip,omitempty"` - Pcpnatport int `json:"pcpnatport,omitempty"` - Pcpnounce int `json:"pcpnounce,omitempty"` - Pcpprotocol string `json:"pcpprotocol,omitempty"` - Pcprefcnt int `json:"pcprefcnt,omitempty"` - Pcpsrcip string `json:"pcpsrcip,omitempty"` - Pcpsrcport int `json:"pcpsrcport,omitempty"` - Subscrip string `json:"subscrip,omitempty"` + NatType string `json:"nattype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PCPAddr int `json:"pcpaddr,omitempty"` + PCPDstIP string `json:"pcpdstip,omitempty"` + PCPDstPort int `json:"pcpdstport,omitempty"` + PCPLifetime int `json:"pcplifetime,omitempty"` + PCPNatIP string `json:"pcpnatip,omitempty"` + PCPNatPort int `json:"pcpnatport,omitempty"` + PCPNounce int `json:"pcpnounce,omitempty"` + PCPProtocol string `json:"pcpprotocol,omitempty"` + PCPRefCnt int `json:"pcprefcnt,omitempty"` + PCPSrcIP string `json:"pcpsrcip,omitempty"` + PCPSrcPort int `json:"pcpsrcport,omitempty"` + SubscrIP string `json:"subscrip,omitempty"` } -type Pcpprofile struct { - Announcemulticount int `json:"announcemulticount,omitempty"` +type PCPProfile struct { + AnnounceMultiCount int `json:"announcemulticount,omitempty"` Count float64 `json:"__count,omitempty"` Mapping string `json:"mapping,omitempty"` - Maxmaplife int `json:"maxmaplife,omitempty"` - Minmaplife int `json:"minmaplife,omitempty"` + MaxMapLife int `json:"maxmaplife,omitempty"` + MinMapLife int `json:"minmaplife,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Peer string `json:"peer,omitempty"` - Thirdparty string `json:"thirdparty,omitempty"` + ThirdParty string `json:"thirdparty,omitempty"` } diff --git a/nitrogo/models/policy.go b/nitrogo/models/policy.go index 73f606b..8dc1789 100644 --- a/nitrogo/models/policy.go +++ b/nitrogo/models/policy.go @@ -1,7 +1,7 @@ package models // policy configuration structs -type PolicypatsetPatternBinding struct { +type PolicyPatsetPatternBinding struct { Builtin []string `json:"builtin,omitempty"` Charset string `json:"charset,omitempty"` Comment string `json:"comment,omitempty"` @@ -11,214 +11,214 @@ type PolicypatsetPatternBinding struct { String string `json:"String,omitempty"` } -type PolicystringmapBinding struct { +type PolicyStringMapBinding struct { Name string `json:"name,omitempty"` - PolicystringmapPatternBinding []interface{} `json:"policystringmap_pattern_binding,omitempty"` + PolicyStringMapPatternBinding []interface{} `json:"policystringmap_pattern_binding,omitempty"` } -type PolicydatasetBinding struct { +type PolicyDatasetBinding struct { Name string `json:"name,omitempty"` - PolicydatasetValueBinding []interface{} `json:"policydataset_value_binding,omitempty"` + PolicyDatasetValueBinding []interface{} `json:"policydataset_value_binding,omitempty"` } -type PolicystringmapPatternBinding struct { +type PolicyStringMapPatternBinding struct { Comment string `json:"comment,omitempty"` Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` } -type Policypatsetfile struct { - Bindstatus string `json:"bindstatus,omitempty"` - Bindstatuscode int `json:"bindstatuscode,omitempty"` - Boundpatterns int `json:"boundpatterns,omitempty"` +type PolicyPatsetFile struct { + BindStatus string `json:"bindstatus,omitempty"` + BindStatusCode int `json:"bindstatuscode,omitempty"` + BoundPatterns int `json:"boundpatterns,omitempty"` Charset string `json:"charset,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Delimiter string `json:"delimiter,omitempty"` Imported bool `json:"imported,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` - Patsetname string `json:"patsetname,omitempty"` + PatsetName string `json:"patsetname,omitempty"` Src string `json:"src,omitempty"` - Totalpatterns int `json:"totalpatterns,omitempty"` + TotalPatterns int `json:"totalpatterns,omitempty"` } -type Policystringmap struct { +type PolicyStringMap struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type PolicypatsetBinding struct { +type PolicyPatsetBinding struct { Name string `json:"name,omitempty"` - PolicypatsetPatternBinding []interface{} `json:"policypatset_pattern_binding,omitempty"` + PolicyPatsetPatternBinding []interface{} `json:"policypatset_pattern_binding,omitempty"` } -type PolicydatasetValueBinding struct { +type PolicyDatasetValueBinding struct { Comment string `json:"comment,omitempty"` - Endrange string `json:"endrange,omitempty"` + EndRange string `json:"endrange,omitempty"` Index int `json:"index,omitempty"` Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` } -type Policytracing struct { - Capturesslhandshakepolicies string `json:"capturesslhandshakepolicies,omitempty"` - Clientip string `json:"clientip,omitempty"` +type PolicyTracing struct { + CaptureSSLHandshakePolicies string `json:"capturesslhandshakepolicies,omitempty"` + ClientIP string `json:"clientip,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` Detail string `json:"detail,omitempty"` - Filterexpr string `json:"filterexpr,omitempty"` - Isresponse int `json:"isresponse,omitempty"` - Isundefpolicy int `json:"isundefpolicy,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Packetengineid int `json:"packetengineid,omitempty"` - Policynames []string `json:"policynames,omitempty"` - Policytracingmodule string `json:"policytracingmodule,omitempty"` - Policytracingrecordcount int `json:"policytracingrecordcount,omitempty"` - Protocoltype string `json:"protocoltype,omitempty"` - Srcport int `json:"srcport,omitempty"` - Transactionid string `json:"transactionid,omitempty"` - Transactiontime string `json:"transactiontime,omitempty"` - Url string `json:"url,omitempty"` -} - -type Policyurlset struct { - Canaryurl string `json:"canaryurl,omitempty"` + FilterExpr string `json:"filterexpr,omitempty"` + IsResponse int `json:"isresponse,omitempty"` + IsUndefPolicy int `json:"isundefpolicy,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PacketEngineID int `json:"packetengineid,omitempty"` + PolicyNames []string `json:"policynames,omitempty"` + PolicyTracingModule string `json:"policytracingmodule,omitempty"` + PolicyTracingRecordCount int `json:"policytracingrecordcount,omitempty"` + ProtocolType string `json:"protocoltype,omitempty"` + SrcPort int `json:"srcport,omitempty"` + TransactionID string `json:"transactionid,omitempty"` + TransactionTime string `json:"transactiontime,omitempty"` + URL string `json:"url,omitempty"` +} + +type PolicyURLSet struct { + CanaryURL string `json:"canaryurl,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Delimiter string `json:"delimiter,omitempty"` Imported bool `json:"imported,omitempty"` Interval int `json:"interval,omitempty"` - Matchedid int `json:"matchedid,omitempty"` + MatchedID int `json:"matchedid,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` - Patterncount int `json:"patterncount,omitempty"` - Privateset bool `json:"privateset,omitempty"` - Rowseparator string `json:"rowseparator,omitempty"` - Subdomainexactmatch bool `json:"subdomainexactmatch,omitempty"` - Url string `json:"url,omitempty"` + PatternCount int `json:"patterncount,omitempty"` + PrivateSet bool `json:"privateset,omitempty"` + RowSeparator string `json:"rowseparator,omitempty"` + SubdomainExactMatch bool `json:"subdomainexactmatch,omitempty"` + URL string `json:"url,omitempty"` } -type Policyevaluation struct { +type PolicyEvaluation struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Expression string `json:"expression,omitempty"` Input string `json:"input,omitempty"` - Istruncatedrefresult bool `json:"istruncatedrefresult,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pitactionerrorresult string `json:"pitactionerrorresult,omitempty"` - Pitactionevaltime int `json:"pitactionevaltime,omitempty"` - Pitboolerrorresult string `json:"pitboolerrorresult,omitempty"` - Pitboolevaltime int `json:"pitboolevaltime,omitempty"` - Pitboolresult bool `json:"pitboolresult,omitempty"` - Pitdoubleerrorresult string `json:"pitdoubleerrorresult,omitempty"` - Pitdoubleevaltime int `json:"pitdoubleevaltime,omitempty"` - Pitdoubleresult float64 `json:"pitdoubleresult,omitempty"` - Pitmodifiedinputdata string `json:"pitmodifiedinputdata,omitempty"` - Pitnewoffsetarray []interface{} `json:"pitnewoffsetarray,omitempty"` - Pitnumerrorresult string `json:"pitnumerrorresult,omitempty"` - Pitnumevaltime int `json:"pitnumevaltime,omitempty"` - Pitnumresult int `json:"pitnumresult,omitempty"` - Pitoffseterrorresult string `json:"pitoffseterrorresult,omitempty"` - Pitoffsetevaltime int `json:"pitoffsetevaltime,omitempty"` - Pitoffsetlengtharray []interface{} `json:"pitoffsetlengtharray,omitempty"` - Pitoffsetnewlengtharray []interface{} `json:"pitoffsetnewlengtharray,omitempty"` - Pitoffsetresult int `json:"pitoffsetresult,omitempty"` - Pitoffsetresultlen int `json:"pitoffsetresultlen,omitempty"` - Pitoldoffsetarray []interface{} `json:"pitoldoffsetarray,omitempty"` - Pitoperationperformerarray []string `json:"pitoperationperformerarray,omitempty"` - Pitreferrorresult string `json:"pitreferrorresult,omitempty"` - Pitrefevaltime int `json:"pitrefevaltime,omitempty"` - Pitrefresult string `json:"pitrefresult,omitempty"` - Pitulongerrorresult string `json:"pitulongerrorresult,omitempty"` - Pitulongevaltime int `json:"pitulongevaltime,omitempty"` - Pitulongresult int `json:"pitulongresult,omitempty"` + IsTruncatedRefResult bool `json:"istruncatedrefresult,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PitActionErrorResult string `json:"pitactionerrorresult,omitempty"` + PitActionEvalTime int `json:"pitactionevaltime,omitempty"` + PitBoolErrorResult string `json:"pitboolerrorresult,omitempty"` + PitBoolEvalTime int `json:"pitboolevaltime,omitempty"` + PitBoolResult bool `json:"pitboolresult,omitempty"` + PitDoubleErrorResult string `json:"pitdoubleerrorresult,omitempty"` + PitDoubleEvalTime int `json:"pitdoubleevaltime,omitempty"` + PitDoubleResult float64 `json:"pitdoubleresult,omitempty"` + PitModifiedInputData string `json:"pitmodifiedinputdata,omitempty"` + PitNewOffsetArray []interface{} `json:"pitnewoffsetarray,omitempty"` + PitNumErrorResult string `json:"pitnumerrorresult,omitempty"` + PitNumEvalTime int `json:"pitnumevaltime,omitempty"` + PitNumResult int `json:"pitnumresult,omitempty"` + PitOffsetErrorResult string `json:"pitoffseterrorresult,omitempty"` + PitOffsetEvalTime int `json:"pitoffsetevaltime,omitempty"` + PitOffsetLengthArray []interface{} `json:"pitoffsetlengtharray,omitempty"` + PitOffsetNewLengthArray []interface{} `json:"pitoffsetnewlengtharray,omitempty"` + PitOffsetResult int `json:"pitoffsetresult,omitempty"` + PitOffsetResultLen int `json:"pitoffsetresultlen,omitempty"` + PitOldOffsetArray []interface{} `json:"pitoldoffsetarray,omitempty"` + PitOperationPerformerArray []string `json:"pitoperationperformerarray,omitempty"` + PitRefErrorResult string `json:"pitreferrorresult,omitempty"` + PitRefEvalTime int `json:"pitrefevaltime,omitempty"` + PitRefResult string `json:"pitrefresult,omitempty"` + PitUlongErrorResult string `json:"pitulongerrorresult,omitempty"` + PitUlongEvalTime int `json:"pitulongevaltime,omitempty"` + PitUlongResult int `json:"pitulongresult,omitempty"` TypeField string `json:"type,omitempty"` } -type Policyhttpcallout struct { - Bodyexpr string `json:"bodyexpr,omitempty"` - Cacheforsecs int `json:"cacheforsecs,omitempty"` +type PolicyHTTPCallout struct { + BodyExpr string `json:"bodyexpr,omitempty"` + CacheForSecs int `json:"cacheforsecs,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Fullreqexpr string `json:"fullreqexpr,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + FullReqExpr string `json:"fullreqexpr,omitempty"` Headers []string `json:"headers,omitempty"` Hits int `json:"hits,omitempty"` - Hostexpr string `json:"hostexpr,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + HostExpr string `json:"hostexpr,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Parameters []string `json:"parameters,omitempty"` Port int `json:"port,omitempty"` - Recursivecallout int `json:"recursivecallout,omitempty"` - Resultexpr string `json:"resultexpr,omitempty"` - Returntype string `json:"returntype,omitempty"` + RecursiveCallout int `json:"recursivecallout,omitempty"` + ResultExpr string `json:"resultexpr,omitempty"` + ReturnType string `json:"returntype,omitempty"` Scheme string `json:"scheme,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Undefhits int `json:"undefhits,omitempty"` - Undefreason string `json:"undefreason,omitempty"` - Urlstemexpr string `json:"urlstemexpr,omitempty"` - Vserver string `json:"vserver,omitempty"` + SvrState string `json:"svrstate,omitempty"` + UndefHits int `json:"undefhits,omitempty"` + UndefReason string `json:"undefreason,omitempty"` + URLStemExpr string `json:"urlstemexpr,omitempty"` + VServer string `json:"vserver,omitempty"` } -type Policydataset struct { +type PolicyDataset struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Dynamic string `json:"dynamic,omitempty"` - Dynamiconly bool `json:"dynamiconly,omitempty"` + DynamicOnly bool `json:"dynamiconly,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Patsetfile string `json:"patsetfile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PatsetFile string `json:"patsetfile,omitempty"` TypeField string `json:"type,omitempty"` } -type Policymap struct { +type PolicyMap struct { Count float64 `json:"__count,omitempty"` - Mappolicyname string `json:"mappolicyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sd string `json:"sd,omitempty"` - Su string `json:"su,omitempty"` - Targetname string `json:"targetname,omitempty"` - Td string `json:"td,omitempty"` - Tu string `json:"tu,omitempty"` + MapPolicyName string `json:"mappolicyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SD string `json:"sd,omitempty"` + SU string `json:"su,omitempty"` + TargetName string `json:"targetname,omitempty"` + TD string `json:"td,omitempty"` + TU string `json:"tu,omitempty"` } -type Policyexpression struct { +type PolicyExpression struct { Builtin []string `json:"builtin,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pihits int `json:"pihits,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PIHits int `json:"pihits,omitempty"` Type1 string `json:"type1,omitempty"` TypeField string `json:"type,omitempty"` Value string `json:"value,omitempty"` } -type Policypatset struct { +type PolicyPatset struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Dynamic string `json:"dynamic,omitempty"` - Dynamiconly bool `json:"dynamiconly,omitempty"` + DynamicOnly bool `json:"dynamiconly,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Patsetfile string `json:"patsetfile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PatsetFile string `json:"patsetfile,omitempty"` } -type Policyparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type PolicyParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Timeout int `json:"timeout,omitempty"` } diff --git a/nitrogo/models/pq.go b/nitrogo/models/pq.go index 818fa91..85b5fd3 100644 --- a/nitrogo/models/pq.go +++ b/nitrogo/models/pq.go @@ -4,23 +4,23 @@ package models -type Pqbinding struct { - Vservername string `json:"vservername,omitempty"` - Policyname string `json:"policyname,omitempty"` +type PQBinding struct { + VServerName string `json:"vservername,omitempty"` + PolicyName string `json:"policyname,omitempty"` Rule string `json:"rule,omitempty"` Priority string `json:"priority,omitempty"` Weight string `json:"weight,omitempty"` - Qdepth string `json:"qdepth,omitempty"` - Polqdepth string `json:"polqdepth,omitempty"` + QDepth string `json:"qdepth,omitempty"` + PolQDepth string `json:"polqdepth,omitempty"` Hits string `json:"hits,omitempty"` } -type Pqpolicy struct { - Policyname string `json:"policyname,omitempty"` +type PQPolicy struct { + PolicyName string `json:"policyname,omitempty"` Rule string `json:"rule,omitempty"` Priority int `json:"priority,omitempty"` Weight int `json:"weight,omitempty"` - Qdepth int `json:"qdepth,omitempty"` - Polqdepth int `json:"polqdepth,omitempty"` + QDepth int `json:"qdepth,omitempty"` + PolQDepth int `json:"polqdepth,omitempty"` Hits string `json:"hits,omitempty"` } diff --git a/nitrogo/models/protocol.go b/nitrogo/models/protocol.go index cc573a8..38abffe 100644 --- a/nitrogo/models/protocol.go +++ b/nitrogo/models/protocol.go @@ -1,21 +1,21 @@ package models // protocol configuration structs -type Protocolhttpband struct { - Accesscount []interface{} `json:"accesscount,omitempty"` - Accessratio []interface{} `json:"accessratio,omitempty"` - Accessrationew []interface{} `json:"accessrationew,omitempty"` - Avgbandsize []interface{} `json:"avgbandsize,omitempty"` - Avgbandsizenew []interface{} `json:"avgbandsizenew,omitempty"` - Banddata []interface{} `json:"banddata,omitempty"` - Banddatanew []interface{} `json:"banddatanew,omitempty"` - Bandrange int `json:"bandrange,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Numberofbands int `json:"numberofbands,omitempty"` - Reqbandsize int `json:"reqbandsize,omitempty"` - Respbandsize int `json:"respbandsize,omitempty"` - Totalbandsize []interface{} `json:"totalbandsize,omitempty"` +type ProtocolHTTPBand struct { + AccessCount []interface{} `json:"accesscount,omitempty"` + AccessRatio []interface{} `json:"accessratio,omitempty"` + AccessRatioNew []interface{} `json:"accessrationew,omitempty"` + AvgBandSize []interface{} `json:"avgbandsize,omitempty"` + AvgBandSizeNew []interface{} `json:"avgbandsizenew,omitempty"` + BandData []interface{} `json:"banddata,omitempty"` + BandDataNew []interface{} `json:"banddatanew,omitempty"` + BandRange int `json:"bandrange,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NumberOfBands int `json:"numberofbands,omitempty"` + ReqBandSize int `json:"reqbandsize,omitempty"` + RespBandSize int `json:"respbandsize,omitempty"` + TotalBandSize []interface{} `json:"totalbandsize,omitempty"` Totals []interface{} `json:"totals,omitempty"` TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/quic.go b/nitrogo/models/quic.go index 083804e..3381c4e 100644 --- a/nitrogo/models/quic.go +++ b/nitrogo/models/quic.go @@ -1,33 +1,33 @@ package models // quic configuration structs -type Quicparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Quicsecrettimeout int `json:"quicsecrettimeout,omitempty"` +type QUICParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + QUICSecretTimeout int `json:"quicsecrettimeout,omitempty"` } -type Quicprofile struct { - Ackdelayexponent int `json:"ackdelayexponent,omitempty"` - Activeconnectionidlimit int `json:"activeconnectionidlimit,omitempty"` - Activeconnectionmigration string `json:"activeconnectionmigration,omitempty"` +type QUICProfile struct { + AckDelayExponent int `json:"ackdelayexponent,omitempty"` + ActiveConnectionIDLimit int `json:"activeconnectionidlimit,omitempty"` + ActiveConnectionMigration string `json:"activeconnectionmigration,omitempty"` Builtin []string `json:"builtin,omitempty"` - Congestionctrlalgorithm string `json:"congestionctrlalgorithm,omitempty"` + CongestionCtrlAlgorithm string `json:"congestionctrlalgorithm,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` - Initialmaxdata int `json:"initialmaxdata,omitempty"` - Initialmaxstreamdatabidilocal int `json:"initialmaxstreamdatabidilocal,omitempty"` - Initialmaxstreamdatabidiremote int `json:"initialmaxstreamdatabidiremote,omitempty"` - Initialmaxstreamdatauni int `json:"initialmaxstreamdatauni,omitempty"` - Initialmaxstreamsbidi int `json:"initialmaxstreamsbidi,omitempty"` - Initialmaxstreamsuni int `json:"initialmaxstreamsuni,omitempty"` - Maxackdelay int `json:"maxackdelay,omitempty"` - Maxidletimeout int `json:"maxidletimeout,omitempty"` - Maxudpdatagramsperburst int `json:"maxudpdatagramsperburst,omitempty"` - Maxudppayloadsize int `json:"maxudppayloadsize,omitempty"` + InitialMaxData int `json:"initialmaxdata,omitempty"` + InitialMaxStreamDataBidiLocal int `json:"initialmaxstreamdatabidilocal,omitempty"` + InitialMaxStreamDataBidiRemote int `json:"initialmaxstreamdatabidiremote,omitempty"` + InitialMaxStreamDataUni int `json:"initialmaxstreamdatauni,omitempty"` + InitialMaxStreamsBidi int `json:"initialmaxstreamsbidi,omitempty"` + InitialMaxStreamsUni int `json:"initialmaxstreamsuni,omitempty"` + MaxAckDelay int `json:"maxackdelay,omitempty"` + MaxIdleTimeout int `json:"maxidletimeout,omitempty"` + MaxUDPDatagramsPerBurst int `json:"maxudpdatagramsperburst,omitempty"` + MaxUDPPayloadSize int `json:"maxudppayloadsize,omitempty"` Name string `json:"name,omitempty"` - Newtokenvalidityperiod int `json:"newtokenvalidityperiod,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Retrytokenvalidityperiod int `json:"retrytokenvalidityperiod,omitempty"` - Statelessaddressvalidation string `json:"statelessaddressvalidation,omitempty"` + NewTokenValidityPeriod int `json:"newtokenvalidityperiod,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + RetryTokenValidityPeriod int `json:"retrytokenvalidityperiod,omitempty"` + StatelessAddressValidation string `json:"statelessaddressvalidation,omitempty"` } diff --git a/nitrogo/models/quicbridge.go b/nitrogo/models/quicbridge.go index f4a14c8..3de39f0 100644 --- a/nitrogo/models/quicbridge.go +++ b/nitrogo/models/quicbridge.go @@ -1,11 +1,11 @@ package models // quicbridge configuration structs -type Quicbridgeprofile struct { +type QUICBridgeProfile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Refcnt int `json:"refcnt,omitempty"` - Routingalgorithm string `json:"routingalgorithm,omitempty"` - Serveridlength int `json:"serveridlength,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RefCnt int `json:"refcnt,omitempty"` + RoutingAlgorithm string `json:"routingalgorithm,omitempty"` + ServerIDLength int `json:"serveridlength,omitempty"` } diff --git a/nitrogo/models/rdp.go b/nitrogo/models/rdp.go index 66126ad..cc3878c 100644 --- a/nitrogo/models/rdp.go +++ b/nitrogo/models/rdp.go @@ -1,54 +1,54 @@ package models // rdp configuration structs -type Rdpclientprofile struct { - Addusernameinrdpfile string `json:"addusernameinrdpfile,omitempty"` - Audiocapturemode string `json:"audiocapturemode,omitempty"` +type RDPClientProfile struct { + AddUsernameInRDPFile string `json:"addusernameinrdpfile,omitempty"` + AudioCaptureMode string `json:"audiocapturemode,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` - Keyboardhook string `json:"keyboardhook,omitempty"` - Multimonitorsupport string `json:"multimonitorsupport,omitempty"` + KeyboardHook string `json:"keyboardhook,omitempty"` + MultiMonitorSupport string `json:"multimonitorsupport,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Psk string `json:"psk,omitempty"` - Randomizerdpfilename string `json:"randomizerdpfilename,omitempty"` - Rdpcookievalidity int `json:"rdpcookievalidity,omitempty"` - Rdpcustomparams string `json:"rdpcustomparams,omitempty"` - Rdpfilename string `json:"rdpfilename,omitempty"` - Rdphost string `json:"rdphost,omitempty"` - Rdplinkattribute string `json:"rdplinkattribute,omitempty"` - Rdplistener string `json:"rdplistener,omitempty"` - Rdpurloverride string `json:"rdpurloverride,omitempty"` - Rdpvalidateclientip string `json:"rdpvalidateclientip,omitempty"` - Redirectclipboard string `json:"redirectclipboard,omitempty"` - Redirectcomports string `json:"redirectcomports,omitempty"` - Redirectdrives string `json:"redirectdrives,omitempty"` - Redirectpnpdevices string `json:"redirectpnpdevices,omitempty"` - Redirectprinters string `json:"redirectprinters,omitempty"` - Videoplaybackmode string `json:"videoplaybackmode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PSK string `json:"psk,omitempty"` + RandomizeRDPFileName string `json:"randomizerdpfilename,omitempty"` + RDPCookieValidity int `json:"rdpcookievalidity,omitempty"` + RDPCustomParams string `json:"rdpcustomparams,omitempty"` + RDPFileName string `json:"rdpfilename,omitempty"` + RDPHost string `json:"rdphost,omitempty"` + RDPLinkAttribute string `json:"rdplinkattribute,omitempty"` + RDPListener string `json:"rdplistener,omitempty"` + RDPURLOverride string `json:"rdpurloverride,omitempty"` + RDPValidateClientIP string `json:"rdpvalidateclientip,omitempty"` + RedirectClipboard string `json:"redirectclipboard,omitempty"` + RedirectComPorts string `json:"redirectcomports,omitempty"` + RedirectDrives string `json:"redirectdrives,omitempty"` + RedirectPnpDevices string `json:"redirectpnpdevices,omitempty"` + RedirectPrinters string `json:"redirectprinters,omitempty"` + VideoPlaybackMode string `json:"videoplaybackmode,omitempty"` } -type Rdpserverprofile struct { +type RDPServerProfile struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Psk string `json:"psk,omitempty"` - Rdpip string `json:"rdpip,omitempty"` - Rdpport int `json:"rdpport,omitempty"` - Rdpredirection string `json:"rdpredirection,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PSK string `json:"psk,omitempty"` + RDPIP string `json:"rdpip,omitempty"` + RDPPort int `json:"rdpport,omitempty"` + RDPRedirection string `json:"rdpredirection,omitempty"` } -type Rdpconnections struct { +type RDPConnections struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Endpointip string `json:"endpointip,omitempty"` - Endpointport int `json:"endpointport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Peid int `json:"peid,omitempty"` - Targetip string `json:"targetip,omitempty"` - Targetport int `json:"targetport,omitempty"` + EndpointIP string `json:"endpointip,omitempty"` + EndpointPort int `json:"endpointport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PEID int `json:"peid,omitempty"` + TargetIP string `json:"targetip,omitempty"` + TargetPort int `json:"targetport,omitempty"` Username string `json:"username,omitempty"` } diff --git a/nitrogo/models/reputation.go b/nitrogo/models/reputation.go index 14e21b3..1f03c37 100644 --- a/nitrogo/models/reputation.go +++ b/nitrogo/models/reputation.go @@ -1,10 +1,10 @@ package models // reputation configuration structs -type Reputationsettings struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Proxyport int `json:"proxyport,omitempty"` - Proxyserver string `json:"proxyserver,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` +type ReputationSettings struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProxyPassword string `json:"proxypassword,omitempty"` + ProxyPort int `json:"proxyport,omitempty"` + ProxyServer string `json:"proxyserver,omitempty"` + ProxyUsername string `json:"proxyusername,omitempty"` } diff --git a/nitrogo/models/responder.go b/nitrogo/models/responder.go index ef174d6..d9813f9 100644 --- a/nitrogo/models/responder.go +++ b/nitrogo/models/responder.go @@ -1,183 +1,183 @@ package models // responder configuration structs -type ResponderglobalResponderpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ResponderGlobalResponderPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type ResponderpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicyResponderglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyResponderGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicyResponderpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyResponderPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicyCrvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyCRVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ResponderPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Responderhtmlpage struct { - Cacertfile string `json:"cacertfile,omitempty"` +type ResponderHTMLPage struct { + CACertFile string `json:"cacertfile,omitempty"` Comment string `json:"comment,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Overwrite bool `json:"overwrite,omitempty"` Response string `json:"response,omitempty"` Src string `json:"src,omitempty"` } -type Responderaction struct { +type ResponderAction struct { Builtin []string `json:"builtin,omitempty"` - Bypasssafetycheck string `json:"bypasssafetycheck,omitempty"` + BypassSafetyCheck string `json:"bypasssafetycheck,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Headers []string `json:"headers,omitempty"` Hits int `json:"hits,omitempty"` - Htmlpage string `json:"htmlpage,omitempty"` + HTMLPage string `json:"htmlpage,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reasonphrase string `json:"reasonphrase,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Responsestatuscode int `json:"responsestatuscode,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReasonPhrase string `json:"reasonphrase,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + ResponseStatusCode int `json:"responsestatuscode,omitempty"` Target string `json:"target,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Responderpolicylabel struct { +type ResponderPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicylabelResponderpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type ResponderPolicyLabelResponderPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type ResponderpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - ResponderpolicylabelPolicybindingBinding []interface{} `json:"responderpolicylabel_policybinding_binding,omitempty"` - ResponderpolicylabelResponderpolicyBinding []interface{} `json:"responderpolicylabel_responderpolicy_binding,omitempty"` +type ResponderPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + ResponderPolicyLabelPolicyBindingBinding []interface{} `json:"responderpolicylabel_policybinding_binding,omitempty"` + ResponderPolicyLabelResponderPolicyBinding []interface{} `json:"responderpolicylabel_responderpolicy_binding,omitempty"` } -type Responderpolicy struct { +type ResponderPolicy struct { Action string `json:"action,omitempty"` - Appflowaction string `json:"appflowaction,omitempty"` + AppFlowAction string `json:"appflowaction,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type ResponderpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type ResponderPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Responderparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type ResponderParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Timeout int `json:"timeout,omitempty"` - Undefaction string `json:"undefaction,omitempty"` + UndefAction string `json:"undefaction,omitempty"` } -type ResponderpolicyBinding struct { +type ResponderPolicyBinding struct { Name string `json:"name,omitempty"` - ResponderpolicyCrvserverBinding []interface{} `json:"responderpolicy_crvserver_binding,omitempty"` - ResponderpolicyCsvserverBinding []interface{} `json:"responderpolicy_csvserver_binding,omitempty"` - ResponderpolicyLbvserverBinding []interface{} `json:"responderpolicy_lbvserver_binding,omitempty"` - ResponderpolicyResponderglobalBinding []interface{} `json:"responderpolicy_responderglobal_binding,omitempty"` - ResponderpolicyResponderpolicylabelBinding []interface{} `json:"responderpolicy_responderpolicylabel_binding,omitempty"` - ResponderpolicyVpnvserverBinding []interface{} `json:"responderpolicy_vpnvserver_binding,omitempty"` + ResponderPolicyCRVServerBinding []interface{} `json:"responderpolicy_crvserver_binding,omitempty"` + ResponderPolicyCSVServerBinding []interface{} `json:"responderpolicy_csvserver_binding,omitempty"` + ResponderPolicyLBVServerBinding []interface{} `json:"responderpolicy_lbvserver_binding,omitempty"` + ResponderPolicyResponderGlobalBinding []interface{} `json:"responderpolicy_responderglobal_binding,omitempty"` + ResponderPolicyResponderPolicyLabelBinding []interface{} `json:"responderpolicy_responderpolicylabel_binding,omitempty"` + ResponderPolicyVPNVServerBinding []interface{} `json:"responderpolicy_vpnvserver_binding,omitempty"` } -type ResponderglobalBinding struct { - ResponderglobalResponderpolicyBinding []interface{} `json:"responderglobal_responderpolicy_binding,omitempty"` +type ResponderGlobalBinding struct { + ResponderGlobalResponderPolicyBinding []interface{} `json:"responderglobal_responderpolicy_binding,omitempty"` } diff --git a/nitrogo/models/rewrite.go b/nitrogo/models/rewrite.go index 1d63eb7..19b46f5 100644 --- a/nitrogo/models/rewrite.go +++ b/nitrogo/models/rewrite.go @@ -1,11 +1,11 @@ package models // rewrite configuration structs -type RewriteglobalBinding struct { - RewriteglobalRewritepolicyBinding []interface{} `json:"rewriteglobal_rewritepolicy_binding,omitempty"` +type RewriteGlobalBinding struct { + RewriteGlobalRewritePolicyBinding []interface{} `json:"rewriteglobal_rewritepolicy_binding,omitempty"` } -type Rewritepolicy struct { +type RewritePolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` @@ -13,156 +13,156 @@ type Rewritepolicy struct { Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Logaction string `json:"logaction,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Rewriteaction struct { +type RewriteAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Refinesearch string `json:"refinesearch,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + RefineSearch string `json:"refinesearch,omitempty"` Search string `json:"search,omitempty"` - Stringbuilderexpr string `json:"stringbuilderexpr,omitempty"` + StringBuilderExpr string `json:"stringbuilderexpr,omitempty"` Target string `json:"target,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type RewritepolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type RewritePolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type RewritepolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type RewritePolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type RewritepolicylabelRewritepolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type RewritePolicyLabelRewritePolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type RewritepolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - RewritepolicylabelPolicybindingBinding []interface{} `json:"rewritepolicylabel_policybinding_binding,omitempty"` - RewritepolicylabelRewritepolicyBinding []interface{} `json:"rewritepolicylabel_rewritepolicy_binding,omitempty"` +type RewritePolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + RewritePolicyLabelPolicyBindingBinding []interface{} `json:"rewritepolicylabel_policybinding_binding,omitempty"` + RewritePolicyLabelRewritePolicyBinding []interface{} `json:"rewritepolicylabel_rewritepolicy_binding,omitempty"` } -type RewritepolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type RewritePolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type RewritepolicyRewriteglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type RewritePolicyRewriteGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type RewritepolicyBinding struct { +type RewritePolicyBinding struct { Name string `json:"name,omitempty"` - RewritepolicyCsvserverBinding []interface{} `json:"rewritepolicy_csvserver_binding,omitempty"` - RewritepolicyLbvserverBinding []interface{} `json:"rewritepolicy_lbvserver_binding,omitempty"` - RewritepolicyRewriteglobalBinding []interface{} `json:"rewritepolicy_rewriteglobal_binding,omitempty"` - RewritepolicyRewritepolicylabelBinding []interface{} `json:"rewritepolicy_rewritepolicylabel_binding,omitempty"` - RewritepolicyVpnvserverBinding []interface{} `json:"rewritepolicy_vpnvserver_binding,omitempty"` + RewritePolicyCSVServerBinding []interface{} `json:"rewritepolicy_csvserver_binding,omitempty"` + RewritePolicyLBVServerBinding []interface{} `json:"rewritepolicy_lbvserver_binding,omitempty"` + RewritePolicyRewriteGlobalBinding []interface{} `json:"rewritepolicy_rewriteglobal_binding,omitempty"` + RewritePolicyRewritePolicyLabelBinding []interface{} `json:"rewritepolicy_rewritepolicylabel_binding,omitempty"` + RewritePolicyVPNVServerBinding []interface{} `json:"rewritepolicy_vpnvserver_binding,omitempty"` } -type Rewriteparam struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type RewriteParam struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Timeout int `json:"timeout,omitempty"` - Undefaction string `json:"undefaction,omitempty"` + UndefAction string `json:"undefaction,omitempty"` } -type Rewritepolicylabel struct { +type RewritePolicyLabel struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` Priority int `json:"priority,omitempty"` Transform string `json:"transform,omitempty"` } -type RewritepolicyRewritepolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type RewritePolicyRewritePolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type RewriteglobalRewritepolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type RewriteGlobalRewritePolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type RewritepolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type RewritePolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/router.go b/nitrogo/models/router.go index e353b3b..75f710a 100644 --- a/nitrogo/models/router.go +++ b/nitrogo/models/router.go @@ -1,10 +1,10 @@ package models // router configuration structs -type Routerdynamicrouting struct { - Commandstring string `json:"commandstring,omitempty"` +type RouterDynamicRouting struct { + CommandString string `json:"commandstring,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Output string `json:"output,omitempty"` } diff --git a/nitrogo/models/sc.go b/nitrogo/models/sc.go index 41d6ab0..e294a88 100644 --- a/nitrogo/models/sc.go +++ b/nitrogo/models/sc.go @@ -4,20 +4,20 @@ package models -type Scpolicy struct { +type SCPolicy struct { Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` + URL string `json:"url,omitempty"` Rule string `json:"rule,omitempty"` Delay int `json:"delay,omitempty"` - Maxconn int `json:"maxconn,omitempty"` + MaxConn int `json:"maxconn,omitempty"` Action string `json:"action,omitempty"` - Altcontentsvcname string `json:"altcontentsvcname,omitempty"` - Altcontentpath string `json:"altcontentpath,omitempty"` + AltContentSvcName string `json:"altcontentsvcname,omitempty"` + AltContentPath string `json:"altcontentpath,omitempty"` } -type Scparameter struct { - Sessionlife int `json:"sessionlife,omitempty"` - Vsr string `json:"vsr,omitempty"` +type SCParameter struct { + SessionLife int `json:"sessionlife,omitempty"` + VSR string `json:"vsr,omitempty"` Builtin string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` } diff --git a/nitrogo/models/smpp.go b/nitrogo/models/smpp.go index 6424f05..cb52d0b 100644 --- a/nitrogo/models/smpp.go +++ b/nitrogo/models/smpp.go @@ -1,19 +1,19 @@ package models // smpp configuration structs -type Smppparam struct { - Addrnpi int `json:"addrnpi,omitempty"` - Addrrange string `json:"addrrange,omitempty"` - Addrton int `json:"addrton,omitempty"` - Clientmode string `json:"clientmode,omitempty"` - Msgqueue string `json:"msgqueue,omitempty"` - Msgqueuesize int `json:"msgqueuesize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SMPPParam struct { + AddrNPI int `json:"addrnpi,omitempty"` + AddrRange string `json:"addrrange,omitempty"` + AddrTON int `json:"addrton,omitempty"` + ClientMode string `json:"clientmode,omitempty"` + MsgQueue string `json:"msgqueue,omitempty"` + MsgQueueSize int `json:"msgqueuesize,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Smppuser struct { +type SMPPUser struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` } diff --git a/nitrogo/models/snmp.go b/nitrogo/models/snmp.go index 5b508e7..46943d3 100644 --- a/nitrogo/models/snmp.go +++ b/nitrogo/models/snmp.go @@ -1,137 +1,137 @@ package models // snmp configuration structs -type Snmpmanager struct { +type SNMPManager struct { Count float64 `json:"__count,omitempty"` Domain string `json:"domain,omitempty"` - Domainresolveretry int `json:"domainresolveretry,omitempty"` - Ip string `json:"ip,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + DomainResolveRetry int `json:"domainresolveretry,omitempty"` + IP string `json:"ip,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Snmpalarm struct { +type SNMPAlarm struct { Count float64 `json:"__count,omitempty"` Logging string `json:"logging,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Normalvalue int `json:"normalvalue,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NormalValue int `json:"normalvalue,omitempty"` Severity string `json:"severity,omitempty"` State string `json:"state,omitempty"` - Thresholdvalue int `json:"thresholdvalue,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` Time int `json:"time,omitempty"` Timeout int `json:"timeout,omitempty"` - Trapname string `json:"trapname,omitempty"` + TrapName string `json:"trapname,omitempty"` } -type Snmpoption struct { - Customtrap string `json:"customtrap,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Partitionnameintrap string `json:"partitionnameintrap,omitempty"` - Severityinfointrap string `json:"severityinfointrap,omitempty"` - Snmpset string `json:"snmpset,omitempty"` - Snmptraplogging string `json:"snmptraplogging,omitempty"` - Snmptraplogginglevel string `json:"snmptraplogginglevel,omitempty"` +type SNMPOption struct { + CustomTrap string `json:"customtrap,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PartitionNameInTrap string `json:"partitionnameintrap,omitempty"` + SeverityInfoInTrap string `json:"severityinfointrap,omitempty"` + SNMPSet string `json:"snmpset,omitempty"` + SNMPTrapLogging string `json:"snmptraplogging,omitempty"` + SNMPTrapLoggingLevel string `json:"snmptraplogginglevel,omitempty"` } -type Snmpengineid struct { +type SNMPEngineID struct { Count float64 `json:"__count,omitempty"` - Defaultengineid string `json:"defaultengineid,omitempty"` - Engineid string `json:"engineid,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` + DefaultEngineID string `json:"defaultengineid,omitempty"` + EngineID string `json:"engineid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } -type Snmpmib struct { +type SNMPMIB struct { Contact string `json:"contact,omitempty"` Count float64 `json:"__count,omitempty"` - Customid string `json:"customid,omitempty"` + CustomID string `json:"customid,omitempty"` Location string `json:"location,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ownernode int `json:"ownernode,omitempty"` - Sysdesc string `json:"sysdesc,omitempty"` - Sysoid string `json:"sysoid,omitempty"` - Sysservices int `json:"sysservices,omitempty"` - Sysuptime int `json:"sysuptime,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + SysDesc string `json:"sysdesc,omitempty"` + SysOID string `json:"sysoid,omitempty"` + SysServices int `json:"sysservices,omitempty"` + SysUptime int `json:"sysuptime,omitempty"` } -type Snmpcommunity struct { - Communityname string `json:"communityname,omitempty"` +type SNMPCommunity struct { + CommunityName string `json:"communityname,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Permissions string `json:"permissions,omitempty"` } -type SnmptrapBinding struct { - SnmptrapSnmpuserBinding []interface{} `json:"snmptrap_snmpuser_binding,omitempty"` - Td int `json:"td,omitempty"` - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` +type SNMPTrapBinding struct { + SNMPTrapSNMPUserBinding []interface{} `json:"snmptrap_snmpuser_binding,omitempty"` + TD int `json:"td,omitempty"` + TrapClass string `json:"trapclass,omitempty"` + TrapDestination string `json:"trapdestination,omitempty"` Version string `json:"version,omitempty"` } -type Snmpuser struct { - Authpasswd string `json:"authpasswd,omitempty"` - Authtype string `json:"authtype,omitempty"` +type SNMPUser struct { + AuthPasswd string `json:"authpasswd,omitempty"` + AuthType string `json:"authtype,omitempty"` Count float64 `json:"__count,omitempty"` - Engineid string `json:"engineid,omitempty"` + EngineID string `json:"engineid,omitempty"` Group string `json:"group,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Privpasswd string `json:"privpasswd,omitempty"` - Privtype string `json:"privtype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PrivPasswd string `json:"privpasswd,omitempty"` + PrivType string `json:"privtype,omitempty"` Status string `json:"status,omitempty"` - Storagetype string `json:"storagetype,omitempty"` + StorageType string `json:"storagetype,omitempty"` } -type Snmpgroup struct { +type SNMPGroup struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Readviewname string `json:"readviewname,omitempty"` - Securitylevel string `json:"securitylevel,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReadViewName string `json:"readviewname,omitempty"` + SecurityLevel string `json:"securitylevel,omitempty"` Status string `json:"status,omitempty"` - Storagetype string `json:"storagetype,omitempty"` + StorageType string `json:"storagetype,omitempty"` } -type Snmptrap struct { - Allpartitions string `json:"allpartitions,omitempty"` - Communityname string `json:"communityname,omitempty"` +type SNMPTrap struct { + AllPartitions string `json:"allpartitions,omitempty"` + CommunityName string `json:"communityname,omitempty"` Count float64 `json:"__count,omitempty"` - Destport int `json:"destport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + DestPort int `json:"destport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Severity string `json:"severity,omitempty"` - Srcip string `json:"srcip,omitempty"` - Td int `json:"td,omitempty"` - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` + SrcIP string `json:"srcip,omitempty"` + TD int `json:"td,omitempty"` + TrapClass string `json:"trapclass,omitempty"` + TrapDestination string `json:"trapdestination,omitempty"` Version string `json:"version,omitempty"` } -type SnmptrapSnmpuserBinding struct { - Securitylevel string `json:"securitylevel,omitempty"` - Td int `json:"td,omitempty"` - Trapclass string `json:"trapclass,omitempty"` - Trapdestination string `json:"trapdestination,omitempty"` +type SNMPTrapSNMPUserBinding struct { + SecurityLevel string `json:"securitylevel,omitempty"` + TD int `json:"td,omitempty"` + TrapClass string `json:"trapclass,omitempty"` + TrapDestination string `json:"trapdestination,omitempty"` Username string `json:"username,omitempty"` Version string `json:"version,omitempty"` } -type Snmpoid struct { +type SNMPOID struct { Count float64 `json:"__count,omitempty"` - Entitytype string `json:"entitytype,omitempty"` + EntityType string `json:"entitytype,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Snmpoid string `json:"Snmpoid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SNMPOID string `json:"Snmpoid,omitempty"` } -type Snmpview struct { +type SNMPView struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Status string `json:"status,omitempty"` - Storagetype string `json:"storagetype,omitempty"` + StorageType string `json:"storagetype,omitempty"` Subtree string `json:"subtree,omitempty"` TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/spillover.go b/nitrogo/models/spillover.go index 0a891c7..a876a4b 100644 --- a/nitrogo/models/spillover.go +++ b/nitrogo/models/spillover.go @@ -1,17 +1,17 @@ package models // spillover configuration structs -type SpilloverpolicyGslbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SpilloverPolicyGSLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Spilloverpolicy struct { +type SpilloverPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` @@ -19,45 +19,45 @@ type Spilloverpolicy struct { Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type SpilloverpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SpilloverPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type SpilloverpolicyBinding struct { +type SpilloverPolicyBinding struct { Name string `json:"name,omitempty"` - SpilloverpolicyCsvserverBinding []interface{} `json:"spilloverpolicy_csvserver_binding,omitempty"` - SpilloverpolicyGslbvserverBinding []interface{} `json:"spilloverpolicy_gslbvserver_binding,omitempty"` - SpilloverpolicyLbvserverBinding []interface{} `json:"spilloverpolicy_lbvserver_binding,omitempty"` + SpilloverPolicyCSVServerBinding []interface{} `json:"spilloverpolicy_csvserver_binding,omitempty"` + SpilloverPolicyGSLBVServerBinding []interface{} `json:"spilloverpolicy_gslbvserver_binding,omitempty"` + SpilloverPolicyLBVServerBinding []interface{} `json:"spilloverpolicy_lbvserver_binding,omitempty"` } -type Spilloveraction struct { +type SpilloverAction struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SpilloverpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SpilloverPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/ssl.go b/nitrogo/models/ssl.go index da9fd2d..7d3b8cb 100644 --- a/nitrogo/models/ssl.go +++ b/nitrogo/models/ssl.go @@ -1,569 +1,569 @@ package models // ssl configuration structs -type SslcertkeybundleIntermediatecertlinksBinding struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` +type SSLCertKeyBundleIntermediateCertLinksBinding struct { + CertKeyBundleName string `json:"certkeybundlename,omitempty"` + ClientCertNotAfter string `json:"clientcertnotafter,omitempty"` + ClientCertNotBefore string `json:"clientcertnotbefore,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` Issuer string `json:"issuer,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize int `json:"publickeysize,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` + PublicKey string `json:"publickey,omitempty"` + PublicKeySize int `json:"publickeysize,omitempty"` + SANDNS string `json:"sandns,omitempty"` + SANIPAdd string `json:"sanipadd,omitempty"` Serial string `json:"serial,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` Status string `json:"status,omitempty"` Subject string `json:"subject,omitempty"` } -type Sslhpkekey struct { +type SSLHPKEKey struct { Count float64 `json:"__count,omitempty"` - Dhkem string `json:"dhkem,omitempty"` + DHKEM string `json:"dhkem,omitempty"` File string `json:"file,omitempty"` - Hpkekeyname string `json:"hpkekeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + HPKEKeyName string `json:"hpkekeyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SslpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SSLPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type SslcipherBinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - SslcipherIndividualcipherBinding []interface{} `json:"sslcipher_individualcipher_binding,omitempty"` - SslcipherSslciphersuiteBinding []interface{} `json:"sslcipher_sslciphersuite_binding,omitempty"` - SslcipherSslprofileBinding []interface{} `json:"sslcipher_sslprofile_binding,omitempty"` +type SSLCipherBinding struct { + CipherGroupName string `json:"ciphergroupname,omitempty"` + SSLCipherIndividualCipherBinding []interface{} `json:"sslcipher_individualcipher_binding,omitempty"` + SSLCipherSSLCipherSuiteBinding []interface{} `json:"sslcipher_sslciphersuite_binding,omitempty"` + SSLCipherSSLProfileBinding []interface{} `json:"sslcipher_sslprofile_binding,omitempty"` } -type SslpolicySslpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SSLPolicySSLPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type SslvserverSslcertkeyBinding struct { - Ca bool `json:"ca,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SSLVServerSSLCertKeyBinding struct { + CA bool `json:"ca,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + SkipCAName bool `json:"skipcaname,omitempty"` + SNICert bool `json:"snicert,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type SslcrlSerialnumberBinding struct { - Crlname string `json:"crlname,omitempty"` +type SSLCRLSerialNumberBinding struct { + CRLName string `json:"crlname,omitempty"` Date string `json:"date,omitempty"` Number string `json:"number,omitempty"` } -type Sslfipskey struct { +type SSLFIPSKey struct { Count float64 `json:"__count,omitempty"` Curve string `json:"curve,omitempty"` Exponent string `json:"exponent,omitempty"` - Fipskeyname string `json:"fipskeyname,omitempty"` + FIPSKeyName string `json:"fipskeyname,omitempty"` Inform string `json:"inform,omitempty"` - Iv string `json:"iv,omitempty"` + IV string `json:"iv,omitempty"` Key string `json:"key,omitempty"` - Keytype string `json:"keytype,omitempty"` + KeyType string `json:"keytype,omitempty"` Modulus int `json:"modulus,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Size int `json:"size,omitempty"` - Wrapkeyname string `json:"wrapkeyname,omitempty"` + WrapKeyName string `json:"wrapkeyname,omitempty"` } -type SslcipherSslprofileBinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` +type SSLCipherSSLProfileBinding struct { + CipherGroupName string `json:"ciphergroupname,omitempty"` + CipherOperation string `json:"cipheroperation,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + CiphGrpAls string `json:"ciphgrpals,omitempty"` Description string `json:"description,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` } -type Sslfipssimtarget struct { - Certfile string `json:"certfile,omitempty"` - Keyvector string `json:"keyvector,omitempty"` - Sourcesecret string `json:"sourcesecret,omitempty"` - Targetsecret string `json:"targetsecret,omitempty"` +type SSLFIPSSimTarget struct { + CertFile string `json:"certfile,omitempty"` + KeyVector string `json:"keyvector,omitempty"` + SourceSecret string `json:"sourcesecret,omitempty"` + TargetSecret string `json:"targetsecret,omitempty"` } -type SslserviceSslpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type SSLServiceSSLPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Polinherit int `json:"polinherit,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolInherit int `json:"polinherit,omitempty"` Priority int `json:"priority,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` TypeField string `json:"type,omitempty"` } -type SslprofileSslciphersuiteBinding struct { - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SSLProfileSSLCipherSuiteBinding struct { + CipherName string `json:"ciphername,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` } -type SslpolicySslserviceBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SSLPolicySSLServiceBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type SslvserverBinding struct { - SslvserverEcccurveBinding []interface{} `json:"sslvserver_ecccurve_binding,omitempty"` - SslvserverHashicorpBinding []interface{} `json:"sslvserver_hashicorp_binding,omitempty"` - SslvserverSslcacertbundleBinding []interface{} `json:"sslvserver_sslcacertbundle_binding,omitempty"` - SslvserverSslcertkeyBinding []interface{} `json:"sslvserver_sslcertkey_binding,omitempty"` - SslvserverSslcertkeybundleBinding []interface{} `json:"sslvserver_sslcertkeybundle_binding,omitempty"` - SslvserverSslcipherBinding []interface{} `json:"sslvserver_sslcipher_binding,omitempty"` - SslvserverSslciphersuiteBinding []interface{} `json:"sslvserver_sslciphersuite_binding,omitempty"` - SslvserverSslpolicyBinding []interface{} `json:"sslvserver_sslpolicy_binding,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SSLVServerBinding struct { + SSLVServerECCCurveBinding []interface{} `json:"sslvserver_ecccurve_binding,omitempty"` + SSLVServerHashicorpBinding []interface{} `json:"sslvserver_hashicorp_binding,omitempty"` + SSLVServerSSLCACertBundleBinding []interface{} `json:"sslvserver_sslcacertbundle_binding,omitempty"` + SSLVServerSSLCertKeyBinding []interface{} `json:"sslvserver_sslcertkey_binding,omitempty"` + SSLVServerSSLCertKeyBundleBinding []interface{} `json:"sslvserver_sslcertkeybundle_binding,omitempty"` + SSLVServerSSLCipherBinding []interface{} `json:"sslvserver_sslcipher_binding,omitempty"` + SSLVServerSSLCipherSuiteBinding []interface{} `json:"sslvserver_sslciphersuite_binding,omitempty"` + SSLVServerSSLPolicyBinding []interface{} `json:"sslvserver_sslpolicy_binding,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Sslecdsakey struct { - Aes256 bool `json:"aes256,omitempty"` +type SSLECDSAKey struct { + AES256 bool `json:"aes256,omitempty"` Curve string `json:"curve,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` + DES bool `json:"des,omitempty"` + DES3 bool `json:"des3,omitempty"` + KeyFile string `json:"keyfile,omitempty"` + KeyForm string `json:"keyform,omitempty"` Password string `json:"password,omitempty"` - Pkcs8 bool `json:"pkcs8,omitempty"` + PKCS8 bool `json:"pkcs8,omitempty"` } -type SslservicegroupSslcacertbundleBinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type SSLServiceGroupSSLCACertBundleBinding struct { + CACertBundleName string `json:"cacertbundlename,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type Sslhsmkey struct { +type SSLHSMKey struct { Count float64 `json:"__count,omitempty"` - Hsmkeyname string `json:"hsmkeyname,omitempty"` - Hsmtype string `json:"hsmtype,omitempty"` + HSMKeyName string `json:"hsmkeyname,omitempty"` + HSMType string `json:"hsmtype,omitempty"` Key string `json:"key,omitempty"` - Keystore string `json:"keystore,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + KeyStore string `json:"keystore,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` - Serialnum string `json:"serialnum,omitempty"` + SerialNum string `json:"serialnum,omitempty"` State string `json:"state,omitempty"` } -type SslcacertgroupBinding struct { - Cacertgroupname string `json:"cacertgroupname,omitempty"` - SslcacertgroupSslcertkeyBinding []interface{} `json:"sslcacertgroup_sslcertkey_binding,omitempty"` +type SSLCACertGroupBinding struct { + CACertGroupName string `json:"cacertgroupname,omitempty"` + SSLCACertGroupSSLCertKeyBinding []interface{} `json:"sslcacertgroup_sslcertkey_binding,omitempty"` } -type Sslciphersuite struct { - Ciphername string `json:"ciphername,omitempty"` +type SSLCipherSuite struct { + CipherName string `json:"ciphername,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SslcrlBinding struct { - Crlname string `json:"crlname,omitempty"` - SslcrlSerialnumberBinding []interface{} `json:"sslcrl_serialnumber_binding,omitempty"` +type SSLCRLBinding struct { + CRLName string `json:"crlname,omitempty"` + SSLCRLSerialNumberBinding []interface{} `json:"sslcrl_serialnumber_binding,omitempty"` } -type SslpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - SslpolicylabelSslpolicyBinding []interface{} `json:"sslpolicylabel_sslpolicy_binding,omitempty"` +type SSLPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + SSLPolicyLabelSSLPolicyBinding []interface{} `json:"sslpolicylabel_sslpolicy_binding,omitempty"` } -type SslservicegroupBinding struct { - Servicegroupname string `json:"servicegroupname,omitempty"` - SslservicegroupEcccurveBinding []interface{} `json:"sslservicegroup_ecccurve_binding,omitempty"` - SslservicegroupSslcacertbundleBinding []interface{} `json:"sslservicegroup_sslcacertbundle_binding,omitempty"` - SslservicegroupSslcertkeyBinding []interface{} `json:"sslservicegroup_sslcertkey_binding,omitempty"` - SslservicegroupSslcipherBinding []interface{} `json:"sslservicegroup_sslcipher_binding,omitempty"` - SslservicegroupSslciphersuiteBinding []interface{} `json:"sslservicegroup_sslciphersuite_binding,omitempty"` +type SSLServiceGroupBinding struct { + ServiceGroupName string `json:"servicegroupname,omitempty"` + SSLServiceGroupECCCurveBinding []interface{} `json:"sslservicegroup_ecccurve_binding,omitempty"` + SSLServiceGroupSSLCACertBundleBinding []interface{} `json:"sslservicegroup_sslcacertbundle_binding,omitempty"` + SSLServiceGroupSSLCertKeyBinding []interface{} `json:"sslservicegroup_sslcertkey_binding,omitempty"` + SSLServiceGroupSSLCipherBinding []interface{} `json:"sslservicegroup_sslcipher_binding,omitempty"` + SSLServiceGroupSSLCipherSuiteBinding []interface{} `json:"sslservicegroup_sslciphersuite_binding,omitempty"` } -type Sslwrapkey struct { +type SSLWrapKey struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Salt string `json:"salt,omitempty"` - Wrapkeyname string `json:"wrapkeyname,omitempty"` + WrapKeyName string `json:"wrapkeyname,omitempty"` } -type Sslocspresponder struct { - Batchingdelay int `json:"batchingdelay,omitempty"` - Batchingdepth int `json:"batchingdepth,omitempty"` +type SSLOCSPResponder struct { + BatchingDelay int `json:"batchingdelay,omitempty"` + BatchingDepth int `json:"batchingdepth,omitempty"` Cache string `json:"cache,omitempty"` - Cachetimeout int `json:"cachetimeout,omitempty"` + CacheTimeout int `json:"cachetimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Httpmethod string `json:"httpmethod,omitempty"` - Insertclientcert string `json:"insertclientcert,omitempty"` + HTTPMethod string `json:"httpmethod,omitempty"` + InsertClientCert string `json:"insertclientcert,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ocspaiarefcount int `json:"ocspaiarefcount,omitempty"` - Ocspipaddrstr string `json:"ocspipaddrstr,omitempty"` - Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OCSPAIARefCount int `json:"ocspaiarefcount,omitempty"` + OCSPIPAddrStr string `json:"ocspipaddrstr,omitempty"` + OCSPURLResolveTimeout int `json:"ocspurlresolvetimeout,omitempty"` Port int `json:"port,omitempty"` - Producedattimeskew int `json:"producedattimeskew,omitempty"` - Respondercert string `json:"respondercert,omitempty"` - Resptimeout int `json:"resptimeout,omitempty"` - Signingcert string `json:"signingcert,omitempty"` - Trustresponder bool `json:"trustresponder,omitempty"` - Url string `json:"url,omitempty"` - Usenonce string `json:"usenonce,omitempty"` + ProducedAtTimeSkew int `json:"producedattimeskew,omitempty"` + ResponderCert string `json:"respondercert,omitempty"` + RespTimeout int `json:"resptimeout,omitempty"` + SigningCert string `json:"signingcert,omitempty"` + TrustResponder bool `json:"trustresponder,omitempty"` + URL string `json:"url,omitempty"` + UseNonce string `json:"usenonce,omitempty"` } -type Sslcrl struct { - Basedn string `json:"basedn,omitempty"` +type SSLCRL struct { + BaseDN string `json:"basedn,omitempty"` Binary string `json:"binary,omitempty"` - Binddn string `json:"binddn,omitempty"` - Cacert string `json:"cacert,omitempty"` - Cacertfile string `json:"cacertfile,omitempty"` - Cakeyfile string `json:"cakeyfile,omitempty"` + BindDN string `json:"binddn,omitempty"` + CACert string `json:"cacert,omitempty"` + CACertFile string `json:"cacertfile,omitempty"` + CAKeyFile string `json:"cakeyfile,omitempty"` Count float64 `json:"__count,omitempty"` - Crlname string `json:"crlname,omitempty"` - Crlpath string `json:"crlpath,omitempty"` + CRLName string `json:"crlname,omitempty"` + CRLPath string `json:"crlpath,omitempty"` Day int `json:"day,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` Flags int `json:"flags,omitempty"` - Gencrl string `json:"gencrl,omitempty"` - Indexfile string `json:"indexfile,omitempty"` + GenCRL string `json:"gencrl,omitempty"` + IndexFile string `json:"indexfile,omitempty"` Inform string `json:"inform,omitempty"` Interval string `json:"interval,omitempty"` Issuer string `json:"issuer,omitempty"` - Lastupdate string `json:"lastupdate,omitempty"` - Lastupdatetime int `json:"lastupdatetime,omitempty"` + LastUpdate string `json:"lastupdate,omitempty"` + LastUpdateTime int `json:"lastupdatetime,omitempty"` Method string `json:"method,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nextupdate string `json:"nextupdate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextUpdate string `json:"nextupdate,omitempty"` Password string `json:"password,omitempty"` Port int `json:"port,omitempty"` Refresh string `json:"refresh,omitempty"` Revoke string `json:"revoke,omitempty"` Scope string `json:"scope,omitempty"` Server string `json:"server,omitempty"` - Signaturealgo string `json:"signaturealgo,omitempty"` + SignatureAlgo string `json:"signaturealgo,omitempty"` Time string `json:"time,omitempty"` - Url string `json:"url,omitempty"` + URL string `json:"url,omitempty"` Version int `json:"version,omitempty"` } -type SslcertkeybundleBinding struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - SslcertkeybundleIntermediatecertlinksBinding []interface{} `json:"sslcertkeybundle_intermediatecertlinks_binding,omitempty"` - SslcertkeybundleSslvserverBinding []interface{} `json:"sslcertkeybundle_sslvserver_binding,omitempty"` +type SSLCertKeyBundleBinding struct { + CertKeyBundleName string `json:"certkeybundlename,omitempty"` + SSLCertKeyBundleIntermediateCertLinksBinding []interface{} `json:"sslcertkeybundle_intermediatecertlinks_binding,omitempty"` + SSLCertKeyBundleSSLVServerBinding []interface{} `json:"sslcertkeybundle_sslvserver_binding,omitempty"` } -type SslprofileSslcipherBinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` +type SSLProfileSSLCipherBinding struct { + CipherAliasName string `json:"cipheraliasname,omitempty"` + CipherName string `json:"ciphername,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` } -type SslpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SSLPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Sslpkcs8 struct { - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` +type SSLPKCS8 struct { + KeyFile string `json:"keyfile,omitempty"` + KeyForm string `json:"keyform,omitempty"` Password string `json:"password,omitempty"` - Pkcs8file string `json:"pkcs8file,omitempty"` + PKCS8File string `json:"pkcs8file,omitempty"` } -type SslvserverSslcacertbundleBinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SSLVServerSSLCACertBundleBinding struct { + CACertBundleName string `json:"cacertbundlename,omitempty"` + SkipCACertBundle bool `json:"skipcacertbundle,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type SslprofileBinding struct { +type SSLProfileBinding struct { Name string `json:"name,omitempty"` - SslprofileEcccurveBinding []interface{} `json:"sslprofile_ecccurve_binding,omitempty"` - SslprofileSslcertkeyBinding []interface{} `json:"sslprofile_sslcertkey_binding,omitempty"` - SslprofileSslcipherBinding []interface{} `json:"sslprofile_sslcipher_binding,omitempty"` - SslprofileSslciphersuiteBinding []interface{} `json:"sslprofile_sslciphersuite_binding,omitempty"` - SslprofileSslechconfigBinding []interface{} `json:"sslprofile_sslechconfig_binding,omitempty"` - SslprofileSslvserverBinding []interface{} `json:"sslprofile_sslvserver_binding,omitempty"` + SSLProfileECCCurveBinding []interface{} `json:"sslprofile_ecccurve_binding,omitempty"` + SSLProfileSSLCertKeyBinding []interface{} `json:"sslprofile_sslcertkey_binding,omitempty"` + SSLProfileSSLCipherBinding []interface{} `json:"sslprofile_sslcipher_binding,omitempty"` + SSLProfileSSLCipherSuiteBinding []interface{} `json:"sslprofile_sslciphersuite_binding,omitempty"` + SSLProfileSSLECHConfigBinding []interface{} `json:"sslprofile_sslechconfig_binding,omitempty"` + SSLProfileSSLVServerBinding []interface{} `json:"sslprofile_sslvserver_binding,omitempty"` } -type SslcertkeyServiceBinding struct { - Ca bool `json:"ca,omitempty"` - Certkey string `json:"certkey,omitempty"` +type SSLCertKeyServiceBinding struct { + CA bool `json:"ca,omitempty"` + CertKey string `json:"certkey,omitempty"` Data int `json:"data,omitempty"` Service bool `json:"service,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` Version int `json:"version,omitempty"` } -type SslvserverEcccurveBinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SSLVServerECCCurveBinding struct { + ECCCurveName string `json:"ecccurvename,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Sslcacertgroup struct { - Cacertgroupname string `json:"cacertgroupname,omitempty"` - Cacertgroupreferences int `json:"cacertgroupreferences,omitempty"` +type SSLCACertGroup struct { + CACertGroupName string `json:"cacertgroupname,omitempty"` + CACertGroupReferences int `json:"cacertgroupreferences,omitempty"` Count float64 `json:"__count,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` } -type SslserviceSslcipherBinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Cipherdefaulton int `json:"cipherdefaulton,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type SSLServiceSSLCipherBinding struct { + CipherAliasName string `json:"cipheraliasname,omitempty"` + CipherDefaultOn int `json:"cipherdefaulton,omitempty"` + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` } -type SslvserverSslcipherBinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type SSLVServerSSLCipherBinding struct { + CipherAliasName string `json:"cipheraliasname,omitempty"` + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Ssldefaultprofile struct { +type SSLDefaultProfile struct { } -type SslcertkeyCrldistributionBinding struct { - Ca bool `json:"ca,omitempty"` - Certkey string `json:"certkey,omitempty"` +type SSLCertKeyCRLDistributionBinding struct { + CA bool `json:"ca,omitempty"` + CertKey string `json:"certkey,omitempty"` Issuer string `json:"issuer,omitempty"` } -type Sslcacertbundle struct { - Bundlefile string `json:"bundlefile,omitempty"` - Cacertbundlename string `json:"cacertbundlename,omitempty"` +type SSLCACertBundle struct { + BundleFile string `json:"bundlefile,omitempty"` + CACertBundleName string `json:"cacertbundlename,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Servername string `json:"servername,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServerName string `json:"servername,omitempty"` } -type Ssldtlsprofile struct { +type SSLDTLSProfile struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` - Helloverifyrequest string `json:"helloverifyrequest,omitempty"` - Initialretrytimeout int `json:"initialretrytimeout,omitempty"` - Maxbadmacignorecount int `json:"maxbadmacignorecount,omitempty"` - Maxholdqlen int `json:"maxholdqlen,omitempty"` - Maxpacketsize int `json:"maxpacketsize,omitempty"` - Maxrecordsize int `json:"maxrecordsize,omitempty"` - Maxretrytime int `json:"maxretrytime,omitempty"` + HelloVerifyRequest string `json:"helloverifyrequest,omitempty"` + InitialRetryTimeout int `json:"initialretrytimeout,omitempty"` + MaxBadMACIgnoreCount int `json:"maxbadmacignorecount,omitempty"` + MaxHoldQLen int `json:"maxholdqlen,omitempty"` + MaxPacketSize int `json:"maxpacketsize,omitempty"` + MaxRecordSize int `json:"maxrecordsize,omitempty"` + MaxRetryTime int `json:"maxretrytime,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pmtudiscovery string `json:"pmtudiscovery,omitempty"` - Terminatesession string `json:"terminatesession,omitempty"` -} - -type Sslcert struct { - Cacert string `json:"cacert,omitempty"` - Cacertform string `json:"cacertform,omitempty"` - Cakey string `json:"cakey,omitempty"` - Cakeyform string `json:"cakeyform,omitempty"` - Caserial string `json:"caserial,omitempty"` - Certfile string `json:"certfile,omitempty"` - Certform string `json:"certform,omitempty"` - Certtype string `json:"certtype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PMTUDiscovery string `json:"pmtudiscovery,omitempty"` + TerminateSession string `json:"terminatesession,omitempty"` +} + +type SSLCert struct { + CACert string `json:"cacert,omitempty"` + CACertForm string `json:"cacertform,omitempty"` + CAKey string `json:"cakey,omitempty"` + CAKeyForm string `json:"cakeyform,omitempty"` + CASerial string `json:"caserial,omitempty"` + CertFile string `json:"certfile,omitempty"` + CertForm string `json:"certform,omitempty"` + CertType string `json:"certtype,omitempty"` Days int `json:"days,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` - Reqfile string `json:"reqfile,omitempty"` - Subjectaltname string `json:"subjectaltname,omitempty"` -} - -type SslpolicySslglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` + KeyFile string `json:"keyfile,omitempty"` + KeyForm string `json:"keyform,omitempty"` + PEMPassphrase string `json:"pempassphrase,omitempty"` + ReqFile string `json:"reqfile,omitempty"` + SubjectAltName string `json:"subjectaltname,omitempty"` +} + +type SSLPolicySSLGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Sslrsakey struct { - Aes256 bool `json:"aes256,omitempty"` +type SSLRSAKey struct { + AES256 bool `json:"aes256,omitempty"` Bits int `json:"bits,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` + DES bool `json:"des,omitempty"` + DES3 bool `json:"des3,omitempty"` Exponent string `json:"exponent,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` + KeyFile string `json:"keyfile,omitempty"` + KeyForm string `json:"keyform,omitempty"` Password string `json:"password,omitempty"` - Pkcs8 bool `json:"pkcs8,omitempty"` + PKCS8 bool `json:"pkcs8,omitempty"` } -type SslserviceEcccurveBinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Servicename string `json:"servicename,omitempty"` +type SSLServiceECCCurveBinding struct { + ECCCurveName string `json:"ecccurvename,omitempty"` + ServiceName string `json:"servicename,omitempty"` } -type SslserviceSslcertkeyBinding struct { - Ca bool `json:"ca,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Servicename string `json:"servicename,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Snicert bool `json:"snicert,omitempty"` +type SSLServiceSSLCertKeyBinding struct { + CA bool `json:"ca,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SkipCAName bool `json:"skipcaname,omitempty"` + SNICert bool `json:"snicert,omitempty"` } -type Sslservicegroup struct { - Ca bool `json:"ca,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Commonname string `json:"commonname,omitempty"` +type SSLServiceGroup struct { + CA bool `json:"ca,omitempty"` + CipherRedirect string `json:"cipherredirect,omitempty"` + CipherURL string `json:"cipherurl,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + ClientAuth string `json:"clientauth,omitempty"` + ClientCert string `json:"clientcert,omitempty"` + CommonName string `json:"commonname,omitempty"` Count float64 `json:"__count,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Dh string `json:"dh,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Quicflag bool `json:"quicflag,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Serverauth string `json:"serverauth,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Servicename string `json:"servicename,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` -} - -type SslprofileSslvserverBinding struct { - Cipherpriority int `json:"cipherpriority,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + DH string `json:"dh,omitempty"` + DHCount int `json:"dhcount,omitempty"` + DHFile string `json:"dhfile,omitempty"` + DHKeyExpSizeLimit string `json:"dhkeyexpsizelimit,omitempty"` + ERSA string `json:"ersa,omitempty"` + ERSACount int `json:"ersacount,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NonFIPSCiphers string `json:"nonfipsciphers,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + OCSPStapling string `json:"ocspstapling,omitempty"` + QUICFlag bool `json:"quicflag,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + SendCloseNotify string `json:"sendclosenotify,omitempty"` + ServerAuth string `json:"serverauth,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SessReuse string `json:"sessreuse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SNICert bool `json:"snicert,omitempty"` + SNIEnable string `json:"snienable,omitempty"` + SSL2 string `json:"ssl2,omitempty"` + SSL3 string `json:"ssl3,omitempty"` + SSLClientLogs string `json:"sslclientlogs,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` + SSLRedirect string `json:"sslredirect,omitempty"` + SSLv2Redirect string `json:"sslv2redirect,omitempty"` + SSLv2URL string `json:"sslv2url,omitempty"` + StrictSigDigestCheck string `json:"strictsigdigestcheck,omitempty"` + TLS1 string `json:"tls1,omitempty"` + TLS11 string `json:"tls11,omitempty"` + TLS12 string `json:"tls12,omitempty"` + TLS13 string `json:"tls13,omitempty"` +} + +type SSLProfileSSLVServerBinding struct { + CipherPriority int `json:"cipherpriority,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` } -type Sslcertlink struct { - Certkeyname string `json:"certkeyname,omitempty"` +type SSLCertLink struct { + CertKeyName string `json:"certkeyname,omitempty"` Count float64 `json:"__count,omitempty"` - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + LinkCertKeyName string `json:"linkcertkeyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SslglobalSslpolicyBinding struct { - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type SSLGlobalSSLPolicyBinding struct { + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type Sslcrlfile struct { +type SSLCRLFile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` } -type SslcertchainSslcertkeyBinding struct { - Addsubject bool `json:"addsubject,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Isca bool `json:"isca,omitempty"` - Islinked bool `json:"islinked,omitempty"` - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` -} - -type Sslparameter struct { - Crlmemorysizemb int `json:"crlmemorysizemb,omitempty"` - Cryptodevdisablelimit int `json:"cryptodevdisablelimit,omitempty"` - Defaultprofile string `json:"defaultprofile,omitempty"` - Denysslreneg string `json:"denysslreneg,omitempty"` - Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` - Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` - Heterogeneoussslhw string `json:"heterogeneoussslhw,omitempty"` - Hybridfipsmode string `json:"hybridfipsmode,omitempty"` - Insertcertspace string `json:"insertcertspace,omitempty"` - Insertionencoding string `json:"insertionencoding,omitempty"` - Montls1112disable string `json:"montls1112disable,omitempty"` - Ndcppcompliancecertcheck string `json:"ndcppcompliancecertcheck,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ocspcachesize int `json:"ocspcachesize,omitempty"` - Operationqueuelimit int `json:"operationqueuelimit,omitempty"` - Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` - Pushflag int `json:"pushflag,omitempty"` - Quantumsize string `json:"quantumsize,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Sigdigesttype []string `json:"sigdigesttype,omitempty"` - Snihttphostmatch string `json:"snihttphostmatch,omitempty"` - Softwarecryptothreshold int `json:"softwarecryptothreshold,omitempty"` - Sslierrorcache string `json:"sslierrorcache,omitempty"` - Sslimaxerrorcachemem int `json:"sslimaxerrorcachemem,omitempty"` - Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` - Strictcachecks string `json:"strictcachecks,omitempty"` - Svctls1112disable string `json:"svctls1112disable,omitempty"` - Undefactioncontrol string `json:"undefactioncontrol,omitempty"` - Undefactiondata string `json:"undefactiondata,omitempty"` -} - -type Ssldhparam struct { +type SSLCertChainSSLCertKeyBinding struct { + AddSubject bool `json:"addsubject,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + IsCA bool `json:"isca,omitempty"` + IsLinked bool `json:"islinked,omitempty"` + LinkCertKeyName string `json:"linkcertkeyname,omitempty"` +} + +type SSLParameter struct { + CRLMemorySizeMB int `json:"crlmemorysizemb,omitempty"` + CryptoDevDisableLimit int `json:"cryptodevdisablelimit,omitempty"` + DefaultProfile string `json:"defaultprofile,omitempty"` + DenySSLReneg string `json:"denysslreneg,omitempty"` + DropReqWithNoHostHeader string `json:"dropreqwithnohostheader,omitempty"` + EncryptTriggerPktCount int `json:"encrypttriggerpktcount,omitempty"` + HeterogeneousSSLHW string `json:"heterogeneoussslhw,omitempty"` + HybridFIPSMode string `json:"hybridfipsmode,omitempty"` + InsertCertSpace string `json:"insertcertspace,omitempty"` + InsertionEncoding string `json:"insertionencoding,omitempty"` + MonTLS1112Disable string `json:"montls1112disable,omitempty"` + NDCPPComplianceCertCheck string `json:"ndcppcompliancecertcheck,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OCSPCachesize int `json:"ocspcachesize,omitempty"` + OperationQueueLimit int `json:"operationqueuelimit,omitempty"` + PushEncTriggerTimeout int `json:"pushenctriggertimeout,omitempty"` + PushFlag int `json:"pushflag,omitempty"` + QuantumSize string `json:"quantumsize,omitempty"` + SendCloseNotify string `json:"sendclosenotify,omitempty"` + SigDigestType []string `json:"sigdigesttype,omitempty"` + SNIHTTPHostMatch string `json:"snihttphostmatch,omitempty"` + SoftwareCryptoThreshold int `json:"softwarecryptothreshold,omitempty"` + SSLIErrorCache string `json:"sslierrorcache,omitempty"` + SSLIMaxErrorCacheMem int `json:"sslimaxerrorcachemem,omitempty"` + SSLTriggerTimeout int `json:"ssltriggertimeout,omitempty"` + StrictCAChecks string `json:"strictcachecks,omitempty"` + SvcTLS1112Disable string `json:"svctls1112disable,omitempty"` + UndefActionControl string `json:"undefactioncontrol,omitempty"` + UndefActionData string `json:"undefactiondata,omitempty"` +} + +type SSLDHParam struct { Bits int `json:"bits,omitempty"` - Dhfile string `json:"dhfile,omitempty"` + DHFile string `json:"dhfile,omitempty"` Gen string `json:"gen,omitempty"` } -type Sslpolicy struct { +type SSLPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` @@ -572,703 +572,703 @@ type Sslpolicy struct { Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Reqaction string `json:"reqaction,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReqAction string `json:"reqaction,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Sslcertbundle struct { +type SSLCertBundle struct { Count float64 `json:"__count,omitempty"` - Inuse string `json:"inuse,omitempty"` + InUse string `json:"inuse,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` } -type SslcertkeySslvserverBinding struct { - Ca bool `json:"ca,omitempty"` - Certkey string `json:"certkey,omitempty"` +type SSLCertKeySSLVServerBinding struct { + CA bool `json:"ca,omitempty"` + CertKey string `json:"certkey,omitempty"` Data int `json:"data,omitempty"` - Servername string `json:"servername,omitempty"` + ServerName string `json:"servername,omitempty"` Version int `json:"version,omitempty"` - Vserver bool `json:"vserver,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServer bool `json:"vserver,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type SslcertkeybundleSslvserverBinding struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - Servername string `json:"servername,omitempty"` +type SSLCertKeyBundleSSLVServerBinding struct { + CertKeyBundleName string `json:"certkeybundlename,omitempty"` + ServerName string `json:"servername,omitempty"` } -type SslservicegroupEcccurveBinding struct { - Ecccurvename string `json:"ecccurvename,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` +type SSLServiceGroupECCCurveBinding struct { + ECCCurveName string `json:"ecccurvename,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type SslprofileSslcertkeyBinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Forgingcacertkey bool `json:"forgingcacertkey,omitempty"` +type SSLProfileSSLCertKeyBinding struct { + CertKeyName string `json:"certkeyname,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + ForgingCACertKey bool `json:"forgingcacertkey,omitempty"` Name string `json:"name,omitempty"` - Sslicacertkey string `json:"sslicacertkey,omitempty"` + SSLICACertKey string `json:"sslicacertkey,omitempty"` } -type Sslcertfile struct { +type SSLCertFile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` } -type SslcacertgroupSslcertkeyBinding struct { - Cacertgroupname string `json:"cacertgroupname,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` +type SSLCACertGroupSSLCertKeyBinding struct { + CACertGroupName string `json:"cacertgroupname,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` } -type SslservicegroupSslcipherBinding struct { - Cipheraliasname string `json:"cipheraliasname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type SSLServiceGroupSSLCipherBinding struct { + CipherAliasName string `json:"cipheraliasname,omitempty"` + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type Sslcertkey struct { +type SSLCertKey struct { Builtin []string `json:"builtin,omitempty"` Bundle string `json:"bundle,omitempty"` Cert string `json:"cert,omitempty"` - Certificatesource string `json:"certificatesource,omitempty"` - Certificatetype []string `json:"certificatetype,omitempty"` - Certkey string `json:"certkey,omitempty"` - Certkeydigest string `json:"certkeydigest,omitempty"` - Certkeystatus string `json:"certkeystatus,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` + CertificateSource string `json:"certificatesource,omitempty"` + CertificateType []string `json:"certificatetype,omitempty"` + CertKey string `json:"certkey,omitempty"` + CertKeyDigest string `json:"certkeydigest,omitempty"` + CertKeyStatus string `json:"certkeystatus,omitempty"` + ClientCertNotAfter string `json:"clientcertnotafter,omitempty"` + ClientCertNotBefore string `json:"clientcertnotbefore,omitempty"` Count float64 `json:"__count,omitempty"` Data int `json:"data,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` - Deletecertkeyfilesonremoval string `json:"deletecertkeyfilesonremoval,omitempty"` - Deletefromdevice bool `json:"deletefromdevice,omitempty"` - Expirymonitor string `json:"expirymonitor,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` + DeleteCertKeyFilesOnRemoval string `json:"deletecertkeyfilesonremoval,omitempty"` + DeleteFromDevice bool `json:"deletefromdevice,omitempty"` + ExpiryMonitor string `json:"expirymonitor,omitempty"` Feature string `json:"feature,omitempty"` - Fipskey string `json:"fipskey,omitempty"` - Hsmkey string `json:"hsmkey,omitempty"` + FIPSKey string `json:"fipskey,omitempty"` + HSMKey string `json:"hsmkey,omitempty"` Inform string `json:"inform,omitempty"` Issuer string `json:"issuer,omitempty"` Key string `json:"key,omitempty"` - Linkcertkeyname string `json:"linkcertkeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodomaincheck bool `json:"nodomaincheck,omitempty"` - Notificationperiod int `json:"notificationperiod,omitempty"` - Ocspresponsestatus string `json:"ocspresponsestatus,omitempty"` - Ocspstaplingcache bool `json:"ocspstaplingcache,omitempty"` - Passcrypt string `json:"passcrypt,omitempty"` - Passplain string `json:"passplain,omitempty"` + LinkCertKeyName string `json:"linkcertkeyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDomainCheck bool `json:"nodomaincheck,omitempty"` + NotificationPeriod int `json:"notificationperiod,omitempty"` + OCSPResponseStatus string `json:"ocspresponsestatus,omitempty"` + OCSPStaplingCache bool `json:"ocspstaplingcache,omitempty"` + PassCrypt string `json:"passcrypt,omitempty"` + PassPlain string `json:"passplain,omitempty"` Password bool `json:"password,omitempty"` Priority int `json:"priority,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize int `json:"publickeysize,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` + PublicKey string `json:"publickey,omitempty"` + PublicKeySize int `json:"publickeysize,omitempty"` + SANDNS string `json:"sandns,omitempty"` + SANIPAdd string `json:"sanipadd,omitempty"` Serial string `json:"serial,omitempty"` - Servicename string `json:"servicename,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` Status string `json:"status,omitempty"` Subject string `json:"subject,omitempty"` Version int `json:"version,omitempty"` } -type SslprofileSslechconfigBinding struct { - Cipherpriority int `json:"cipherpriority,omitempty"` - Echconfigname string `json:"echconfigname,omitempty"` +type SSLProfileSSLECHConfigBinding struct { + CipherPriority int `json:"cipherpriority,omitempty"` + ECHConfigName string `json:"echconfigname,omitempty"` Name string `json:"name,omitempty"` } -type SslserviceSslciphersuiteBinding struct { - Cipherdefaulton int `json:"cipherdefaulton,omitempty"` - Ciphername string `json:"ciphername,omitempty"` +type SSLServiceSSLCipherSuiteBinding struct { + CipherDefaultOn int `json:"cipherdefaulton,omitempty"` + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Servicename string `json:"servicename,omitempty"` + ServiceName string `json:"servicename,omitempty"` } -type Sslcertkeybundle struct { - Bundlefile string `json:"bundlefile,omitempty"` - Certkeybundlename string `json:"certkeybundlename,omitempty"` +type SSLCertKeyBundle struct { + BundleFile string `json:"bundlefile,omitempty"` + CertKeyBundleName string `json:"certkeybundlename,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passplain string `json:"passplain,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PassPlain string `json:"passplain,omitempty"` } -type SslcertchainBinding struct { - Certkeyname string `json:"certkeyname,omitempty"` - SslcertchainSslcertkeyBinding []interface{} `json:"sslcertchain_sslcertkey_binding,omitempty"` +type SSLCertChainBinding struct { + CertKeyName string `json:"certkeyname,omitempty"` + SSLCertChainSSLCertKeyBinding []interface{} `json:"sslcertchain_sslcertkey_binding,omitempty"` } -type Sslcertificatechain struct { - Certkeyname string `json:"certkeyname,omitempty"` - Chaincomplete int `json:"chaincomplete,omitempty"` - Chainissuer string `json:"chainissuer,omitempty"` - Chainlinked []string `json:"chainlinked,omitempty"` - Chainpossiblelinks []string `json:"chainpossiblelinks,omitempty"` +type SSLCertificateChain struct { + CertKeyName string `json:"certkeyname,omitempty"` + ChainComplete int `json:"chaincomplete,omitempty"` + ChainIssuer string `json:"chainissuer,omitempty"` + ChainLinked []string `json:"chainlinked,omitempty"` + ChainPossibleLinks []string `json:"chainpossiblelinks,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SslprofileEcccurveBinding struct { - Cipherpriority int `json:"cipherpriority,omitempty"` - Ecccurvename string `json:"ecccurvename,omitempty"` +type SSLProfileECCCurveBinding struct { + CipherPriority int `json:"cipherpriority,omitempty"` + ECCCurveName string `json:"ecccurvename,omitempty"` Name string `json:"name,omitempty"` } -type Sslservice struct { - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Commonname string `json:"commonname,omitempty"` +type SSLService struct { + CipherRedirect string `json:"cipherredirect,omitempty"` + CipherURL string `json:"cipherurl,omitempty"` + ClientAuth string `json:"clientauth,omitempty"` + ClientCert string `json:"clientcert,omitempty"` + CommonName string `json:"commonname,omitempty"` Count float64 `json:"__count,omitempty"` - Dh string `json:"dh,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Dtls1 string `json:"dtls1,omitempty"` - Dtls12 string `json:"dtls12,omitempty"` - Dtlsflag bool `json:"dtlsflag,omitempty"` - Dtlsprofilename string `json:"dtlsprofilename,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Quicflag bool `json:"quicflag,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Serverauth string `json:"serverauth,omitempty"` + DH string `json:"dh,omitempty"` + DHCount int `json:"dhcount,omitempty"` + DHFile string `json:"dhfile,omitempty"` + DHKeyExpSizeLimit string `json:"dhkeyexpsizelimit,omitempty"` + DTLS1 string `json:"dtls1,omitempty"` + DTLS12 string `json:"dtls12,omitempty"` + DTLSFlag bool `json:"dtlsflag,omitempty"` + DTLSProfileName string `json:"dtlsprofilename,omitempty"` + ERSA string `json:"ersa,omitempty"` + ERSACount int `json:"ersacount,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NonFIPSCiphers string `json:"nonfipsciphers,omitempty"` + OCSPStapling string `json:"ocspstapling,omitempty"` + PushEncTrigger string `json:"pushenctrigger,omitempty"` + QUICFlag bool `json:"quicflag,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + SendCloseNotify string `json:"sendclosenotify,omitempty"` + ServerAuth string `json:"serverauth,omitempty"` Service int `json:"service,omitempty"` - Servicename string `json:"servicename,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` -} - -type Sslprofile struct { - Allowextendedmastersecret string `json:"allowextendedmastersecret,omitempty"` - Allowlegacykdf string `json:"allowlegacykdf,omitempty"` - Allowunknownsni string `json:"allowunknownsni,omitempty"` - Alpnprotocol string `json:"alpnprotocol,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SessReuse string `json:"sessreuse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SkipCACertBundle bool `json:"skipcacertbundle,omitempty"` + SkipCAName bool `json:"skipcaname,omitempty"` + SNIEnable string `json:"snienable,omitempty"` + SSL2 string `json:"ssl2,omitempty"` + SSL3 string `json:"ssl3,omitempty"` + SSLClientLogs string `json:"sslclientlogs,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` + SSLRedirect string `json:"sslredirect,omitempty"` + SSLv2Redirect string `json:"sslv2redirect,omitempty"` + SSLv2URL string `json:"sslv2url,omitempty"` + StrictSigDigestCheck string `json:"strictsigdigestcheck,omitempty"` + TLS1 string `json:"tls1,omitempty"` + TLS11 string `json:"tls11,omitempty"` + TLS12 string `json:"tls12,omitempty"` + TLS13 string `json:"tls13,omitempty"` +} + +type SSLProfile struct { + AllowExtendedMasterSecret string `json:"allowextendedmastersecret,omitempty"` + AllowLegacyKDF string `json:"allowlegacykdf,omitempty"` + AllowUnknownSNI string `json:"allowunknownsni,omitempty"` + ALPNProtocol string `json:"alpnprotocol,omitempty"` Builtin []string `json:"builtin,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientauthuseboundcachain string `json:"clientauthuseboundcachain,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Commonname string `json:"commonname,omitempty"` + CipherName string `json:"ciphername,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + CipherRedirect string `json:"cipherredirect,omitempty"` + CipherURL string `json:"cipherurl,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + ClientAuth string `json:"clientauth,omitempty"` + ClientAuthUseBoundCAChain string `json:"clientauthuseboundcachain,omitempty"` + ClientCert string `json:"clientcert,omitempty"` + CommonName string `json:"commonname,omitempty"` Count float64 `json:"__count,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Defaultsni string `json:"defaultsni,omitempty"` - Denysslreneg string `json:"denysslreneg,omitempty"` - Dh string `json:"dh,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Dropreqwithnohostheader string `json:"dropreqwithnohostheader,omitempty"` - Dynamicclientcert string `json:"dynamicclientcert,omitempty"` - Encryptedclienthello string `json:"encryptedclienthello,omitempty"` - Encrypttriggerpktcount int `json:"encrypttriggerpktcount,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + DefaultSNI string `json:"defaultsni,omitempty"` + DenySSLReneg string `json:"denysslreneg,omitempty"` + DH string `json:"dh,omitempty"` + DHCount int `json:"dhcount,omitempty"` + DHEKeyExchangeWithPSK string `json:"dhekeyexchangewithpsk,omitempty"` + DHFile string `json:"dhfile,omitempty"` + DHKeyExpSizeLimit string `json:"dhkeyexpsizelimit,omitempty"` + DropReqWithNoHostHeader string `json:"dropreqwithnohostheader,omitempty"` + DynamicClientCert string `json:"dynamicclientcert,omitempty"` + EncryptedClientHello string `json:"encryptedclienthello,omitempty"` + EncryptTriggerPktCount int `json:"encrypttriggerpktcount,omitempty"` + ERSA string `json:"ersa,omitempty"` + ERSACount int `json:"ersacount,omitempty"` Feature string `json:"feature,omitempty"` - Hsts string `json:"hsts,omitempty"` - Includesubdomains string `json:"includesubdomains,omitempty"` - Insertionencoding string `json:"insertionencoding,omitempty"` + HSTS string `json:"hsts,omitempty"` + IncludeSubdomains string `json:"includesubdomains,omitempty"` + InsertionEncoding string `json:"insertionencoding,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Maxage int `json:"maxage,omitempty"` - Maxrenegrate int `json:"maxrenegrate,omitempty"` + LabelType string `json:"labeltype,omitempty"` + MaxAge int `json:"maxage,omitempty"` + MaxRenegRate int `json:"maxrenegrate,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + NonFIPSCiphers string `json:"nonfipsciphers,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + OCSPStapling string `json:"ocspstapling,omitempty"` Preload string `json:"preload,omitempty"` - Prevsessionkeylifetime int `json:"prevsessionkeylifetime,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Pushenctriggertimeout int `json:"pushenctriggertimeout,omitempty"` - Pushflag int `json:"pushflag,omitempty"` - Quantumsize string `json:"quantumsize,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` - Serverauth string `json:"serverauth,omitempty"` + PrevSessionKeyLifetime int `json:"prevsessionkeylifetime,omitempty"` + PushEncTrigger string `json:"pushenctrigger,omitempty"` + PushEncTriggerTimeout int `json:"pushenctriggertimeout,omitempty"` + PushFlag int `json:"pushflag,omitempty"` + QuantumSize string `json:"quantumsize,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + SendCloseNotify string `json:"sendclosenotify,omitempty"` + ServerAuth string `json:"serverauth,omitempty"` Service int `json:"service,omitempty"` - Sessionkeylifetime int `json:"sessionkeylifetime,omitempty"` - Sessionticket string `json:"sessionticket,omitempty"` - Sessionticketkeydata string `json:"sessionticketkeydata,omitempty"` - Sessionticketkeyrefresh string `json:"sessionticketkeyrefresh,omitempty"` - Sessionticketlifetime int `json:"sessionticketlifetime,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Skipclientcertpolicycheck string `json:"skipclientcertpolicycheck,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Snienable string `json:"snienable,omitempty"` - Snihttphostmatch string `json:"snihttphostmatch,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Sslimaxsessperserver int `json:"sslimaxsessperserver,omitempty"` - Sslinterception string `json:"sslinterception,omitempty"` - Ssliocspcheck string `json:"ssliocspcheck,omitempty"` - Sslireneg string `json:"sslireneg,omitempty"` - Ssliverifyservercertforreuse string `json:"ssliverifyservercertforreuse,omitempty"` - Ssllogprofile string `json:"ssllogprofile,omitempty"` - Sslpfobjecttype int `json:"sslpfobjecttype,omitempty"` - Sslprofiletype string `json:"sslprofiletype,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Ssltriggertimeout int `json:"ssltriggertimeout,omitempty"` - Strictcachecks string `json:"strictcachecks,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` - Zerorttearlydata string `json:"zerorttearlydata,omitempty"` -} - -type Sslzerotouchparam struct { - Admconnectivitystatus string `json:"admconnectivitystatus,omitempty"` - Httpstatuscode string `json:"httpstatuscode,omitempty"` - Keyfilename string `json:"keyfilename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nextrequesttime string `json:"nextrequesttime,omitempty"` - Ocspbatchingdelay int `json:"ocspbatchingdelay,omitempty"` - Ocspbatchingdepth int `json:"ocspbatchingdepth,omitempty"` - Ocspcachetimeout int `json:"ocspcachetimeout,omitempty"` - Ocsphttpmethod string `json:"ocsphttpmethod,omitempty"` - Ocspproducedattimeskew int `json:"ocspproducedattimeskew,omitempty"` - Ocspresptimeout int `json:"ocspresptimeout,omitempty"` - Ocsptrustresponder string `json:"ocsptrustresponder,omitempty"` - Ocspurlresolvetimeout int `json:"ocspurlresolvetimeout,omitempty"` - Ocspusenonce string `json:"ocspusenonce,omitempty"` + SessionKeyLifetime int `json:"sessionkeylifetime,omitempty"` + SessionTicket string `json:"sessionticket,omitempty"` + SessionTicketKeyData string `json:"sessionticketkeydata,omitempty"` + SessionTicketKeyRefresh string `json:"sessionticketkeyrefresh,omitempty"` + SessionTicketLifetime int `json:"sessionticketlifetime,omitempty"` + SessReuse string `json:"sessreuse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SkipCAName bool `json:"skipcaname,omitempty"` + SkipClientCertPolicyCheck string `json:"skipclientcertpolicycheck,omitempty"` + SNICert bool `json:"snicert,omitempty"` + SNIEnable string `json:"snienable,omitempty"` + SNIHTTPHostMatch string `json:"snihttphostmatch,omitempty"` + SSL3 string `json:"ssl3,omitempty"` + SSLClientLogs string `json:"sslclientlogs,omitempty"` + SSLIMaxSessPerServer int `json:"sslimaxsessperserver,omitempty"` + SSLInterception string `json:"sslinterception,omitempty"` + SSLIOCSPCheck string `json:"ssliocspcheck,omitempty"` + SSLIReneg string `json:"sslireneg,omitempty"` + SSLIVerifyServerCertForReuse string `json:"ssliverifyservercertforreuse,omitempty"` + SSLLogProfile string `json:"ssllogprofile,omitempty"` + SSLPFObjectType int `json:"sslpfobjecttype,omitempty"` + SSLProfileType string `json:"sslprofiletype,omitempty"` + SSLRedirect string `json:"sslredirect,omitempty"` + SSLTriggerTimeout int `json:"ssltriggertimeout,omitempty"` + StrictCAChecks string `json:"strictcachecks,omitempty"` + StrictSigDigestCheck string `json:"strictsigdigestcheck,omitempty"` + TLS1 string `json:"tls1,omitempty"` + TLS11 string `json:"tls11,omitempty"` + TLS12 string `json:"tls12,omitempty"` + TLS13 string `json:"tls13,omitempty"` + TLS13SessionTicketsPerAuthContext int `json:"tls13sessionticketsperauthcontext,omitempty"` + ZeroRTTEarlyData string `json:"zerorttearlydata,omitempty"` +} + +type SSLZeroTouchParam struct { + ADMConnectivityStatus string `json:"admconnectivitystatus,omitempty"` + HTTPStatusCode string `json:"httpstatuscode,omitempty"` + KeyFileName string `json:"keyfilename,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextRequestTime string `json:"nextrequesttime,omitempty"` + OCSPBatchingDelay int `json:"ocspbatchingdelay,omitempty"` + OCSPBatchingDepth int `json:"ocspbatchingdepth,omitempty"` + OCSPCacheTimeout int `json:"ocspcachetimeout,omitempty"` + OCSPHTTPMethod string `json:"ocsphttpmethod,omitempty"` + OCSPProducedAtTimeSkew int `json:"ocspproducedattimeskew,omitempty"` + OCSPRespTimeout int `json:"ocspresptimeout,omitempty"` + OCSPTrustResponder string `json:"ocsptrustresponder,omitempty"` + OCSPURLResolveTimeout int `json:"ocspurlresolvetimeout,omitempty"` + OCSPUseNonce string `json:"ocspusenonce,omitempty"` Passphrase string `json:"passphrase,omitempty"` - Remoteserverip string `json:"remoteserverip,omitempty"` - Requesttimestamp string `json:"requesttimestamp,omitempty"` - Requesttype string `json:"requesttype,omitempty"` - Zerotouch string `json:"zerotouch,omitempty"` + RemoteServerIP string `json:"remoteserverip,omitempty"` + RequestTimestamp string `json:"requesttimestamp,omitempty"` + RequestType string `json:"requesttype,omitempty"` + ZeroTouch string `json:"zerotouch,omitempty"` } -type SslpolicyBinding struct { +type SSLPolicyBinding struct { Name string `json:"name,omitempty"` - SslpolicyCsvserverBinding []interface{} `json:"sslpolicy_csvserver_binding,omitempty"` - SslpolicyLbvserverBinding []interface{} `json:"sslpolicy_lbvserver_binding,omitempty"` - SslpolicySslglobalBinding []interface{} `json:"sslpolicy_sslglobal_binding,omitempty"` - SslpolicySslpolicylabelBinding []interface{} `json:"sslpolicy_sslpolicylabel_binding,omitempty"` - SslpolicySslserviceBinding []interface{} `json:"sslpolicy_sslservice_binding,omitempty"` - SslpolicySslvserverBinding []interface{} `json:"sslpolicy_sslvserver_binding,omitempty"` -} - -type Sslpkcs12 struct { - Aes256 bool `json:"aes256,omitempty"` - Certfile string `json:"certfile,omitempty"` - Des bool `json:"des,omitempty"` - Des3 bool `json:"des3,omitempty"` + SSLPolicyCSVServerBinding []interface{} `json:"sslpolicy_csvserver_binding,omitempty"` + SSLPolicyLBVServerBinding []interface{} `json:"sslpolicy_lbvserver_binding,omitempty"` + SSLPolicySSLGlobalBinding []interface{} `json:"sslpolicy_sslglobal_binding,omitempty"` + SSLPolicySSLPolicyLabelBinding []interface{} `json:"sslpolicy_sslpolicylabel_binding,omitempty"` + SSLPolicySSLServiceBinding []interface{} `json:"sslpolicy_sslservice_binding,omitempty"` + SSLPolicySSLVServerBinding []interface{} `json:"sslpolicy_sslvserver_binding,omitempty"` +} + +type SSLPKCS12 struct { + AES256 bool `json:"aes256,omitempty"` + CertFile string `json:"certfile,omitempty"` + DES bool `json:"des,omitempty"` + DES3 bool `json:"des3,omitempty"` Export bool `json:"export,omitempty"` Import bool `json:"Import,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Outfile string `json:"outfile,omitempty"` + KeyFile string `json:"keyfile,omitempty"` + OutFile string `json:"outfile,omitempty"` Password string `json:"password,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` - Pkcs12file string `json:"pkcs12file,omitempty"` + PEMPassphrase string `json:"pempassphrase,omitempty"` + PKCS12File string `json:"pkcs12file,omitempty"` } -type SslpolicySslvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type SSLPolicySSLVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type SslcipherSslciphersuiteBinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` +type SSLCipherSSLCipherSuiteBinding struct { + CipherGroupName string `json:"ciphergroupname,omitempty"` + CipherName string `json:"ciphername,omitempty"` + CipherOperation string `json:"cipheroperation,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + CiphGrpAls string `json:"ciphgrpals,omitempty"` Description string `json:"description,omitempty"` } -type Sslkeyfile struct { +type SSLKeyFile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` Src string `json:"src,omitempty"` } -type SslpolicylabelSslpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type SSLPolicyLabelSSLPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Ssldynamicclientcertcache struct { +type SSLDynamicClientCertCache struct { } -type SslglobalBinding struct { - SslglobalSslpolicyBinding []interface{} `json:"sslglobal_sslpolicy_binding,omitempty"` +type SSLGlobalBinding struct { + SSLGlobalSSLPolicyBinding []interface{} `json:"sslglobal_sslpolicy_binding,omitempty"` } -type SslserviceSslcacertbundleBinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Servicename string `json:"servicename,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` +type SSLServiceSSLCACertBundleBinding struct { + CACertBundleName string `json:"cacertbundlename,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SkipCACertBundle bool `json:"skipcacertbundle,omitempty"` } -type SslcipherIndividualcipherBinding struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipheroperation string `json:"cipheroperation,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Ciphgrpals string `json:"ciphgrpals,omitempty"` +type SSLCipherIndividualCipherBinding struct { + CipherGroupName string `json:"ciphergroupname,omitempty"` + CipherName string `json:"ciphername,omitempty"` + CipherOperation string `json:"cipheroperation,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + CiphGrpAls string `json:"ciphgrpals,omitempty"` Description string `json:"description,omitempty"` } -type SslvserverSslcertkeybundleBinding struct { - Certkeybundlename string `json:"certkeybundlename,omitempty"` - Snicertkeybundle bool `json:"snicertkeybundle,omitempty"` - Vservername string `json:"vservername,omitempty"` +type SSLVServerSSLCertKeyBundleBinding struct { + CertKeyBundleName string `json:"certkeybundlename,omitempty"` + SNICertKeyBundle bool `json:"snicertkeybundle,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type SslcertkeySslocspresponderBinding struct { - Ca bool `json:"ca,omitempty"` - Certkey string `json:"certkey,omitempty"` - Ocspresponder string `json:"ocspresponder,omitempty"` +type SSLCertKeySSLOCSPResponderBinding struct { + CA bool `json:"ca,omitempty"` + CertKey string `json:"certkey,omitempty"` + OCSPResponder string `json:"ocspresponder,omitempty"` Priority int `json:"priority,omitempty"` } -type Ssldhfile struct { +type SSLDHFile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` } -type SslvserverSslciphersuiteBinding struct { - Ciphername string `json:"ciphername,omitempty"` +type SSLVServerSSLCipherSuiteBinding struct { + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type SslvserverHashicorpBinding struct { +type SSLVServerHashicorpBinding struct { Vault string `json:"vault,omitempty"` - Vservername string `json:"vservername,omitempty"` -} - -type Sslfips struct { - Coresenabled int `json:"coresenabled,omitempty"` - Coresmax int `json:"coresmax,omitempty"` - Erasedata string `json:"erasedata,omitempty"` - Fipsfw string `json:"fipsfw,omitempty"` - Fipshwmajorversion int `json:"fipshwmajorversion,omitempty"` - Fipshwminorversion int `json:"fipshwminorversion,omitempty"` - Fipshwversionstring string `json:"fipshwversionstring,omitempty"` - Firmwarereleasedate string `json:"firmwarereleasedate,omitempty"` + VServerName string `json:"vservername,omitempty"` +} + +type SSLFIPS struct { + CoresEnabled int `json:"coresenabled,omitempty"` + CoresMax int `json:"coresmax,omitempty"` + EraseData string `json:"erasedata,omitempty"` + FIPSFW string `json:"fipsfw,omitempty"` + FIPSHWMajorVersion int `json:"fipshwmajorversion,omitempty"` + FIPSHWMinorVersion int `json:"fipshwminorversion,omitempty"` + FIPSHWVersionString string `json:"fipshwversionstring,omitempty"` + FirmwareReleaseDate string `json:"firmwarereleasedate,omitempty"` Flag int `json:"flag,omitempty"` - Flashmemoryfree int `json:"flashmemoryfree,omitempty"` - Flashmemorytotal int `json:"flashmemorytotal,omitempty"` - Hsmlabel string `json:"hsmlabel,omitempty"` - Inithsm string `json:"inithsm,omitempty"` - Majorversion int `json:"majorversion,omitempty"` - Minorversion int `json:"minorversion,omitempty"` + FlashMemoryFree int `json:"flashmemoryfree,omitempty"` + FlashMemoryTotal int `json:"flashmemorytotal,omitempty"` + HSMLabel string `json:"hsmlabel,omitempty"` + InitHSM string `json:"inithsm,omitempty"` + MajorVersion int `json:"majorversion,omitempty"` + MinorVersion int `json:"minorversion,omitempty"` Model string `json:"model,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Oldsopassword string `json:"oldsopassword,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OldSOPassword string `json:"oldsopassword,omitempty"` Serial int `json:"serial,omitempty"` - Serialno string `json:"serialno,omitempty"` - Sopassword string `json:"sopassword,omitempty"` - Sramfree int `json:"sramfree,omitempty"` - Sramtotal int `json:"sramtotal,omitempty"` + SerialNo string `json:"serialno,omitempty"` + SOPassword string `json:"sopassword,omitempty"` + SRAMFree int `json:"sramfree,omitempty"` + SRAMTotal int `json:"sramtotal,omitempty"` State int `json:"state,omitempty"` Status int `json:"status,omitempty"` - Userpassword string `json:"userpassword,omitempty"` + UserPassword string `json:"userpassword,omitempty"` } -type Sslaction struct { +type SSLAction struct { Builtin []string `json:"builtin,omitempty"` - Cacertgrpname string `json:"cacertgrpname,omitempty"` - Certfingerprintdigest string `json:"certfingerprintdigest,omitempty"` - Certfingerprintheader string `json:"certfingerprintheader,omitempty"` - Certhashheader string `json:"certhashheader,omitempty"` - Certheader string `json:"certheader,omitempty"` - Certissuerheader string `json:"certissuerheader,omitempty"` - Certnotafterheader string `json:"certnotafterheader,omitempty"` - Certnotbeforeheader string `json:"certnotbeforeheader,omitempty"` - Certserialheader string `json:"certserialheader,omitempty"` - Certsubjectheader string `json:"certsubjectheader,omitempty"` + CACertGrpName string `json:"cacertgrpname,omitempty"` + CertFingerprintDigest string `json:"certfingerprintdigest,omitempty"` + CertFingerprintHeader string `json:"certfingerprintheader,omitempty"` + CertHashHeader string `json:"certhashheader,omitempty"` + CertHeader string `json:"certheader,omitempty"` + CertIssuerHeader string `json:"certissuerheader,omitempty"` + CertNotAfterHeader string `json:"certnotafterheader,omitempty"` + CertNotBeforeHeader string `json:"certnotbeforeheader,omitempty"` + CertSerialHeader string `json:"certserialheader,omitempty"` + CertSubjectHeader string `json:"certsubjectheader,omitempty"` Cipher string `json:"cipher,omitempty"` - Cipherheader string `json:"cipherheader,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` - Clientcertfingerprint string `json:"clientcertfingerprint,omitempty"` - Clientcerthash string `json:"clientcerthash,omitempty"` - Clientcertissuer string `json:"clientcertissuer,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Clientcertserialnumber string `json:"clientcertserialnumber,omitempty"` - Clientcertsubject string `json:"clientcertsubject,omitempty"` - Clientcertverification string `json:"clientcertverification,omitempty"` + CipherHeader string `json:"cipherheader,omitempty"` + ClientAuth string `json:"clientauth,omitempty"` + ClientCert string `json:"clientcert,omitempty"` + ClientCertFingerprint string `json:"clientcertfingerprint,omitempty"` + ClientCertHash string `json:"clientcerthash,omitempty"` + ClientCertIssuer string `json:"clientcertissuer,omitempty"` + ClientCertNotAfter string `json:"clientcertnotafter,omitempty"` + ClientCertNotBefore string `json:"clientcertnotbefore,omitempty"` + ClientCertSerialNumber string `json:"clientcertserialnumber,omitempty"` + ClientCertSubject string `json:"clientcertsubject,omitempty"` + ClientCertVerification string `json:"clientcertverification,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` Forward string `json:"forward,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ocspcache string `json:"ocspcache,omitempty"` - Ocspcertvalidation string `json:"ocspcertvalidation,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` - Owasupport string `json:"owasupport,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Sessionid string `json:"sessionid,omitempty"` - Sessionidheader string `json:"sessionidheader,omitempty"` - Ssllogprofile string `json:"ssllogprofile,omitempty"` - Undefhits int `json:"undefhits,omitempty"` -} - -type SslservicegroupSslciphersuiteBinding struct { - Ciphername string `json:"ciphername,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OCSPCache string `json:"ocspcache,omitempty"` + OCSPCertValidation string `json:"ocspcertvalidation,omitempty"` + OCSPStapling string `json:"ocspstapling,omitempty"` + OWASupport string `json:"owasupport,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + SessionID string `json:"sessionid,omitempty"` + SessionIDHeader string `json:"sessionidheader,omitempty"` + SSLLogProfile string `json:"ssllogprofile,omitempty"` + UndefHits int `json:"undefhits,omitempty"` +} + +type SSLServiceGroupSSLCipherSuiteBinding struct { + CipherName string `json:"ciphername,omitempty"` Description string `json:"description,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } -type Ssllogprofile struct { +type SSLLogProfile struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ssllogclauth string `json:"ssllogclauth,omitempty"` - Ssllogclauthfailures string `json:"ssllogclauthfailures,omitempty"` - Sslloghs string `json:"sslloghs,omitempty"` - Sslloghsfailures string `json:"sslloghsfailures,omitempty"` -} - -type Sslfipssimsource struct { - Certfile string `json:"certfile,omitempty"` - Sourcesecret string `json:"sourcesecret,omitempty"` - Targetsecret string `json:"targetsecret,omitempty"` -} - -type SslservicegroupSslcertkeyBinding struct { - Ca bool `json:"ca,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Servicegroupname string `json:"servicegroupname,omitempty"` - Snicert bool `json:"snicert,omitempty"` -} - -type Sslcertreq struct { - Challengepassword string `json:"challengepassword,omitempty"` - Commonname string `json:"commonname,omitempty"` - Companyname string `json:"companyname,omitempty"` - Countryname string `json:"countryname,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Fipskeyname string `json:"fipskeyname,omitempty"` - Keyfile string `json:"keyfile,omitempty"` - Keyform string `json:"keyform,omitempty"` - Localityname string `json:"localityname,omitempty"` - Organizationname string `json:"organizationname,omitempty"` - Organizationunitname string `json:"organizationunitname,omitempty"` - Pempassphrase string `json:"pempassphrase,omitempty"` - Reqfile string `json:"reqfile,omitempty"` - Statename string `json:"statename,omitempty"` - Subjectaltname string `json:"subjectaltname,omitempty"` -} - -type SslcacertbundleBinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - SslcacertbundleIntermediatecacertlistBinding []interface{} `json:"sslcacertbundle_intermediatecacertlist_binding,omitempty"` -} - -type SslserviceBinding struct { - Servicename string `json:"servicename,omitempty"` - SslserviceEcccurveBinding []interface{} `json:"sslservice_ecccurve_binding,omitempty"` - SslserviceSslcacertbundleBinding []interface{} `json:"sslservice_sslcacertbundle_binding,omitempty"` - SslserviceSslcertkeyBinding []interface{} `json:"sslservice_sslcertkey_binding,omitempty"` - SslserviceSslcipherBinding []interface{} `json:"sslservice_sslcipher_binding,omitempty"` - SslserviceSslciphersuiteBinding []interface{} `json:"sslservice_sslciphersuite_binding,omitempty"` - SslserviceSslpolicyBinding []interface{} `json:"sslservice_sslpolicy_binding,omitempty"` -} - -type Sslcipher struct { - Ciphergroupname string `json:"ciphergroupname,omitempty"` - Ciphername string `json:"ciphername,omitempty"` - Cipherpriority int `json:"cipherpriority,omitempty"` - Ciphgrpalias string `json:"ciphgrpalias,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SSLLogClAuth string `json:"ssllogclauth,omitempty"` + SSLLogClAuthFailures string `json:"ssllogclauthfailures,omitempty"` + SSLLogHS string `json:"sslloghs,omitempty"` + SSLLogHSFailures string `json:"sslloghsfailures,omitempty"` +} + +type SSLFIPSSimSource struct { + CertFile string `json:"certfile,omitempty"` + SourceSecret string `json:"sourcesecret,omitempty"` + TargetSecret string `json:"targetsecret,omitempty"` +} + +type SSLServiceGroupSSLCertKeyBinding struct { + CA bool `json:"ca,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + SNICert bool `json:"snicert,omitempty"` +} + +type SSLCertReq struct { + ChallengePassword string `json:"challengepassword,omitempty"` + CommonName string `json:"commonname,omitempty"` + CompanyName string `json:"companyname,omitempty"` + CountryName string `json:"countryname,omitempty"` + DigestMethod string `json:"digestmethod,omitempty"` + EmailAddress string `json:"emailaddress,omitempty"` + FIPSKeyName string `json:"fipskeyname,omitempty"` + KeyFile string `json:"keyfile,omitempty"` + KeyForm string `json:"keyform,omitempty"` + LocalityName string `json:"localityname,omitempty"` + OrganizationName string `json:"organizationname,omitempty"` + OrganizationUnitName string `json:"organizationunitname,omitempty"` + PEMPassphrase string `json:"pempassphrase,omitempty"` + ReqFile string `json:"reqfile,omitempty"` + StateName string `json:"statename,omitempty"` + SubjectAltName string `json:"subjectaltname,omitempty"` +} + +type SSLCACertBundleBinding struct { + CACertBundleName string `json:"cacertbundlename,omitempty"` + SSLCACertBundleIntermediateCACertListBinding []interface{} `json:"sslcacertbundle_intermediatecacertlist_binding,omitempty"` +} + +type SSLServiceBinding struct { + ServiceName string `json:"servicename,omitempty"` + SSLServiceECCCurveBinding []interface{} `json:"sslservice_ecccurve_binding,omitempty"` + SSLServiceSSLCACertBundleBinding []interface{} `json:"sslservice_sslcacertbundle_binding,omitempty"` + SSLServiceSSLCertKeyBinding []interface{} `json:"sslservice_sslcertkey_binding,omitempty"` + SSLServiceSSLCipherBinding []interface{} `json:"sslservice_sslcipher_binding,omitempty"` + SSLServiceSSLCipherSuiteBinding []interface{} `json:"sslservice_sslciphersuite_binding,omitempty"` + SSLServiceSSLPolicyBinding []interface{} `json:"sslservice_sslpolicy_binding,omitempty"` +} + +type SSLCipher struct { + CipherGroupName string `json:"ciphergroupname,omitempty"` + CipherName string `json:"ciphername,omitempty"` + CipherPriority int `json:"cipherpriority,omitempty"` + CiphGrpAlias string `json:"ciphgrpalias,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` } -type Sslcertchain struct { - Certkeyname string `json:"certkeyname,omitempty"` +type SSLCertChain struct { + CertKeyName string `json:"certkeyname,omitempty"` Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type SslcertkeyBinding struct { - Certkey string `json:"certkey,omitempty"` - SslcertkeyCrldistributionBinding []interface{} `json:"sslcertkey_crldistribution_binding,omitempty"` - SslcertkeyServiceBinding []interface{} `json:"sslcertkey_service_binding,omitempty"` - SslcertkeySslocspresponderBinding []interface{} `json:"sslcertkey_sslocspresponder_binding,omitempty"` - SslcertkeySslprofileBinding []interface{} `json:"sslcertkey_sslprofile_binding,omitempty"` - SslcertkeySslvserverBinding []interface{} `json:"sslcertkey_sslvserver_binding,omitempty"` +type SSLCertKeyBinding struct { + CertKey string `json:"certkey,omitempty"` + SSLCertKeyCRLDistributionBinding []interface{} `json:"sslcertkey_crldistribution_binding,omitempty"` + SSLCertKeyServiceBinding []interface{} `json:"sslcertkey_service_binding,omitempty"` + SSLCertKeySSLOCSPResponderBinding []interface{} `json:"sslcertkey_sslocspresponder_binding,omitempty"` + SSLCertKeySSLProfileBinding []interface{} `json:"sslcertkey_sslprofile_binding,omitempty"` + SSLCertKeySSLVServerBinding []interface{} `json:"sslcertkey_sslvserver_binding,omitempty"` } -type Sslpolicylabel struct { +type SSLPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Flowtype int `json:"flowtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + FlowType int `json:"flowtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type SslcertkeySslprofileBinding struct { - Ca bool `json:"ca,omitempty"` - Certkey string `json:"certkey,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` +type SSLCertKeySSLProfileBinding struct { + CA bool `json:"ca,omitempty"` + CertKey string `json:"certkey,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` } -type SslvserverSslpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type SSLVServerSSLPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` - Polinherit int `json:"polinherit,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolInherit int `json:"polinherit,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` - Vservername string `json:"vservername,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Sslechconfig struct { +type SSLECHConfig struct { Count float64 `json:"__count,omitempty"` - Echcipher string `json:"echcipher,omitempty"` - Echconfigid int `json:"echconfigid,omitempty"` - Echconfigname string `json:"echconfigname,omitempty"` - Echpublicname string `json:"echpublicname,omitempty"` - Hpkekeyname string `json:"hpkekeyname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + ECHCipher string `json:"echcipher,omitempty"` + ECHConfigID int `json:"echconfigid,omitempty"` + ECHConfigName string `json:"echconfigname,omitempty"` + ECHPublicName string `json:"echpublicname,omitempty"` + HPKEKeyName string `json:"hpkekeyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Version int `json:"version,omitempty"` } -type SslcacertbundleIntermediatecacertlistBinding struct { - Cacertbundlename string `json:"cacertbundlename,omitempty"` - Clientcertnotafter string `json:"clientcertnotafter,omitempty"` - Clientcertnotbefore string `json:"clientcertnotbefore,omitempty"` - Daystoexpiration int `json:"daystoexpiration,omitempty"` +type SSLCACertBundleIntermediateCACertListBinding struct { + CACertBundleName string `json:"cacertbundlename,omitempty"` + ClientCertNotAfter string `json:"clientcertnotafter,omitempty"` + ClientCertNotBefore string `json:"clientcertnotbefore,omitempty"` + DaysToExpiration int `json:"daystoexpiration,omitempty"` Issuer string `json:"issuer,omitempty"` - Publickey string `json:"publickey,omitempty"` - Publickeysize int `json:"publickeysize,omitempty"` - Sandns string `json:"sandns,omitempty"` - Sanipadd string `json:"sanipadd,omitempty"` + PublicKey string `json:"publickey,omitempty"` + PublicKeySize int `json:"publickeysize,omitempty"` + SANDNS string `json:"sandns,omitempty"` + SANIPAdd string `json:"sanipadd,omitempty"` Serial string `json:"serial,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` Status string `json:"status,omitempty"` Subject string `json:"subject,omitempty"` } -type Sslvserver struct { - Ca bool `json:"ca,omitempty"` - Cipherredirect string `json:"cipherredirect,omitempty"` - Cipherurl string `json:"cipherurl,omitempty"` - Cleartextport int `json:"cleartextport,omitempty"` - Clientauth string `json:"clientauth,omitempty"` - Clientcert string `json:"clientcert,omitempty"` +type SSLVServer struct { + CA bool `json:"ca,omitempty"` + CipherRedirect string `json:"cipherredirect,omitempty"` + CipherURL string `json:"cipherurl,omitempty"` + ClearTextPort int `json:"cleartextport,omitempty"` + ClientAuth string `json:"clientauth,omitempty"` + ClientCert string `json:"clientcert,omitempty"` Count float64 `json:"__count,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Defaultsni string `json:"defaultsni,omitempty"` - Dh string `json:"dh,omitempty"` - Dhcount int `json:"dhcount,omitempty"` - Dhekeyexchangewithpsk string `json:"dhekeyexchangewithpsk,omitempty"` - Dhfile string `json:"dhfile,omitempty"` - Dhkeyexpsizelimit string `json:"dhkeyexpsizelimit,omitempty"` - Dtls1 string `json:"dtls1,omitempty"` - Dtls12 string `json:"dtls12,omitempty"` - Dtlsflag bool `json:"dtlsflag,omitempty"` - Dtlsprofilename string `json:"dtlsprofilename,omitempty"` - Ersa string `json:"ersa,omitempty"` - Ersacount int `json:"ersacount,omitempty"` - Hsts string `json:"hsts,omitempty"` - Includesubdomains string `json:"includesubdomains,omitempty"` - Maxage int `json:"maxage,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nonfipsciphers string `json:"nonfipsciphers,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Ocspstapling string `json:"ocspstapling,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + DefaultSNI string `json:"defaultsni,omitempty"` + DH string `json:"dh,omitempty"` + DHCount int `json:"dhcount,omitempty"` + DHEKeyExchangeWithPSK string `json:"dhekeyexchangewithpsk,omitempty"` + DHFile string `json:"dhfile,omitempty"` + DHKeyExpSizeLimit string `json:"dhkeyexpsizelimit,omitempty"` + DTLS1 string `json:"dtls1,omitempty"` + DTLS12 string `json:"dtls12,omitempty"` + DTLSFlag bool `json:"dtlsflag,omitempty"` + DTLSProfileName string `json:"dtlsprofilename,omitempty"` + ERSA string `json:"ersa,omitempty"` + ERSACount int `json:"ersacount,omitempty"` + HSTS string `json:"hsts,omitempty"` + IncludeSubdomains string `json:"includesubdomains,omitempty"` + MaxAge int `json:"maxage,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NonFIPSCiphers string `json:"nonfipsciphers,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + OCSPStapling string `json:"ocspstapling,omitempty"` Preload string `json:"preload,omitempty"` - Pushenctrigger string `json:"pushenctrigger,omitempty"` - Quicflag bool `json:"quicflag,omitempty"` - Redirectportrewrite string `json:"redirectportrewrite,omitempty"` - Sendclosenotify string `json:"sendclosenotify,omitempty"` + PushEncTrigger string `json:"pushenctrigger,omitempty"` + QUICFlag bool `json:"quicflag,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + SendCloseNotify string `json:"sendclosenotify,omitempty"` Service int `json:"service,omitempty"` - Sessreuse string `json:"sessreuse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Skipcacertbundle bool `json:"skipcacertbundle,omitempty"` - Skipcaname bool `json:"skipcaname,omitempty"` - Snicert bool `json:"snicert,omitempty"` - Snienable string `json:"snienable,omitempty"` - Ssl2 string `json:"ssl2,omitempty"` - Ssl3 string `json:"ssl3,omitempty"` - Sslclientlogs string `json:"sslclientlogs,omitempty"` - Sslprofile string `json:"sslprofile,omitempty"` - Sslredirect string `json:"sslredirect,omitempty"` - Sslv2redirect string `json:"sslv2redirect,omitempty"` - Sslv2url string `json:"sslv2url,omitempty"` - Strictsigdigestcheck string `json:"strictsigdigestcheck,omitempty"` - Tls1 string `json:"tls1,omitempty"` - Tls11 string `json:"tls11,omitempty"` - Tls12 string `json:"tls12,omitempty"` - Tls13 string `json:"tls13,omitempty"` - Tls13sessionticketsperauthcontext int `json:"tls13sessionticketsperauthcontext,omitempty"` - Vservername string `json:"vservername,omitempty"` - Zerorttearlydata string `json:"zerorttearlydata,omitempty"` + SessReuse string `json:"sessreuse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SkipCACertBundle bool `json:"skipcacertbundle,omitempty"` + SkipCAName bool `json:"skipcaname,omitempty"` + SNICert bool `json:"snicert,omitempty"` + SNIEnable string `json:"snienable,omitempty"` + SSL2 string `json:"ssl2,omitempty"` + SSL3 string `json:"ssl3,omitempty"` + SSLClientLogs string `json:"sslclientlogs,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` + SSLRedirect string `json:"sslredirect,omitempty"` + SSLv2Redirect string `json:"sslv2redirect,omitempty"` + SSLv2URL string `json:"sslv2url,omitempty"` + StrictSigDigestCheck string `json:"strictsigdigestcheck,omitempty"` + TLS1 string `json:"tls1,omitempty"` + TLS11 string `json:"tls11,omitempty"` + TLS12 string `json:"tls12,omitempty"` + TLS13 string `json:"tls13,omitempty"` + TLS13SessionTicketsPerAuthContext int `json:"tls13sessionticketsperauthcontext,omitempty"` + VServerName string `json:"vservername,omitempty"` + ZeroRTTEarlyData string `json:"zerorttearlydata,omitempty"` } diff --git a/nitrogo/models/stream.go b/nitrogo/models/stream.go index a0b5b84..ab8e2a4 100644 --- a/nitrogo/models/stream.go +++ b/nitrogo/models/stream.go @@ -1,51 +1,51 @@ package models // stream configuration structs -type Streamsession struct { +type StreamSession struct { Name string `json:"name,omitempty"` } -type Streamidentifier struct { - Acceptancethreshold string `json:"acceptancethreshold,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` - Breachthreshold int `json:"breachthreshold,omitempty"` +type StreamIdentifier struct { + AcceptanceThreshold string `json:"acceptancethreshold,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` + BreachThreshold int `json:"breachthreshold,omitempty"` Count float64 `json:"__count,omitempty"` Interval int `json:"interval,omitempty"` Log string `json:"log,omitempty"` - Loginterval int `json:"loginterval,omitempty"` - Loglimit int `json:"loglimit,omitempty"` - Maxtransactionthreshold int `json:"maxtransactionthreshold,omitempty"` - Mintransactionthreshold int `json:"mintransactionthreshold,omitempty"` + LogInterval int `json:"loginterval,omitempty"` + LogLimit int `json:"loglimit,omitempty"` + MaxTransactionThreshold int `json:"maxtransactionthreshold,omitempty"` + MinTransactionThreshold int `json:"mintransactionthreshold,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule []string `json:"rule,omitempty"` - Samplecount int `json:"samplecount,omitempty"` - Selectorname string `json:"selectorname,omitempty"` - Snmptrap string `json:"snmptrap,omitempty"` + SampleCount int `json:"samplecount,omitempty"` + SelectorName string `json:"selectorname,omitempty"` + SNMPTrap string `json:"snmptrap,omitempty"` Sort string `json:"sort,omitempty"` - Trackackonlypackets string `json:"trackackonlypackets,omitempty"` - Tracktransactions string `json:"tracktransactions,omitempty"` + TrackAckOnlyPackets string `json:"trackackonlypackets,omitempty"` + TrackTransactions string `json:"tracktransactions,omitempty"` } -type StreamidentifierBinding struct { +type StreamIdentifierBinding struct { Name string `json:"name,omitempty"` - StreamidentifierAnalyticsprofileBinding []interface{} `json:"streamidentifier_analyticsprofile_binding,omitempty"` - StreamidentifierStreamsessionBinding []interface{} `json:"streamidentifier_streamsession_binding,omitempty"` + StreamIdentifierAnalyticsProfileBinding []interface{} `json:"streamidentifier_analyticsprofile_binding,omitempty"` + StreamIdentifierStreamSessionBinding []interface{} `json:"streamidentifier_streamsession_binding,omitempty"` } -type StreamidentifierAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type StreamIdentifierAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type Streamselector struct { +type StreamSelector struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule []string `json:"rule,omitempty"` } -type StreamidentifierStreamsessionBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type StreamIdentifierStreamSessionBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/subscriber.go b/nitrogo/models/subscriber.go index f8ed2fe..2a593b4 100644 --- a/nitrogo/models/subscriber.go +++ b/nitrogo/models/subscriber.go @@ -1,91 +1,91 @@ package models // subscriber configuration structs -type Subscribersessions struct { - Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` +type SubscriberSessions struct { + AVPDisplayBuffer string `json:"avpdisplaybuffer,omitempty"` Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Idlettl int `json:"idlettl,omitempty"` - Ip string `json:"ip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Servicepath string `json:"servicepath,omitempty"` - Subscriberrules []string `json:"subscriberrules,omitempty"` - Subscriptionidtype string `json:"subscriptionidtype,omitempty"` - Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` - Ttl int `json:"ttl,omitempty"` - Vlan int `json:"vlan,omitempty"` + IdleTTL int `json:"idlettl,omitempty"` + IP string `json:"ip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + ServicePath string `json:"servicepath,omitempty"` + SubscriberRules []string `json:"subscriberrules,omitempty"` + SubscriptionIDType string `json:"subscriptionidtype,omitempty"` + SubscriptionIDValue string `json:"subscriptionidvalue,omitempty"` + TTL int `json:"ttl,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Subscribergxinterface struct { - Cerrequesttimeout int `json:"cerrequesttimeout,omitempty"` - Gxreportingavp1 []interface{} `json:"gxreportingavp1,omitempty"` - Gxreportingavp1type string `json:"gxreportingavp1type,omitempty"` - Gxreportingavp1vendorid int `json:"gxreportingavp1vendorid,omitempty"` - Gxreportingavp2 []interface{} `json:"gxreportingavp2,omitempty"` - Gxreportingavp2type string `json:"gxreportingavp2type,omitempty"` - Gxreportingavp2vendorid int `json:"gxreportingavp2vendorid,omitempty"` - Gxreportingavp3 []interface{} `json:"gxreportingavp3,omitempty"` - Gxreportingavp3type string `json:"gxreportingavp3type,omitempty"` - Gxreportingavp3vendorid int `json:"gxreportingavp3vendorid,omitempty"` - Gxreportingavp4 []interface{} `json:"gxreportingavp4,omitempty"` - Gxreportingavp4type string `json:"gxreportingavp4type,omitempty"` - Gxreportingavp4vendorid int `json:"gxreportingavp4vendorid,omitempty"` - Gxreportingavp5 []interface{} `json:"gxreportingavp5,omitempty"` - Gxreportingavp5type string `json:"gxreportingavp5type,omitempty"` - Gxreportingavp5vendorid int `json:"gxreportingavp5vendorid,omitempty"` - Healthcheck string `json:"healthcheck,omitempty"` - Healthcheckttl int `json:"healthcheckttl,omitempty"` - Holdonsubscriberabsence string `json:"holdonsubscriberabsence,omitempty"` +type SubscriberGxInterface struct { + CerRequestTimeout int `json:"cerrequesttimeout,omitempty"` + GxReportingAVP1 []interface{} `json:"gxreportingavp1,omitempty"` + GxReportingAVP1Type string `json:"gxreportingavp1type,omitempty"` + GxReportingAVP1VendorID int `json:"gxreportingavp1vendorid,omitempty"` + GxReportingAVP2 []interface{} `json:"gxreportingavp2,omitempty"` + GxReportingAVP2Type string `json:"gxreportingavp2type,omitempty"` + GxReportingAVP2VendorID int `json:"gxreportingavp2vendorid,omitempty"` + GxReportingAVP3 []interface{} `json:"gxreportingavp3,omitempty"` + GxReportingAVP3Type string `json:"gxreportingavp3type,omitempty"` + GxReportingAVP3VendorID int `json:"gxreportingavp3vendorid,omitempty"` + GxReportingAVP4 []interface{} `json:"gxreportingavp4,omitempty"` + GxReportingAVP4Type string `json:"gxreportingavp4type,omitempty"` + GxReportingAVP4VendorID int `json:"gxreportingavp4vendorid,omitempty"` + GxReportingAVP5 []interface{} `json:"gxreportingavp5,omitempty"` + GxReportingAVP5Type string `json:"gxreportingavp5type,omitempty"` + GxReportingAVP5VendorID int `json:"gxreportingavp5vendorid,omitempty"` + HealthCheck string `json:"healthcheck,omitempty"` + HealthCheckTTL int `json:"healthcheckttl,omitempty"` + HoldOnSubscriberAbsence string `json:"holdonsubscriberabsence,omitempty"` Identity string `json:"identity,omitempty"` - Idlettl int `json:"idlettl,omitempty"` - Negativettl int `json:"negativettl,omitempty"` - Negativettllimitedsuccess string `json:"negativettllimitedsuccess,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Pcrfrealm string `json:"pcrfrealm,omitempty"` - Purgesdbongxfailure string `json:"purgesdbongxfailure,omitempty"` + IdleTTL int `json:"idlettl,omitempty"` + NegativeTTL int `json:"negativettl,omitempty"` + NegativeTTLLimitedSuccess string `json:"negativettllimitedsuccess,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PCRFRealm string `json:"pcrfrealm,omitempty"` + PurgeSDBOnGxFailure string `json:"purgesdbongxfailure,omitempty"` Realm string `json:"realm,omitempty"` - Requestretryattempts int `json:"requestretryattempts,omitempty"` - Requesttimeout int `json:"requesttimeout,omitempty"` - Revalidationtimeout int `json:"revalidationtimeout,omitempty"` + RequestRetryAttempts int `json:"requestretryattempts,omitempty"` + RequestTimeout int `json:"requesttimeout,omitempty"` + RevalidationTimeout int `json:"revalidationtimeout,omitempty"` Service string `json:"service,omitempty"` - Servicepathavp []interface{} `json:"servicepathavp,omitempty"` - Servicepathinfomode string `json:"servicepathinfomode,omitempty"` - Servicepathvendorid int `json:"servicepathvendorid,omitempty"` + ServicePathAVP []interface{} `json:"servicepathavp,omitempty"` + ServicePathInfoMode string `json:"servicepathinfomode,omitempty"` + ServicePathVendorID int `json:"servicepathvendorid,omitempty"` Status string `json:"status,omitempty"` - Svrstate string `json:"svrstate,omitempty"` - Vserver string `json:"vserver,omitempty"` + SvrState string `json:"svrstate,omitempty"` + VServer string `json:"vserver,omitempty"` } -type Subscriberprofile struct { - Avpdisplaybuffer string `json:"avpdisplaybuffer,omitempty"` +type SubscriberProfile struct { + AVPDisplayBuffer string `json:"avpdisplaybuffer,omitempty"` Count float64 `json:"__count,omitempty"` Flags int `json:"flags,omitempty"` - Ip string `json:"ip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Servicepath string `json:"servicepath,omitempty"` - Subscriberrules []string `json:"subscriberrules,omitempty"` - Subscriptionidtype string `json:"subscriptionidtype,omitempty"` - Subscriptionidvalue string `json:"subscriptionidvalue,omitempty"` - Ttl int `json:"ttl,omitempty"` - Vlan int `json:"vlan,omitempty"` + IP string `json:"ip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ServicePath string `json:"servicepath,omitempty"` + SubscriberRules []string `json:"subscriberrules,omitempty"` + SubscriptionIDType string `json:"subscriptionidtype,omitempty"` + SubscriptionIDValue string `json:"subscriptionidvalue,omitempty"` + TTL int `json:"ttl,omitempty"` + VLAN int `json:"vlan,omitempty"` } -type Subscriberparam struct { +type SubscriberParam struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Idleaction string `json:"idleaction,omitempty"` - Idlettl int `json:"idlettl,omitempty"` - Interfacetype string `json:"interfacetype,omitempty"` - Ipv6prefixlookuplist []interface{} `json:"ipv6prefixlookuplist,omitempty"` - Keytype string `json:"keytype,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + IdleAction string `json:"idleaction,omitempty"` + IdleTTL int `json:"idlettl,omitempty"` + InterfaceType string `json:"interfacetype,omitempty"` + IPv6PrefixLookupList []interface{} `json:"ipv6prefixlookuplist,omitempty"` + KeyType string `json:"keytype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Subscriberradiusinterface struct { - Listeningservice string `json:"listeningservice,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Radiusinterimasstart string `json:"radiusinterimasstart,omitempty"` - Svrstate string `json:"svrstate,omitempty"` +type SubscriberRadiusInterface struct { + ListeningService string `json:"listeningservice,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RadiusInterimAsStart string `json:"radiusinterimasstart,omitempty"` + SvrState string `json:"svrstate,omitempty"` } diff --git a/nitrogo/models/system.go b/nitrogo/models/system.go index 7615593..60133a0 100644 --- a/nitrogo/models/system.go +++ b/nitrogo/models/system.go @@ -1,317 +1,310 @@ package models // system configuration structs -type SystemglobalAuthenticationldappolicyBinding struct { +type SystemGlobalAuthenticationLDAPPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type SystemuserSystemcmdpolicyBinding struct { - Policyname string `json:"policyname,omitempty"` +type SystemUserSystemCmdPolicyBinding struct { + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Username string `json:"username,omitempty"` } -type SystemglobalAuditsyslogpolicyBinding struct { +type SystemGlobalAuditSyslogPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Systemhwerror struct { - Diskcheck bool `json:"diskcheck,omitempty"` - Hwerrorcount int `json:"hwerrorcount,omitempty"` +type SystemHWError struct { + DiskCheck bool `json:"diskcheck,omitempty"` + HWErrorCount int `json:"hwerrorcount,omitempty"` Response string `json:"response,omitempty"` } -type Systemparameter struct { - Allowdefaultpartition string `json:"allowdefaultpartition,omitempty"` - Basicauth string `json:"basicauth,omitempty"` - Cliloglevel string `json:"cliloglevel,omitempty"` - Daystoexpire int `json:"daystoexpire,omitempty"` +type SystemParameter struct { + AllowDefaultPartition string `json:"allowdefaultpartition,omitempty"` + BasicAuth string `json:"basicauth,omitempty"` + CLILogLevel string `json:"cliloglevel,omitempty"` + DaysToExpire int `json:"daystoexpire,omitempty"` Doppler string `json:"doppler,omitempty"` - Fipsusermode string `json:"fipsusermode,omitempty"` - Forcepasswordchange string `json:"forcepasswordchange,omitempty"` - Googleanalytics string `json:"googleanalytics,omitempty"` - Localauth string `json:"localauth,omitempty"` - Maxclient int `json:"maxclient,omitempty"` - Maxsessionperuser int `json:"maxsessionperuser,omitempty"` - Minpasswordlen int `json:"minpasswordlen,omitempty"` - Natpcbforceflushlimit int `json:"natpcbforceflushlimit,omitempty"` - Natpcbrstontimeout string `json:"natpcbrstontimeout,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passwordhistorycontrol string `json:"passwordhistorycontrol,omitempty"` - Promptstring string `json:"promptstring,omitempty"` - Pwdhistorycount int `json:"pwdhistorycount,omitempty"` - Rbaonresponse string `json:"rbaonresponse,omitempty"` - Reauthonauthparamchange string `json:"reauthonauthparamchange,omitempty"` - Removesensitivefiles string `json:"removesensitivefiles,omitempty"` - Restrictedtimeout string `json:"restrictedtimeout,omitempty"` - Strongpassword string `json:"strongpassword,omitempty"` + FIPSUserMode string `json:"fipsusermode,omitempty"` + ForcePasswordChange string `json:"forcepasswordchange,omitempty"` + GoogleAnalytics string `json:"googleanalytics,omitempty"` + LocalAuth string `json:"localauth,omitempty"` + MaxClient int `json:"maxclient,omitempty"` + MaxSessionPerUser int `json:"maxsessionperuser,omitempty"` + MinPasswordLen int `json:"minpasswordlen,omitempty"` + NATPCBForceFlushLimit int `json:"natpcbforceflushlimit,omitempty"` + NATPCBRstOnTimeout string `json:"natpcbrstontimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PasswordHistoryControl string `json:"passwordhistorycontrol,omitempty"` + PromptString string `json:"promptstring,omitempty"` + PwdHistoryCount int `json:"pwdhistorycount,omitempty"` + RBAOnResponse string `json:"rbaonresponse,omitempty"` + ReAuthOnAuthParamChange string `json:"reauthonauthparamchange,omitempty"` + RemoveSensitiveFiles string `json:"removesensitivefiles,omitempty"` + RestrictedTimeout string `json:"restrictedtimeout,omitempty"` + StrongPassword string `json:"strongpassword,omitempty"` Timeout int `json:"timeout,omitempty"` - Totalauthtimeout int `json:"totalauthtimeout,omitempty"` - Wafprotection []string `json:"wafprotection,omitempty"` - Warnpriorndays int `json:"warnpriorndays,omitempty"` + TotalAuthTimeout int `json:"totalauthtimeout,omitempty"` + WAFProtection []string `json:"wafprotection,omitempty"` + WarnPriorNDays int `json:"warnpriorndays,omitempty"` } -type SystemgroupSystemcmdpolicyBinding struct { - Groupname string `json:"groupname,omitempty"` - Policyname string `json:"policyname,omitempty"` +type SystemGroupSystemCmdPolicyBinding struct { + GroupName string `json:"groupname,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type SystemglobalAuthenticationlocalpolicyBinding struct { +type SystemGlobalAuthenticationLocalPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Systemadmuserinfo struct { +type SystemADMUserInfo struct { Username string `json:"username,omitempty"` } -type Systemsession struct { +type SystemSession struct { All bool `json:"all,omitempty"` - Clientipaddress string `json:"clientipaddress,omitempty"` - Clienttype string `json:"clienttype,omitempty"` + ClientIPAddress string `json:"clientipaddress,omitempty"` + ClientType string `json:"clienttype,omitempty"` Count float64 `json:"__count,omitempty"` - Currentconn bool `json:"currentconn,omitempty"` - Expirytime int `json:"expirytime,omitempty"` - Lastactivitytime string `json:"lastactivitytime,omitempty"` - Lastactivitytimelocal string `json:"lastactivitytimelocal,omitempty"` - Logintime string `json:"logintime,omitempty"` - Logintimelocal string `json:"logintimelocal,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numofconnections int `json:"numofconnections,omitempty"` - Partitionname string `json:"partitionname,omitempty"` - Sid int `json:"sid,omitempty"` + CurrentConn bool `json:"currentconn,omitempty"` + ExpiryTime int `json:"expirytime,omitempty"` + LastActivityTime string `json:"lastactivitytime,omitempty"` + LastActivityTimeLocal string `json:"lastactivitytimelocal,omitempty"` + LoginTime string `json:"logintime,omitempty"` + LoginTimeLocal string `json:"logintimelocal,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumOfConnections int `json:"numofconnections,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + SID int `json:"sid,omitempty"` Username string `json:"username,omitempty"` } -type Systemautorestorefeature struct { +type SystemAutoRestoreFeature struct { } -type SystemglobalBinding struct { - SystemglobalAuditnslogpolicyBinding []interface{} `json:"systemglobal_auditnslogpolicy_binding,omitempty"` - SystemglobalAuditsyslogpolicyBinding []interface{} `json:"systemglobal_auditsyslogpolicy_binding,omitempty"` - SystemglobalAuthenticationldappolicyBinding []interface{} `json:"systemglobal_authenticationldappolicy_binding,omitempty"` - SystemglobalAuthenticationlocalpolicyBinding []interface{} `json:"systemglobal_authenticationlocalpolicy_binding,omitempty"` - SystemglobalAuthenticationpolicyBinding []interface{} `json:"systemglobal_authenticationpolicy_binding,omitempty"` - SystemglobalAuthenticationradiuspolicyBinding []interface{} `json:"systemglobal_authenticationradiuspolicy_binding,omitempty"` - SystemglobalAuthenticationtacacspolicyBinding []interface{} `json:"systemglobal_authenticationtacacspolicy_binding,omitempty"` +type SystemGlobalBinding struct { + SystemGlobalAuditNSLogPolicyBinding []interface{} `json:"systemglobal_auditnslogpolicy_binding,omitempty"` + SystemGlobalAuditSyslogPolicyBinding []interface{} `json:"systemglobal_auditsyslogpolicy_binding,omitempty"` + SystemGlobalAuthenticationLDAPPolicyBinding []interface{} `json:"systemglobal_authenticationldappolicy_binding,omitempty"` + SystemGlobalAuthenticationLocalPolicyBinding []interface{} `json:"systemglobal_authenticationlocalpolicy_binding,omitempty"` + SystemGlobalAuthenticationPolicyBinding []interface{} `json:"systemglobal_authenticationpolicy_binding,omitempty"` + SystemGlobalAuthenticationRADIUSPolicyBinding []interface{} `json:"systemglobal_authenticationradiuspolicy_binding,omitempty"` + SystemGlobalAuthenticationTACACSPolicyBinding []interface{} `json:"systemglobal_authenticationtacacspolicy_binding,omitempty"` } -type Systemkek struct { +type SystemKEK struct { Level string `json:"level,omitempty"` } -type Systemcpuparam struct { +type SystemCPUParam struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Pemode string `json:"pemode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PEMode string `json:"pemode,omitempty"` } -type Systemrestorepoint struct { - Backupfilename string `json:"backupfilename,omitempty"` +type SystemRestorePoint struct { + BackupFileName string `json:"backupfilename,omitempty"` Count float64 `json:"__count,omitempty"` - Createdby string `json:"createdby,omitempty"` - Creationtime string `json:"creationtime,omitempty"` - Filename string `json:"filename,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Techsuprtname string `json:"techsuprtname,omitempty"` + CreatedBy string `json:"createdby,omitempty"` + CreationTime string `json:"creationtime,omitempty"` + FileName string `json:"filename,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + TechSuprtName string `json:"techsuprtname,omitempty"` Version string `json:"version,omitempty"` } -type SystemglobalAuditnslogpolicyBinding struct { +type SystemGlobalAuditNSLogPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Systemgroup struct { - Allowedmanagementinterface []string `json:"allowedmanagementinterface,omitempty"` +type SystemGroup struct { + AllowedManagementInterface []string `json:"allowedmanagementinterface,omitempty"` Count float64 `json:"__count,omitempty"` - Daystoexpire int `json:"daystoexpire,omitempty"` - Groupname string `json:"groupname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Promptstring string `json:"promptstring,omitempty"` + DaysToExpire int `json:"daystoexpire,omitempty"` + GroupName string `json:"groupname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PromptString string `json:"promptstring,omitempty"` Timeout int `json:"timeout,omitempty"` - Warnpriorndays int `json:"warnpriorndays,omitempty"` + WarnPriorNDays int `json:"warnpriorndays,omitempty"` } -type SystemglobalAuthenticationradiuspolicyBinding struct { +type SystemGlobalAuthenticationRADIUSPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type SystemgroupSystemuserBinding struct { - Groupname string `json:"groupname,omitempty"` +type SystemGroupSystemUserBinding struct { + GroupName string `json:"groupname,omitempty"` Username string `json:"username,omitempty"` } -type SystemglobalAuthenticationtacacspolicyBinding struct { +type SystemGlobalAuthenticationTACACSPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type SystemuserSystemgroupBinding struct { - Groupname string `json:"groupname,omitempty"` +type SystemUserSystemGroupBinding struct { + GroupName string `json:"groupname,omitempty"` Username string `json:"username,omitempty"` } -type Systemfipsstatus struct { - Fipsstatus string `json:"fipsstatus,omitempty"` - Intelhwcryptographicacceleratorversion string `json:"intelhwcryptographicacceleratorversion,omitempty"` - Netscalercontrolplanecryptographiclibraryversion string `json:"netscalercontrolplanecryptographiclibraryversion,omitempty"` - Netscalercrytographicmoduleversion string `json:"netscalercrytographicmoduleversion,omitempty"` - Netscalerdataplanecryptographiclibraryversion string `json:"netscalerdataplanecryptographiclibraryversion,omitempty"` - Netscalerjitterentropysourceversion string `json:"netscalerjitterentropysourceversion,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` +type SystemFIPSStatus struct { + FIPSStatus string `json:"fipsstatus,omitempty"` + IntelHWCryptographicAcceleratorVersion string `json:"intelhwcryptographicacceleratorversion,omitempty"` + NetScalerControlPlaneCryptographicLibraryVersion string `json:"netscalercontrolplanecryptographiclibraryversion,omitempty"` + NetScalerCrytographicModuleVersion string `json:"netscalercrytographicmoduleversion,omitempty"` + NetScalerDataPlaneCryptographicLibraryVersion string `json:"netscalerdataplanecryptographiclibraryversion,omitempty"` + NetScalerJitterEntropySourceVersion string `json:"netscalerjitterentropysourceversion,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type Systemextramgmtcpu struct { - Configuredstate string `json:"configuredstate,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` -} - -type Systemsignedexereport struct { +type SystemSignedExeReport struct { Message string `json:"message,omitempty"` } -type Systemnsbtracing struct { - Configuredstate string `json:"configuredstate,omitempty"` - Effectivestate string `json:"effectivestate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` +type SystemNSBTracing struct { + ConfiguredState string `json:"configuredstate,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` } -type Systemcmdpolicy struct { +type SystemCmdPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` - Cmdspec string `json:"cmdspec,omitempty"` + CmdSpec string `json:"cmdspec,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Policyname string `json:"policyname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PolicyName string `json:"policyname,omitempty"` } -type SystemgroupNspartitionBinding struct { - Groupname string `json:"groupname,omitempty"` - Partitionname string `json:"partitionname,omitempty"` +type SystemGroupNSPartitionBinding struct { + GroupName string `json:"groupname,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } -type SystemglobalAuthenticationpolicyBinding struct { +type SystemGlobalAuthenticationPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nextfactor string `json:"nextfactor,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type SystemgroupBinding struct { - Groupname string `json:"groupname,omitempty"` - SystemgroupNspartitionBinding []interface{} `json:"systemgroup_nspartition_binding,omitempty"` - SystemgroupSystemcmdpolicyBinding []interface{} `json:"systemgroup_systemcmdpolicy_binding,omitempty"` - SystemgroupSystemuserBinding []interface{} `json:"systemgroup_systemuser_binding,omitempty"` +type SystemGroupBinding struct { + GroupName string `json:"groupname,omitempty"` + SystemGroupNSPartitionBinding []interface{} `json:"systemgroup_nspartition_binding,omitempty"` + SystemGroupSystemCmdPolicyBinding []interface{} `json:"systemgroup_systemcmdpolicy_binding,omitempty"` + SystemGroupSystemUserBinding []interface{} `json:"systemgroup_systemuser_binding,omitempty"` } -type Systembackup struct { +type SystemBackup struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Createdby string `json:"createdby,omitempty"` - Creationtime string `json:"creationtime,omitempty"` - Filename string `json:"filename,omitempty"` - Includekernel string `json:"includekernel,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + CreatedBy string `json:"createdby,omitempty"` + CreationTime string `json:"creationtime,omitempty"` + FileName string `json:"filename,omitempty"` + IncludeKernel string `json:"includekernel,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Level string `json:"level,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Size int `json:"size,omitempty"` - Skipbackup bool `json:"skipbackup,omitempty"` - Uselocaltimezone bool `json:"uselocaltimezone,omitempty"` + SkipBackup bool `json:"skipbackup,omitempty"` + UseLocalTimezone bool `json:"uselocaltimezone,omitempty"` Version string `json:"version,omitempty"` } -type Systemsshkey struct { +type SystemSSHKey struct { Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Src string `json:"src,omitempty"` - Sshkeytype string `json:"sshkeytype,omitempty"` + SSHKeyType string `json:"sshkeytype,omitempty"` } -type Systemuser struct { - Allowedmanagementinterface []string `json:"allowedmanagementinterface,omitempty"` - Allowedmanagementinterfacekind string `json:"allowedmanagementinterfacekind,omitempty"` +type SystemUser struct { + AllowedManagementInterface []string `json:"allowedmanagementinterface,omitempty"` + AllowedManagementInterfaceKind string `json:"allowedmanagementinterfacekind,omitempty"` Count float64 `json:"__count,omitempty"` - Daystoexpirekind string `json:"daystoexpirekind,omitempty"` + DaysToExpireKind string `json:"daystoexpirekind,omitempty"` Encrypted bool `json:"encrypted,omitempty"` - Externalauth string `json:"externalauth,omitempty"` - Hashmethod string `json:"hashmethod,omitempty"` - Lastpwdchangetimestamp int `json:"lastpwdchangetimestamp,omitempty"` + ExternalAuth string `json:"externalauth,omitempty"` + HashMethod string `json:"hashmethod,omitempty"` + LastPwdChangeTimestamp int `json:"lastpwdchangetimestamp,omitempty"` Logging string `json:"logging,omitempty"` - Maxsession int `json:"maxsession,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + MaxSession int `json:"maxsession,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Password string `json:"password,omitempty"` - Promptinheritedfrom string `json:"promptinheritedfrom,omitempty"` - Promptstring string `json:"promptstring,omitempty"` + PromptInheritedFrom string `json:"promptinheritedfrom,omitempty"` + PromptString string `json:"promptstring,omitempty"` Timeout int `json:"timeout,omitempty"` - Timeoutkind string `json:"timeoutkind,omitempty"` + TimeoutKind string `json:"timeoutkind,omitempty"` Username string `json:"username,omitempty"` } -type SystemuserBinding struct { - SystemuserNspartitionBinding []interface{} `json:"systemuser_nspartition_binding,omitempty"` - SystemuserSystemcmdpolicyBinding []interface{} `json:"systemuser_systemcmdpolicy_binding,omitempty"` - SystemuserSystemgroupBinding []interface{} `json:"systemuser_systemgroup_binding,omitempty"` +type SystemUserBinding struct { + SystemUserNSPartitionBinding []interface{} `json:"systemuser_nspartition_binding,omitempty"` + SystemUserSystemCmdPolicyBinding []interface{} `json:"systemuser_systemcmdpolicy_binding,omitempty"` + SystemUserSystemGroupBinding []interface{} `json:"systemuser_systemgroup_binding,omitempty"` Username string `json:"username,omitempty"` } -type Systemfile struct { +type SystemFile struct { Count float64 `json:"__count,omitempty"` - Fileaccesstime string `json:"fileaccesstime,omitempty"` - Filecontent string `json:"filecontent,omitempty"` - Fileencoding string `json:"fileencoding,omitempty"` - Filelocation string `json:"filelocation,omitempty"` - Filemode []string `json:"filemode,omitempty"` - Filemodifiedtime string `json:"filemodifiedtime,omitempty"` - Filename string `json:"filename,omitempty"` - Filesize int `json:"filesize,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` -} - -type SystemuserNspartitionBinding struct { - Partitionname string `json:"partitionname,omitempty"` + FileAccessTime string `json:"fileaccesstime,omitempty"` + FileContent string `json:"filecontent,omitempty"` + FileEncoding string `json:"fileencoding,omitempty"` + FileLocation string `json:"filelocation,omitempty"` + FileMode []string `json:"filemode,omitempty"` + FileModifiedTime string `json:"filemodifiedtime,omitempty"` + FileName string `json:"filename,omitempty"` + FileSize int `json:"filesize,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` +} + +type SystemUserNSPartitionBinding struct { + PartitionName string `json:"partitionname,omitempty"` Username string `json:"username,omitempty"` } @@ -330,10 +323,10 @@ type SystemStatus struct { AuxVolt6 float64 `json:"auxvolt6,omitempty"` AuxVolt7 float64 `json:"auxvolt7,omitempty"` ClearStats string `json:"clearstats,omitempty"` - Cpu0Temp int `json:"cpu0temp,omitempty"` - Cpu1Temp int `json:"cpu1temp,omitempty"` - CpuFan0Apeed int `json:"cpufan0speed,omitempty"` - CpuFan1Apeed int `json:"cpufan1speed,omitempty"` + CPU0Temp int `json:"cpu0temp,omitempty"` + CPU1Temp int `json:"cpu1temp,omitempty"` + CPUFan0Speed int `json:"cpufan0speed,omitempty"` + CPUFan1Speed int `json:"cpufan1speed,omitempty"` CPUUsage string `json:"cpuusage,omitempty"` CPUUsagePcnt float64 `json:"cpuusagepcnt,omitempty"` Disk0Avail int `json:"disk0avail,omitempty"` @@ -341,7 +334,7 @@ type SystemStatus struct { Disk0Size int `json:"disk0size,omitempty"` Disk0Used int `json:"disk0used,omitempty"` Disk1Avail int `json:"disk1avail,omitempty"` - Disk1perUsage int `json:"disk1perusage,omitempty"` + Disk1PerUsage int `json:"disk1perusage,omitempty"` Disk1Size int `json:"disk1size,omitempty"` Disk1Used int `json:"disk1used,omitempty"` Fan0Speed int `json:"fan0speed,omitempty"` @@ -356,7 +349,7 @@ type SystemStatus struct { MemUsagePcnt float64 `json:"memusagepcnt,omitempty"` MemUseInMB string `json:"memuseinmb,omitempty"` MgmtCPU0UsagePcnt float64 `json:"mgmtcpu0usagepcnt,omitempty"` - MgmtCPUUsageCcnt float64 `json:"mgmtcpuusagepcnt,omitempty"` + MgmtCPUUsagePcnt float64 `json:"mgmtcpuusagepcnt,omitempty"` NumCPUs string `json:"numcpus,omitempty"` PktCPUUsagePcnt float64 `json:"pktcpuusagepcnt,omitempty"` PowerSupply1Status string `json:"powersupply1status,omitempty"` @@ -370,13 +363,13 @@ type SystemStatus struct { StartTimeLocal string `json:"starttimelocal,omitempty"` SystemFanSpeed int `json:"systemfanspeed,omitempty"` TimeSinceStart string `json:"timesincestart,omitempty"` - VoltageV12n float64 `json:"voltagev12n,omitempty"` - VoltageV12p float64 `json:"voltagev12p,omitempty"` + VoltageV12N float64 `json:"voltagev12n,omitempty"` + VoltageV12P float64 `json:"voltagev12p,omitempty"` VoltageV33Main float64 `json:"voltagev33main,omitempty"` VoltageV33Stby float64 `json:"voltagev33stby,omitempty"` - VoltageV5n float64 `json:"voltagev5n,omitempty"` - VoltageV5p float64 `json:"voltagev5p,omitempty"` - VoltageV5sb float64 `json:"voltagev5sb,omitempty"` + VoltageV5N float64 `json:"voltagev5n,omitempty"` + VoltageV5P float64 `json:"voltagev5p,omitempty"` + VoltageV5SB float64 `json:"voltagev5sb,omitempty"` VoltageVBat float64 `json:"voltagevbat,omitempty"` VoltageVCC0 float64 `json:"voltagevcc0,omitempty"` VoltageVCC1 float64 `json:"voltagevcc1,omitempty"` @@ -385,7 +378,7 @@ type SystemStatus struct { } type SystemExtraMgmtCPU struct { - Nodeid int `json:"nodeid,omitempty"` + NodeID int `json:"nodeid,omitempty"` ConfiguredState string `json:"configuredstate,omitempty"` EffectiveState string `json:"effectivestate,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` diff --git a/nitrogo/models/tm.go b/nitrogo/models/tm.go index 7cf6aaa..1e657c9 100644 --- a/nitrogo/models/tm.go +++ b/nitrogo/models/tm.go @@ -1,278 +1,278 @@ package models // tm configuration structs -type Tmformssoaction struct { - Actionurl string `json:"actionurl,omitempty"` +type TMFormSSOAction struct { + ActionURL string `json:"actionurl,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Namevaluepair string `json:"namevaluepair,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nvtype string `json:"nvtype,omitempty"` - Passwdfield string `json:"passwdfield,omitempty"` - Responsesize int `json:"responsesize,omitempty"` - Ssosuccessrule string `json:"ssosuccessrule,omitempty"` - Submitmethod string `json:"submitmethod,omitempty"` - Userfield string `json:"userfield,omitempty"` + NameValuePair string `json:"namevaluepair,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NVType string `json:"nvtype,omitempty"` + PasswdField string `json:"passwdfield,omitempty"` + ResponseSize int `json:"responsesize,omitempty"` + SSOSuccessRule string `json:"ssosuccessrule,omitempty"` + SubmitMethod string `json:"submitmethod,omitempty"` + UserField string `json:"userfield,omitempty"` } -type TmtrafficpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMTrafficPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Tmtrafficpolicy struct { +type TMTrafficPolicy struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type TmglobalTmtrafficpolicyBinding struct { - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policyname string `json:"policyname,omitempty"` +type TMGlobalTMTrafficPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type TmglobalBinding struct { - TmglobalAuditnslogpolicyBinding []interface{} `json:"tmglobal_auditnslogpolicy_binding,omitempty"` - TmglobalAuditsyslogpolicyBinding []interface{} `json:"tmglobal_auditsyslogpolicy_binding,omitempty"` - TmglobalTmsessionpolicyBinding []interface{} `json:"tmglobal_tmsessionpolicy_binding,omitempty"` - TmglobalTmtrafficpolicyBinding []interface{} `json:"tmglobal_tmtrafficpolicy_binding,omitempty"` +type TMGlobalBinding struct { + TMGlobalAuditNSLogPolicyBinding []interface{} `json:"tmglobal_auditnslogpolicy_binding,omitempty"` + TMGlobalAuditSyslogPolicyBinding []interface{} `json:"tmglobal_auditsyslogpolicy_binding,omitempty"` + TMGlobalTMSessionPolicyBinding []interface{} `json:"tmglobal_tmsessionpolicy_binding,omitempty"` + TMGlobalTMTrafficPolicyBinding []interface{} `json:"tmglobal_tmtrafficpolicy_binding,omitempty"` } -type TmtrafficpolicyBinding struct { +type TMTrafficPolicyBinding struct { Name string `json:"name,omitempty"` - TmtrafficpolicyCsvserverBinding []interface{} `json:"tmtrafficpolicy_csvserver_binding,omitempty"` - TmtrafficpolicyLbvserverBinding []interface{} `json:"tmtrafficpolicy_lbvserver_binding,omitempty"` - TmtrafficpolicyTmglobalBinding []interface{} `json:"tmtrafficpolicy_tmglobal_binding,omitempty"` + TMTrafficPolicyCSVServerBinding []interface{} `json:"tmtrafficpolicy_csvserver_binding,omitempty"` + TMTrafficPolicyLBVServerBinding []interface{} `json:"tmtrafficpolicy_lbvserver_binding,omitempty"` + TMTrafficPolicyTMGlobalBinding []interface{} `json:"tmtrafficpolicy_tmglobal_binding,omitempty"` } -type Tmsessionpolicy struct { +type TMSessionPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Feature string `json:"feature,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type TmtrafficpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMTrafficPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TmsessionpolicyTmglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMSessionPolicyTMGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Tmsessionparameter struct { - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` +type TMSessionParameter struct { + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` Homepage string `json:"homepage,omitempty"` - Httponlycookie string `json:"httponlycookie,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + HTTPOnlyCookie string `json:"httponlycookie,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Persistentcookie string `json:"persistentcookie,omitempty"` - Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Ssodomain string `json:"ssodomain,omitempty"` - Tmsessionpolicybindtype string `json:"tmsessionpolicybindtype,omitempty"` - Tmsessionpolicycount int `json:"tmsessionpolicycount,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PersistentCookie string `json:"persistentcookie,omitempty"` + PersistentCookieValidity int `json:"persistentcookievalidity,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + SSODomain string `json:"ssodomain,omitempty"` + TMSessionPolicyBindType string `json:"tmsessionpolicybindtype,omitempty"` + TMSessionPolicyCount int `json:"tmsessionpolicycount,omitempty"` } -type TmglobalAuditnslogpolicyBinding struct { - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policyname string `json:"policyname,omitempty"` +type TMGlobalAuditNSLogPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Tmtrafficaction struct { - Apptimeout int `json:"apptimeout,omitempty"` +type TMTrafficAction struct { + AppTimeout int `json:"apptimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Forcedtimeout string `json:"forcedtimeout,omitempty"` - Forcedtimeoutval int `json:"forcedtimeoutval,omitempty"` - Formssoaction string `json:"formssoaction,omitempty"` - Initiatelogout string `json:"initiatelogout,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + ForcedTimeout string `json:"forcedtimeout,omitempty"` + ForcedTimeoutVal int `json:"forcedtimeoutval,omitempty"` + FormSSOAction string `json:"formssoaction,omitempty"` + InitiateLogout string `json:"initiatelogout,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` - Persistentcookie string `json:"persistentcookie,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Sso string `json:"sso,omitempty"` - Userexpression string `json:"userexpression,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PasswdExpression string `json:"passwdexpression,omitempty"` + PersistentCookie string `json:"persistentcookie,omitempty"` + SAMLSSOProfile string `json:"samlssoprofile,omitempty"` + SSO string `json:"sso,omitempty"` + UserExpression string `json:"userexpression,omitempty"` } -type TmsessionpolicyBinding struct { +type TMSessionPolicyBinding struct { Name string `json:"name,omitempty"` - TmsessionpolicyAaagroupBinding []interface{} `json:"tmsessionpolicy_aaagroup_binding,omitempty"` - TmsessionpolicyAaauserBinding []interface{} `json:"tmsessionpolicy_aaauser_binding,omitempty"` - TmsessionpolicyAuthenticationvserverBinding []interface{} `json:"tmsessionpolicy_authenticationvserver_binding,omitempty"` - TmsessionpolicyTmglobalBinding []interface{} `json:"tmsessionpolicy_tmglobal_binding,omitempty"` + TMSessionPolicyAAAGroupBinding []interface{} `json:"tmsessionpolicy_aaagroup_binding,omitempty"` + TMSessionPolicyAAAUserBinding []interface{} `json:"tmsessionpolicy_aaauser_binding,omitempty"` + TMSessionPolicyAuthenticationVServerBinding []interface{} `json:"tmsessionpolicy_authenticationvserver_binding,omitempty"` + TMSessionPolicyTMGlobalBinding []interface{} `json:"tmsessionpolicy_tmglobal_binding,omitempty"` } -type TmsessionpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMSessionPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TmtrafficpolicyTmglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMTrafficPolicyTMGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TmglobalTmsessionpolicyBinding struct { - Bindpolicytype int `json:"bindpolicytype,omitempty"` +type TMGlobalTMSessionPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policyname string `json:"policyname,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type TmglobalAuditsyslogpolicyBinding struct { - Bindpolicytype int `json:"bindpolicytype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Policyname string `json:"policyname,omitempty"` +type TMGlobalAuditSyslogPolicyBinding struct { + BindPolicyType int `json:"bindpolicytype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Tmsamlssoprofile struct { - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` +type TMSAMLSSOProfile struct { + AssertionConsumerServiceURL string `json:"assertionconsumerserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10Expr string `json:"attribute10expr,omitempty"` + Attribute10Format string `json:"attribute10format,omitempty"` + Attribute10FriendlyName string `json:"attribute10friendlyname,omitempty"` Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11Expr string `json:"attribute11expr,omitempty"` + Attribute11Format string `json:"attribute11format,omitempty"` + Attribute11FriendlyName string `json:"attribute11friendlyname,omitempty"` Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12Expr string `json:"attribute12expr,omitempty"` + Attribute12Format string `json:"attribute12format,omitempty"` + Attribute12FriendlyName string `json:"attribute12friendlyname,omitempty"` Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13Expr string `json:"attribute13expr,omitempty"` + Attribute13Format string `json:"attribute13format,omitempty"` + Attribute13FriendlyName string `json:"attribute13friendlyname,omitempty"` Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14Expr string `json:"attribute14expr,omitempty"` + Attribute14Format string `json:"attribute14format,omitempty"` + Attribute14FriendlyName string `json:"attribute14friendlyname,omitempty"` Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15Expr string `json:"attribute15expr,omitempty"` + Attribute15Format string `json:"attribute15format,omitempty"` + Attribute15FriendlyName string `json:"attribute15friendlyname,omitempty"` Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute16Expr string `json:"attribute16expr,omitempty"` + Attribute16Format string `json:"attribute16format,omitempty"` + Attribute16FriendlyName string `json:"attribute16friendlyname,omitempty"` + Attribute1Expr string `json:"attribute1expr,omitempty"` + Attribute1Format string `json:"attribute1format,omitempty"` + Attribute1FriendlyName string `json:"attribute1friendlyname,omitempty"` Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2Expr string `json:"attribute2expr,omitempty"` + Attribute2Format string `json:"attribute2format,omitempty"` + Attribute2FriendlyName string `json:"attribute2friendlyname,omitempty"` Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3Expr string `json:"attribute3expr,omitempty"` + Attribute3Format string `json:"attribute3format,omitempty"` + Attribute3FriendlyName string `json:"attribute3friendlyname,omitempty"` Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4Expr string `json:"attribute4expr,omitempty"` + Attribute4Format string `json:"attribute4format,omitempty"` + Attribute4FriendlyName string `json:"attribute4friendlyname,omitempty"` Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5Expr string `json:"attribute5expr,omitempty"` + Attribute5Format string `json:"attribute5format,omitempty"` + Attribute5FriendlyName string `json:"attribute5friendlyname,omitempty"` Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6Expr string `json:"attribute6expr,omitempty"` + Attribute6Format string `json:"attribute6format,omitempty"` + Attribute6FriendlyName string `json:"attribute6friendlyname,omitempty"` Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7Expr string `json:"attribute7expr,omitempty"` + Attribute7Format string `json:"attribute7format,omitempty"` + Attribute7FriendlyName string `json:"attribute7friendlyname,omitempty"` Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8Expr string `json:"attribute8expr,omitempty"` + Attribute8Format string `json:"attribute8format,omitempty"` + Attribute8FriendlyName string `json:"attribute8friendlyname,omitempty"` Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9Expr string `json:"attribute9expr,omitempty"` + Attribute9Format string `json:"attribute9format,omitempty"` + Attribute9FriendlyName string `json:"attribute9friendlyname,omitempty"` Audience string `json:"audience,omitempty"` Count float64 `json:"__count,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + DigestMethod string `json:"digestmethod,omitempty"` + EncryptAssertion string `json:"encryptassertion,omitempty"` + EncryptionAlgorithm string `json:"encryptionalgorithm,omitempty"` Name string `json:"name,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Skewtime int `json:"skewtime,omitempty"` + NameIDExpr string `json:"nameidexpr,omitempty"` + NameIDFormat string `json:"nameidformat,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RelayStateRule string `json:"relaystaterule,omitempty"` + SAMLIssuerName string `json:"samlissuername,omitempty"` + SAMLSigningCertName string `json:"samlsigningcertname,omitempty"` + SAMLSPCertName string `json:"samlspcertname,omitempty"` + SendPassword string `json:"sendpassword,omitempty"` + SignAssertion string `json:"signassertion,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + SkewTime int `json:"skewtime,omitempty"` } -type Tmsessionaction struct { +type TMSessionAction struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` Feature string `json:"feature,omitempty"` Homepage string `json:"homepage,omitempty"` - Httponlycookie string `json:"httponlycookie,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + HTTPOnlyCookie string `json:"httponlycookie,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Persistentcookie string `json:"persistentcookie,omitempty"` - Persistentcookievalidity int `json:"persistentcookievalidity,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Ssodomain string `json:"ssodomain,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PersistentCookie string `json:"persistentcookie,omitempty"` + PersistentCookieValidity int `json:"persistentcookievalidity,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + SSODomain string `json:"ssodomain,omitempty"` } -type TmsessionpolicyAuthenticationvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMSessionPolicyAuthenticationVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TmsessionpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type TMSessionPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/transform.go b/nitrogo/models/transform.go index f58709c..1423be0 100644 --- a/nitrogo/models/transform.go +++ b/nitrogo/models/transform.go @@ -1,175 +1,175 @@ package models // transform configuration structs -type TransformpolicyCsvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type TransformPolicyCSVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TransformprofileBinding struct { +type TransformProfileBinding struct { Name string `json:"name,omitempty"` - TransformprofileTransformactionBinding []interface{} `json:"transformprofile_transformaction_binding,omitempty"` + TransformProfileTransformActionBinding []interface{} `json:"transformprofile_transformaction_binding,omitempty"` } -type TransformpolicyBinding struct { +type TransformPolicyBinding struct { Name string `json:"name,omitempty"` - TransformpolicyCsvserverBinding []interface{} `json:"transformpolicy_csvserver_binding,omitempty"` - TransformpolicyLbvserverBinding []interface{} `json:"transformpolicy_lbvserver_binding,omitempty"` - TransformpolicyTransformglobalBinding []interface{} `json:"transformpolicy_transformglobal_binding,omitempty"` - TransformpolicyTransformpolicylabelBinding []interface{} `json:"transformpolicy_transformpolicylabel_binding,omitempty"` + TransformPolicyCSVServerBinding []interface{} `json:"transformpolicy_csvserver_binding,omitempty"` + TransformPolicyLBVServerBinding []interface{} `json:"transformpolicy_lbvserver_binding,omitempty"` + TransformPolicyTransformGlobalBinding []interface{} `json:"transformpolicy_transformglobal_binding,omitempty"` + TransformPolicyTransformPolicyLabelBinding []interface{} `json:"transformpolicy_transformpolicylabel_binding,omitempty"` } -type Transformpolicylabel struct { +type TransformPolicyLabel struct { Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` Priority int `json:"priority,omitempty"` } -type TransformpolicyTransformpolicylabelBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type TransformPolicyTransformPolicyLabelBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TransformpolicylabelTransformpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type TransformPolicyLabelTransformPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Transformpolicy struct { +type TransformPolicy struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Logaction string `json:"logaction,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` Rule string `json:"rule,omitempty"` } -type Transformprofile struct { - Additionalreqheaderslist string `json:"additionalreqheaderslist,omitempty"` - Additionalrespheaderslist string `json:"additionalrespheaderslist,omitempty"` +type TransformProfile struct { + AdditionalReqHeadersList string `json:"additionalreqheaderslist,omitempty"` + AdditionalRespHeadersList string `json:"additionalrespheaderslist,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Onlytransformabsurlinbody string `json:"onlytransformabsurlinbody,omitempty"` - Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` - Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` - Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` - Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OnlyTransformAbsURLInBody string `json:"onlytransformabsurlinbody,omitempty"` + RegexForFindingURLInCSS string `json:"regexforfindingurlincss,omitempty"` + RegexForFindingURLInJavascript string `json:"regexforfindingurlinjavascript,omitempty"` + RegexForFindingURLInXComponent string `json:"regexforfindingurlinxcomponent,omitempty"` + RegexForFindingURLInXML string `json:"regexforfindingurlinxml,omitempty"` TypeField string `json:"type,omitempty"` } -type TransformglobalTransformpolicyBinding struct { - Flowtype int `json:"flowtype,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type TransformGlobalTransformPolicyBinding struct { + FlowType int `json:"flowtype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type TransformpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type TransformPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Transformaction struct { +type TransformAction struct { Comment string `json:"comment,omitempty"` - Continuematching string `json:"continuematching,omitempty"` - Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` - Cookiedomaininto string `json:"cookiedomaininto,omitempty"` + ContinueMatching string `json:"continuematching,omitempty"` + CookieDomainFrom string `json:"cookiedomainfrom,omitempty"` + CookieDomainInto string `json:"cookiedomaininto,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Priority int `json:"priority,omitempty"` - Profilename string `json:"profilename,omitempty"` - Requrlfrom string `json:"requrlfrom,omitempty"` - Requrlinto string `json:"requrlinto,omitempty"` - Resurlfrom string `json:"resurlfrom,omitempty"` - Resurlinto string `json:"resurlinto,omitempty"` + ProfileName string `json:"profilename,omitempty"` + ReqURLFrom string `json:"requrlfrom,omitempty"` + ReqURLInto string `json:"requrlinto,omitempty"` + ResURLFrom string `json:"resurlfrom,omitempty"` + ResURLInto string `json:"resurlinto,omitempty"` State string `json:"state,omitempty"` } -type TransformpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - TransformpolicylabelPolicybindingBinding []interface{} `json:"transformpolicylabel_policybinding_binding,omitempty"` - TransformpolicylabelTransformpolicyBinding []interface{} `json:"transformpolicylabel_transformpolicy_binding,omitempty"` +type TransformPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + TransformPolicyLabelPolicyBindingBinding []interface{} `json:"transformpolicylabel_policybinding_binding,omitempty"` + TransformPolicyLabelTransformPolicyBinding []interface{} `json:"transformpolicylabel_transformpolicy_binding,omitempty"` } -type TransformglobalBinding struct { - TransformglobalTransformpolicyBinding []interface{} `json:"transformglobal_transformpolicy_binding,omitempty"` +type TransformGlobalBinding struct { + TransformGlobalTransformPolicyBinding []interface{} `json:"transformglobal_transformpolicy_binding,omitempty"` } -type TransformprofileTransformactionBinding struct { - Actioncomment string `json:"actioncomment,omitempty"` - Actionname string `json:"actionname,omitempty"` - Cookiedomainfrom string `json:"cookiedomainfrom,omitempty"` - Cookiedomaininto string `json:"cookiedomaininto,omitempty"` +type TransformProfileTransformActionBinding struct { + ActionComment string `json:"actioncomment,omitempty"` + ActionName string `json:"actionname,omitempty"` + CookieDomainFrom string `json:"cookiedomainfrom,omitempty"` + CookieDomainInto string `json:"cookiedomaininto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` - Profilename string `json:"profilename,omitempty"` - Requrlfrom string `json:"requrlfrom,omitempty"` - Requrlinto string `json:"requrlinto,omitempty"` - Resurlfrom string `json:"resurlfrom,omitempty"` - Resurlinto string `json:"resurlinto,omitempty"` + ProfileName string `json:"profilename,omitempty"` + ReqURLFrom string `json:"requrlfrom,omitempty"` + ReqURLInto string `json:"requrlinto,omitempty"` + ResURLFrom string `json:"resurlfrom,omitempty"` + ResURLInto string `json:"resurlinto,omitempty"` State string `json:"state,omitempty"` } -type TransformpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type TransformPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type TransformpolicyTransformglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type TransformPolicyTransformGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/tunnel.go b/nitrogo/models/tunnel.go index 3b86cca..880eb1b 100644 --- a/nitrogo/models/tunnel.go +++ b/nitrogo/models/tunnel.go @@ -1,54 +1,54 @@ package models // tunnel configuration structs -type Tunneltrafficpolicy struct { +type TunnelTrafficPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` - Clienttransactions int `json:"clienttransactions,omitempty"` - Clientttlb int `json:"clientttlb,omitempty"` + ClientTransactions int `json:"clienttransactions,omitempty"` + ClientTTLB int `json:"clientttlb,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Logaction string `json:"logaction,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Rxbytes int `json:"rxbytes,omitempty"` - Servertransactions int `json:"servertransactions,omitempty"` - Serverttlb int `json:"serverttlb,omitempty"` - Txbytes int `json:"txbytes,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + RxBytes int `json:"rxbytes,omitempty"` + ServerTransactions int `json:"servertransactions,omitempty"` + ServerTTLB int `json:"serverttlb,omitempty"` + TxBytes int `json:"txbytes,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type TunnelglobalBinding struct { - TunnelglobalTunneltrafficpolicyBinding []interface{} `json:"tunnelglobal_tunneltrafficpolicy_binding,omitempty"` +type TunnelGlobalBinding struct { + TunnelGlobalTunnelTrafficPolicyBinding []interface{} `json:"tunnelglobal_tunneltrafficpolicy_binding,omitempty"` } -type TunneltrafficpolicyBinding struct { +type TunnelTrafficPolicyBinding struct { Name string `json:"name,omitempty"` - TunneltrafficpolicyTunnelglobalBinding []interface{} `json:"tunneltrafficpolicy_tunnelglobal_binding,omitempty"` + TunnelTrafficPolicyTunnelGlobalBinding []interface{} `json:"tunneltrafficpolicy_tunnelglobal_binding,omitempty"` } -type TunneltrafficpolicyTunnelglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type TunnelTrafficPolicyTunnelGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type TunnelglobalTunneltrafficpolicyBinding struct { +type TunnelGlobalTunnelTrafficPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` - Policytype string `json:"policytype,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` + PolicyType string `json:"policytype,omitempty"` Priority int `json:"priority,omitempty"` State string `json:"state,omitempty"` TypeField string `json:"type,omitempty"` diff --git a/nitrogo/models/ulfd.go b/nitrogo/models/ulfd.go index 6bce1ef..1bc1cc5 100644 --- a/nitrogo/models/ulfd.go +++ b/nitrogo/models/ulfd.go @@ -1,9 +1,9 @@ package models // ulfd configuration structs -type Ulfdserver struct { +type ULFDServer struct { Count float64 `json:"__count,omitempty"` - Loggerip string `json:"loggerip,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + LoggerIP string `json:"loggerip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` State string `json:"state,omitempty"` } diff --git a/nitrogo/models/urlfiltering.go b/nitrogo/models/urlfiltering.go index 47058fa..784c68b 100644 --- a/nitrogo/models/urlfiltering.go +++ b/nitrogo/models/urlfiltering.go @@ -4,33 +4,33 @@ package models -type Urlfilteringparameter struct { - Hoursbetweendbupdates int `json:"hoursbetweendbupdates,omitempty"` - Timeofdaytoupdatedb string `json:"timeofdaytoupdatedb,omitempty"` - Localdatabasethreads int `json:"localdatabasethreads,omitempty"` - Cloudhost string `json:"cloudhost,omitempty"` - Seeddbpath string `json:"seeddbpath,omitempty"` - Maxnumberofcloudthreads string `json:"maxnumberofcloudthreads,omitempty"` - Cloudkeepalivetimeout string `json:"cloudkeepalivetimeout,omitempty"` - Cloudserverconnecttimeout string `json:"cloudserverconnecttimeout,omitempty"` - Clouddblookuptimeout string `json:"clouddblookuptimeout,omitempty"` - Proxyhostip string `json:"proxyhostip,omitempty"` - Proxyport string `json:"proxyport,omitempty"` - Proxyusername string `json:"proxyusername,omitempty"` - Proxypassword string `json:"proxypassword,omitempty"` - Seeddbsizelevel string `json:"seeddbsizelevel,omitempty"` +type URLFilteringParameter struct { + HoursBetweenDBUpdates int `json:"hoursbetweendbupdates,omitempty"` + TimeOfDayToUpdateDB string `json:"timeofdaytoupdatedb,omitempty"` + LocalDatabaseThreads int `json:"localdatabasethreads,omitempty"` + CloudHost string `json:"cloudhost,omitempty"` + SeedDBPath string `json:"seeddbpath,omitempty"` + MaxNumberOfCloudThreads string `json:"maxnumberofcloudthreads,omitempty"` + CloudKeepAliveTimeout string `json:"cloudkeepalivetimeout,omitempty"` + CloudServerConnectTimeout string `json:"cloudserverconnecttimeout,omitempty"` + CloudDBLookupTimeout string `json:"clouddblookuptimeout,omitempty"` + ProxyHostIP string `json:"proxyhostip,omitempty"` + ProxyPort string `json:"proxyport,omitempty"` + ProxyUsername string `json:"proxyusername,omitempty"` + ProxyPassword string `json:"proxypassword,omitempty"` + SeedDBSizeLevel string `json:"seeddbsizelevel,omitempty"` } -type Urlfilteringcategories struct { +type URLFilteringCategories struct { Group string `json:"group,omitempty"` Categories string `json:"categories,omitempty"` } -type Urlfilteringcategorization struct { - Url string `json:"url,omitempty"` +type URLFilteringCategorization struct { + URL string `json:"url,omitempty"` Categorization string `json:"categorization,omitempty"` } -type Urlfilteringcategorygroups struct { - Categorygroups string `json:"categorygroups,omitempty"` +type URLFilteringCategoryGroups struct { + CategoryGroups string `json:"categorygroups,omitempty"` } diff --git a/nitrogo/models/user.go b/nitrogo/models/user.go index e9c4bd9..71b7170 100644 --- a/nitrogo/models/user.go +++ b/nitrogo/models/user.go @@ -1,30 +1,30 @@ package models // user configuration structs -type Uservserver struct { +type UserVServer struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Curstate string `json:"curstate,omitempty"` - Defaultlb string `json:"defaultlb,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` + CurState string `json:"curstate,omitempty"` + DefaultLB string `json:"defaultlb,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` Params string `json:"Params,omitempty"` Port int `json:"port,omitempty"` State string `json:"state,omitempty"` - Statechangetimemsec int `json:"statechangetimemsec,omitempty"` - Statechangetimesec string `json:"statechangetimesec,omitempty"` - Tickssincelaststatechange int `json:"tickssincelaststatechange,omitempty"` - Userprotocol string `json:"userprotocol,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + UserProtocol string `json:"userprotocol,omitempty"` Value string `json:"value,omitempty"` } -type Userprotocol struct { +type UserProtocol struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Extension string `json:"extension,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Transport string `json:"transport,omitempty"` } diff --git a/nitrogo/models/utility.go b/nitrogo/models/utility.go index e649f7c..b30146f 100644 --- a/nitrogo/models/utility.go +++ b/nitrogo/models/utility.go @@ -2,17 +2,17 @@ package models // utility configuration structs type Raid struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } type Install struct { A bool `json:"a,omitempty"` Async bool `json:"Async,omitempty"` - Enhancedupgrade bool `json:"enhancedupgrade,omitempty"` - Id int `json:"id,omitempty"` + EnhancedUpgrade bool `json:"enhancedupgrade,omitempty"` + ID int `json:"id,omitempty"` L bool `json:"l,omitempty"` - Resizeswapvar bool `json:"resizeswapvar,omitempty"` - Url string `json:"url,omitempty"` + ResizeSwapVar bool `json:"resizeswapvar,omitempty"` + URL string `json:"url,omitempty"` Y bool `json:"y,omitempty"` } @@ -22,7 +22,7 @@ type Traceroute6 struct { M int `json:"m,omitempty"` N bool `json:"n,omitempty"` P int `json:"p,omitempty"` - Packetlen int `json:"packetlen,omitempty"` + PacketLen int `json:"packetlen,omitempty"` Q int `json:"q,omitempty"` R bool `json:"r,omitempty"` Response string `json:"response,omitempty"` @@ -47,19 +47,19 @@ type Ping struct { T1 int `json:"t,omitempty"` } -type Techsupport struct { - Adss bool `json:"adss,omitempty"` - Authtoken string `json:"authtoken,omitempty"` - Casenumber string `json:"casenumber,omitempty"` +type TechSupport struct { + ADSS bool `json:"adss,omitempty"` + AuthToken string `json:"authtoken,omitempty"` + CaseNumber string `json:"casenumber,omitempty"` Description string `json:"description,omitempty"` File string `json:"file,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Nodes []interface{} `json:"nodes,omitempty"` - Partitionname string `json:"partitionname,omitempty"` + PartitionName string `json:"partitionname,omitempty"` Proxy string `json:"proxy,omitempty"` Response string `json:"response,omitempty"` Scope string `json:"scope,omitempty"` - Servername string `json:"servername,omitempty"` + ServerName string `json:"servername,omitempty"` Time string `json:"time,omitempty"` Upload bool `json:"upload,omitempty"` } @@ -71,7 +71,7 @@ type Traceroute struct { N bool `json:"n,omitempty"` P string `json:"P,omitempty"` P1 int `json:"p,omitempty"` - Packetlen int `json:"packetlen,omitempty"` + PacketLen int `json:"packetlen,omitempty"` Q int `json:"q,omitempty"` R bool `json:"r,omitempty"` Response string `json:"response,omitempty"` @@ -83,41 +83,41 @@ type Traceroute struct { W int `json:"w,omitempty"` } -type Callhome struct { - Anomalydetection string `json:"anomalydetection,omitempty"` - Callhomestatus []string `json:"callhomestatus,omitempty"` - Emailaddress string `json:"emailaddress,omitempty"` - Flashfirstfail string `json:"flashfirstfail,omitempty"` - Flashlatestfailure string `json:"flashlatestfailure,omitempty"` - Hbcustominterval int `json:"hbcustominterval,omitempty"` - Hddfirstfail string `json:"hddfirstfail,omitempty"` - Hddlatestfailure string `json:"hddlatestfailure,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Memthrefirstanomaly string `json:"memthrefirstanomaly,omitempty"` - Memthrelatestanomaly string `json:"memthrelatestanomaly,omitempty"` +type CallHome struct { + AnomalyDetection string `json:"anomalydetection,omitempty"` + CallHomeStatus []string `json:"callhomestatus,omitempty"` + EmailAddress string `json:"emailaddress,omitempty"` + FlashFirstFail string `json:"flashfirstfail,omitempty"` + FlashLatestFailure string `json:"flashlatestfailure,omitempty"` + HBCustomInterval int `json:"hbcustominterval,omitempty"` + HDDFirstFail string `json:"hddfirstfail,omitempty"` + HDDLatestFailure string `json:"hddlatestfailure,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + MemThreFirstAnomaly string `json:"memthrefirstanomaly,omitempty"` + MemThreLatestAnomaly string `json:"memthrelatestanomaly,omitempty"` Mode string `json:"mode,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` Port int `json:"port,omitempty"` - Powfirstfail string `json:"powfirstfail,omitempty"` - Powlatestfailure string `json:"powlatestfailure,omitempty"` - Proxyauthservice string `json:"proxyauthservice,omitempty"` - Proxymode string `json:"proxymode,omitempty"` - Restartlatestfail string `json:"restartlatestfail,omitempty"` - Rlfirsthighdrop string `json:"rlfirsthighdrop,omitempty"` - Rllatesthighdrop string `json:"rllatesthighdrop,omitempty"` - Sslcardfirstfailure string `json:"sslcardfirstfailure,omitempty"` - Sslcardlatestfailure string `json:"sslcardlatestfailure,omitempty"` + PowFirstFail string `json:"powfirstfail,omitempty"` + PowLatestFailure string `json:"powlatestfailure,omitempty"` + ProxyAuthService string `json:"proxyauthservice,omitempty"` + ProxyMode string `json:"proxymode,omitempty"` + RestartLatestFail string `json:"restartlatestfail,omitempty"` + RLFirstHighDrop string `json:"rlfirsthighdrop,omitempty"` + RLLatestHighDrop string `json:"rllatesthighdrop,omitempty"` + SSLCardFirstFailure string `json:"sslcardfirstfailure,omitempty"` + SSLCardLatestFailure string `json:"sslcardlatestfailure,omitempty"` } -type Filesystemencryption struct { - Effectivestate string `json:"effectivestate,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Ntimes0flash int `json:"ntimes0flash,omitempty"` - Ntimes0var int `json:"ntimes0var,omitempty"` +type FileSystemEncryption struct { + EffectiveState string `json:"effectivestate,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NTimes0Flash int `json:"ntimes0flash,omitempty"` + NTimes0Var int `json:"ntimes0var,omitempty"` Passphrase string `json:"passphrase,omitempty"` - Supportedstate string `json:"supportedstate,omitempty"` + SupportedState string `json:"supportedstate,omitempty"` } type Ping6 struct { diff --git a/nitrogo/models/videooptimization.go b/nitrogo/models/videooptimization.go index 75dc302..b8291c4 100644 --- a/nitrogo/models/videooptimization.go +++ b/nitrogo/models/videooptimization.go @@ -1,234 +1,234 @@ package models // videooptimization configuration structs -type VideooptimizationglobalpacingBinding struct { - VideooptimizationglobalpacingVideooptimizationpacingpolicyBinding []interface{} `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding,omitempty"` +type VideoOptimizationGlobalPacingBinding struct { + VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding []interface{} `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding,omitempty"` } -type Videooptimizationparameter struct { - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Quicpacingrate int `json:"quicpacingrate,omitempty"` - Randomsamplingpercentage float64 `json:"randomsamplingpercentage,omitempty"` +type VideoOptimizationParameter struct { + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + QUICPacingRate int `json:"quicpacingrate,omitempty"` + RandomSamplingPercentage float64 `json:"randomsamplingpercentage,omitempty"` } -type VideooptimizationpacingpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - VideooptimizationpacingpolicylabelPolicybindingBinding []interface{} `json:"videooptimizationpacingpolicylabel_policybinding_binding,omitempty"` - VideooptimizationpacingpolicylabelVideooptimizationpacingpolicyBinding []interface{} `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding,omitempty"` +type VideoOptimizationPacingPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + VideoOptimizationPacingPolicyLabelPolicyBindingBinding []interface{} `json:"videooptimizationpacingpolicylabel_policybinding_binding,omitempty"` + VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding []interface{} `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding,omitempty"` } -type Videooptimizationpacingaction struct { +type VideoOptimizationPacingAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rate int `json:"rate,omitempty"` - Referencecount int `json:"referencecount,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Videooptimizationdetectionpolicylabel struct { +type VideoOptimizationDetectionPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationglobaldetectionVideooptimizationdetectionpolicyBinding struct { - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding struct { + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type VideooptimizationdetectionpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type VideoOptimizationDetectionPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationpacingpolicyLbvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type VideoOptimizationPacingPolicyLBVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Videooptimizationpacingpolicy struct { +type VideoOptimizationPacingPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type VideooptimizationdetectionpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationDetectionPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationdetectionpolicyBinding struct { +type VideoOptimizationDetectionPolicyBinding struct { Name string `json:"name,omitempty"` - VideooptimizationdetectionpolicyLbvserverBinding []interface{} `json:"videooptimizationdetectionpolicy_lbvserver_binding,omitempty"` - VideooptimizationdetectionpolicyVideooptimizationglobaldetectionBinding []interface{} `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding,omitempty"` + VideoOptimizationDetectionPolicyLBVServerBinding []interface{} `json:"videooptimizationdetectionpolicy_lbvserver_binding,omitempty"` + VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding []interface{} `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding,omitempty"` } -type VideooptimizationglobalpacingVideooptimizationpacingpolicyBinding struct { - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding struct { + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policyname string `json:"policyname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` TypeField string `json:"type,omitempty"` } -type VideooptimizationpacingpolicyBinding struct { +type VideoOptimizationPacingPolicyBinding struct { Name string `json:"name,omitempty"` - VideooptimizationpacingpolicyLbvserverBinding []interface{} `json:"videooptimizationpacingpolicy_lbvserver_binding,omitempty"` - VideooptimizationpacingpolicyVideooptimizationglobalpacingBinding []interface{} `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding,omitempty"` + VideoOptimizationPacingPolicyLBVServerBinding []interface{} `json:"videooptimizationpacingpolicy_lbvserver_binding,omitempty"` + VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding []interface{} `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding,omitempty"` } -type VideooptimizationdetectionpolicylabelBinding struct { - Labelname string `json:"labelname,omitempty"` - VideooptimizationdetectionpolicylabelPolicybindingBinding []interface{} `json:"videooptimizationdetectionpolicylabel_policybinding_binding,omitempty"` - VideooptimizationdetectionpolicylabelVideooptimizationdetectionpolicyBinding []interface{} `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding,omitempty"` +type VideoOptimizationDetectionPolicyLabelBinding struct { + LabelName string `json:"labelname,omitempty"` + VideoOptimizationDetectionPolicyLabelPolicyBindingBinding []interface{} `json:"videooptimizationdetectionpolicylabel_policybinding_binding,omitempty"` + VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding []interface{} `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding,omitempty"` } -type VideooptimizationglobaldetectionBinding struct { - VideooptimizationglobaldetectionVideooptimizationdetectionpolicyBinding []interface{} `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding,omitempty"` +type VideoOptimizationGlobalDetectionBinding struct { + VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding []interface{} `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding,omitempty"` } -type VideooptimizationpacingpolicylabelPolicybindingBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationPacingPolicyLabelPolicyBindingBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationdetectionpolicylabelVideooptimizationdetectionpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Videooptimizationdetectionaction struct { +type VideoOptimizationDetectionAction struct { Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Referencecount int `json:"referencecount,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` TypeField string `json:"type,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type VideooptimizationpacingpolicyVideooptimizationglobalpacingBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationpacingpolicylabelVideooptimizationpacingpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` +type VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Invoke bool `json:"invoke,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Policyname string `json:"policyname,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` } -type Videooptimizationdetectionpolicy struct { +type VideoOptimizationDetectionPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type Videooptimizationpacingpolicylabel struct { +type VideoOptimizationPacingPolicyLabel struct { Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` Hits int `json:"hits,omitempty"` - InvokeLabelname string `json:"invoke_labelname,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Numpol int `json:"numpol,omitempty"` - Policylabeltype string `json:"policylabeltype,omitempty"` + InvokeLabelName string `json:"invoke_labelname,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NumPol int `json:"numpol,omitempty"` + PolicyLabelType string `json:"policylabeltype,omitempty"` Priority int `json:"priority,omitempty"` } -type VideooptimizationdetectionpolicyVideooptimizationglobaldetectionBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Labelname string `json:"labelname,omitempty"` - Labeltype string `json:"labeltype,omitempty"` +type VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } diff --git a/nitrogo/models/vpn.go b/nitrogo/models/vpn.go index bcd1eb1..28bb9db 100644 --- a/nitrogo/models/vpn.go +++ b/nitrogo/models/vpn.go @@ -1,1439 +1,1439 @@ package models // vpn configuration structs -type VpnclientlessaccesspolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNClientlessAccessPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnglobalAuditnslogpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuditNSLogPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnicadtlsconnection struct { - Channelnumber int `json:"channelnumber,omitempty"` +type VPNICADTLSConnection struct { + ChannelNumber int `json:"channelnumber,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` Domain string `json:"domain,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Peid int `json:"peid,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PeID int `json:"peid,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcPort int `json:"srcport,omitempty"` Username string `json:"username,omitempty"` } -type Vpnstoreinfo struct { +type VPNStoreInfo struct { Count float64 `json:"__count,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Storeapisupport string `json:"storeapisupport,omitempty"` - Storelist string `json:"storelist,omitempty"` - Storeserverissf string `json:"storeserverissf,omitempty"` - Storeserverstatus string `json:"storeserverstatus,omitempty"` - Storestatus string `json:"storestatus,omitempty"` - Url string `json:"url,omitempty"` -} - -type VpnglobalIntranetipBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetip string `json:"intranetip,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + StoreAPISupport string `json:"storeapisupport,omitempty"` + StoreList string `json:"storelist,omitempty"` + StoreServerIsSF string `json:"storeserverissf,omitempty"` + StoreServerStatus string `json:"storeserverstatus,omitempty"` + StoreStatus string `json:"storestatus,omitempty"` + URL string `json:"url,omitempty"` +} + +type VPNGlobalIntranetIPBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` Netmask string `json:"netmask,omitempty"` } -type VpnurlpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNURLPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnurlpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNURLPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Vpneula struct { +type VPNEULA struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type VpnsessionpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNSessionPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnsessionpolicyBinding struct { +type VPNSessionPolicyBinding struct { Name string `json:"name,omitempty"` - VpnsessionpolicyAaagroupBinding []interface{} `json:"vpnsessionpolicy_aaagroup_binding,omitempty"` - VpnsessionpolicyAaauserBinding []interface{} `json:"vpnsessionpolicy_aaauser_binding,omitempty"` - VpnsessionpolicyVpnglobalBinding []interface{} `json:"vpnsessionpolicy_vpnglobal_binding,omitempty"` - VpnsessionpolicyVpnvserverBinding []interface{} `json:"vpnsessionpolicy_vpnvserver_binding,omitempty"` + VPNSessionPolicyAAAGroupBinding []interface{} `json:"vpnsessionpolicy_aaagroup_binding,omitempty"` + VPNSessionPolicyAAAUserBinding []interface{} `json:"vpnsessionpolicy_aaauser_binding,omitempty"` + VPNSessionPolicyVPNGlobalBinding []interface{} `json:"vpnsessionpolicy_vpnglobal_binding,omitempty"` + VPNSessionPolicyVPNVServerBinding []interface{} `json:"vpnsessionpolicy_vpnvserver_binding,omitempty"` } -type VpnvserverCspolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerCSPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuditsyslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuditSyslogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpnclientlessaccesspolicyBinding struct { +type VPNGlobalVPNClientlessAccessPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Globalbindtype string `json:"globalbindtype,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` + GlobalBindType string `json:"globalbindtype,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` TypeField string `json:"type,omitempty"` } -type VpnglobalSecureprivateaccessurlBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` +type VPNGlobalSecurePrivateAccessURLBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + SecurePrivateAccessURL string `json:"secureprivateaccessurl,omitempty"` } -type VpnvserverAppcontrollerBinding struct { - Acttype int `json:"acttype,omitempty"` - Appcontroller string `json:"appcontroller,omitempty"` +type VPNVServerAppControllerBinding struct { + ActType int `json:"acttype,omitempty"` + AppController string `json:"appcontroller,omitempty"` Name string `json:"name,omitempty"` } -type VpnglobalVpnsecureprivateaccessprofileBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` +type VPNGlobalVPNSecurePrivateAccessProfileBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` } -type VpnurlpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNURLPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnglobalAuthenticationcertpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationCertPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAnalyticsprofileBinding struct { - Analyticsprofile string `json:"analyticsprofile,omitempty"` +type VPNVServerAnalyticsProfileBinding struct { + AnalyticsProfile string `json:"analyticsprofile,omitempty"` Name string `json:"name,omitempty"` } -type Vpnintranetapplication struct { - Clientapplication []string `json:"clientapplication,omitempty"` +type VPNIntranetApplication struct { + ClientApplication []string `json:"clientapplication,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport string `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort string `json:"destport,omitempty"` Hostname string `json:"hostname,omitempty"` Interception string `json:"interception,omitempty"` - Intranetapplication string `json:"intranetapplication,omitempty"` - Ipaddress string `json:"ipaddress,omitempty"` - Iprange string `json:"iprange,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IPRange string `json:"iprange,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Protocol string `json:"protocol,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` + SpoofIIP string `json:"spoofiip,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcPort int `json:"srcport,omitempty"` } -type VpnglobalVpntrafficpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalVPNTrafficPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnurlaction struct { - Actualurl string `json:"actualurl,omitempty"` - Applicationtype string `json:"applicationtype,omitempty"` - Clientlessaccess string `json:"clientlessaccess,omitempty"` +type VPNURLAction struct { + ActualURL string `json:"actualurl,omitempty"` + ApplicationType string `json:"applicationtype,omitempty"` + ClientlessAccess string `json:"clientlessaccess,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Iconurl string `json:"iconurl,omitempty"` - Linkname string `json:"linkname,omitempty"` + IconURL string `json:"iconurl,omitempty"` + LinkName string `json:"linkname,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Ssotype string `json:"ssotype,omitempty"` - Vservername string `json:"vservername,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SAMLSSOProfile string `json:"samlssoprofile,omitempty"` + SSOType string `json:"ssotype,omitempty"` + VServerName string `json:"vservername,omitempty"` } -type Vpnpcoipconnection struct { +type VPNPCoIPConnection struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Peid int `json:"peid,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PeID int `json:"peid,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcPort int `json:"srcport,omitempty"` Username string `json:"username,omitempty"` } -type VpnvserverVpneulaBinding struct { - Acttype int `json:"acttype,omitempty"` - Eula string `json:"eula,omitempty"` +type VPNVServerVPNEULABinding struct { + ActType int `json:"acttype,omitempty"` + EULA string `json:"eula,omitempty"` Name string `json:"name,omitempty"` } -type VpnvserverAuthenticationnegotiatepolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationNegotiatePolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnsfconfig struct { +type VPNSFConfig struct { Count float64 `json:"__count,omitempty"` Filename string `json:"filename,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Vserver []string `json:"vserver,omitempty"` } -type Vpnportaltheme struct { - Basetheme string `json:"basetheme,omitempty"` +type VPNPortalTheme struct { + BaseTheme string `json:"basetheme,omitempty"` Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type VpntrafficpolicyVpnvserverBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNTrafficPolicyVPNVServerBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnglobalAuthenticationldappolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationLDAPPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpneulaBinding struct { - Eula string `json:"eula,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type Vpnparameter struct { - Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` - Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` - Allowedlogingroups string `json:"allowedlogingroups,omitempty"` - Allprotocolproxy string `json:"allprotocolproxy,omitempty"` - Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` - Apptokentimeout int `json:"apptokentimeout,omitempty"` - Authorizationgroup string `json:"authorizationgroup,omitempty"` - Autoproxyurl string `json:"autoproxyurl,omitempty"` - Backendcertvalidation string `json:"backendcertvalidation,omitempty"` - Backenddtls12 string `json:"backenddtls12,omitempty"` - Backendserversni string `json:"backendserversni,omitempty"` - Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` - Clientchoices string `json:"clientchoices,omitempty"` - Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` - Clientconfiguration []string `json:"clientconfiguration,omitempty"` - Clientdebug string `json:"clientdebug,omitempty"` - Clientidletimeout int `json:"clientidletimeout,omitempty"` - Clientidletimeoutwarning int `json:"clientidletimeoutwarning,omitempty"` - Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` - Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` - Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` - Clientoptions []string `json:"clientoptions,omitempty"` - Clientsecurity string `json:"clientsecurity,omitempty"` - Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` - Clientsecuritylog string `json:"clientsecuritylog,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` - Clientversions string `json:"clientversions,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Emailhome string `json:"emailhome,omitempty"` - Encryptcsecexp string `json:"encryptcsecexp,omitempty"` - Epaclienttype string `json:"epaclienttype,omitempty"` - Forcecleanup []string `json:"forcecleanup,omitempty"` - Forcedtimeout int `json:"forcedtimeout,omitempty"` - Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` - Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` - Ftpproxy string `json:"ftpproxy,omitempty"` - Gopherproxy string `json:"gopherproxy,omitempty"` - Homepage string `json:"homepage,omitempty"` - Httpport []interface{} `json:"httpport,omitempty"` - Httpproxy string `json:"httpproxy,omitempty"` - Httptrackconnproxy string `json:"httptrackconnproxy,omitempty"` - Icaproxy string `json:"icaproxy,omitempty"` - Icasessiontimeout string `json:"icasessiontimeout,omitempty"` - Icauseraccounting string `json:"icauseraccounting,omitempty"` - Iconwithreceiver string `json:"iconwithreceiver,omitempty"` - Iipdnssuffix string `json:"iipdnssuffix,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Killconnections string `json:"killconnections,omitempty"` - Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` - Locallanaccess string `json:"locallanaccess,omitempty"` - Loginscript string `json:"loginscript,omitempty"` - Logoutscript string `json:"logoutscript,omitempty"` - Macpluginupgrade string `json:"macpluginupgrade,omitempty"` - Maxiipperuser int `json:"maxiipperuser,omitempty"` - Mdxtokentimeout int `json:"mdxtokentimeout,omitempty"` +type VPNGlobalVPNEULABinding struct { + EULA string `json:"eula,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` +} + +type VPNParameter struct { + AccessRestrictedPageRedirect string `json:"accessrestrictedpageredirect,omitempty"` + AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` + AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` + AllProtocolProxy string `json:"allprotocolproxy,omitempty"` + AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` + AppTokenTimeout int `json:"apptokentimeout,omitempty"` + AuthorizationGroup string `json:"authorizationgroup,omitempty"` + AutoProxyURL string `json:"autoproxyurl,omitempty"` + BackendCertValidation string `json:"backendcertvalidation,omitempty"` + BackendDTLS12 string `json:"backenddtls12,omitempty"` + BackendServerSNI string `json:"backendserversni,omitempty"` + CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` + ClientChoices string `json:"clientchoices,omitempty"` + ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` + ClientConfiguration []string `json:"clientconfiguration,omitempty"` + ClientDebug string `json:"clientdebug,omitempty"` + ClientIDleTimeout int `json:"clientidletimeout,omitempty"` + ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` + ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` + ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` + ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` + ClientOptions []string `json:"clientoptions,omitempty"` + ClientSecurity string `json:"clientsecurity,omitempty"` + ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` + ClientSecurityLog string `json:"clientsecuritylog,omitempty"` + ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` + ClientVersions string `json:"clientversions,omitempty"` + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` + DevicePosture string `json:"deviceposture,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + EmailHome string `json:"emailhome,omitempty"` + EncryptCSECExp string `json:"encryptcsecexp,omitempty"` + EPAClientType string `json:"epaclienttype,omitempty"` + ForceCleanup []string `json:"forcecleanup,omitempty"` + ForcedTimeout int `json:"forcedtimeout,omitempty"` + ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` + FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` + FTPProxy string `json:"ftpproxy,omitempty"` + GopherProxy string `json:"gopherproxy,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPPort []interface{} `json:"httpport,omitempty"` + HTTPProxy string `json:"httpproxy,omitempty"` + HTTPTrackConnProxy string `json:"httptrackconnproxy,omitempty"` + ICAProxy string `json:"icaproxy,omitempty"` + ICASessionTimeout string `json:"icasessiontimeout,omitempty"` + ICAUserAccounting string `json:"icauseraccounting,omitempty"` + IconWithReceiver string `json:"iconwithreceiver,omitempty"` + IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KillConnections string `json:"killconnections,omitempty"` + LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` + LocalLANAccess string `json:"locallanaccess,omitempty"` + LoginScript string `json:"loginscript,omitempty"` + LogoutScript string `json:"logoutscript,omitempty"` + MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` + MaxIIPPerUser int `json:"maxiipperuser,omitempty"` + MDXTokenTimeout int `json:"mdxtokentimeout,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ntdomain string `json:"ntdomain,omitempty"` - Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NTDomain string `json:"ntdomain,omitempty"` + PCoIPProfileName string `json:"pcoipprofilename,omitempty"` Proxy string `json:"proxy,omitempty"` - Proxyexception string `json:"proxyexception,omitempty"` - Proxylocalbypass string `json:"proxylocalbypass,omitempty"` - Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` - Rfc1918 string `json:"rfc1918,omitempty"` - Samesite string `json:"samesite,omitempty"` - Securebrowse string `json:"securebrowse,omitempty"` - Secureprivateaccess string `json:"secureprivateaccess,omitempty"` - Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Smartgroup string `json:"smartgroup,omitempty"` - Socksproxy string `json:"socksproxy,omitempty"` - Splitdns string `json:"splitdns,omitempty"` - Splittunnel string `json:"splittunnel,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Sslproxy string `json:"sslproxy,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Storefronturl string `json:"storefronturl,omitempty"` - Transparentinterception string `json:"transparentinterception,omitempty"` - Uitheme string `json:"uitheme,omitempty"` - Useiip string `json:"useiip,omitempty"` - Usemip string `json:"usemip,omitempty"` - Userdomains string `json:"userdomains,omitempty"` - Vpnsessionpolicybindtype string `json:"vpnsessionpolicybindtype,omitempty"` - Vpnsessionpolicycount int `json:"vpnsessionpolicycount,omitempty"` - Wihome string `json:"wihome,omitempty"` - Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` - Windowsautologon string `json:"windowsautologon,omitempty"` - Windowsclienttype string `json:"windowsclienttype,omitempty"` - Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` + ProxyException string `json:"proxyexception,omitempty"` + ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` + RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` + RFC1918 string `json:"rfc1918,omitempty"` + SameSite string `json:"samesite,omitempty"` + SecureBrowse string `json:"securebrowse,omitempty"` + SecurePrivateAccess string `json:"secureprivateaccess,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SmartGroup string `json:"smartgroup,omitempty"` + SocksProxy string `json:"socksproxy,omitempty"` + SplitDNS string `json:"splitdns,omitempty"` + SplitTunnel string `json:"splittunnel,omitempty"` + SpoofIIP string `json:"spoofiip,omitempty"` + SSLProxy string `json:"sslproxy,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + StoreFrontURL string `json:"storefronturl,omitempty"` + TransparentInterception string `json:"transparentinterception,omitempty"` + UITheme string `json:"uitheme,omitempty"` + UseIIP string `json:"useiip,omitempty"` + UseMIP string `json:"usemip,omitempty"` + UserDomains string `json:"userdomains,omitempty"` + VPNSessionPolicyBindType string `json:"vpnsessionpolicybindtype,omitempty"` + VPNSessionPolicyCount int `json:"vpnsessionpolicycount,omitempty"` + WIHome string `json:"wihome,omitempty"` + WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` + WindowsAutoLogon string `json:"windowsautologon,omitempty"` + WindowsClientType string `json:"windowsclienttype,omitempty"` + WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` Winsip string `json:"winsip,omitempty"` - Wiportalmode string `json:"wiportalmode,omitempty"` + WIPortalMode string `json:"wiportalmode,omitempty"` } -type Vpnclientlessaccessprofile struct { +type VPNClientlessAccessProfile struct { Builtin []string `json:"builtin,omitempty"` - Clientconsumedcookies string `json:"clientconsumedcookies,omitempty"` + ClientConsumedCookies string `json:"clientconsumedcookies,omitempty"` Count float64 `json:"__count,omitempty"` - Cssrewritepolicylabel string `json:"cssrewritepolicylabel,omitempty"` + CSSRewritePolicyLabel string `json:"cssrewritepolicylabel,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` - Javascriptrewritepolicylabel string `json:"javascriptrewritepolicylabel,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` - Regexforfindingcustomurls string `json:"regexforfindingcustomurls,omitempty"` - Regexforfindingurlincss string `json:"regexforfindingurlincss,omitempty"` - Regexforfindingurlinjavascript string `json:"regexforfindingurlinjavascript,omitempty"` - Regexforfindingurlinxcomponent string `json:"regexforfindingurlinxcomponent,omitempty"` - Regexforfindingurlinxml string `json:"regexforfindingurlinxml,omitempty"` - Reqhdrrewritepolicylabel string `json:"reqhdrrewritepolicylabel,omitempty"` - Requirepersistentcookie string `json:"requirepersistentcookie,omitempty"` - Reshdrrewritepolicylabel string `json:"reshdrrewritepolicylabel,omitempty"` - Urlrewritepolicylabel string `json:"urlrewritepolicylabel,omitempty"` - Xcomponentrewritepolicylabel string `json:"xcomponentrewritepolicylabel,omitempty"` - Xmlrewritepolicylabel string `json:"xmlrewritepolicylabel,omitempty"` -} - -type Vpnsamlssoprofile struct { - Assertionconsumerserviceurl string `json:"assertionconsumerserviceurl,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` + JavascriptRewritePolicyLabel string `json:"javascriptrewritepolicylabel,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` + RegexForFindingCustomURLs string `json:"regexforfindingcustomurls,omitempty"` + RegexForFindingURLInCSS string `json:"regexforfindingurlincss,omitempty"` + RegexForFindingURLInJavascript string `json:"regexforfindingurlinjavascript,omitempty"` + RegexForFindingURLInXComponent string `json:"regexforfindingurlinxcomponent,omitempty"` + RegexForFindingURLInXML string `json:"regexforfindingurlinxml,omitempty"` + ReqHdrRewritePolicyLabel string `json:"reqhdrrewritepolicylabel,omitempty"` + RequirePersistentCookie string `json:"requirepersistentcookie,omitempty"` + ResHdrRewritePolicyLabel string `json:"reshdrrewritepolicylabel,omitempty"` + URLRewritePolicyLabel string `json:"urlrewritepolicylabel,omitempty"` + XComponentRewritePolicyLabel string `json:"xcomponentrewritepolicylabel,omitempty"` + XMLRewritePolicyLabel string `json:"xmlrewritepolicylabel,omitempty"` +} + +type VPNSAMLSSOProfile struct { + AssertionConsumerServiceURL string `json:"assertionconsumerserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` - Attribute10expr string `json:"attribute10expr,omitempty"` - Attribute10format string `json:"attribute10format,omitempty"` - Attribute10friendlyname string `json:"attribute10friendlyname,omitempty"` + Attribute10Expr string `json:"attribute10expr,omitempty"` + Attribute10Format string `json:"attribute10format,omitempty"` + Attribute10FriendlyName string `json:"attribute10friendlyname,omitempty"` Attribute11 string `json:"attribute11,omitempty"` - Attribute11expr string `json:"attribute11expr,omitempty"` - Attribute11format string `json:"attribute11format,omitempty"` - Attribute11friendlyname string `json:"attribute11friendlyname,omitempty"` + Attribute11Expr string `json:"attribute11expr,omitempty"` + Attribute11Format string `json:"attribute11format,omitempty"` + Attribute11FriendlyName string `json:"attribute11friendlyname,omitempty"` Attribute12 string `json:"attribute12,omitempty"` - Attribute12expr string `json:"attribute12expr,omitempty"` - Attribute12format string `json:"attribute12format,omitempty"` - Attribute12friendlyname string `json:"attribute12friendlyname,omitempty"` + Attribute12Expr string `json:"attribute12expr,omitempty"` + Attribute12Format string `json:"attribute12format,omitempty"` + Attribute12FriendlyName string `json:"attribute12friendlyname,omitempty"` Attribute13 string `json:"attribute13,omitempty"` - Attribute13expr string `json:"attribute13expr,omitempty"` - Attribute13format string `json:"attribute13format,omitempty"` - Attribute13friendlyname string `json:"attribute13friendlyname,omitempty"` + Attribute13Expr string `json:"attribute13expr,omitempty"` + Attribute13Format string `json:"attribute13format,omitempty"` + Attribute13FriendlyName string `json:"attribute13friendlyname,omitempty"` Attribute14 string `json:"attribute14,omitempty"` - Attribute14expr string `json:"attribute14expr,omitempty"` - Attribute14format string `json:"attribute14format,omitempty"` - Attribute14friendlyname string `json:"attribute14friendlyname,omitempty"` + Attribute14Expr string `json:"attribute14expr,omitempty"` + Attribute14Format string `json:"attribute14format,omitempty"` + Attribute14FriendlyName string `json:"attribute14friendlyname,omitempty"` Attribute15 string `json:"attribute15,omitempty"` - Attribute15expr string `json:"attribute15expr,omitempty"` - Attribute15format string `json:"attribute15format,omitempty"` - Attribute15friendlyname string `json:"attribute15friendlyname,omitempty"` + Attribute15Expr string `json:"attribute15expr,omitempty"` + Attribute15Format string `json:"attribute15format,omitempty"` + Attribute15FriendlyName string `json:"attribute15friendlyname,omitempty"` Attribute16 string `json:"attribute16,omitempty"` - Attribute16expr string `json:"attribute16expr,omitempty"` - Attribute16format string `json:"attribute16format,omitempty"` - Attribute16friendlyname string `json:"attribute16friendlyname,omitempty"` - Attribute1expr string `json:"attribute1expr,omitempty"` - Attribute1format string `json:"attribute1format,omitempty"` - Attribute1friendlyname string `json:"attribute1friendlyname,omitempty"` + Attribute16Expr string `json:"attribute16expr,omitempty"` + Attribute16Format string `json:"attribute16format,omitempty"` + Attribute16FriendlyName string `json:"attribute16friendlyname,omitempty"` + Attribute1Expr string `json:"attribute1expr,omitempty"` + Attribute1Format string `json:"attribute1format,omitempty"` + Attribute1FriendlyName string `json:"attribute1friendlyname,omitempty"` Attribute2 string `json:"attribute2,omitempty"` - Attribute2expr string `json:"attribute2expr,omitempty"` - Attribute2format string `json:"attribute2format,omitempty"` - Attribute2friendlyname string `json:"attribute2friendlyname,omitempty"` + Attribute2Expr string `json:"attribute2expr,omitempty"` + Attribute2Format string `json:"attribute2format,omitempty"` + Attribute2FriendlyName string `json:"attribute2friendlyname,omitempty"` Attribute3 string `json:"attribute3,omitempty"` - Attribute3expr string `json:"attribute3expr,omitempty"` - Attribute3format string `json:"attribute3format,omitempty"` - Attribute3friendlyname string `json:"attribute3friendlyname,omitempty"` + Attribute3Expr string `json:"attribute3expr,omitempty"` + Attribute3Format string `json:"attribute3format,omitempty"` + Attribute3FriendlyName string `json:"attribute3friendlyname,omitempty"` Attribute4 string `json:"attribute4,omitempty"` - Attribute4expr string `json:"attribute4expr,omitempty"` - Attribute4format string `json:"attribute4format,omitempty"` - Attribute4friendlyname string `json:"attribute4friendlyname,omitempty"` + Attribute4Expr string `json:"attribute4expr,omitempty"` + Attribute4Format string `json:"attribute4format,omitempty"` + Attribute4FriendlyName string `json:"attribute4friendlyname,omitempty"` Attribute5 string `json:"attribute5,omitempty"` - Attribute5expr string `json:"attribute5expr,omitempty"` - Attribute5format string `json:"attribute5format,omitempty"` - Attribute5friendlyname string `json:"attribute5friendlyname,omitempty"` + Attribute5Expr string `json:"attribute5expr,omitempty"` + Attribute5Format string `json:"attribute5format,omitempty"` + Attribute5FriendlyName string `json:"attribute5friendlyname,omitempty"` Attribute6 string `json:"attribute6,omitempty"` - Attribute6expr string `json:"attribute6expr,omitempty"` - Attribute6format string `json:"attribute6format,omitempty"` - Attribute6friendlyname string `json:"attribute6friendlyname,omitempty"` + Attribute6Expr string `json:"attribute6expr,omitempty"` + Attribute6Format string `json:"attribute6format,omitempty"` + Attribute6FriendlyName string `json:"attribute6friendlyname,omitempty"` Attribute7 string `json:"attribute7,omitempty"` - Attribute7expr string `json:"attribute7expr,omitempty"` - Attribute7format string `json:"attribute7format,omitempty"` - Attribute7friendlyname string `json:"attribute7friendlyname,omitempty"` + Attribute7Expr string `json:"attribute7expr,omitempty"` + Attribute7Format string `json:"attribute7format,omitempty"` + Attribute7FriendlyName string `json:"attribute7friendlyname,omitempty"` Attribute8 string `json:"attribute8,omitempty"` - Attribute8expr string `json:"attribute8expr,omitempty"` - Attribute8format string `json:"attribute8format,omitempty"` - Attribute8friendlyname string `json:"attribute8friendlyname,omitempty"` + Attribute8Expr string `json:"attribute8expr,omitempty"` + Attribute8Format string `json:"attribute8format,omitempty"` + Attribute8FriendlyName string `json:"attribute8friendlyname,omitempty"` Attribute9 string `json:"attribute9,omitempty"` - Attribute9expr string `json:"attribute9expr,omitempty"` - Attribute9format string `json:"attribute9format,omitempty"` - Attribute9friendlyname string `json:"attribute9friendlyname,omitempty"` + Attribute9Expr string `json:"attribute9expr,omitempty"` + Attribute9Format string `json:"attribute9format,omitempty"` + Attribute9FriendlyName string `json:"attribute9friendlyname,omitempty"` Audience string `json:"audience,omitempty"` Count float64 `json:"__count,omitempty"` - Digestmethod string `json:"digestmethod,omitempty"` - Encryptassertion string `json:"encryptassertion,omitempty"` - Encryptionalgorithm string `json:"encryptionalgorithm,omitempty"` + DigestMethod string `json:"digestmethod,omitempty"` + EncryptAssertion string `json:"encryptassertion,omitempty"` + EncryptionAlgorithm string `json:"encryptionalgorithm,omitempty"` Name string `json:"name,omitempty"` - Nameidexpr string `json:"nameidexpr,omitempty"` - Nameidformat string `json:"nameidformat,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Relaystaterule string `json:"relaystaterule,omitempty"` - Samlissuername string `json:"samlissuername,omitempty"` - Samlsigningcertname string `json:"samlsigningcertname,omitempty"` - Samlspcertname string `json:"samlspcertname,omitempty"` - Sendpassword string `json:"sendpassword,omitempty"` - Signassertion string `json:"signassertion,omitempty"` - Signaturealg string `json:"signaturealg,omitempty"` - Signatureservice string `json:"signatureservice,omitempty"` - Skewtime int `json:"skewtime,omitempty"` -} - -type VpnvserverAuditnslogpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` + NameIDExpr string `json:"nameidexpr,omitempty"` + NameIDFormat string `json:"nameidformat,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RelayStateRule string `json:"relaystaterule,omitempty"` + SAMLIssuerName string `json:"samlissuername,omitempty"` + SAMLSigningCertName string `json:"samlsigningcertname,omitempty"` + SAMLSPCertName string `json:"samlspcertname,omitempty"` + SendPassword string `json:"sendpassword,omitempty"` + SignAssertion string `json:"signassertion,omitempty"` + SignatureAlg string `json:"signaturealg,omitempty"` + SignatureService string `json:"signatureservice,omitempty"` + SkewTime int `json:"skewtime,omitempty"` +} + +type VPNVServerAuditNSLogPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpnsessionpolicyBinding struct { +type VPNGlobalVPNSessionPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnpcoipvserverprofile struct { +type VPNPCoIPVServerProfile struct { Count float64 `json:"__count,omitempty"` - Logindomain string `json:"logindomain,omitempty"` + LoginDomain string `json:"logindomain,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Udpport int `json:"udpport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + UDPPort int `json:"udpport,omitempty"` } -type VpnsessionpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNSessionPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnvserverIntranetip6Binding struct { - Acttype int `json:"acttype,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` +type VPNVServerIntranetIP6Binding struct { + ActType int `json:"acttype,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` Name string `json:"name,omitempty"` - Numaddr int `json:"numaddr,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } -type VpnvserverFeopolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerFEOPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalAuditsyslogpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuditSyslogPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverVpnsessionpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerVPNSessionPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverVpnurlBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerVPNURLBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Urlname string `json:"urlname,omitempty"` + URLName string `json:"urlname,omitempty"` } -type VpnvserverVpnurlpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerVPNURLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationwebauthpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationWebAuthPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnclientlessaccesspolicy struct { +type VPNClientlessAccessPolicy struct { Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` Description string `json:"description,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` - Isdefault bool `json:"isdefault,omitempty"` + IsDefault bool `json:"isdefault,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Profilename string `json:"profilename,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ProfileName string `json:"profilename,omitempty"` Rule string `json:"rule,omitempty"` - Undefaction string `json:"undefaction,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefAction string `json:"undefaction,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type VpnvserverAaapreauthenticationpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAAAPreauthenticationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpntrafficpolicyBinding struct { +type VPNTrafficPolicyBinding struct { Name string `json:"name,omitempty"` - VpntrafficpolicyAaagroupBinding []interface{} `json:"vpntrafficpolicy_aaagroup_binding,omitempty"` - VpntrafficpolicyAaauserBinding []interface{} `json:"vpntrafficpolicy_aaauser_binding,omitempty"` - VpntrafficpolicyVpnglobalBinding []interface{} `json:"vpntrafficpolicy_vpnglobal_binding,omitempty"` - VpntrafficpolicyVpnvserverBinding []interface{} `json:"vpntrafficpolicy_vpnvserver_binding,omitempty"` + VPNTrafficPolicyAAAGroupBinding []interface{} `json:"vpntrafficpolicy_aaagroup_binding,omitempty"` + VPNTrafficPolicyAAAUserBinding []interface{} `json:"vpntrafficpolicy_aaauser_binding,omitempty"` + VPNTrafficPolicyVPNGlobalBinding []interface{} `json:"vpntrafficpolicy_vpnglobal_binding,omitempty"` + VPNTrafficPolicyVPNVServerBinding []interface{} `json:"vpntrafficpolicy_vpnvserver_binding,omitempty"` } -type VpnvserverAuthenticationsamlidppolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationSAMLIDPPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnnexthopserver struct { +type VPNNextHopServer struct { Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nexthopfqdn string `json:"nexthopfqdn,omitempty"` - Nexthopip string `json:"nexthopip,omitempty"` - Nexthopport int `json:"nexthopport,omitempty"` - Resaddresstype string `json:"resaddresstype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NextHopFQDN string `json:"nexthopfqdn,omitempty"` + NextHopIP string `json:"nexthopip,omitempty"` + NextHopPort int `json:"nexthopport,omitempty"` + ResAddressType string `json:"resaddresstype,omitempty"` Secure string `json:"secure,omitempty"` } -type Vpnurlpolicy struct { +type VPNURLPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Logaction string `json:"logaction,omitempty"` + LogAction string `json:"logaction,omitempty"` Name string `json:"name,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` - Undefhits int `json:"undefhits,omitempty"` + UndefHits int `json:"undefhits,omitempty"` } -type VpnglobalVpnurlpolicyBinding struct { +type VPNGlobalVPNURLPolicyBinding struct { Builtin []string `json:"builtin,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnsessionpolicy struct { +type VPNSessionPolicy struct { Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type Vpnurl struct { - Actualurl string `json:"actualurl,omitempty"` - Appjson string `json:"appjson,omitempty"` - Applicationtype string `json:"applicationtype,omitempty"` - Clientlessaccess string `json:"clientlessaccess,omitempty"` +type VPNURL struct { + ActualURL string `json:"actualurl,omitempty"` + AppJSON string `json:"appjson,omitempty"` + ApplicationType string `json:"applicationtype,omitempty"` + ClientlessAccess string `json:"clientlessaccess,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Iconurl string `json:"iconurl,omitempty"` - Linkname string `json:"linkname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Ssotype string `json:"ssotype,omitempty"` - Urlname string `json:"urlname,omitempty"` - Vservername string `json:"vservername,omitempty"` -} - -type VpnglobalAuthenticationpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` + IconURL string `json:"iconurl,omitempty"` + LinkName string `json:"linkname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SAMLSSOProfile string `json:"samlssoprofile,omitempty"` + SSOType string `json:"ssotype,omitempty"` + URLName string `json:"urlname,omitempty"` + VServerName string `json:"vservername,omitempty"` +} + +type VPNGlobalAuthenticationPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationtacacspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationTACACSPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpnnexthopserverBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Nexthopserver string `json:"nexthopserver,omitempty"` +type VPNGlobalVPNNextHopServerBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextHopServer string `json:"nexthopserver,omitempty"` } -type VpnvserverIcapolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerICAPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationcertpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationCertPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationsamlpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationSAMLPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnurlpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNURLPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpntrafficpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNTrafficPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnvserverCachepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerCachePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpnportalthemeBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Portaltheme string `json:"portaltheme,omitempty"` +type VPNGlobalVPNPortalThemeBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } -type VpnvserverSharefileserverBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerShareFileServerBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Sharefile string `json:"sharefile,omitempty"` + ShareFile string `json:"sharefile,omitempty"` } -type VpnglobalAuthenticationsamlpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationSAMLPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpntrafficpolicy struct { +type VPNTrafficPolicy struct { Action string `json:"action,omitempty"` Count float64 `json:"__count,omitempty"` - Expressiontype string `json:"expressiontype,omitempty"` + ExpressionType string `json:"expressiontype,omitempty"` Hits int `json:"hits,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` Rule string `json:"rule,omitempty"` } -type VpnvserverAuthenticationloginschemapolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationLoginSchemaPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverVpntrafficpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerVPNTrafficPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnsessionpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNSessionPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnvserverVpnintranetapplicationBinding struct { - Acttype int `json:"acttype,omitempty"` - Intranetapplication string `json:"intranetapplication,omitempty"` +type VPNVServerVPNIntranetApplicationBinding struct { + ActType int `json:"acttype,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` Name string `json:"name,omitempty"` } -type VpnvserverAppflowpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAppFlowPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalAuthenticationradiuspolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationRADIUSPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnclientlessaccesspolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNClientlessAccessPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnglobalAuthenticationlocalpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationLocalPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalVpnurlBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Urlname string `json:"urlname,omitempty"` +type VPNGlobalVPNURLBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + URLName string `json:"urlname,omitempty"` } -type VpnsessionpolicyAaagroupBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNSessionPolicyAAAGroupBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnvserverBinding struct { +type VPNVServerBinding struct { Name string `json:"name,omitempty"` - VpnvserverAaapreauthenticationpolicyBinding []interface{} `json:"vpnvserver_aaapreauthenticationpolicy_binding,omitempty"` - VpnvserverAnalyticsprofileBinding []interface{} `json:"vpnvserver_analyticsprofile_binding,omitempty"` - VpnvserverAppcontrollerBinding []interface{} `json:"vpnvserver_appcontroller_binding,omitempty"` - VpnvserverAppflowpolicyBinding []interface{} `json:"vpnvserver_appflowpolicy_binding,omitempty"` - VpnvserverAppfwpolicyBinding []interface{} `json:"vpnvserver_appfwpolicy_binding,omitempty"` - VpnvserverAuditnslogpolicyBinding []interface{} `json:"vpnvserver_auditnslogpolicy_binding,omitempty"` - VpnvserverAuditsyslogpolicyBinding []interface{} `json:"vpnvserver_auditsyslogpolicy_binding,omitempty"` - VpnvserverAuthenticationcertpolicyBinding []interface{} `json:"vpnvserver_authenticationcertpolicy_binding,omitempty"` - VpnvserverAuthenticationdfapolicyBinding []interface{} `json:"vpnvserver_authenticationdfapolicy_binding,omitempty"` - VpnvserverAuthenticationldappolicyBinding []interface{} `json:"vpnvserver_authenticationldappolicy_binding,omitempty"` - VpnvserverAuthenticationlocalpolicyBinding []interface{} `json:"vpnvserver_authenticationlocalpolicy_binding,omitempty"` - VpnvserverAuthenticationloginschemapolicyBinding []interface{} `json:"vpnvserver_authenticationloginschemapolicy_binding,omitempty"` - VpnvserverAuthenticationnegotiatepolicyBinding []interface{} `json:"vpnvserver_authenticationnegotiatepolicy_binding,omitempty"` - VpnvserverAuthenticationoauthidppolicyBinding []interface{} `json:"vpnvserver_authenticationoauthidppolicy_binding,omitempty"` - VpnvserverAuthenticationpolicyBinding []interface{} `json:"vpnvserver_authenticationpolicy_binding,omitempty"` - VpnvserverAuthenticationradiuspolicyBinding []interface{} `json:"vpnvserver_authenticationradiuspolicy_binding,omitempty"` - VpnvserverAuthenticationsamlidppolicyBinding []interface{} `json:"vpnvserver_authenticationsamlidppolicy_binding,omitempty"` - VpnvserverAuthenticationsamlpolicyBinding []interface{} `json:"vpnvserver_authenticationsamlpolicy_binding,omitempty"` - VpnvserverAuthenticationtacacspolicyBinding []interface{} `json:"vpnvserver_authenticationtacacspolicy_binding,omitempty"` - VpnvserverAuthenticationwebauthpolicyBinding []interface{} `json:"vpnvserver_authenticationwebauthpolicy_binding,omitempty"` - VpnvserverCachepolicyBinding []interface{} `json:"vpnvserver_cachepolicy_binding,omitempty"` - VpnvserverCspolicyBinding []interface{} `json:"vpnvserver_cspolicy_binding,omitempty"` - VpnvserverFeopolicyBinding []interface{} `json:"vpnvserver_feopolicy_binding,omitempty"` - VpnvserverIcapolicyBinding []interface{} `json:"vpnvserver_icapolicy_binding,omitempty"` - VpnvserverIntranetip6Binding []interface{} `json:"vpnvserver_intranetip6_binding,omitempty"` - VpnvserverIntranetipBinding []interface{} `json:"vpnvserver_intranetip_binding,omitempty"` - VpnvserverResponderpolicyBinding []interface{} `json:"vpnvserver_responderpolicy_binding,omitempty"` - VpnvserverRewritepolicyBinding []interface{} `json:"vpnvserver_rewritepolicy_binding,omitempty"` - VpnvserverSecureprivateaccessurlBinding []interface{} `json:"vpnvserver_secureprivateaccessurl_binding,omitempty"` - VpnvserverSharefileserverBinding []interface{} `json:"vpnvserver_sharefileserver_binding,omitempty"` - VpnvserverStaserverBinding []interface{} `json:"vpnvserver_staserver_binding,omitempty"` - VpnvserverVpnclientlessaccesspolicyBinding []interface{} `json:"vpnvserver_vpnclientlessaccesspolicy_binding,omitempty"` - VpnvserverVpnepaprofileBinding []interface{} `json:"vpnvserver_vpnepaprofile_binding,omitempty"` - VpnvserverVpneulaBinding []interface{} `json:"vpnvserver_vpneula_binding,omitempty"` - VpnvserverVpnintranetapplicationBinding []interface{} `json:"vpnvserver_vpnintranetapplication_binding,omitempty"` - VpnvserverVpnnexthopserverBinding []interface{} `json:"vpnvserver_vpnnexthopserver_binding,omitempty"` - VpnvserverVpnportalthemeBinding []interface{} `json:"vpnvserver_vpnportaltheme_binding,omitempty"` - VpnvserverVpnsecureprivateaccessprofileBinding []interface{} `json:"vpnvserver_vpnsecureprivateaccessprofile_binding,omitempty"` - VpnvserverVpnsessionpolicyBinding []interface{} `json:"vpnvserver_vpnsessionpolicy_binding,omitempty"` - VpnvserverVpntrafficpolicyBinding []interface{} `json:"vpnvserver_vpntrafficpolicy_binding,omitempty"` - VpnvserverVpnurlBinding []interface{} `json:"vpnvserver_vpnurl_binding,omitempty"` - VpnvserverVpnurlpolicyBinding []interface{} `json:"vpnvserver_vpnurlpolicy_binding,omitempty"` -} - -type Vpnsessionaction struct { - Advancedclientlessvpnmode string `json:"advancedclientlessvpnmode,omitempty"` - Allowedlogingroups string `json:"allowedlogingroups,omitempty"` - Allprotocolproxy string `json:"allprotocolproxy,omitempty"` - Alwaysonprofilename string `json:"alwaysonprofilename,omitempty"` - Authorizationgroup string `json:"authorizationgroup,omitempty"` - Autoproxyurl string `json:"autoproxyurl,omitempty"` + VPNVServerAAAPreauthenticationPolicyBinding []interface{} `json:"vpnvserver_aaapreauthenticationpolicy_binding,omitempty"` + VPNVServerAnalyticsProfileBinding []interface{} `json:"vpnvserver_analyticsprofile_binding,omitempty"` + VPNVServerAppControllerBinding []interface{} `json:"vpnvserver_appcontroller_binding,omitempty"` + VPNVServerAppFlowPolicyBinding []interface{} `json:"vpnvserver_appflowpolicy_binding,omitempty"` + VPNVServerAppFWPolicyBinding []interface{} `json:"vpnvserver_appfwpolicy_binding,omitempty"` + VPNVServerAuditNSLogPolicyBinding []interface{} `json:"vpnvserver_auditnslogpolicy_binding,omitempty"` + VPNVServerAuditSyslogPolicyBinding []interface{} `json:"vpnvserver_auditsyslogpolicy_binding,omitempty"` + VPNVServerAuthenticationCertPolicyBinding []interface{} `json:"vpnvserver_authenticationcertpolicy_binding,omitempty"` + VPNVServerAuthenticationDFAPolicyBinding []interface{} `json:"vpnvserver_authenticationdfapolicy_binding,omitempty"` + VPNVServerAuthenticationLDAPPolicyBinding []interface{} `json:"vpnvserver_authenticationldappolicy_binding,omitempty"` + VPNVServerAuthenticationLocalPolicyBinding []interface{} `json:"vpnvserver_authenticationlocalpolicy_binding,omitempty"` + VPNVServerAuthenticationLoginSchemaPolicyBinding []interface{} `json:"vpnvserver_authenticationloginschemapolicy_binding,omitempty"` + VPNVServerAuthenticationNegotiatePolicyBinding []interface{} `json:"vpnvserver_authenticationnegotiatepolicy_binding,omitempty"` + VPNVServerAuthenticationOAuthIDPPolicyBinding []interface{} `json:"vpnvserver_authenticationoauthidppolicy_binding,omitempty"` + VPNVServerAuthenticationPolicyBinding []interface{} `json:"vpnvserver_authenticationpolicy_binding,omitempty"` + VPNVServerAuthenticationRADIUSPolicyBinding []interface{} `json:"vpnvserver_authenticationradiuspolicy_binding,omitempty"` + VPNVServerAuthenticationSAMLIDPPolicyBinding []interface{} `json:"vpnvserver_authenticationsamlidppolicy_binding,omitempty"` + VPNVServerAuthenticationSAMLPolicyBinding []interface{} `json:"vpnvserver_authenticationsamlpolicy_binding,omitempty"` + VPNVServerAuthenticationTACACSPolicyBinding []interface{} `json:"vpnvserver_authenticationtacacspolicy_binding,omitempty"` + VPNVServerAuthenticationWebAuthPolicyBinding []interface{} `json:"vpnvserver_authenticationwebauthpolicy_binding,omitempty"` + VPNVServerCachePolicyBinding []interface{} `json:"vpnvserver_cachepolicy_binding,omitempty"` + VPNVServerCSPolicyBinding []interface{} `json:"vpnvserver_cspolicy_binding,omitempty"` + VPNVServerFEOPolicyBinding []interface{} `json:"vpnvserver_feopolicy_binding,omitempty"` + VPNVServerICAPolicyBinding []interface{} `json:"vpnvserver_icapolicy_binding,omitempty"` + VPNVServerIntranetIP6Binding []interface{} `json:"vpnvserver_intranetip6_binding,omitempty"` + VPNVServerIntranetIPBinding []interface{} `json:"vpnvserver_intranetip_binding,omitempty"` + VPNVServerResponderPolicyBinding []interface{} `json:"vpnvserver_responderpolicy_binding,omitempty"` + VPNVServerRewritePolicyBinding []interface{} `json:"vpnvserver_rewritepolicy_binding,omitempty"` + VPNVServerSecurePrivateAccessURLBinding []interface{} `json:"vpnvserver_secureprivateaccessurl_binding,omitempty"` + VPNVServerShareFileServerBinding []interface{} `json:"vpnvserver_sharefileserver_binding,omitempty"` + VPNVServerSTAServerBinding []interface{} `json:"vpnvserver_staserver_binding,omitempty"` + VPNVServerVPNClientlessAccessPolicyBinding []interface{} `json:"vpnvserver_vpnclientlessaccesspolicy_binding,omitempty"` + VPNVServerVPNEPAProfileBinding []interface{} `json:"vpnvserver_vpnepaprofile_binding,omitempty"` + VPNVServerVPNEULABinding []interface{} `json:"vpnvserver_vpneula_binding,omitempty"` + VPNVServerVPNIntranetApplicationBinding []interface{} `json:"vpnvserver_vpnintranetapplication_binding,omitempty"` + VPNVServerVPNNextHopServerBinding []interface{} `json:"vpnvserver_vpnnexthopserver_binding,omitempty"` + VPNVServerVPNPortalThemeBinding []interface{} `json:"vpnvserver_vpnportaltheme_binding,omitempty"` + VPNVServerVPNSecurePrivateAccessProfileBinding []interface{} `json:"vpnvserver_vpnsecureprivateaccessprofile_binding,omitempty"` + VPNVServerVPNSessionPolicyBinding []interface{} `json:"vpnvserver_vpnsessionpolicy_binding,omitempty"` + VPNVServerVPNTrafficPolicyBinding []interface{} `json:"vpnvserver_vpntrafficpolicy_binding,omitempty"` + VPNVServerVPNURLBinding []interface{} `json:"vpnvserver_vpnurl_binding,omitempty"` + VPNVServerVPNURLPolicyBinding []interface{} `json:"vpnvserver_vpnurlpolicy_binding,omitempty"` +} + +type VPNSessionAction struct { + AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` + AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` + AllProtocolProxy string `json:"allprotocolproxy,omitempty"` + AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` + AuthorizationGroup string `json:"authorizationgroup,omitempty"` + AutoProxyURL string `json:"autoproxyurl,omitempty"` Builtin []string `json:"builtin,omitempty"` - Citrixreceiverhome string `json:"citrixreceiverhome,omitempty"` - Clientchoices string `json:"clientchoices,omitempty"` - Clientcleanupprompt string `json:"clientcleanupprompt,omitempty"` - Clientconfiguration []string `json:"clientconfiguration,omitempty"` - Clientdebug string `json:"clientdebug,omitempty"` - Clientidletimeout int `json:"clientidletimeout,omitempty"` - Clientidletimeoutwarning int `json:"clientidletimeoutwarning,omitempty"` - Clientlessmodeurlencoding string `json:"clientlessmodeurlencoding,omitempty"` - Clientlesspersistentcookie string `json:"clientlesspersistentcookie,omitempty"` - Clientlessvpnmode string `json:"clientlessvpnmode,omitempty"` - Clientoptions string `json:"clientoptions,omitempty"` - Clientsecurity string `json:"clientsecurity,omitempty"` - Clientsecuritygroup string `json:"clientsecuritygroup,omitempty"` - Clientsecuritylog string `json:"clientsecuritylog,omitempty"` - Clientsecuritymessage string `json:"clientsecuritymessage,omitempty"` + CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` + ClientChoices string `json:"clientchoices,omitempty"` + ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` + ClientConfiguration []string `json:"clientconfiguration,omitempty"` + ClientDebug string `json:"clientdebug,omitempty"` + ClientIDleTimeout int `json:"clientidletimeout,omitempty"` + ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` + ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` + ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` + ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` + ClientOptions string `json:"clientoptions,omitempty"` + ClientSecurity string `json:"clientsecurity,omitempty"` + ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` + ClientSecurityLog string `json:"clientsecuritylog,omitempty"` + ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` Count float64 `json:"__count,omitempty"` - Defaultauthorizationaction string `json:"defaultauthorizationaction,omitempty"` - Dnsvservername string `json:"dnsvservername,omitempty"` - Emailhome string `json:"emailhome,omitempty"` - Epaclienttype string `json:"epaclienttype,omitempty"` + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + EmailHome string `json:"emailhome,omitempty"` + EPAClientType string `json:"epaclienttype,omitempty"` Feature string `json:"feature,omitempty"` - Forcecleanup []string `json:"forcecleanup,omitempty"` - Forcedtimeout int `json:"forcedtimeout,omitempty"` - Forcedtimeoutwarning int `json:"forcedtimeoutwarning,omitempty"` - Fqdnspoofedip string `json:"fqdnspoofedip,omitempty"` - Ftpproxy string `json:"ftpproxy,omitempty"` - Gopherproxy string `json:"gopherproxy,omitempty"` - Homepage string `json:"homepage,omitempty"` - Httpport []interface{} `json:"httpport,omitempty"` - Httpproxy string `json:"httpproxy,omitempty"` - Icaproxy string `json:"icaproxy,omitempty"` - Iconwithreceiver string `json:"iconwithreceiver,omitempty"` - Iipdnssuffix string `json:"iipdnssuffix,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` - Killconnections string `json:"killconnections,omitempty"` - Linuxpluginupgrade string `json:"linuxpluginupgrade,omitempty"` - Locallanaccess string `json:"locallanaccess,omitempty"` - Loginscript string `json:"loginscript,omitempty"` - Logoutscript string `json:"logoutscript,omitempty"` - Macpluginupgrade string `json:"macpluginupgrade,omitempty"` + ForceCleanup []string `json:"forcecleanup,omitempty"` + ForcedTimeout int `json:"forcedtimeout,omitempty"` + ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` + FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` + FTPProxy string `json:"ftpproxy,omitempty"` + GopherProxy string `json:"gopherproxy,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPPort []interface{} `json:"httpport,omitempty"` + HTTPProxy string `json:"httpproxy,omitempty"` + ICAProxy string `json:"icaproxy,omitempty"` + IconWithReceiver string `json:"iconwithreceiver,omitempty"` + IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KillConnections string `json:"killconnections,omitempty"` + LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` + LocalLANAccess string `json:"locallanaccess,omitempty"` + LoginScript string `json:"loginscript,omitempty"` + LogoutScript string `json:"logoutscript,omitempty"` + MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ntdomain string `json:"ntdomain,omitempty"` - Pcoipprofilename string `json:"pcoipprofilename,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NTDomain string `json:"ntdomain,omitempty"` + PCoIPProfileName string `json:"pcoipprofilename,omitempty"` Proxy string `json:"proxy,omitempty"` - Proxyexception string `json:"proxyexception,omitempty"` - Proxylocalbypass string `json:"proxylocalbypass,omitempty"` - Rdpclientprofilename string `json:"rdpclientprofilename,omitempty"` - Rfc1918 string `json:"rfc1918,omitempty"` - Securebrowse string `json:"securebrowse,omitempty"` - Sesstimeout int `json:"sesstimeout,omitempty"` - Sfgatewayauthtype string `json:"sfgatewayauthtype,omitempty"` - Smartgroup string `json:"smartgroup,omitempty"` - Socksproxy string `json:"socksproxy,omitempty"` - Splitdns string `json:"splitdns,omitempty"` - Splittunnel string `json:"splittunnel,omitempty"` - Spoofiip string `json:"spoofiip,omitempty"` - Sslproxy string `json:"sslproxy,omitempty"` - Sso string `json:"sso,omitempty"` - Ssocredential string `json:"ssocredential,omitempty"` - Storefronturl string `json:"storefronturl,omitempty"` - Transparentinterception string `json:"transparentinterception,omitempty"` - Useiip string `json:"useiip,omitempty"` - Usemip string `json:"usemip,omitempty"` - Useraccounting string `json:"useraccounting,omitempty"` - Wihome string `json:"wihome,omitempty"` - Wihomeaddresstype string `json:"wihomeaddresstype,omitempty"` - Windowsautologon string `json:"windowsautologon,omitempty"` - Windowsclienttype string `json:"windowsclienttype,omitempty"` - Windowspluginupgrade string `json:"windowspluginupgrade,omitempty"` - Winsip string `json:"winsip,omitempty"` - Wiportalmode string `json:"wiportalmode,omitempty"` -} - -type VpnvserverAuthenticationldappolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` + ProxyException string `json:"proxyexception,omitempty"` + ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` + RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` + RFC1918 string `json:"rfc1918,omitempty"` + SecureBrowse string `json:"securebrowse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SFGatewayAuthType string `json:"sfgatewayauthtype,omitempty"` + SmartGroup string `json:"smartgroup,omitempty"` + SocksProxy string `json:"socksproxy,omitempty"` + SplitDNS string `json:"splitdns,omitempty"` + SplitTunnel string `json:"splittunnel,omitempty"` + SpoofIIP string `json:"spoofiip,omitempty"` + SSLProxy string `json:"sslproxy,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + StoreFrontURL string `json:"storefronturl,omitempty"` + TransparentInterception string `json:"transparentinterception,omitempty"` + UseIIP string `json:"useiip,omitempty"` + UseMIP string `json:"usemip,omitempty"` + UserAccounting string `json:"useraccounting,omitempty"` + WIHome string `json:"wihome,omitempty"` + WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` + WindowsAutoLogon string `json:"windowsautologon,omitempty"` + WindowsClientType string `json:"windowsclienttype,omitempty"` + WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` + Winsip string `json:"winsip,omitempty"` + WIPortalMode string `json:"wiportalmode,omitempty"` +} + +type VPNVServerAuthenticationLDAPPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpntrafficaction struct { - Apptimeout int `json:"apptimeout,omitempty"` +type VPNTrafficAction struct { + AppTimeout int `json:"apptimeout,omitempty"` Count float64 `json:"__count,omitempty"` - Formssoaction string `json:"formssoaction,omitempty"` + FormSSOAction string `json:"formssoaction,omitempty"` Fta string `json:"fta,omitempty"` Hdx string `json:"hdx,omitempty"` - Kcdaccount string `json:"kcdaccount,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Passwdexpression string `json:"passwdexpression,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PasswdExpression string `json:"passwdexpression,omitempty"` Proxy string `json:"proxy,omitempty"` Qual string `json:"qual,omitempty"` - Samlssoprofile string `json:"samlssoprofile,omitempty"` - Sso string `json:"sso,omitempty"` - Userexpression string `json:"userexpression,omitempty"` + SAMLSSOProfile string `json:"samlssoprofile,omitempty"` + SSO string `json:"sso,omitempty"` + UserExpression string `json:"userexpression,omitempty"` Wanscaler string `json:"wanscaler,omitempty"` } -type VpnvserverVpnsecureprivateaccessprofileBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerVPNSecurePrivateAccessProfileBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Secureprivateaccessprofile string `json:"secureprivateaccessprofile,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` } -type VpnvserverVpnepaprofileBinding struct { - Acttype int `json:"acttype,omitempty"` - Epaprofile string `json:"epaprofile,omitempty"` - Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` +type VPNVServerVPNEPAProfileBinding struct { + ActType int `json:"acttype,omitempty"` + EPAProfile string `json:"epaprofile,omitempty"` + EPAProfileOptional bool `json:"epaprofileoptional,omitempty"` Name string `json:"name,omitempty"` } -type Vpnformssoaction struct { - Actionurl string `json:"actionurl,omitempty"` +type VPNFormSSOAction struct { + ActionURL string `json:"actionurl,omitempty"` Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` - Namevaluepair string `json:"namevaluepair,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nvtype string `json:"nvtype,omitempty"` - Passwdfield string `json:"passwdfield,omitempty"` - Responsesize int `json:"responsesize,omitempty"` - Ssosuccessrule string `json:"ssosuccessrule,omitempty"` - Submitmethod string `json:"submitmethod,omitempty"` - Userfield string `json:"userfield,omitempty"` -} - -type VpnvserverAuthenticationradiuspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` + NameValuePair string `json:"namevaluepair,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NvType string `json:"nvtype,omitempty"` + PasswdField string `json:"passwdfield,omitempty"` + ResponseSize int `json:"responsesize,omitempty"` + SSOSuccessRule string `json:"ssosuccessrule,omitempty"` + SubmitMethod string `json:"submitmethod,omitempty"` + UserField string `json:"userfield,omitempty"` +} + +type VPNVServerAuthenticationRADIUSPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationlocalpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationLocalPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpntrafficpolicyVpnglobalBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNTrafficPolicyVPNGlobalBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type VpnurlpolicyBinding struct { +type VPNURLPolicyBinding struct { Name string `json:"name,omitempty"` - VpnurlpolicyAaagroupBinding []interface{} `json:"vpnurlpolicy_aaagroup_binding,omitempty"` - VpnurlpolicyAaauserBinding []interface{} `json:"vpnurlpolicy_aaauser_binding,omitempty"` - VpnurlpolicyVpnglobalBinding []interface{} `json:"vpnurlpolicy_vpnglobal_binding,omitempty"` - VpnurlpolicyVpnvserverBinding []interface{} `json:"vpnurlpolicy_vpnvserver_binding,omitempty"` + VPNURLPolicyAAAGroupBinding []interface{} `json:"vpnurlpolicy_aaagroup_binding,omitempty"` + VPNURLPolicyAAAUserBinding []interface{} `json:"vpnurlpolicy_aaauser_binding,omitempty"` + VPNURLPolicyVPNGlobalBinding []interface{} `json:"vpnurlpolicy_vpnglobal_binding,omitempty"` + VPNURLPolicyVPNVServerBinding []interface{} `json:"vpnurlpolicy_vpnvserver_binding,omitempty"` } -type VpnvserverResponderpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerResponderPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverSecureprivateaccessurlBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerSecurePrivateAccessURLBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Secureprivateaccessurl string `json:"secureprivateaccessurl,omitempty"` + SecurePrivateAccessURL string `json:"secureprivateaccessurl,omitempty"` } -type VpnvserverAuthenticationpolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalBinding struct { - VpnglobalAppcontrollerBinding []interface{} `json:"vpnglobal_appcontroller_binding,omitempty"` - VpnglobalAppfwpolicyBinding []interface{} `json:"vpnglobal_appfwpolicy_binding,omitempty"` - VpnglobalAuditnslogpolicyBinding []interface{} `json:"vpnglobal_auditnslogpolicy_binding,omitempty"` - VpnglobalAuditsyslogpolicyBinding []interface{} `json:"vpnglobal_auditsyslogpolicy_binding,omitempty"` - VpnglobalAuthenticationcertpolicyBinding []interface{} `json:"vpnglobal_authenticationcertpolicy_binding,omitempty"` - VpnglobalAuthenticationldappolicyBinding []interface{} `json:"vpnglobal_authenticationldappolicy_binding,omitempty"` - VpnglobalAuthenticationlocalpolicyBinding []interface{} `json:"vpnglobal_authenticationlocalpolicy_binding,omitempty"` - VpnglobalAuthenticationnegotiatepolicyBinding []interface{} `json:"vpnglobal_authenticationnegotiatepolicy_binding,omitempty"` - VpnglobalAuthenticationpolicyBinding []interface{} `json:"vpnglobal_authenticationpolicy_binding,omitempty"` - VpnglobalAuthenticationradiuspolicyBinding []interface{} `json:"vpnglobal_authenticationradiuspolicy_binding,omitempty"` - VpnglobalAuthenticationsamlpolicyBinding []interface{} `json:"vpnglobal_authenticationsamlpolicy_binding,omitempty"` - VpnglobalAuthenticationtacacspolicyBinding []interface{} `json:"vpnglobal_authenticationtacacspolicy_binding,omitempty"` - VpnglobalGslbdomainBinding []interface{} `json:"vpnglobal_gslbdomain_binding,omitempty"` - VpnglobalIntranetip6Binding []interface{} `json:"vpnglobal_intranetip6_binding,omitempty"` - VpnglobalIntranetipBinding []interface{} `json:"vpnglobal_intranetip_binding,omitempty"` - VpnglobalSecureprivateaccessurlBinding []interface{} `json:"vpnglobal_secureprivateaccessurl_binding,omitempty"` - VpnglobalSharefileserverBinding []interface{} `json:"vpnglobal_sharefileserver_binding,omitempty"` - VpnglobalSslcertkeyBinding []interface{} `json:"vpnglobal_sslcertkey_binding,omitempty"` - VpnglobalStaserverBinding []interface{} `json:"vpnglobal_staserver_binding,omitempty"` - VpnglobalVpnclientlessaccesspolicyBinding []interface{} `json:"vpnglobal_vpnclientlessaccesspolicy_binding,omitempty"` - VpnglobalVpneulaBinding []interface{} `json:"vpnglobal_vpneula_binding,omitempty"` - VpnglobalVpnintranetapplicationBinding []interface{} `json:"vpnglobal_vpnintranetapplication_binding,omitempty"` - VpnglobalVpnnexthopserverBinding []interface{} `json:"vpnglobal_vpnnexthopserver_binding,omitempty"` - VpnglobalVpnportalthemeBinding []interface{} `json:"vpnglobal_vpnportaltheme_binding,omitempty"` - VpnglobalVpnsecureprivateaccessprofileBinding []interface{} `json:"vpnglobal_vpnsecureprivateaccessprofile_binding,omitempty"` - VpnglobalVpnsessionpolicyBinding []interface{} `json:"vpnglobal_vpnsessionpolicy_binding,omitempty"` - VpnglobalVpntrafficpolicyBinding []interface{} `json:"vpnglobal_vpntrafficpolicy_binding,omitempty"` - VpnglobalVpnurlBinding []interface{} `json:"vpnglobal_vpnurl_binding,omitempty"` - VpnglobalVpnurlpolicyBinding []interface{} `json:"vpnglobal_vpnurlpolicy_binding,omitempty"` -} - -type VpnglobalAppcontrollerBinding struct { - Appcontroller string `json:"appcontroller,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` -} - -type VpnvserverAuthenticationdfapolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNGlobalBinding struct { + VPNGlobalAppControllerBinding []interface{} `json:"vpnglobal_appcontroller_binding,omitempty"` + VPNGlobalAppFWPolicyBinding []interface{} `json:"vpnglobal_appfwpolicy_binding,omitempty"` + VPNGlobalAuditNSLogPolicyBinding []interface{} `json:"vpnglobal_auditnslogpolicy_binding,omitempty"` + VPNGlobalAuditSyslogPolicyBinding []interface{} `json:"vpnglobal_auditsyslogpolicy_binding,omitempty"` + VPNGlobalAuthenticationCertPolicyBinding []interface{} `json:"vpnglobal_authenticationcertpolicy_binding,omitempty"` + VPNGlobalAuthenticationLDAPPolicyBinding []interface{} `json:"vpnglobal_authenticationldappolicy_binding,omitempty"` + VPNGlobalAuthenticationLocalPolicyBinding []interface{} `json:"vpnglobal_authenticationlocalpolicy_binding,omitempty"` + VPNGlobalAuthenticationNegotiatePolicyBinding []interface{} `json:"vpnglobal_authenticationnegotiatepolicy_binding,omitempty"` + VPNGlobalAuthenticationPolicyBinding []interface{} `json:"vpnglobal_authenticationpolicy_binding,omitempty"` + VPNGlobalAuthenticationRADIUSPolicyBinding []interface{} `json:"vpnglobal_authenticationradiuspolicy_binding,omitempty"` + VPNGlobalAuthenticationSAMLPolicyBinding []interface{} `json:"vpnglobal_authenticationsamlpolicy_binding,omitempty"` + VPNGlobalAuthenticationTACACSPolicyBinding []interface{} `json:"vpnglobal_authenticationtacacspolicy_binding,omitempty"` + VPNGlobalGSLBDomainBinding []interface{} `json:"vpnglobal_gslbdomain_binding,omitempty"` + VPNGlobalIntranetIP6Binding []interface{} `json:"vpnglobal_intranetip6_binding,omitempty"` + VPNGlobalIntranetIPBinding []interface{} `json:"vpnglobal_intranetip_binding,omitempty"` + VPNGlobalSecurePrivateAccessURLBinding []interface{} `json:"vpnglobal_secureprivateaccessurl_binding,omitempty"` + VPNGlobalShareFileServerBinding []interface{} `json:"vpnglobal_sharefileserver_binding,omitempty"` + VPNGlobalSSLCertKeyBinding []interface{} `json:"vpnglobal_sslcertkey_binding,omitempty"` + VPNGlobalSTAServerBinding []interface{} `json:"vpnglobal_staserver_binding,omitempty"` + VPNGlobalVPNClientlessAccessPolicyBinding []interface{} `json:"vpnglobal_vpnclientlessaccesspolicy_binding,omitempty"` + VPNGlobalVPNEULABinding []interface{} `json:"vpnglobal_vpneula_binding,omitempty"` + VPNGlobalVPNIntranetApplicationBinding []interface{} `json:"vpnglobal_vpnintranetapplication_binding,omitempty"` + VPNGlobalVPNNextHopServerBinding []interface{} `json:"vpnglobal_vpnnexthopserver_binding,omitempty"` + VPNGlobalVPNPortalThemeBinding []interface{} `json:"vpnglobal_vpnportaltheme_binding,omitempty"` + VPNGlobalVPNSecurePrivateAccessProfileBinding []interface{} `json:"vpnglobal_vpnsecureprivateaccessprofile_binding,omitempty"` + VPNGlobalVPNSessionPolicyBinding []interface{} `json:"vpnglobal_vpnsessionpolicy_binding,omitempty"` + VPNGlobalVPNTrafficPolicyBinding []interface{} `json:"vpnglobal_vpntrafficpolicy_binding,omitempty"` + VPNGlobalVPNURLBinding []interface{} `json:"vpnglobal_vpnurl_binding,omitempty"` + VPNGlobalVPNURLPolicyBinding []interface{} `json:"vpnglobal_vpnurlpolicy_binding,omitempty"` +} + +type VPNGlobalAppControllerBinding struct { + AppController string `json:"appcontroller,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` +} + +type VPNVServerAuthenticationDFAPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnpcoipprofile struct { - Conserverurl string `json:"conserverurl,omitempty"` +type VPNPCoIPProfile struct { + ConServerURL string `json:"conserverurl,omitempty"` Count float64 `json:"__count,omitempty"` - Icvverification string `json:"icvverification,omitempty"` + IcvVerification string `json:"icvverification,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Sessionidletimeout int `json:"sessionidletimeout,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SessionIdleTimeout int `json:"sessionidletimeout,omitempty"` } -type VpnglobalSharefileserverBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Sharefile string `json:"sharefile,omitempty"` +type VPNGlobalShareFileServerBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + ShareFile string `json:"sharefile,omitempty"` } -type VpntrafficpolicyAaauserBinding struct { - Activepolicy int `json:"activepolicy,omitempty"` - Boundto string `json:"boundto,omitempty"` +type VPNTrafficPolicyAAAUserBinding struct { + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` } -type Vpnalwaysonprofile struct { - Clientcontrol string `json:"clientcontrol,omitempty"` +type VPNAlwaysOnProfile struct { + ClientControl string `json:"clientcontrol,omitempty"` Count float64 `json:"__count,omitempty"` - Locationbasedvpn string `json:"locationbasedvpn,omitempty"` + LocationBasedVPN string `json:"locationbasedvpn,omitempty"` Name string `json:"name,omitempty"` - Networkaccessonvpnfailure string `json:"networkaccessonvpnfailure,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NetworkAccessOnVPNFailure string `json:"networkaccessonvpnfailure,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type VpnvserverVpnnexthopserverBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerVPNNextHopServerBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Nexthopserver string `json:"nexthopserver,omitempty"` + NextHopServer string `json:"nexthopserver,omitempty"` } -type VpnglobalAppfwpolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAppFWPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverStaserverBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerSTAServerBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Staaddresstype string `json:"staaddresstype,omitempty"` - Staauthid string `json:"staauthid,omitempty"` - Staserver string `json:"staserver,omitempty"` - Stastate string `json:"stastate,omitempty"` + STAAddressType string `json:"staaddresstype,omitempty"` + STAAuthID string `json:"staauthid,omitempty"` + STAServer string `json:"staserver,omitempty"` + STAState string `json:"stastate,omitempty"` } -type VpnglobalVpnintranetapplicationBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetapplication string `json:"intranetapplication,omitempty"` +type VPNGlobalVPNIntranetApplicationBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` } -type VpnvserverIntranetipBinding struct { - Acttype int `json:"acttype,omitempty"` - Intranetip string `json:"intranetip,omitempty"` +type VPNVServerIntranetIPBinding struct { + ActType int `json:"acttype,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` MapField string `json:"map,omitempty"` Name string `json:"name,omitempty"` Netmask string `json:"netmask,omitempty"` } -type VpnclientlessaccesspolicyBinding struct { +type VPNClientlessAccessPolicyBinding struct { Name string `json:"name,omitempty"` - VpnclientlessaccesspolicyVpnglobalBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnglobal_binding,omitempty"` - VpnclientlessaccesspolicyVpnvserverBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnvserver_binding,omitempty"` + VPNClientlessAccessPolicyVPNGlobalBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnglobal_binding,omitempty"` + VPNClientlessAccessPolicyVPNVServerBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnvserver_binding,omitempty"` } -type VpnglobalAuthenticationnegotiatepolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationNegotiatePolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalAuthenticationtacacspolicyBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Policyname string `json:"policyname,omitempty"` +type VPNGlobalAuthenticationTACACSPolicyBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalIntranetip6Binding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetip6 string `json:"intranetip6,omitempty"` - Numaddr int `json:"numaddr,omitempty"` +type VPNGlobalIntranetIP6Binding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } -type Vpnvserver struct { - Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` - Advancedepa string `json:"advancedepa,omitempty"` - Appflowlog string `json:"appflowlog,omitempty"` +type VPNVServer struct { + AccessRestrictedPageRedirect string `json:"accessrestrictedpageredirect,omitempty"` + AdvancedEPA string `json:"advancedepa,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` Authentication string `json:"authentication,omitempty"` - Authnprofile string `json:"authnprofile,omitempty"` - Backupvserver string `json:"backupvserver,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Cachetype string `json:"cachetype,omitempty"` - Cachevserver string `json:"cachevserver,omitempty"` - Certkeynames string `json:"certkeynames,omitempty"` - Cginfrahomepageredirect string `json:"cginfrahomepageredirect,omitempty"` - Clttimeout int `json:"clttimeout,omitempty"` + AuthnProfile string `json:"authnprofile,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + CacheType string `json:"cachetype,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CertKeyNames string `json:"certkeynames,omitempty"` + CGInfraHomePageRedirect string `json:"cginfrahomepageredirect,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` Count float64 `json:"__count,omitempty"` - Csvserver string `json:"csvserver,omitempty"` - Curaaausers int `json:"curaaausers,omitempty"` - Curstate string `json:"curstate,omitempty"` - Curtotalusers int `json:"curtotalusers,omitempty"` - Deploymenttype string `json:"deploymenttype,omitempty"` - Devicecert string `json:"devicecert,omitempty"` - Deviceposture string `json:"deviceposture,omitempty"` - Disableprimaryondown string `json:"disableprimaryondown,omitempty"` + CSVServer string `json:"csvserver,omitempty"` + CurAAAUsers int `json:"curaaausers,omitempty"` + CurState string `json:"curstate,omitempty"` + CurTotalUsers int `json:"curtotalusers,omitempty"` + DeploymentType string `json:"deploymenttype,omitempty"` + DeviceCert string `json:"devicecert,omitempty"` + DevicePosture string `json:"deviceposture,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` Domain string `json:"domain,omitempty"` - Doublehop string `json:"doublehop,omitempty"` - Downstateflush string `json:"downstateflush,omitempty"` - Dtls string `json:"dtls,omitempty"` - Epaprofileoptional bool `json:"epaprofileoptional,omitempty"` - Failedlogintimeout int `json:"failedlogintimeout,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` - Httpprofilename string `json:"httpprofilename,omitempty"` - Icaonly string `json:"icaonly,omitempty"` - Icaproxysessionmigration string `json:"icaproxysessionmigration,omitempty"` - Icmpvsrresponse string `json:"icmpvsrresponse,omitempty"` - Ip string `json:"ip,omitempty"` - Ipset string `json:"ipset,omitempty"` - Ipv46 string `json:"ipv46,omitempty"` - L2conn string `json:"l2conn,omitempty"` - Linuxepapluginupgrade string `json:"linuxepapluginupgrade,omitempty"` - Listenpolicy string `json:"listenpolicy,omitempty"` - Listenpriority int `json:"listenpriority,omitempty"` - Loginonce string `json:"loginonce,omitempty"` - Logoutonsmartcardremoval string `json:"logoutonsmartcardremoval,omitempty"` - Macepapluginupgrade string `json:"macepapluginupgrade,omitempty"` + DoubleHop string `json:"doublehop,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + DTLS string `json:"dtls,omitempty"` + EPAProfileOptional bool `json:"epaprofileoptional,omitempty"` + FailedLoginTimeout int `json:"failedlogintimeout,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + ICAOnly string `json:"icaonly,omitempty"` + ICAProxySessionMigration string `json:"icaproxysessionmigration,omitempty"` + ICMPVSRResponse string `json:"icmpvsrresponse,omitempty"` + IP string `json:"ip,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LinuxEPAPluginUpgrade string `json:"linuxepapluginupgrade,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` + LoginOnce string `json:"loginonce,omitempty"` + LogoutOnSmartcardRemoval string `json:"logoutonsmartcardremoval,omitempty"` + MacEPAPluginUpgrade string `json:"macepapluginupgrade,omitempty"` MapField string `json:"map,omitempty"` - Maxaaausers int `json:"maxaaausers,omitempty"` - Maxloginattempts int `json:"maxloginattempts,omitempty"` + MaxAAAUsers int `json:"maxaaausers,omitempty"` + MaxLoginAttempts int `json:"maxloginattempts,omitempty"` Name string `json:"name,omitempty"` - Netprofile string `json:"netprofile,omitempty"` - Newname string `json:"newname,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Ngname string `json:"ngname,omitempty"` - Nodefaultbindings string `json:"nodefaultbindings,omitempty"` - Pcoipvserverprofilename string `json:"pcoipvserverprofilename,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NGName string `json:"ngname,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + PCoIPVServerProfileName string `json:"pcoipvserverprofilename,omitempty"` Port int `json:"port,omitempty"` Precedence string `json:"precedence,omitempty"` - Quicprofilename string `json:"quicprofilename,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` Range int `json:"range,omitempty"` - Rdpserverprofilename string `json:"rdpserverprofilename,omitempty"` + RDPServerProfileName string `json:"rdpserverprofilename,omitempty"` Redirect string `json:"redirect,omitempty"` - Redirecturl string `json:"redirecturl,omitempty"` + RedirectURL string `json:"redirecturl,omitempty"` Response string `json:"response,omitempty"` - Rhistate string `json:"rhistate,omitempty"` + RHIState string `json:"rhistate,omitempty"` Rule string `json:"rule,omitempty"` - Samesite string `json:"samesite,omitempty"` + SameSite string `json:"samesite,omitempty"` Secondary bool `json:"secondary,omitempty"` - Secureprivateaccess string `json:"secureprivateaccess,omitempty"` - Servicename string `json:"servicename,omitempty"` - Servicetype string `json:"servicetype,omitempty"` - Somethod string `json:"somethod,omitempty"` - Sopersistence string `json:"sopersistence,omitempty"` - Sopersistencetimeout int `json:"sopersistencetimeout,omitempty"` - Sothreshold int `json:"sothreshold,omitempty"` + SecurePrivateAccess string `json:"secureprivateaccess,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` State string `json:"state,omitempty"` Status int `json:"status,omitempty"` - Tcpprofilename string `json:"tcpprofilename,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` TypeField string `json:"type,omitempty"` - Usemip string `json:"usemip,omitempty"` - Userdomains string `json:"userdomains,omitempty"` + UseMIP string `json:"usemip,omitempty"` + UserDomains string `json:"userdomains,omitempty"` Value string `json:"value,omitempty"` - Vserverfqdn string `json:"vserverfqdn,omitempty"` + VServerFQDN string `json:"vserverfqdn,omitempty"` Weight int `json:"weight,omitempty"` - Windowsepapluginupgrade string `json:"windowsepapluginupgrade,omitempty"` + WindowsEPAPluginUpgrade string `json:"windowsepapluginupgrade,omitempty"` } -type VpnglobalSslcertkeyBinding struct { - Cacert string `json:"cacert,omitempty"` - Certkeyname string `json:"certkeyname,omitempty"` - Crlcheck string `json:"crlcheck,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Ocspcheck string `json:"ocspcheck,omitempty"` - Userdataencryptionkey string `json:"userdataencryptionkey,omitempty"` +type VPNGlobalSSLCertKeyBinding struct { + CACert string `json:"cacert,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + UserDataEncryptionKey string `json:"userdataencryptionkey,omitempty"` } -type VpnvserverAppfwpolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAppFWPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type Vpnicaconnection struct { +type VPNICAConnection struct { All bool `json:"all,omitempty"` Count float64 `json:"__count,omitempty"` - Destip string `json:"destip,omitempty"` - Destport int `json:"destport,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` Domain string `json:"domain,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Nodeid int `json:"nodeid,omitempty"` - Peid int `json:"peid,omitempty"` - Productname string `json:"productname,omitempty"` - Srcip string `json:"srcip,omitempty"` - Srcport int `json:"srcport,omitempty"` - Tenantname string `json:"tenantname,omitempty"` - Transproto string `json:"transproto,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PeID int `json:"peid,omitempty"` + ProductName string `json:"productname,omitempty"` + SrcIP string `json:"srcip,omitempty"` + SrcPort int `json:"srcport,omitempty"` + TenantName string `json:"tenantname,omitempty"` + TransProto string `json:"transproto,omitempty"` Username string `json:"username,omitempty"` } -type VpnvserverRewritepolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerRewritePolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnvserverAuthenticationoauthidppolicyBinding struct { - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerAuthenticationOAuthIDPPolicyBinding struct { + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` Secondary bool `json:"secondary,omitempty"` } -type VpnglobalStaserverBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Staaddresstype string `json:"staaddresstype,omitempty"` - Staauthid string `json:"staauthid,omitempty"` - Staserver string `json:"staserver,omitempty"` - Stastate string `json:"stastate,omitempty"` +type VPNGlobalSTAServerBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + STAAddressType string `json:"staaddresstype,omitempty"` + STAAuthID string `json:"staauthid,omitempty"` + STAServer string `json:"staserver,omitempty"` + STAState string `json:"stastate,omitempty"` } -type Vpnsecureprivateaccessprofile struct { - Accessrestrictedpageredirect string `json:"accessrestrictedpageredirect,omitempty"` - Chromeenterprisepremiummode string `json:"chromeenterprisepremiummode,omitempty"` - Clouddeployment string `json:"clouddeployment,omitempty"` +type VPNSecurePrivateAccessProfile struct { + AccessRestrictedPageRedirect string `json:"accessrestrictedpageredirect,omitempty"` + ChromeEnterprisePremiumMode string `json:"chromeenterprisepremiummode,omitempty"` + CloudDeployment string `json:"clouddeployment,omitempty"` Count float64 `json:"__count,omitempty"` - Customerid string `json:"customerid,omitempty"` + CustomerID string `json:"customerid,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Url string `json:"url,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + URL string `json:"url,omitempty"` } -type Vpnepaprofile struct { +type VPNEPAProfile struct { Count float64 `json:"__count,omitempty"` Data string `json:"data,omitempty"` Filename string `json:"filename,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } -type VpnvserverVpnportalthemeBinding struct { - Acttype int `json:"acttype,omitempty"` +type VPNVServerVPNPortalThemeBinding struct { + ActType int `json:"acttype,omitempty"` Name string `json:"name,omitempty"` - Portaltheme string `json:"portaltheme,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } -type VpnglobalDomainBinding struct { - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Intranetdomain string `json:"intranetdomain,omitempty"` +type VPNGlobalDomainBinding struct { + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetDomain string `json:"intranetdomain,omitempty"` } -type VpnvserverVpnclientlessaccesspolicyBinding struct { - Acttype int `json:"acttype,omitempty"` - Bindpoint string `json:"bindpoint,omitempty"` - Gotopriorityexpression string `json:"gotopriorityexpression,omitempty"` - Groupextraction bool `json:"groupextraction,omitempty"` +type VPNVServerVPNClientlessAccessPolicyBinding struct { + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` Name string `json:"name,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` diff --git a/nitrogo/models/wasm.go b/nitrogo/models/wasm.go index c7e1f2a..b614a0d 100644 --- a/nitrogo/models/wasm.go +++ b/nitrogo/models/wasm.go @@ -1,10 +1,10 @@ package models // wasm configuration structs -type Wasmmodule struct { +type WasmModule struct { Count float64 `json:"__count,omitempty"` - Modulefile string `json:"modulefile,omitempty"` + ModuleFile string `json:"modulefile,omitempty"` Name string `json:"name,omitempty"` - Nextgenapiresource string `json:"_nextgenapiresource,omitempty"` - Signaturefile string `json:"signaturefile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + SignatureFile string `json:"signaturefile,omitempty"` } From cd2567b80deb011aa48ab1f2d18be3a25b0a39d5 Mon Sep 17 00:00:00 2001 From: AdamJCrawford Date: Fri, 20 Mar 2026 22:16:46 -0500 Subject: [PATCH 10/10] function definitions. --- LICENSE | 2 +- nitrogo/aaa.go | 4591 ++++++++++- nitrogo/adm.go | 81 +- nitrogo/analytics.go | 295 +- nitrogo/app.go | 60 +- nitrogo/appflow.go | 1382 +++- nitrogo/appfw.go | 6283 +++++++++++++- nitrogo/appqoe.go | 596 +- nitrogo/audit.go | 2499 +++++- nitrogo/authentication.go | 11242 ++++++++++++++++++++++++-- nitrogo/authorization.go | 855 +- nitrogo/autoscale.go | 596 +- nitrogo/azure.go | 229 +- nitrogo/basic.go | 2486 +++++- nitrogo/bfd.go | 62 +- nitrogo/bot.go | 1775 +++- nitrogo/cache.go | 1405 +++- nitrogo/client.go | 1 + nitrogo/cloud.go | 592 +- nitrogo/cluster.go | 1800 ++++- nitrogo/cmp.go | 1142 ++- nitrogo/content_inspection.go | 1440 +++- nitrogo/cr.go | 1930 ++++- nitrogo/cs.go | 3086 ++++++- nitrogo/db.go | 291 +- nitrogo/dns.go | 3441 +++++++- nitrogo/feo.go | 785 +- nitrogo/glsb.go | 242 - nitrogo/gslb.go | 2998 +++++++ nitrogo/ha.go | 735 +- nitrogo/ica.go | 1137 ++- nitrogo/ipsec.go | 191 +- nitrogo/ipsecalg.go | 235 +- nitrogo/lldp.go | 179 +- nitrogo/lsn.go | 4304 +++++++++- nitrogo/models/aaa.go | 374 +- nitrogo/models/analytics.go | 2 +- nitrogo/models/api.go | 8 +- nitrogo/models/appflow.go | 22 +- nitrogo/models/appfw.go | 130 +- nitrogo/models/appqoe.go | 4 +- nitrogo/models/audit.go | 52 +- nitrogo/models/authentication.go | 905 ++- nitrogo/models/authorization.go | 16 +- nitrogo/models/autoscale.go | 4 +- nitrogo/models/basic.go | 82 +- nitrogo/models/bot.go | 38 +- nitrogo/models/cache.go | 18 +- nitrogo/models/cluster.go | 124 +- nitrogo/models/cmp.go | 20 +- nitrogo/models/contentinspection.go | 18 +- nitrogo/models/cr.go | 36 +- nitrogo/models/cs.go | 58 +- nitrogo/models/dns.go | 40 +- nitrogo/models/feo.go | 10 +- nitrogo/models/gslb.go | 66 +- nitrogo/models/ha.go | 12 +- nitrogo/models/ica.go | 10 +- nitrogo/models/kafka.go | 4 +- nitrogo/models/lb.go | 650 +- nitrogo/models/lsn.go | 197 +- nitrogo/models/metrics.go | 20 +- nitrogo/models/network.go | 417 +- nitrogo/models/ns.go | 301 +- nitrogo/models/ntp.go | 10 +- nitrogo/models/policy.go | 80 +- nitrogo/models/protocol.go | 32 +- nitrogo/models/responder.go | 22 +- nitrogo/models/rewrite.go | 20 +- nitrogo/models/snmp.go | 10 +- nitrogo/models/spillover.go | 8 +- nitrogo/models/ssl.go | 120 +- nitrogo/models/stream.go | 6 +- nitrogo/models/subscriber.go | 92 +- nitrogo/models/system.go | 109 +- nitrogo/models/tm.go | 26 +- nitrogo/models/transform.go | 22 +- nitrogo/models/tunnel.go | 6 +- nitrogo/models/utility.go | 28 +- nitrogo/models/videooptimization.go | 28 +- nitrogo/models/vpn.go | 1393 ++-- nitrogo/network.go | 10451 ++++++++++++++++++++++-- nitrogo/ns.go | 7898 ++++++++++++++++-- nitrogo/ntp.go | 298 +- nitrogo/pcp.go | 369 +- nitrogo/policy.go | 1423 +++- nitrogo/protocol.go | 96 +- nitrogo/rdp.go | 388 +- nitrogo/reputation.go | 81 +- nitrogo/responder.go | 1314 ++- nitrogo/rewrite.go | 1163 ++- nitrogo/router.go | 159 +- nitrogo/smpp.go | 210 +- nitrogo/snmp.go | 1436 +++- nitrogo/spillover.go | 606 +- nitrogo/ssl.go | 6449 ++++++++++++++- nitrogo/stream.go | 440 +- nitrogo/subscriber.go | 423 +- nitrogo/system.go | 2899 ++++++- nitrogo/tm.go | 1661 +++- nitrogo/transform.go | 1255 ++- nitrogo/tunnel.go | 423 +- nitrogo/ulfd.go | 119 +- nitrogo/url_filtering.go | 220 +- nitrogo/user.go | 336 +- nitrogo/utility.go | 288 +- nitrogo/video_optimization.go | 2130 ++++- nitrogo/vpn.go | 10412 ++++++++++++++++++++++-- 108 files changed, 108372 insertions(+), 9193 deletions(-) delete mode 100644 nitrogo/glsb.go create mode 100644 nitrogo/gslb.go diff --git a/LICENSE b/LICENSE index a3b5176..5c15f33 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Adam Crawford +Copyright (c) 2026 Adam Crawford Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/nitrogo/aaa.go b/nitrogo/aaa.go index 182a228..0ba60db 100644 --- a/nitrogo/aaa.go +++ b/nitrogo/aaa.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( aaaCertParamsURL = "/nitro/v1/config/aaacertparams" aaaGlobalAAAPreauthenticationPolicyBindingURL = "/nitro/v1/config/aaaglobal_aaapreauthenticationpolicy_binding" @@ -7,6 +17,10 @@ const ( aaaGlobalBindingURL = "/nitro/v1/config/aaaglobal_binding" aaaGroupURL = "/nitro/v1/config/aaagroup" aaaGroupAAAUserBindingURL = "/nitro/v1/config/aaagroup_aaauser_binding" + aaaGroupAuditnslogPolicyBindingURL = "/nitro/v1/config/aaagroup_auditnslogpolicy_binding" + aaaGroupAuditsyslogPolicyBindingURL = "/nitro/v1/config/aaagroup_auditsyslogpolicy_binding" + aaaGroupAuthorizationPolicyBindingURL = "/nitro/v1/config/aaagroup_authorizationpolicy_binding" + aaaGroupBindingURL = "/nitro/v1/config/aaagroup_binding" aaaGroupIntranetIP6BindingURL = "/nitro/v1/config/aaagroup_intranetip6_binding" aaaGroupIntranetIPBindingURL = "/nitro/v1/config/aaagroup_intranetip_binding" aaaGroupTMSessionPolicyBindingURL = "/nitro/v1/config/aaagroup_tmsessionpolicy_binding" @@ -54,385 +68,4332 @@ type AAAService struct { // aaacertparams // Configuration for certificate parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaacertparams -func (s *AAAService) UpdateAAACertParams() {} -func (s *AAAService) UnsetAAACertParams() {} -func (s *AAAService) GetAllAAACertParams() {} +func (s *AAAService) UpdateAAACertParams(resource models.AAACertParams) error { + payload := map[string]any{"aaacertparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaCertParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAACertParams(resource models.AAACertParams) error { + payload := map[string]any{"aaacertparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaCertParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAACertParams() (models.AAACertParams, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaCertParamsURL, nil) + if err != nil { + return models.AAACertParams{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAACertParams{}, err + } + + var result struct { + Data models.AAACertParams `json:"aaacertparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAACertParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} // aaaglobal_aaapreauthenticationpolicy_binding // Binding object showing the aaapreauthenticationpolicy that can be bound to aaaglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaglobal_aaapreauthenticationpolicy_binding -func (s *AAAService) AddAAAGlobalAAAPreauthenticationPolicyBinding() {} -func (s *AAAService) DeleteAAAGlobalAAAPreauthenticationPolicyBinding() {} -func (s *AAAService) GetAAAGlobalAAAPreauthenticationPolicyBinding() {} -func (s *AAAService) CountAAAGlobalAAAPreauthenticationPolicyBinding() {} +func (s *AAAService) AddAAAGlobalAAAPreauthenticationPolicyBinding(resource models.AAAGlobalAAAPreAuthenticationPolicyBinding) error { + payload := map[string]any{"aaaglobal_aaapreauthenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGlobalAAAPreauthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGlobalAAAPreauthenticationPolicyBinding(policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaGlobalAAAPreauthenticationPolicyBindingURL, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAAAGlobalAAAPreauthenticationPolicyBinding() ([]models.AAAGlobalAAAPreAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGlobalAAAPreauthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGlobalAAAPreAuthenticationPolicyBinding `json:"aaaglobal_aaapreauthenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGlobalAAAPreauthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaGlobalAAAPreauthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGlobalAAAPreAuthenticationPolicyBinding `json:"aaaglobal_aaapreauthenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // aaaglobal_authenticationnegotiataction_binding // Binding object showing the authenticationnegotiateaction that can be bound to aaaglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaglobal_authenticationnegotiateaction_binding -func (s *AAAService) AddAAAGlobalAuthenticationNegotiateActionBinding() {} -func (s *AAAService) DeleteAAAGlobalAuthenticationNegotiateActionBinding() {} -func (s *AAAService) GetAAAGlobalAuthenticationNegotiateActionBinding() {} -func (s *AAAService) CountAAAGlobalAuthenticationNegotiateActionBinding() {} +func (s *AAAService) AddAAAGlobalAuthenticationNegotiateActionBinding(resource models.AAAGlobalAuthenticationNegotiateActionBinding) error { + payload := map[string]any{"aaaglobal_authenticationnegotiateaction_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGlobalAuthenticationNegotiateActionBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGlobalAuthenticationNegotiateActionBinding(policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaGlobalAuthenticationNegotiateActionBindingURL, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAAAGlobalAuthenticationNegotiateActionBinding() ([]models.AAAGlobalAuthenticationNegotiateActionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGlobalAuthenticationNegotiateActionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGlobalAuthenticationNegotiateActionBinding `json:"aaaglobal_authenticationnegotiateaction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGlobalAuthenticationNegotiateActionBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaGlobalAuthenticationNegotiateActionBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGlobalAuthenticationNegotiateActionBinding `json:"aaaglobal_authenticationnegotiateaction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // aaaglobal_binding // Binding object which returns the resources bound to aaaglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaglobal_binding -func (s *AAAService) GetAAAGlobalBinding() {} +func (s *AAAService) GetAAAGlobalBinding() (models.AAAGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGlobalBindingURL, nil) + if err != nil { + return models.AAAGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAGlobalBinding{}, err + } + + var result struct { + Data []models.AAAGlobalBinding `json:"aaaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAGlobalBinding{}, fmt.Errorf("aaaglobal_binding not found") + } + + return result.Data[0], nil +} // aaagroup // Configuration for AAA group resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup -func (s *AAAService) AddAAAGroup() {} -func (s *AAAService) DeleteAAAGroup() {} -func (s *AAAService) GetAllAAAGroup() {} -func (s *AAAService) GetAAAGroup() {} -func (s *AAAService) CountAAAGroup() {} +func (s *AAAService) AddAAAGroup(resource models.AAAGroup) error { + payload := map[string]any{"aaagroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroup(groupname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaGroupURL, groupname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroup() ([]models.AAAGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroup `json:"aaagroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroup(groupname string) (models.AAAGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupURL, groupname), nil) + if err != nil { + return models.AAAGroup{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAGroup{}, err + } + + var result struct { + Data []models.AAAGroup `json:"aaagroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAGroup{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAGroup{}, fmt.Errorf("aaagroup %s not found", groupname) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroup `json:"aaagroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // aaagroup_aaauser_binding // Binding object showing the aaauser that can be bound to aaagroup. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_aaauser_binding -func (s *AAAService) AddAAAGroupAAAUserBinding() {} -func (s *AAAService) DeleteAAAGroupAAAUserBinding() {} -func (s *AAAService) GetAllAAAGroupAAAUserBinding() {} -func (s *AAAService) GetAAAGroupAAAUserBinding() {} -func (s *AAAService) CountAAAGroupAAAUserBinding() {} +func (s *AAAService) AddAAAGroupAAAUserBinding(resource models.AAAGroupAAAUserBinding) error { + payload := map[string]any{"aaagroup_aaauser_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupAAAUserBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupAAAUserBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupAAAUserBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupAAAUserBinding() ([]models.AAAGroupAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupAAAUserBinding `json:"aaagroup_aaauser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupAAAUserBinding(groupname string) ([]models.AAAGroupAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupAAAUserBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupAAAUserBinding `json:"aaagroup_aaauser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupAAAUserBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupAAAUserBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupAAAUserBinding `json:"aaagroup_aaauser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // aaagroup_auditnslogpolicy_binding // Binding object showing the auditnslogpolicy that can be bound to aaagroup. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_auditnslogpolicy_binding -func (s *AAAService) AddAAAGroupAuditNSLogPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupAuditNSLogPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupAuditNSLogPolicyBinding() {} -func (s *AAAService) GetAAAGroupAuditNSLogPolicyBinding() {} -func (s *AAAService) CountAAAGroupAuditNSLogPolicyBinding() {} +func (s *AAAService) AddAAAGroupAuditNSLogPolicyBinding(resource models.AAAGroupAuditNSLogPolicyBinding) error { + payload := map[string]any{"aaagroup_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupAuditnslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupAuditNSLogPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupAuditnslogPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupAuditNSLogPolicyBinding() ([]models.AAAGroupAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupAuditnslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupAuditNSLogPolicyBinding `json:"aaagroup_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupAuditNSLogPolicyBinding(groupname string) ([]models.AAAGroupAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupAuditnslogPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupAuditNSLogPolicyBinding `json:"aaagroup_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupAuditNSLogPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupAuditnslogPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupAuditNSLogPolicyBinding `json:"aaagroup_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // aaagroup_auditsyslogpolicy_binding // Binding object showing the auditsyslogpolicy that can be bound to aaagroup. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_auditsyslogpolicy_binding -func (s *AAAService) AddAAAGroupAuditSyslogPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupAuditSyslogPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupAuditSyslogPolicyBinding() {} -func (s *AAAService) GetAAAGroupAuditSyslogPolicyBinding() {} -func (s *AAAService) CountAAAGroupAuditSyslogPolicyBinding() {} +func (s *AAAService) AddAAAGroupAuditSyslogPolicyBinding(resource models.AAAGroupAuditSyslogPolicyBinding) error { + payload := map[string]any{"aaagroup_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// aaagroup_authorizationpolicy_binding -// Binding object showing the authorizationpolicy that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_authorizationpolicy_binding -func (s *AAAService) AddAAAGroupAuthorizationPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupAuthorizationPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupAuthorizationPolicyBinding() {} -func (s *AAAService) GetAAAGroupAuthorizationPolicyBinding() {} -func (s *AAAService) CountAAAGroupAuthorizationPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, aaaGroupAuditsyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// aaagroup_binding -// Binding object which returns the resources bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_binding -func (s *AAAService) GetAllAAAGroupBinding() {} -func (s *AAAService) GetAAAGroupBinding() {} + _, err = s.client.Do(req) + return err +} -// aaagroup_intranetip6_binding -// Binding object showing the intranetip6 that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_intranetip6_binding -func (s *AAAService) AddAAAGroupIntranetIP6Binding() {} -func (s *AAAService) DeleteAAAGroupIntranetIP6Binding() {} -func (s *AAAService) GetAllAAAGroupIntranetIP6Binding() {} -func (s *AAAService) GetAAAGroupIntranetIP6Binding() {} -func (s *AAAService) CountAAAGroupIntranetIP6Binding() {} +func (s *AAAService) DeleteAAAGroupAuditSyslogPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupAuditsyslogPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } -// aaagroup_intranetip_binding -// Binding object showing the intranetip that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_intranetip_binding -func (s *AAAService) AddAAAGroupIntranetIPBinding() {} -func (s *AAAService) DeleteAAAGroupIntranetIPBinding() {} -func (s *AAAService) GetAllAAAGroupIntranetIPBinding() {} -func (s *AAAService) GetAAAGroupIntranetIPBinding() {} -func (s *AAAService) CountAAAGroupIntranetIPBinding() {} + _, err = s.client.Do(req) + return err +} -// aaagroup_tmsessionpolicy_binding -// Binding object showing the tmsessionpolicy that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_tmsessionpolicy_binding -func (s *AAAService) AddAAAGroupTMSessionPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupTMSessionPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupTMSessionPolicyBinding() {} -func (s *AAAService) GetAAAGroupTMSessionPolicyBinding() {} -func (s *AAAService) CountAAAGroupTMSessionPolicyBinding() {} +func (s *AAAService) GetAllAAAGroupAuditSyslogPolicyBinding() ([]models.AAAGroupAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupAuditsyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// aaagroup_vpnintranetapplication_binding -// Binding object showing the vpnintranetapplication that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnintranetapplication_binding -func (s *AAAService) AddAAAGroupVPNIntranetApplicationBinding() {} -func (s *AAAService) DeleteAAAGroupVPNIntranetApplicationBinding() {} -func (s *AAAService) GetAllAAAGroupVPNIntranetApplicationBinding() {} -func (s *AAAService) GetAAAGroupVPNIntranetApplicationBinding() {} -func (s *AAAService) CountAAAGroupVPNIntranetApplicationBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// aaagroup_vpnsessionpolicy_binding -// Binding object showing the vpnsessionpolicy that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnsessionpolicy_binding -func (s *AAAService) AddAAAGroupVPNSessionPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupVPNSessionPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupVPNSessionPolicyBinding() {} -func (s *AAAService) GetAAAGroupVPNSessionPolicyBinding() {} -func (s *AAAService) CountAAAGroupVPNSessionPolicyBinding() {} + var result struct { + Data []models.AAAGroupAuditSyslogPolicyBinding `json:"aaagroup_auditsyslogpolicy_binding"` + } -// aaagroup_vpntrafficpolicy_binding -// Binding object showing the vpntrafficpolicy that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpntrafficpolicy_binding -func (s *AAAService) AddAAAGroupVPNTrafficPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupVPNTrafficPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupVPNTrafficPolicyBinding() {} -func (s *AAAService) GetAAAGroupVPNTrafficPolicyBinding() {} -func (s *AAAService) CountAAAGroupVPNTrafficPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// aaagroup_vpnurlpolicy_binding -// Binding object showing the vpnurlpolicy that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnurlpolicy_binding -func (s *AAAService) AddAAAGroupVPNURLPolicyBinding() {} -func (s *AAAService) DeleteAAAGroupVPNURLPolicyBinding() {} -func (s *AAAService) GetAllAAAGroupVPNURLPolicyBinding() {} -func (s *AAAService) GetAAAGroupVPNURLPolicyBinding() {} -func (s *AAAService) CountAAAGroupVPNURLPolicyBinding() {} + return result.Data, nil +} -// aaagroup_vpnurl_binding -// Binding object showing the vpnurl that can be bound to aaagroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnurl_binding -func (s *AAAService) AddAAAGroupVPNURLBinding() {} -func (s *AAAService) DeleteAAAGroupVPNURLBinding() {} -func (s *AAAService) GetAllAAAGroupVPNURLBinding() {} -func (s *AAAService) GetAAAGroupVPNURLBinding() {} -func (s *AAAService) CountAAAGroupVPNURLBinding() {} +func (s *AAAService) GetAAAGroupAuditSyslogPolicyBinding(groupname string) ([]models.AAAGroupAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupAuditsyslogPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } -// aaakcdaccount -// Configuration for Kerberos constrained delegation account resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaakcdaccount -func (s *AAAService) AddAAAKCDAccount() {} -func (s *AAAService) DeleteAAAKCDAccount() {} -func (s *AAAService) UpdateAAAKCDAccount() {} -func (s *AAAService) UnsetAAAKCDAccount() {} -func (s *AAAService) GetAllAAAKCDAccount() {} -func (s *AAAService) GetAAAKCDAccount() {} -func (s *AAAService) CountAAAKCDAccount() {} -func (s *AAAService) CheckAAAKCDAccount() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// aaaldapparams -// Configuration for LDAP parameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaldapparams -func (s *AAAService) UpdateAAALDAPParams() {} -func (s *AAAService) UnsetAAALDAPParams() {} -func (s *AAAService) GetAllAAALDAPParams() {} + var result struct { + Data []models.AAAGroupAuditSyslogPolicyBinding `json:"aaagroup_auditsyslogpolicy_binding"` + } -// aaaotpparamter -// Configuration for AAA otpparameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaotpparameter -func (s *AAAService) UpdateAAAOTPParameter() {} -func (s *AAAService) UnsetAAAOTPParameter() {} -func (s *AAAService) GetAllAAAOTPParameter() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// aaaparameter -// Configuration for AAA parameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaparameter -func (s *AAAService) UpdateAAAParameter() {} -func (s *AAAService) UnsetAAAParameter() {} -func (s *AAAService) GetAllAAAParameter() {} + return result.Data, nil +} -// aaapreauthenticationaction -// Configuration for pre authentication action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationaction -func (s *AAAService) AddAAAPreauthenticationAction() {} -func (s *AAAService) DeleteAAAPreauthenticationAction() {} -func (s *AAAService) UpdateAAAPreauthenticationAction() {} -func (s *AAAService) UnsetAAAPreauthenticationAction() {} -func (s *AAAService) GetAllAAAPreauthenticationAction() {} -func (s *AAAService) GetAAAPreauthenticationAction() {} -func (s *AAAService) CountAAAPreauthenticationAction() {} +func (s *AAAService) CountAAAGroupAuditSyslogPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupAuditsyslogPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } -// aaapreauthenticationparameter -// Configuration for pre authentication parameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationparameter -func (s *AAAService) UpdateAAAPreauthenticationParameter() {} -func (s *AAAService) UnsetAAAPreauthenticationParameter() {} -func (s *AAAService) GetAllAAAPreauthenticationParameter() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// aaapreauthenticationpolicy -// Configuration for pre authentication policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy -func (s *AAAService) AddAAAPreauthenticationPolicy() {} -func (s *AAAService) DeleteAAAPreauthenticationPolicy() {} -func (s *AAAService) UpdateAAAPreauthenticationPolicy() {} -func (s *AAAService) GetAllAAAPreauthenticationPolicy() {} -func (s *AAAService) GetAAAPreauthenticationPolicy() {} -func (s *AAAService) CountAAAPreauthenticationPolicy() {} + var result struct { + Data []models.AAAGroupAuditSyslogPolicyBinding `json:"aaagroup_auditsyslogpolicy_binding"` + } -// aaapreauthenticationpolicy_aaaglobal_binding -// Binding object showing the aaaglobal that can be bound to aaapreauthenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_aaaglobal_binding -func (s *AAAService) GetAllAAAPreauthenticationPolicyAAAGlobalBinding() {} -func (s *AAAService) GetAAAPreauthenticationPolicyAAAGlobalBinding() {} -func (s *AAAService) CountAAAPreauthenticationPolicyAAAGlobalBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// aaapreauthenticationpolicy_binding -// Binding object which returns the resources bound to aaapreauthenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_binding -func (s *AAAService) GetAllAAAPreauthenticationPolicyBinding() {} -func (s *AAAService) GetAAAPreauthenticationPolicyBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// aaapreauthentiucationpolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to aaapreauthenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_vpnvserver_binding -func (s *AAAService) GetAllAAAPreauthenticationPolicyVPNVServerBinding() {} -func (s *AAAService) GetAAAPreauthenticationPolicyVPNVServerBinding() {} -func (s *AAAService) CountAAAPreauthenticationPolicyVPNVServerBinding() {} +// aaagroup_authorizationpolicy_binding +// Binding object showing the authorizationpolicy that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_authorizationpolicy_binding +func (s *AAAService) AddAAAGroupAuthorizationPolicyBinding(resource models.AAAGroupAuthorizationPolicyBinding) error { + payload := map[string]any{"aaagroup_authorizationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// aaaradiusparams -// Configuration for RADIUS parameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaradiusparams -func (s *AAAService) UpdateAAARADIUSParams() {} -func (s *AAAService) UnsetAAARADIUSParams() {} -func (s *AAAService) GetAllAAARADIUSParams() {} + req, err := s.client.NewRequest(http.MethodPost, aaaGroupAuthorizationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// aaasession -// Configuration for active connection resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaasession -func (s *AAAService) GetAllAAASession() {} -func (s *AAAService) CountAAASession() {} -func (s *AAAService) KillAAASession() {} + _, err = s.client.Do(req) + return err +} -// aaassoprofile -// Configuration for aaa sso profile resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaassoprofile -func (s *AAAService) AddAAASSOProfile() {} -func (s *AAAService) DeleteAAASSOProfile() {} -func (s *AAAService) GetAllAAASSOProfile() {} -func (s *AAAService) GetAAASSOProfile() {} -func (s *AAAService) CountAAASSOProfile() {} -func (s *AAAService) UpdateAAASSOProfile() {} +func (s *AAAService) DeleteAAAGroupAuthorizationPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupAuthorizationPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } -// aaatacasparams -// Configuration for tacacs parameters resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaatacacsparams -func (s *AAAService) UpdateAAATACACSParams() {} -func (s *AAAService) UnsetAAATACACSParams() {} -func (s *AAAService) GetAllAAATACACSParams() {} + _, err = s.client.Do(req) + return err +} -// aaauser -// Configuration for AAA user resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser -func (s *AAAService) AddAAAUser() {} -func (s *AAAService) DeleteAAAUser() {} -func (s *AAAService) UpdateAAAUser() {} -func (s *AAAService) GetAllAAAUser() {} -func (s *AAAService) GetAAAUser() {} -func (s *AAAService) CountAAAUser() {} -func (s *AAAService) UnlockAAAUser() {} +func (s *AAAService) GetAllAAAGroupAuthorizationPolicyBinding() ([]models.AAAGroupAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupAuthorizationPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// aaauser_aaagroup_binding -// Binding object showing the aaagroup that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_aaagroup_binding -func (s *AAAService) GetAllAAAUserAAAGroupBinding() {} -func (s *AAAService) GetAAAUserAAAGroupBinding() {} -func (s *AAAService) CountAAAUserAAAGroupBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// aaauser_auditnslogpolicy_binding -// Binding object showing the auditnslogpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_auditnslogpolicy_binding -func (s *AAAService) AddAAAUserAuditNSLogPolicyBinding() {} -func (s *AAAService) DeleteAAAUserAuditNSLogPolicyBinding() {} -func (s *AAAService) GetAllAAAUserAuditNSLogPolicyBinding() {} -func (s *AAAService) GetAAAUserAuditNSLogPolicyBinding() {} -func (s *AAAService) CountAAAUserAuditNSLogPolicyBinding() {} + var result struct { + Data []models.AAAGroupAuthorizationPolicyBinding `json:"aaagroup_authorizationpolicy_binding"` + } -// aaauser_auditsyslogpolicy_binding -// Binding object showing the auditsyslogpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_auditsyslogpolicy_binding -func (s *AAAService) AddAAAUserAuditSyslogPolicyBinding() {} -func (s *AAAService) DeleteAAAUserAuditSyslogPolicyBinding() {} -func (s *AAAService) GetAllAAAUserAuditSyslogPolicyBinding() {} -func (s *AAAService) GetAAAUserAuditSyslogPolicyBinding() {} -func (s *AAAService) CountAAAUserAuditSyslogPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// aaauser_authorizationpolicy_binding -// Binding object showing the authorizationpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_authorizationpolicy_binding -func (s *AAAService) AddAAAUserAuthorizationPolicyBinding() {} -func (s *AAAService) DeleteAAAUserAuthorizationPolicyBinding() {} -func (s *AAAService) GetAllAAAUserAuthorizationPolicyBinding() {} -func (s *AAAService) GetAAAUserAuthorizationPolicyBinding() {} -func (s *AAAService) CountAAAUserAuthorizationPolicyBinding() {} + return result.Data, nil +} -// aaauser_binding -// Binding object which returns the resources bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_binding -func (s *AAAService) GetAllAAAUserBinding() {} -func (s *AAAService) GetAAAUserBinding() {} +func (s *AAAService) GetAAAGroupAuthorizationPolicyBinding(groupname string) ([]models.AAAGroupAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupAuthorizationPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } -// aaauser_intranetip6_binding -// Binding object showing the intranetip6 that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_intranetip6_binding -func (s *AAAService) AddAAAUserIntranetIP6Binding() {} -func (s *AAAService) DeleteAAAUserIntranetIP6Binding() {} -func (s *AAAService) GetAllAAAUserIntranetIP6Binding() {} -func (s *AAAService) GetAAAUserIntranetIP6Binding() {} -func (s *AAAService) CountAAAUserIntranetIP6Binding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// aaauser_intranetip_binding -// Binding object showing the intranetip that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_intranetip_binding -func (s *AAAService) AddAAAUserIntranetIPBinding() {} -func (s *AAAService) DeleteAAAUserIntranetIPBinding() {} -func (s *AAAService) GetAllAAAUserIntranetIPBinding() {} -func (s *AAAService) GetAAAUserIntranetIPBinding() {} -func (s *AAAService) CountAAAUserIntranetIPBinding() {} + var result struct { + Data []models.AAAGroupAuthorizationPolicyBinding `json:"aaagroup_authorizationpolicy_binding"` + } -// aaauser_tmsessionpolicy_binding -// Binding object showing the tmsessionpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_tmsessionpolicy_binding -func (s *AAAService) AddAAAUserTMSessionPolicyBinding() {} -func (s *AAAService) DeleteAAAUserTMSessionPolicyBinding() {} -func (s *AAAService) GetAllAAAUserTMSessionPolicyBinding() {} -func (s *AAAService) GetAAAUserTMSessionPolicyBinding() {} -func (s *AAAService) CountAAAUserTMSessionPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// aaauser_vpnintranetapplication_binding -// Binding object showing the vpnintranetapplication that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnintranetapplication_binding -func (s *AAAService) AddAAAUserVPNIntranetApplicationBinding() {} -func (s *AAAService) DeleteAAAUserVPNIntranetApplicationBinding() {} -func (s *AAAService) GetAllAAAUserVPNIntranetApplicationBinding() {} -func (s *AAAService) GetAAAUserVPNIntranetApplicationBinding() {} -func (s *AAAService) CountAAAUserVPNIntranetApplicationBinding() {} + return result.Data, nil +} -// aaauser_vpnsessionpolicy_binding -// Binding object showing the vpnsessionpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnsessionpolicy_binding -func (s *AAAService) AddAAAUserVPNSessionPolicyBinding() {} -func (s *AAAService) DeleteAAAUserVPNSessionPolicyBinding() {} -func (s *AAAService) GetAllAAAUserVPNSessionPolicyBinding() {} -func (s *AAAService) GetAAAUserVPNSessionPolicyBinding() {} -func (s *AAAService) CountAAAUserVPNSessionPolicyBinding() {} +func (s *AAAService) CountAAAGroupAuthorizationPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupAuthorizationPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } -// aaauser_vpntrafficpolicy_binding -// Binding object showing the vpntrafficpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpntrafficpolicy_binding -func (s *AAAService) AddAAAUserVPNTrafficPolicyBinding() {} -func (s *AAAService) DeleteAAAUserVPNTrafficPolicyBinding() {} -func (s *AAAService) GetAllAAAUserVPNTrafficPolicyBinding() {} -func (s *AAAService) GetAAAUserVPNTrafficPolicyBinding() {} -func (s *AAAService) CountAAAUserVPNTrafficPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// aaauser_vpnurlpolicy_binding -// Binding object showing the vpnurlpolicy that can be bound to aaauser. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnurlpolicy_binding -func (s *AAAService) AddAAAUserVPNURLPolicyBinding() {} -func (s *AAAService) DeleteAAAUserVPNURLPolicyBinding() {} -func (s *AAAService) GetAllAAAUserVPNURLPolicyBinding() {} -func (s *AAAService) GetAAAUserVPNURLPolicyBinding() {} -func (s *AAAService) CountAAAUserVPNURLPolicyBinding() {} + var result struct { + Data []models.AAAGroupAuthorizationPolicyBinding `json:"aaagroup_authorizationpolicy_binding"` + } -// aaauser_vpnurl_binding -// Binding object showing the vpnurl that can be bound to aaauser. + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_binding +// Binding object which returns the resources bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_binding +func (s *AAAService) GetAllAAAGroupBinding() ([]models.AAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupBinding `json:"aaagroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupBinding(groupname string) (models.AAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupBindingURL, groupname), nil) + if err != nil { + return models.AAAGroupBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAGroupBinding{}, err + } + + var result struct { + Data []models.AAAGroupBinding `json:"aaagroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAGroupBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAGroupBinding{}, fmt.Errorf("aaagroup_binding %s not found", groupname) + } + + return result.Data[0], nil +} + +// aaagroup_intranetip6_binding +// Binding object showing the intranetip6 that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_intranetip6_binding +func (s *AAAService) AddAAAGroupIntranetIP6Binding(resource models.AAAGroupIntranetIP6Binding) error { + payload := map[string]any{"aaagroup_intranetip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupIntranetIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupIntranetIP6Binding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupIntranetIP6BindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupIntranetIP6Binding() ([]models.AAAGroupIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupIntranetIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupIntranetIP6Binding `json:"aaagroup_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupIntranetIP6Binding(groupname string) ([]models.AAAGroupIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupIntranetIP6BindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupIntranetIP6Binding `json:"aaagroup_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupIntranetIP6Binding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupIntranetIP6BindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupIntranetIP6Binding `json:"aaagroup_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_intranetip_binding +// Binding object showing the intranetip that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_intranetip_binding +func (s *AAAService) AddAAAGroupIntranetIPBinding(resource models.AAAGroupIntranetIPBinding) error { + payload := map[string]any{"aaagroup_intranetip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupIntranetIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupIntranetIPBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupIntranetIPBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupIntranetIPBinding() ([]models.AAAGroupIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupIntranetIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupIntranetIPBinding `json:"aaagroup_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupIntranetIPBinding(groupname string) ([]models.AAAGroupIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupIntranetIPBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupIntranetIPBinding `json:"aaagroup_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupIntranetIPBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupIntranetIPBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupIntranetIPBinding `json:"aaagroup_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_tmsessionpolicy_binding +// Binding object showing the tmsessionpolicy that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_tmsessionpolicy_binding +func (s *AAAService) AddAAAGroupTMSessionPolicyBinding(resource models.AAAGroupTMSessionPolicyBinding) error { + payload := map[string]any{"aaagroup_tmsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupTMSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupTMSessionPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupTMSessionPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupTMSessionPolicyBinding() ([]models.AAAGroupTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupTMSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupTMSessionPolicyBinding `json:"aaagroup_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupTMSessionPolicyBinding(groupname string) ([]models.AAAGroupTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupTMSessionPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupTMSessionPolicyBinding `json:"aaagroup_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupTMSessionPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupTMSessionPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupTMSessionPolicyBinding `json:"aaagroup_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_vpnintranetapplication_binding +// Binding object showing the vpnintranetapplication that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnintranetapplication_binding +func (s *AAAService) AddAAAGroupVPNIntranetApplicationBinding(resource models.AAAGroupVPNIntranetApplicationBinding) error { + payload := map[string]any{"aaagroup_vpnintranetapplication_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupVPNIntranetApplicationBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupVPNIntranetApplicationBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupVPNIntranetApplicationBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupVPNIntranetApplicationBinding() ([]models.AAAGroupVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupVPNIntranetApplicationBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNIntranetApplicationBinding `json:"aaagroup_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupVPNIntranetApplicationBinding(groupname string) ([]models.AAAGroupVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupVPNIntranetApplicationBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNIntranetApplicationBinding `json:"aaagroup_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupVPNIntranetApplicationBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupVPNIntranetApplicationBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupVPNIntranetApplicationBinding `json:"aaagroup_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_vpnsessionpolicy_binding +// Binding object showing the vpnsessionpolicy that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnsessionpolicy_binding +func (s *AAAService) AddAAAGroupVPNSessionPolicyBinding(resource models.AAAGroupVPNSessionPolicyBinding) error { + payload := map[string]any{"aaagroup_vpnsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupVPNSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupVPNSessionPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupVPNSessionPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupVPNSessionPolicyBinding() ([]models.AAAGroupVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupVPNSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNSessionPolicyBinding `json:"aaagroup_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupVPNSessionPolicyBinding(groupname string) ([]models.AAAGroupVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupVPNSessionPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNSessionPolicyBinding `json:"aaagroup_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupVPNSessionPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupVPNSessionPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupVPNSessionPolicyBinding `json:"aaagroup_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_vpntrafficpolicy_binding +// Binding object showing the vpntrafficpolicy that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpntrafficpolicy_binding +func (s *AAAService) AddAAAGroupVPNTrafficPolicyBinding(resource models.AAAGroupVPNTrafficPolicyBinding) error { + payload := map[string]any{"aaagroup_vpntrafficpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupVPNTrafficPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupVPNTrafficPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupVPNTrafficPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupVPNTrafficPolicyBinding() ([]models.AAAGroupVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupVPNTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNTrafficPolicyBinding `json:"aaagroup_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupVPNTrafficPolicyBinding(groupname string) ([]models.AAAGroupVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupVPNTrafficPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNTrafficPolicyBinding `json:"aaagroup_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupVPNTrafficPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupVPNTrafficPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupVPNTrafficPolicyBinding `json:"aaagroup_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_vpnurlpolicy_binding +// Binding object showing the vpnurlpolicy that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnurlpolicy_binding +func (s *AAAService) AddAAAGroupVPNURLPolicyBinding(resource models.AAAGroupVPNURLPolicyBinding) error { + payload := map[string]any{"aaagroup_vpnurlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupVPNURLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupVPNURLPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupVPNURLPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupVPNURLPolicyBinding() ([]models.AAAGroupVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupVPNURLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNURLPolicyBinding `json:"aaagroup_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupVPNURLPolicyBinding(groupname string) ([]models.AAAGroupVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupVPNURLPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNURLPolicyBinding `json:"aaagroup_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupVPNURLPolicyBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupVPNURLPolicyBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupVPNURLPolicyBinding `json:"aaagroup_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaagroup_vpnurl_binding +// Binding object showing the vpnurl that can be bound to aaagroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaagroup_vpnurl_binding +func (s *AAAService) AddAAAGroupVPNURLBinding(resource models.AAAGroupVPNURLBinding) error { + payload := map[string]any{"aaagroup_vpnurl_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaGroupVPNURLBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAGroupVPNURLBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaGroupVPNURLBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAGroupVPNURLBinding() ([]models.AAAGroupVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaGroupVPNURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNURLBinding `json:"aaagroup_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAGroupVPNURLBinding(groupname string) ([]models.AAAGroupVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaGroupVPNURLBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAGroupVPNURLBinding `json:"aaagroup_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAGroupVPNURLBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaGroupVPNURLBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAGroupVPNURLBinding `json:"aaagroup_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaakcdaccount +// Configuration for Kerberos constrained delegation account resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaakcdaccount +func (s *AAAService) AddAAAKCDAccount(resource models.AAAKCDAccount) error { + payload := map[string]any{"aaakcdaccount": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaKCDAccountURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAKCDAccount(kcdaccount string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaKCDAccountURL, kcdaccount), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UpdateAAAKCDAccount(resource models.AAAKCDAccount) error { + payload := map[string]any{"aaakcdaccount": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaKCDAccountURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAAKCDAccount(resource models.AAAKCDAccount) error { + payload := map[string]any{"aaakcdaccount": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaKCDAccountURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAKCDAccount() ([]models.AAAKCDAccount, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaKCDAccountURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAKCDAccount `json:"aaakcdaccount"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAKCDAccount(kcdaccount string) (models.AAAKCDAccount, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaKCDAccountURL, kcdaccount), nil) + if err != nil { + return models.AAAKCDAccount{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAKCDAccount{}, err + } + + var result struct { + Data []models.AAAKCDAccount `json:"aaakcdaccount"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAKCDAccount{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAKCDAccount{}, fmt.Errorf("aaakcdaccount %s not found", kcdaccount) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAKCDAccount() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaKCDAccountURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAKCDAccount `json:"aaakcdaccount"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *AAAService) CheckAAAKCDAccount(resource models.AAAKCDAccount) error { + payload := map[string]any{"aaakcdaccount": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=check", aaaKCDAccountURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// aaaldapparams +// Configuration for LDAP parameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaldapparams +func (s *AAAService) UpdateAAALDAPParams(resource models.AAALDAPParams) error { + payload := map[string]any{"aaaldapparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaLDAPParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAALDAPParams(resource models.AAALDAPParams) error { + payload := map[string]any{"aaaldapparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaLDAPParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAALDAPParams() (models.AAALDAPParams, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaLDAPParamsURL, nil) + if err != nil { + return models.AAALDAPParams{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAALDAPParams{}, err + } + + var result struct { + Data models.AAALDAPParams `json:"aaaldapparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAALDAPParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaaotpparamter +// Configuration for AAA otpparameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaotpparameter +func (s *AAAService) UpdateAAAOTPParameter(resource models.AAAOTPParameter) error { + payload := map[string]any{"aaaotpparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaOTPParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAAOTPParameter(resource models.AAAOTPParameter) error { + payload := map[string]any{"aaaotpparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaOTPParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAOTPParameter() (models.AAAOTPParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaOTPParameterURL, nil) + if err != nil { + return models.AAAOTPParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAOTPParameter{}, err + } + + var result struct { + Data models.AAAOTPParameter `json:"aaaotpparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAOTPParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaaparameter +// Configuration for AAA parameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaparameter +func (s *AAAService) UpdateAAAParameter(resource models.AAAParameter) error { + payload := map[string]any{"aaaparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAAParameter(resource models.AAAParameter) error { + payload := map[string]any{"aaaparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAParameter() (models.AAAParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaParameterURL, nil) + if err != nil { + return models.AAAParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAParameter{}, err + } + + var result struct { + Data models.AAAParameter `json:"aaaparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaapreauthenticationaction +// Configuration for pre authentication action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationaction +func (s *AAAService) AddAAAPreauthenticationAction(resource models.AAAPreAuthenticationAction) error { + payload := map[string]any{"aaapreauthenticationaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaapreauthenticationActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAPreauthenticationAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaapreauthenticationActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UpdateAAAPreauthenticationAction(resource models.AAAPreAuthenticationAction) error { + payload := map[string]any{"aaapreauthenticationaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaapreauthenticationActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAAPreauthenticationAction(resource models.AAAPreAuthenticationAction) error { + payload := map[string]any{"aaapreauthenticationaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaapreauthenticationActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAPreauthenticationAction() ([]models.AAAPreAuthenticationAction, error) { + req, err := s.client.NewRequest(http.MethodGet, aaapreauthenticationActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAPreAuthenticationAction `json:"aaapreauthenticationaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAPreauthenticationAction(name string) (models.AAAPreAuthenticationAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaapreauthenticationActionURL, name), nil) + if err != nil { + return models.AAAPreAuthenticationAction{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationAction{}, err + } + + var result struct { + Data []models.AAAPreAuthenticationAction `json:"aaapreauthenticationaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationAction{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAPreAuthenticationAction{}, fmt.Errorf("aaapreauthenticationaction %s not found", name) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAPreauthenticationAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaapreauthenticationActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAPreAuthenticationAction `json:"aaapreauthenticationaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaapreauthenticationparameter +// Configuration for pre authentication parameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationparameter +func (s *AAAService) UpdateAAAPreauthenticationParameter(resource models.AAAPreAuthenticationParameter) error { + payload := map[string]any{"aaapreauthenticationparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaPreauthenticationParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAAPreauthenticationParameter(resource models.AAAPreAuthenticationParameter) error { + payload := map[string]any{"aaapreauthenticationparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaPreauthenticationParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAPreauthenticationParameter() (models.AAAPreAuthenticationParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaPreauthenticationParameterURL, nil) + if err != nil { + return models.AAAPreAuthenticationParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationParameter{}, err + } + + var result struct { + Data models.AAAPreAuthenticationParameter `json:"aaapreauthenticationparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaapreauthenticationpolicy +// Configuration for pre authentication policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy +func (s *AAAService) AddAAAPreauthenticationPolicy(resource models.AAAPreAuthenticationPolicy) error { + payload := map[string]any{"aaapreauthenticationpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaPreauthenticationPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAPreauthenticationPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaPreauthenticationPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UpdateAAAPreauthenticationPolicy(resource models.AAAPreAuthenticationPolicy) error { + payload := map[string]any{"aaapreauthenticationpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaPreauthenticationPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAPreauthenticationPolicy() ([]models.AAAPreAuthenticationPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaPreauthenticationPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicy `json:"aaapreauthenticationpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAPreauthenticationPolicy(name string) (models.AAAPreAuthenticationPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaPreauthenticationPolicyURL, name), nil) + if err != nil { + return models.AAAPreAuthenticationPolicy{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationPolicy{}, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicy `json:"aaapreauthenticationpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationPolicy{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAPreAuthenticationPolicy{}, fmt.Errorf("aaapreauthenticationpolicy %s not found", name) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAPreauthenticationPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaPreauthenticationPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicy `json:"aaapreauthenticationpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaapreauthenticationpolicy_aaaglobal_binding +// Binding object showing the aaaglobal that can be bound to aaapreauthenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_aaaglobal_binding +func (s *AAAService) GetAllAAAPreauthenticationPolicyAAAGlobalBinding() ([]models.AAAPreAuthenticationPolicyAAAGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaPreauthenticationPolicyAAAGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyAAAGlobalBinding `json:"aaapreauthenticationpolicy_aaaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAPreauthenticationPolicyAAAGlobalBinding(name string) (models.AAAPreAuthenticationPolicyAAAGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaPreauthenticationPolicyAAAGlobalBindingURL, name), nil) + if err != nil { + return models.AAAPreAuthenticationPolicyAAAGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationPolicyAAAGlobalBinding{}, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyAAAGlobalBinding `json:"aaapreauthenticationpolicy_aaaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationPolicyAAAGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAPreAuthenticationPolicyAAAGlobalBinding{}, fmt.Errorf("aaapreauthenticationpolicy_aaaglobal_binding %s not found", name) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAPreauthenticationPolicyAAAGlobalBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaPreauthenticationPolicyAAAGlobalBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyAAAGlobalBinding `json:"aaapreauthenticationpolicy_aaaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaapreauthenticationpolicy_binding +// Binding object which returns the resources bound to aaapreauthenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_binding +func (s *AAAService) GetAllAAAPreauthenticationPolicyBinding() ([]models.AAAPreAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaPreauthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyBinding `json:"aaapreauthenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAPreauthenticationPolicyBinding(name string) (models.AAAPreAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaPreauthenticationPolicyBindingURL, name), nil) + if err != nil { + return models.AAAPreAuthenticationPolicyBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationPolicyBinding{}, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyBinding `json:"aaapreauthenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationPolicyBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAPreAuthenticationPolicyBinding{}, fmt.Errorf("aaapreauthenticationpolicy_binding %s not found", name) + } + + return result.Data[0], nil +} + +// aaapreauthentiucationpolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to aaapreauthenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaapreauthenticationpolicy_vpnvserver_binding +func (s *AAAService) GetAllAAAPreauthenticationPolicyVPNVServerBinding() ([]models.AAAPreAuthenticationPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaPreauthenticationPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyVPNVServerBinding `json:"aaapreauthenticationpolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAPreauthenticationPolicyVPNVServerBinding(name string) (models.AAAPreAuthenticationPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaPreauthenticationPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return models.AAAPreAuthenticationPolicyVPNVServerBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAPreAuthenticationPolicyVPNVServerBinding{}, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyVPNVServerBinding `json:"aaapreauthenticationpolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAPreAuthenticationPolicyVPNVServerBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAPreAuthenticationPolicyVPNVServerBinding{}, fmt.Errorf("aaapreauthenticationpolicy_vpnvserver_binding %s not found", name) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAPreauthenticationPolicyVPNVServerBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaPreauthenticationPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAPreAuthenticationPolicyVPNVServerBinding `json:"aaapreauthenticationpolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaaradiusparams +// Configuration for RADIUS parameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaaradiusparams +func (s *AAAService) UpdateAAARADIUSParams(resource models.AAARADIUSParams) error { + payload := map[string]any{"aaaradiusparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaRADIUSParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAARADIUSParams(resource models.AAARADIUSParams) error { + payload := map[string]any{"aaaradiusparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaRADIUSParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAARADIUSParams() (models.AAARADIUSParams, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaRADIUSParamsURL, nil) + if err != nil { + return models.AAARADIUSParams{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAARADIUSParams{}, err + } + + var result struct { + Data models.AAARADIUSParams `json:"aaaradiusparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAARADIUSParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaasession +// Configuration for active connection resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaasession +func (s *AAAService) GetAllAAASession() ([]models.AAASession, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAASession `json:"aaasession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAASession() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaSessionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAASession `json:"aaasession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *AAAService) KillAAASession(resource models.AAASession) error { + payload := map[string]any{"aaasession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=kill", aaaSessionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// aaassoprofile +// Configuration for aaa sso profile resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaassoprofile +func (s *AAAService) AddAAASSOProfile(resource models.AAASSOProfile) error { + payload := map[string]any{"aaassoprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaSSOProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAASSOProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaSSOProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAASSOProfile() ([]models.AAASSOProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaSSOProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAASSOProfile `json:"aaassoprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAASSOProfile(name string) (models.AAASSOProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaSSOProfileURL, name), nil) + if err != nil { + return models.AAASSOProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAASSOProfile{}, err + } + + var result struct { + Data []models.AAASSOProfile `json:"aaassoprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAASSOProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAASSOProfile{}, fmt.Errorf("aaassoprofile %s not found", name) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAASSOProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaSSOProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAASSOProfile `json:"aaassoprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *AAAService) UpdateAAASSOProfile(resource models.AAASSOProfile) error { + payload := map[string]any{"aaassoprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaSSOProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// aaatacasparams +// Configuration for tacacs parameters resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaatacacsparams +func (s *AAAService) UpdateAAATACACSParams(resource models.AAATACACSParams) error { + payload := map[string]any{"aaatacacsparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaTACACSParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UnsetAAATACACSParams(resource models.AAATACACSParams) error { + payload := map[string]any{"aaatacacsparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", aaaTACACSParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAATACACSParams() (models.AAATACACSParams, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaTACACSParamsURL, nil) + if err != nil { + return models.AAATACACSParams{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAATACACSParams{}, err + } + + var result struct { + Data models.AAATACACSParams `json:"aaatacacsparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAATACACSParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// aaauser +// Configuration for AAA user resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser +func (s *AAAService) AddAAAUser(resource models.AAAUser) error { + payload := map[string]any{"aaauser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUser(username string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", aaaUserURL, username), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) UpdateAAAUser(resource models.AAAUser) error { + payload := map[string]any{"aaauser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, aaaUserURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUser() ([]models.AAAUser, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUser `json:"aaauser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUser(username string) (models.AAAUser, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserURL, username), nil) + if err != nil { + return models.AAAUser{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAUser{}, err + } + + var result struct { + Data []models.AAAUser `json:"aaauser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAUser{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAUser{}, fmt.Errorf("aaauser %s not found", username) + } + + return result.Data[0], nil +} + +func (s *AAAService) CountAAAUser() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", aaaUserURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUser `json:"aaauser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *AAAService) UnlockAAAUser(resource models.AAAUser) error { + payload := map[string]any{"aaauser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unlock", aaaUserURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// aaauser_aaagroup_binding +// Binding object showing the aaagroup that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_aaagroup_binding +func (s *AAAService) GetAllAAAUserAAAGroupBinding() ([]models.AAAUserAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAAAGroupBinding `json:"aaauser_aaagroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserAAAGroupBinding(username string) ([]models.AAAUserAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserAAAGroupBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAAAGroupBinding `json:"aaauser_aaagroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserAAAGroupBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserAAAGroupBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserAAAGroupBinding `json:"aaauser_aaagroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_auditnslogpolicy_binding +// Binding object showing the auditnslogpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_auditnslogpolicy_binding +func (s *AAAService) AddAAAUserAuditNSLogPolicyBinding(resource models.AAAUserAuditNSLogPolicyBinding) error { + payload := map[string]any{"aaauser_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserAuditnslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserAuditNSLogPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserAuditnslogPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserAuditNSLogPolicyBinding() ([]models.AAAUserAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserAuditnslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuditNSLogPolicyBinding `json:"aaauser_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserAuditNSLogPolicyBinding(username string) ([]models.AAAUserAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserAuditnslogPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuditNSLogPolicyBinding `json:"aaauser_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserAuditNSLogPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserAuditnslogPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserAuditNSLogPolicyBinding `json:"aaauser_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_auditsyslogpolicy_binding +// Binding object showing the auditsyslogpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_auditsyslogpolicy_binding +func (s *AAAService) AddAAAUserAuditSyslogPolicyBinding(resource models.AAAUserAuditSyslogPolicyBinding) error { + payload := map[string]any{"aaauser_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserAuditsyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserAuditSyslogPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserAuditsyslogPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserAuditSyslogPolicyBinding() ([]models.AAAUserAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserAuditsyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuditSyslogPolicyBinding `json:"aaauser_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserAuditSyslogPolicyBinding(username string) ([]models.AAAUserAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserAuditsyslogPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuditSyslogPolicyBinding `json:"aaauser_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserAuditSyslogPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserAuditsyslogPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserAuditSyslogPolicyBinding `json:"aaauser_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_authorizationpolicy_binding +// Binding object showing the authorizationpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_authorizationpolicy_binding +func (s *AAAService) AddAAAUserAuthorizationPolicyBinding(resource models.AAAUserAuthorizationPolicyBinding) error { + payload := map[string]any{"aaauser_authorizationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserAuthorizationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserAuthorizationPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserAuthorizationPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserAuthorizationPolicyBinding() ([]models.AAAUserAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserAuthorizationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuthorizationPolicyBinding `json:"aaauser_authorizationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserAuthorizationPolicyBinding(username string) ([]models.AAAUserAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserAuthorizationPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserAuthorizationPolicyBinding `json:"aaauser_authorizationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserAuthorizationPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserAuthorizationPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserAuthorizationPolicyBinding `json:"aaauser_authorizationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_binding +// Binding object which returns the resources bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_binding +func (s *AAAService) GetAllAAAUserBinding() ([]models.AAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserBinding `json:"aaauser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserBinding(username string) (models.AAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserBindingURL, username), nil) + if err != nil { + return models.AAAUserBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AAAUserBinding{}, err + } + + var result struct { + Data []models.AAAUserBinding `json:"aaauser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AAAUserBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.AAAUserBinding{}, fmt.Errorf("aaauser_binding %s not found", username) + } + + return result.Data[0], nil +} + +// aaauser_intranetip6_binding +// Binding object showing the intranetip6 that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_intranetip6_binding +func (s *AAAService) AddAAAUserIntranetIP6Binding(resource models.AAAUserIntranetIP6Binding) error { + payload := map[string]any{"aaauser_intranetip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserIntranetIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserIntranetIP6Binding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserIntranetIP6BindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserIntranetIP6Binding() ([]models.AAAUserIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserIntranetIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserIntranetIP6Binding `json:"aaauser_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserIntranetIP6Binding(username string) ([]models.AAAUserIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserIntranetIP6BindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserIntranetIP6Binding `json:"aaauser_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserIntranetIP6Binding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserIntranetIP6BindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserIntranetIP6Binding `json:"aaauser_intranetip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_intranetip_binding +// Binding object showing the intranetip that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_intranetip_binding +func (s *AAAService) AddAAAUserIntranetIPBinding(resource models.AAAUserIntranetIPBinding) error { + payload := map[string]any{"aaauser_intranetip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserIntranetIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserIntranetIPBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserIntranetIPBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserIntranetIPBinding() ([]models.AAAUserIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserIntranetIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserIntranetIPBinding `json:"aaauser_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserIntranetIPBinding(username string) ([]models.AAAUserIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserIntranetIPBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserIntranetIPBinding `json:"aaauser_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserIntranetIPBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserIntranetIPBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserIntranetIPBinding `json:"aaauser_intranetip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_tmsessionpolicy_binding +// Binding object showing the tmsessionpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_tmsessionpolicy_binding +func (s *AAAService) AddAAAUserTMSessionPolicyBinding(resource models.AAAUserTMSessionPolicyBinding) error { + payload := map[string]any{"aaauser_tmsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserTMSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserTMSessionPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserTMSessionPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserTMSessionPolicyBinding() ([]models.AAAUserTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserTMSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserTMSessionPolicyBinding `json:"aaauser_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserTMSessionPolicyBinding(username string) ([]models.AAAUserTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserTMSessionPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserTMSessionPolicyBinding `json:"aaauser_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserTMSessionPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserTMSessionPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserTMSessionPolicyBinding `json:"aaauser_tmsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_vpnintranetapplication_binding +// Binding object showing the vpnintranetapplication that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnintranetapplication_binding +func (s *AAAService) AddAAAUserVPNIntranetApplicationBinding(resource models.AAAUserVPNIntranetApplicationBinding) error { + payload := map[string]any{"aaauser_vpnintranetapplication_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserVPNIntranetApplicationBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserVPNIntranetApplicationBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserVPNIntranetApplicationBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserVPNIntranetApplicationBinding() ([]models.AAAUserVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserVPNIntranetApplicationBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNIntranetApplicationBinding `json:"aaauser_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserVPNIntranetApplicationBinding(username string) ([]models.AAAUserVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserVPNIntranetApplicationBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNIntranetApplicationBinding `json:"aaauser_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserVPNIntranetApplicationBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserVPNIntranetApplicationBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserVPNIntranetApplicationBinding `json:"aaauser_vpnintranetapplication_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_vpnsessionpolicy_binding +// Binding object showing the vpnsessionpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnsessionpolicy_binding +func (s *AAAService) AddAAAUserVPNSessionPolicyBinding(resource models.AAAUserVPNSessionPolicyBinding) error { + payload := map[string]any{"aaauser_vpnsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserVPNSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserVPNSessionPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserVPNSessionPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserVPNSessionPolicyBinding() ([]models.AAAUserVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserVPNSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNSessionPolicyBinding `json:"aaauser_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserVPNSessionPolicyBinding(username string) ([]models.AAAUserVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserVPNSessionPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNSessionPolicyBinding `json:"aaauser_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserVPNSessionPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserVPNSessionPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserVPNSessionPolicyBinding `json:"aaauser_vpnsessionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_vpntrafficpolicy_binding +// Binding object showing the vpntrafficpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpntrafficpolicy_binding +func (s *AAAService) AddAAAUserVPNTrafficPolicyBinding(resource models.AAAUserVPNTrafficPolicyBinding) error { + payload := map[string]any{"aaauser_vpntrafficpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserVPNTrafficPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserVPNTrafficPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserVPNTrafficPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserVPNTrafficPolicyBinding() ([]models.AAAUserVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserVPNTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNTrafficPolicyBinding `json:"aaauser_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserVPNTrafficPolicyBinding(username string) ([]models.AAAUserVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserVPNTrafficPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNTrafficPolicyBinding `json:"aaauser_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserVPNTrafficPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserVPNTrafficPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserVPNTrafficPolicyBinding `json:"aaauser_vpntrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_vpnurlpolicy_binding +// Binding object showing the vpnurlpolicy that can be bound to aaauser. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnurlpolicy_binding +func (s *AAAService) AddAAAUserVPNURLPolicyBinding(resource models.AAAUserVPNURLPolicyBinding) error { + payload := map[string]any{"aaauser_vpnurlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserVPNURLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserVPNURLPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserVPNURLPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserVPNURLPolicyBinding() ([]models.AAAUserVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserVPNURLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNURLPolicyBinding `json:"aaauser_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserVPNURLPolicyBinding(username string) ([]models.AAAUserVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserVPNURLPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNURLPolicyBinding `json:"aaauser_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserVPNURLPolicyBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserVPNURLPolicyBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserVPNURLPolicyBinding `json:"aaauser_vpnurlpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// aaauser_vpnurl_binding +// Binding object showing the vpnurl that can be bound to aaauser. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/aaa/aaauser_vpnurl_binding -func (s *AAAService) AddAAAUserVPNURLBinding() {} -func (s *AAAService) DeleteAAAUserVPNURLBinding() {} -func (s *AAAService) GetAllAAAUserVPNURLBinding() {} -func (s *AAAService) GetAAAUserVPNURLBinding() {} -func (s *AAAService) CountAAAUserVPNURLBinding() {} +func (s *AAAService) AddAAAUserVPNURLBinding(resource models.AAAUserVPNURLBinding) error { + payload := map[string]any{"aaauser_vpnurl_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, aaaUserVPNURLBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) DeleteAAAUserVPNURLBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", aaaUserVPNURLBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AAAService) GetAllAAAUserVPNURLBinding() ([]models.AAAUserVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, aaaUserVPNURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNURLBinding `json:"aaauser_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) GetAAAUserVPNURLBinding(username string) ([]models.AAAUserVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", aaaUserVPNURLBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AAAUserVPNURLBinding `json:"aaauser_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AAAService) CountAAAUserVPNURLBinding(username string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", aaaUserVPNURLBindingURL, username), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AAAUserVPNURLBinding `json:"aaauser_vpnurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} diff --git a/nitrogo/adm.go b/nitrogo/adm.go index f95a82d..e9c1655 100644 --- a/nitrogo/adm.go +++ b/nitrogo/adm.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( admParameterURL = "/nitro/v1/config/admparameter" ) @@ -13,6 +22,72 @@ type ADMService struct { // admparameter // Configuration for ADM parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/adm/admparameter -func (s *ADMService) UpdateADMParamter() {} -func (s *ADMService) UnsetADMParamter() {} -func (s *ADMService) GetAllADMParamter() {} + +func (s *ADMService) UpdateADMParamter(param models.ADMParameter) error { + payload := map[string]any{ + "admparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, admParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ADMService) UnsetADMParamter(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "admparameter": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, admParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ADMService) GetAllADMParamter() (models.ADMParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, admParameterURL, nil) + if err != nil { + return models.ADMParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ADMParameter{}, err + } + + var result struct { + ADMParameters []models.ADMParameter `json:"admparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ADMParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ADMParameters) > 0 { + return result.ADMParameters[0], nil + } + + return models.ADMParameter{}, nil +} diff --git a/nitrogo/analytics.go b/nitrogo/analytics.go index 2bd0e9a..c65288f 100644 --- a/nitrogo/analytics.go +++ b/nitrogo/analytics.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( analyticsProfileURL = "/nitro/v1/config/analyticsprofile" analyticsGlobalAnalyticsProfileBindingURL = "/nitro/v1/config/analyticsglobal_analyticsprofile_binding" @@ -15,24 +25,283 @@ type AnalyticsService struct { // analyticsglobal_analyticsprofile_binding // Binding object showing the analyticsprofile that can be bound to analyticsglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/analytics/analyticsglobal_analyticsprofile_binding -func (s *AnalyticsService) AddAnalyticsGlobalAnalyticsProfileBinding() {} -func (s *AnalyticsService) DeleteAnalyticsGlobalAnalyticsProfileBinding() {} -func (s *AnalyticsService) GetAnalyticsGlobalAnalyticsProfileBinding() {} -func (s *AnalyticsService) CountAnalyticsGlobalAnalyticsProfileBinding() {} + +func (s *AnalyticsService) AddAnalyticsGlobalAnalyticsProfileBinding(binding models.AnalyticsGlobalAnalyticsProfileBinding) error { + payload := map[string]any{ + "analyticsglobal_analyticsprofile_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, analyticsGlobalAnalyticsProfileBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) DeleteAnalyticsGlobalAnalyticsProfileBinding(analyticsprofile string) error { + reqURL := fmt.Sprintf("%s?args=analyticsprofile:%s", analyticsGlobalAnalyticsProfileBindingURL, url.QueryEscape(analyticsprofile)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) GetAnalyticsGlobalAnalyticsProfileBinding() ([]models.AnalyticsGlobalAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, analyticsGlobalAnalyticsProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AnalyticsGlobalAnalyticsProfileBinding `json:"analyticsglobal_analyticsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AnalyticsService) CountAnalyticsGlobalAnalyticsProfileBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, analyticsGlobalAnalyticsProfileBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"analyticsglobal_analyticsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // analyticsglobal_binding // Binding object which returns the resources bound to analyticsglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/analytics/analyticsglobal_binding -func (s *AnalyticsService) AnalyticsGlobalBinding() {} + +func (s *AnalyticsService) AnalyticsGlobalBinding() (models.AnalyticsGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, analyticsGlobalBindingURL, nil) + if err != nil { + return models.AnalyticsGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AnalyticsGlobalBinding{}, err + } + + var result struct { + Bindings []models.AnalyticsGlobalBinding `json:"analyticsglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AnalyticsGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0], nil + } + + return models.AnalyticsGlobalBinding{}, nil +} // analyticsprofile // Configuration for Analytics profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/analytics/analyticsprofile -func (s *AnalyticsService) AddAnalyticsProfile() {} -func (s *AnalyticsService) UpdateAnalyticsProfile() {} -func (s *AnalyticsService) UnsetAnalyticsProfile() {} -func (s *AnalyticsService) DeleteAnalyticsProfile() {} -func (s *AnalyticsService) GetAllAnalyticsProfile() {} -func (s *AnalyticsService) GetAnalyticsProfile() {} -func (s *AnalyticsService) CheckAnalyticsProfile() {} -func (s *AnalyticsService) ChangeAnalyticsProfile() {} + +func (s *AnalyticsService) AddAnalyticsProfile(profile models.AnalyticsProfile) error { + payload := map[string]any{ + "analyticsprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, analyticsProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) UpdateAnalyticsProfile(profile models.AnalyticsProfile) error { + payload := map[string]any{ + "analyticsprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, analyticsProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) UnsetAnalyticsProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "analyticsprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, analyticsProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) DeleteAnalyticsProfile(name string) error { + url := fmt.Sprintf("%s/%s", analyticsProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AnalyticsService) GetAllAnalyticsProfile() ([]models.AnalyticsProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, analyticsProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AnalyticsProfiles []models.AnalyticsProfile `json:"analyticsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AnalyticsProfiles, nil +} + +func (s *AnalyticsService) GetAnalyticsProfile(name string) ([]models.AnalyticsProfile, error) { + url := fmt.Sprintf("%s/%s", analyticsProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AnalyticsProfiles []models.AnalyticsProfile `json:"analyticsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AnalyticsProfiles, nil +} + +func (s *AnalyticsService) CheckAnalyticsProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, analyticsProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + AnalyticsProfiles []struct { + Count float64 `json:"__count"` + } `json:"analyticsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.AnalyticsProfiles) > 0 { + return result.AnalyticsProfiles[0].Count, nil + } + + return 0, nil +} + +func (s *AnalyticsService) ChangeAnalyticsProfile(profile models.AnalyticsProfile) error { + payload := map[string]any{ + "analyticsprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, analyticsProfileURL+"?action=update", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/app.go b/nitrogo/app.go index 74ac8de..642cb80 100644 --- a/nitrogo/app.go +++ b/nitrogo/app.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( applicationURL = "/nitro/v1/config/application" ) @@ -13,6 +23,50 @@ type AppService struct { // application // Configuration for application resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/app/application -func (s *AppService) ImportApplication() {} -func (s *AppService) ExportApplication() {} -func (s *AppService) DeleteApplication() {} + +func (s *AppService) ImportApplication(app models.Application) error { + payload := map[string]any{ + "application": app, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, applicationURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppService) ExportApplication(app models.Application) error { + payload := map[string]any{ + "application": app, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, applicationURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppService) DeleteApplication(appname string) error { + reqURL := fmt.Sprintf("%s?args=appname:%s", applicationURL, url.QueryEscape(appname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/appflow.go b/nitrogo/appflow.go index f4c14a8..71c4ccd 100644 --- a/nitrogo/appflow.go +++ b/nitrogo/appflow.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( appFlowActionURL = "/nitro/v1/config/appflowaction" appFlowActionAnalyticsProfileBindingURL = "/nitro/v1/config/appflowaction_analyticsprofile_binding" @@ -29,136 +39,1370 @@ type AppFlowService struct { // appflowaction // Configuration for AppFlow action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowaction -func (s *AppFlowService) AddAppFlowAction() {} -func (s *AppFlowService) DeleteAppFlowAction() {} -func (s *AppFlowService) UpdateAppFlowAction() {} -func (s *AppFlowService) UnsetAppFlowAction() {} -func (s *AppFlowService) RenameAppFlowAction() {} -func (s *AppFlowService) GetAllAppFlowAction() {} -func (s *AppFlowService) GetAppFlowAction() {} -func (s *AppFlowService) CountAppFlowAction() {} + +func (s *AppFlowService) AddAppFlowAction(action models.AppFlowAction) error { + payload := map[string]any{ + "appflowaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFlowActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UpdateAppFlowAction(action models.AppFlowAction) error { + payload := map[string]any{ + "appflowaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UnsetAppFlowAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "appflowaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) RenameAppFlowAction(name, newname string) error { + payload := map[string]any{ + "appflowaction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowAction() ([]models.AppFlowAction, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowActions []models.AppFlowAction `json:"appflowaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowActions, nil +} + +func (s *AppFlowService) GetAppFlowAction(name string) ([]models.AppFlowAction, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowActions []models.AppFlowAction `json:"appflowaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowActions, nil +} + +func (s *AppFlowService) CountAppFlowAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + AppFlowActions []struct { + Count float64 `json:"__count"` + } `json:"appflowaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.AppFlowActions) > 0 { + return result.AppFlowActions[0].Count, nil + } + return 0, nil +} // appflowaction_analyticsprofile_binding // Binding object showing the analyticsprofile that can be bound to appflowaction. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowaction_analyticsprofile_binding -func (s *AppFlowService) AddAppFlowActionAnalyticsProfileBinding() {} -func (s *AppFlowService) DeleteAppFlowActionAnalyticsProfileBinding() {} -func (s *AppFlowService) GetAllAppFlowActionAnalyticsProfileBinding() {} -func (s *AppFlowService) GetAppFlowActionAnalyticsProfileBinding() {} -func (s *AppFlowService) CountAppFlowActionAnalyticsProfileBinding() {} + +func (s *AppFlowService) AddAppFlowActionAnalyticsProfileBinding(binding models.AppFlowActionAnalyticsProfileBinding) error { + payload := map[string]any{ + "appflowaction_analyticsprofile_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowActionAnalyticsProfileBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowActionAnalyticsProfileBinding(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFlowActionAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowActionAnalyticsProfileBinding() ([]models.AppFlowActionAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowActionAnalyticsProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowActionAnalyticsProfileBinding `json:"appflowaction_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowActionAnalyticsProfileBinding(name string) ([]models.AppFlowActionAnalyticsProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowActionAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowActionAnalyticsProfileBinding `json:"appflowaction_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowActionAnalyticsProfileBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowActionAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowaction_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowaction_binding // Binding object which returns the resources bound to appflowaction. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowaction_binding -func (s *AppFlowService) GetAllAppFlowActionBinding() {} -func (s *AppFlowService) GetAppFlowActionBinding() {} + +func (s *AppFlowService) GetAllAppFlowActionBinding() ([]models.AppFlowActionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowActionBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowActionBinding `json:"appflowaction_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowActionBinding(name string) ([]models.AppFlowActionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowActionBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowActionBinding `json:"appflowaction_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // appflowcollector // Configuration for AppFlow collector resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowcollector -func (s *AppFlowService) AddAppFlowCollector() {} -func (s *AppFlowService) UpdateAppFlowCollector() {} -func (s *AppFlowService) UnsetAppFlowCollector() {} -func (s *AppFlowService) DeleteAppFlowCollector() {} -func (s *AppFlowService) RenameAppFlowCollector() {} -func (s *AppFlowService) GetAllAppFlowCollector() {} -func (s *AppFlowService) GetAppFlowCollector() {} -func (s *AppFlowService) CountAppFlowCollector() {} + +func (s *AppFlowService) AddAppFlowCollector(collector models.AppFlowCollector) error { + payload := map[string]any{ + "appflowcollector": collector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowCollectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UpdateAppFlowCollector(collector models.AppFlowCollector) error { + payload := map[string]any{ + "appflowcollector": collector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowCollectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UnsetAppFlowCollector(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "appflowcollector": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowCollectorURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowCollector(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFlowCollectorURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) RenameAppFlowCollector(name, newname string) error { + payload := map[string]any{ + "appflowcollector": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowCollectorURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowCollector() ([]models.AppFlowCollector, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowCollectorURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowCollectors []models.AppFlowCollector `json:"appflowcollector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowCollectors, nil +} + +func (s *AppFlowService) GetAppFlowCollector(name string) ([]models.AppFlowCollector, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowCollectorURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowCollectors []models.AppFlowCollector `json:"appflowcollector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowCollectors, nil +} + +func (s *AppFlowService) CountAppFlowCollector() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowCollectorURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + AppFlowCollectors []struct { + Count float64 `json:"__count"` + } `json:"appflowcollector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.AppFlowCollectors) > 0 { + return result.AppFlowCollectors[0].Count, nil + } + return 0, nil +} // appflowglobal_appflowpolicy_binding // Binding object showing the appflowpolicy that can be bound to appflowglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowglobal_appflowpolicy_binding -func (s *AppFlowService) AddAppFlowGlobalAppFlowPolicyBinding() {} -func (s *AppFlowService) DeleteAppFlowGlobalAppFlowPolicyBinding() {} -func (s *AppFlowService) GetAppFlowGlobalAppFlowPolicyBinding() {} -func (s *AppFlowService) CountAppFlowGlobalAppFlowPolicyBinding() {} + +func (s *AppFlowService) AddAppFlowGlobalAppFlowPolicyBinding(binding models.AppFlowGlobalAppFlowPolicyBinding) error { + payload := map[string]any{ + "appflowglobal_appflowpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowGlobalAppFlowPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowGlobalAppFlowPolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", appFlowGlobalAppFlowPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAppFlowGlobalAppFlowPolicyBinding() ([]models.AppFlowGlobalAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowGlobalAppFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowGlobalAppFlowPolicyBinding `json:"appflowglobal_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowGlobalAppFlowPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowGlobalAppFlowPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowglobal_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowglobal_binding // Binding object which returns the resources bound to appflowglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowglobal_binding -func (s *AppFlowService) GetAppFlowGlobalBinding() {} + +func (s *AppFlowService) GetAppFlowGlobalBinding() ([]models.AppFlowGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowGlobalBinding `json:"appflowglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // appflowparam // Configuration for AppFlow parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowparam -func (s *AppFlowService) UpdateAppFlowParam() {} -func (s *AppFlowService) UnsetAppFlowParam() {} -func (s *AppFlowService) GetAllAppFlowParam() {} + +func (s *AppFlowService) UpdateAppFlowParam(param models.AppFlowParam) error { + payload := map[string]any{ + "appflowparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UnsetAppFlowParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "appflowparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowParam() (models.AppFlowParam, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowParamURL, nil) + if err != nil { + return models.AppFlowParam{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.AppFlowParam{}, err + } + var result struct { + AppFlowParams []models.AppFlowParam `json:"appflowparam"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AppFlowParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.AppFlowParams) > 0 { + return result.AppFlowParams[0], nil + } + return models.AppFlowParam{}, nil +} // appflowpolicy // Configuration for AppFlow policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy -func (s *AppFlowService) AddAppFlowPolicy() {} -func (s *AppFlowService) DeleteAppFlowPolicy() {} -func (s *AppFlowService) UpdateAppFlowPolicy() {} -func (s *AppFlowService) UnsetAppFlowPolicy() {} -func (s *AppFlowService) RenameAppFlowPolicy() {} -func (s *AppFlowService) GetAllAppFlowPolicy() {} -func (s *AppFlowService) GetAppFlowPolicy() {} -func (s *AppFlowService) CountAppFlowPolicy() {} + +func (s *AppFlowService) AddAppFlowPolicy(policy models.AppFlowPolicy) error { + payload := map[string]any{ + "appflowpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UpdateAppFlowPolicy(policy models.AppFlowPolicy) error { + payload := map[string]any{ + "appflowpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) UnsetAppFlowPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "appflowpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) RenameAppFlowPolicy(name, newname string) error { + payload := map[string]any{ + "appflowpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowPolicy() ([]models.AppFlowPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowPolicies []models.AppFlowPolicy `json:"appflowpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowPolicies, nil +} + +func (s *AppFlowService) GetAppFlowPolicy(name string) ([]models.AppFlowPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowPolicies []models.AppFlowPolicy `json:"appflowpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowPolicies, nil +} + +func (s *AppFlowService) CountAppFlowPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + AppFlowPolicies []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.AppFlowPolicies) > 0 { + return result.AppFlowPolicies[0].Count, nil + } + return 0, nil +} // appflowpolicylabel // Configuration for AppFlow policy label resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicylabel -func (s *AppFlowService) AddAppFlowPolicyLabel() {} -func (s *AppFlowService) DeleteAppFlowPolicyLabel() {} -func (s *AppFlowService) RenameAppFlowPolicyLabel() {} -func (s *AppFlowService) GetAllAppFlowPolicyLabel() {} -func (s *AppFlowService) GetAppFlowPolicyLabel() {} -func (s *AppFlowService) CountAppFlowPolicyLabel() {} + +func (s *AppFlowService) AddAppFlowPolicyLabel(label models.AppFlowPolicyLabel) error { + payload := map[string]any{ + "appflowpolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowPolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) RenameAppFlowPolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "appflowpolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, appFlowPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowPolicyLabel() ([]models.AppFlowPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowPolicyLabels []models.AppFlowPolicyLabel `json:"appflowpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowPolicyLabels, nil +} + +func (s *AppFlowService) GetAppFlowPolicyLabel(labelname string) ([]models.AppFlowPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + AppFlowPolicyLabels []models.AppFlowPolicyLabel `json:"appflowpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.AppFlowPolicyLabels, nil +} + +func (s *AppFlowService) CountAppFlowPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + AppFlowPolicyLabels []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.AppFlowPolicyLabels) > 0 { + return result.AppFlowPolicyLabels[0].Count, nil + } + return 0, nil +} // appflowpolicylabel_appflowpolicy_binding // Binding object showing the appflowpolicy that can be bound to appflowpolicylabel. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicylabel_appflowpolicy_binding -func (s *AppFlowService) AddAppFlowPolicyLabelAppFlowPolicyBinding() {} -func (s *AppFlowService) DeleteAppFlowPolicyLabelAppFlowPolicyBinding() {} -func (s *AppFlowService) GetAllAppFlowPolicyLabelAppFlowPolicyBinding() {} -func (s *AppFlowService) GetAppFlowPolicyLabelAppFlowPolicyBinding() {} -func (s *AppFlowService) CountAppFlowPolicyLabelAppFlowPolicyBinding() {} + +func (s *AppFlowService) AddAppFlowPolicyLabelAppFlowPolicyBinding(binding models.AppFlowPolicyLabelAppFlowPolicyBinding) error { + payload := map[string]any{ + "appflowpolicylabel_appflowpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, appFlowPolicyLabelAppFlowPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) DeleteAppFlowPolicyLabelAppFlowPolicyBinding(labelname string, policyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s", appFlowPolicyLabelAppFlowPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AppFlowService) GetAllAppFlowPolicyLabelAppFlowPolicyBinding() ([]models.AppFlowPolicyLabelAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyLabelAppFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLabelAppFlowPolicyBinding `json:"appflowpolicylabel_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyLabelAppFlowPolicyBinding(labelname string) ([]models.AppFlowPolicyLabelAppFlowPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyLabelAppFlowPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLabelAppFlowPolicyBinding `json:"appflowpolicylabel_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicyLabelAppFlowPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyLabelAppFlowPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicylabel_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowpolicylabel_binding // Binding object which returns the resources bound to appflowpolicylabel. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicylabel_binding -func (s *AppFlowService) GetAllAppFlowPolicyLabelBinding() {} -func (s *AppFlowService) GetAppFlowPolicyLabelBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyLabelBinding() ([]models.AppFlowPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLabelBinding `json:"appflowpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyLabelBinding(labelname string) ([]models.AppFlowPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLabelBinding `json:"appflowpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // appflowpolicy_appflowglobal_binding // Binding object showing the appflowglobal that can be bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_appflowglobal_binding -func (s *AppFlowService) GetAllAppFlowPolicyAppFlowGlobalBinding() {} -func (s *AppFlowService) GetAppFlowPolicyAppFlowGlobalBinding() {} -func (s *AppFlowService) CountAppFlowPolicyAppFlowGlobalBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyAppFlowGlobalBinding() ([]models.AppFlowPolicyAppFlowGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyAppFlowGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyAppFlowGlobalBinding `json:"appflowpolicy_appflowglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyAppFlowGlobalBinding(name string) ([]models.AppFlowPolicyAppFlowGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyAppFlowGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyAppFlowGlobalBinding `json:"appflowpolicy_appflowglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicyAppFlowGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyAppFlowGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy_appflowglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowpolicy_appflowpolicylabel_binding // Binding object showing the appflowpolicylabel that can be bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_appflowpolicylabel_binding -func (s *AppFlowService) GetAllAppFlowPolicyAppFlowPolicyLabelBinding() {} -func (s *AppFlowService) GetAppFlowPolicyAppFlowPolicyLabelBinding() {} -func (s *AppFlowService) CountAppFlowPolicyAppFlowPolicyLabelBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyAppFlowPolicyLabelBinding() ([]models.AppFlowPolicyAppFlowPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyAppFlowPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyAppFlowPolicyLabelBinding `json:"appflowpolicy_appflowpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyAppFlowPolicyLabelBinding(name string) ([]models.AppFlowPolicyAppFlowPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyAppFlowPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyAppFlowPolicyLabelBinding `json:"appflowpolicy_appflowpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicyAppFlowPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyAppFlowPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy_appflowpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowpolicy_binding // Binding object which returns the resources bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_binding -func (s *AppFlowService) GetAllAppFlowPolicyBinding() {} -func (s *AppFlowService) GetAppFlowPolicyBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyBinding() ([]models.AppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyBinding `json:"appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyBinding(name string) ([]models.AppFlowPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyBinding `json:"appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // appflowpolicy_csvserver_binding // Binding object showing the csvserver that can be bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_csvserver_binding -func (s *AppFlowService) GetAllAppFlowPolicyCSVServerBinding() {} -func (s *AppFlowService) GetAppFlowPolicyCSVServerBinding() {} -func (s *AppFlowService) CountAppFlowPolicyCSVServerBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyCSVServerBinding() ([]models.AppFlowPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyCSVServerBinding `json:"appflowpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyCSVServerBinding(name string) ([]models.AppFlowPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyCSVServerBinding `json:"appflowpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowpolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_lbvserver_binding -func (s *AppFlowService) GetAllAppFlowPolicy_LBVServerBinding() {} -func (s *AppFlowService) GetAppFlowPolicy_LBVServerBinding() {} -func (s *AppFlowService) CountAppFlowPolicy_LBVServerBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicy_LBVServerBinding() ([]models.AppFlowPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLBVServerBinding `json:"appflowpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicy_LBVServerBinding(name string) ([]models.AppFlowPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyLBVServerBinding `json:"appflowpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicy_LBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // appflowpolicy_vpnvserver_binding // Binding object showing the vpnvserver that can be bound to appflowpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appflow/appflowpolicy_vpnvserver_binding -func (s *AppFlowService) GetAllAppFlowPolicyVPNVServerBinding() {} -func (s *AppFlowService) GetAppFlowPolicyVPNVServerBinding() {} -func (s *AppFlowService) CountAppFlowPolicyVPNVServerBinding() {} + +func (s *AppFlowService) GetAllAppFlowPolicyVPNVServerBinding() ([]models.AppFlowPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFlowPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyVPNVServerBinding `json:"appflowpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) GetAppFlowPolicyVPNVServerBinding(name string) ([]models.AppFlowPolicyVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFlowPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AppFlowPolicyVPNVServerBinding `json:"appflowpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AppFlowService) CountAppFlowPolicyVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFlowPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appflowpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/appfw.go b/nitrogo/appfw.go index 3b3327b..9b71ced 100644 --- a/nitrogo/appfw.go +++ b/nitrogo/appfw.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( appFWArchiveURL = "/nitro/v1/config/appfwarchive" appFWConfidFieldURL = "/nitro/v1/config/appfwconfidfield" @@ -71,501 +81,5930 @@ type AppFWService struct { // appfwarchive // Configuration for archive resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwarchive -func (s *AppFWService) DeleteAppFWArchive() {} -func (s *AppFWService) ExportAppFWArchive() {} -func (s *AppFWService) ImportAppFWArchive() {} -func (s *AppFWService) GetAllAppFWArchive() {} +func (s *AppFWService) DeleteAppFWArchive(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWArchiveURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ExportAppFWArchive(resource models.AppFWArchive) error { + payload := map[string]any{ + "appfwarchive": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWArchiveURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ImportAppFWArchive(resource models.AppFWArchive) error { + payload := map[string]any{ + "appfwarchive": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWArchiveURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWArchive() ([]models.AppFWArchive, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWArchiveURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Archives []models.AppFWArchive `json:"appfwarchive"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Archives, nil +} // appfwconfidfield // Configuration for configured confidential form fields resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwconfidfield -func (s *AppFWService) AddAppFWConfigField() {} -func (s *AppFWService) DeleteAppFWConfigField() {} -func (s *AppFWService) UpdateAppFWConfigField() {} -func (s *AppFWService) UnsetAppFWConfigField() {} -func (s *AppFWService) GetAllAppFWConfigField() {} -func (s *AppFWService) CountAppFWConfigField() {} +func (s *AppFWService) AddAppFWConfigField(resource models.AppFWConfidField) error { + payload := map[string]any{ + "appfwconfidfield": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWConfidFieldURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWConfigField(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWConfidFieldURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UpdateAppFWConfigField(resource models.AppFWConfidField) error { + payload := map[string]any{ + "appfwconfidfield": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWConfidFieldURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UnsetAppFWConfigField(resource models.AppFWConfidField) error { + payload := map[string]any{ + "appfwconfidfield": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWConfidFieldURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWConfigField() ([]models.AppFWConfidField, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWConfidFieldURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Fields []models.AppFWConfidField `json:"appfwconfidfield"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Fields, nil +} + +func (s *AppFWService) CountAppFWConfigField() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWConfidFieldURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Fields []struct { + Count float64 `json:"__count"` + } `json:"appfwconfidfield"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Fields) > 0 { + return result.Fields[0].Count, nil + } + + return 0, nil +} // appfwcustomsettings // Configuration for application firewall custom settings XML configuration resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwcustomsettings -func (s *AppFWService) ExportAppFWCustomSettings() {} +func (s *AppFWService) ExportAppFWCustomSettings(resource models.AppFWCustomSettings) error { + payload := map[string]any{ + "appfwcustomsettings": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWCustomSettingsURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // appfwfieldtype // Configuration for application firewall form field type resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwfieldtype -func (s *AppFWService) AddAppFWFieldType() {} -func (s *AppFWService) DeleteAppFWFieldType() {} -func (s *AppFWService) UpdateAppFWFieldType() {} -func (s *AppFWService) GetAllAppFWFieldType() {} -func (s *AppFWService) GetAppFWFieldType() {} -func (s *AppFWService) CountAppFWFieldType() {} +func (s *AppFWService) AddAppFWFieldType(resource models.AppFWFieldType) error { + payload := map[string]any{ + "appfwfieldtype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWFieldTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWFieldType(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWFieldTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UpdateAppFWFieldType(resource models.AppFWFieldType) error { + payload := map[string]any{ + "appfwfieldtype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWFieldTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWFieldType() ([]models.AppFWFieldType, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWFieldTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + FieldTypes []models.AppFWFieldType `json:"appfwfieldtype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.FieldTypes, nil +} + +func (s *AppFWService) GetAppFWFieldType(name string) (*models.AppFWFieldType, error) { + reqURL := fmt.Sprintf("%s/%s", appFWFieldTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + FieldTypes []models.AppFWFieldType `json:"appfwfieldtype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.FieldTypes) == 0 { + return nil, fmt.Errorf("appfwfieldtype not found") + } + + return &result.FieldTypes[0], nil +} + +func (s *AppFWService) CountAppFWFieldType() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWFieldTypeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + FieldTypes []struct { + Count float64 `json:"__count"` + } `json:"appfwfieldtype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.FieldTypes) > 0 { + return result.FieldTypes[0].Count, nil + } + + return 0, nil +} // appfwglobal_appfwpolicy_binding // Binding object showing the appfwpolicy that can be bound to appfwglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_appfwpolicy_binding -func (s *AppFWService) AddAppFWGlobalAppFWPolicyBinding() {} -func (s *AppFWService) DeleteAppFWGlobalAppFWPolicyBinding() {} -func (s *AppFWService) GetAppFWGlobalAppFWPolicyBinding() {} -func (s *AppFWService) CountAppFWGlobalAppFWPolicyBinding() {} +func (s *AppFWService) AddAppFWGlobalAppFWPolicyBinding(resource models.AppFWGlobalAppFWPolicyBinding) error { + payload := map[string]any{ + "appfwglobal_appfwpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } -// appfwglobal_auditnslogpolicy_binding -// Binding object showing the auditnslogpolicy that can be bound to appfwglobal. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_auditnslogpolicy_binding -func (s *AppFWService) AddAppFWGlobalAuditNSLogPolicyBinding() {} -func (s *AppFWService) DeleteAppFWGlobalAuditNSLogPolicyBinding() {} -func (s *AppFWService) GetAppFWGlobalAuditNSLogPolicyBinding() {} -func (s *AppFWService) CountAppFWGlobalAuditNSLogPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, appFWGlobalAppFWPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } -// appfwglobal_audtisyslogpolicy_binding -// Binding object showing the auditsyslogpolicy that can be bound to appfwglobal. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_auditsyslogpolicy_binding -func (s *AppFWService) AddAppFWGlobalAuditSyslogPolicyBinding() {} -func (s *AppFWService) DeleteAppFWGlobalAuditSyslogPolicyBinding() {} -func (s *AppFWService) GetAppFWGlobalAuditSyslogPolicyBinding() {} -func (s *AppFWService) CountAppFWGlobalAuditSyslogPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// appfwglobal_binding -// Binding object which returns the resources bound to appfwglobal. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_binding -func (s *AppFWService) GetAppFWGlobalBinding() {} +func (s *AppFWService) DeleteAppFWGlobalAppFWPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWGlobalAppFWPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } -// appfwhtmlerrorpage -// Configuration for HTML error page resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwhtmlerrorpage -func (s *AppFWService) DeleteAppFWHTMLErrorPage() {} -func (s *AppFWService) GetAllAppFWHTMLErrorPage() {} -func (s *AppFWService) GetAppFWHTMLErrorPage() {} -func (s *AppFWService) ImportAppFWHTMLErrorPage() {} -func (s *AppFWService) ChangeAppFWHTMLErrorPage() {} + _, err = s.client.Do(req) + return err +} -// appfwjsoncontenttype -// Configuration for JSON content type resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwjsoncontenttype -func (s *AppFWService) AddAppFWJSONContentType() {} -func (s *AppFWService) DeleteAppFWJSONContentType() {} -func (s *AppFWService) GetAllAppFWJSONContentType() {} -func (s *AppFWService) GetAppFWJSONContentType() {} -func (s *AppFWService) CountAppFWJSONContentType() {} +func (s *AppFWService) GetAppFWGlobalAppFWPolicyBinding() ([]models.AppFWGlobalAppFWPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAppFWPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// appfwjsonerrorpage -// Configuration for JSON error page resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwjsonerrorpage -func (s *AppFWService) DeleteAppFWJSONErrorPage() {} -func (s *AppFWService) GetAllAppFWJSONErrorPage() {} -func (s *AppFWService) GetAppFWJSONErrorPage() {} -func (s *AppFWService) ImportAppFWJSONErrorPage() {} -func (s *AppFWService) ChangeAppFWJSONErrorPage() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// appfwlearningdata -// Configuration for learning data resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwlearningdata -func (s *AppFWService) DeleteAppFWLearningData() {} -func (s *AppFWService) GetAllAppFWLearningData() {} -func (s *AppFWService) CountAppFWLearningData() {} -func (s *AppFWService) ResetAppFWLearningData() {} -func (s *AppFWService) ExportAppFWLearningData() {} + var result struct { + Bindings []models.AppFWGlobalAppFWPolicyBinding `json:"appfwglobal_appfwpolicy_binding"` + } -// appfwlearningsettings -// Configuration for learning settings resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwlearningsettings -func (s *AppFWService) UpdateAppFWLearningSettings() {} -func (s *AppFWService) UnsetAppFWLearningSettings() {} -func (s *AppFWService) GetAllAppFWLearningSettings() {} -func (s *AppFWService) GetAppFWLearningSettings() {} -func (s *AppFWService) CountAppFWLearningSettings() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwmultipartformcontenttype -// Configuration for Multipart form content type resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwmultipartformcontenttype -func (s *AppFWService) AddAppFWMultipartFormContentType() {} -func (s *AppFWService) DeleteAppFWMultipartFormContentType() {} -func (s *AppFWService) GetAllAppFWMultipartFormContentType() {} -func (s *AppFWService) GetAppFWMultipartFormContentType() {} -func (s *AppFWService) CountAppFWMultipartFormContentType() {} + return result.Bindings, nil +} -// appfwpolicy -// Configuration for application firewall policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy -func (s *AppFWService) AddAppFWPolicy() {} -func (s *AppFWService) DeleteAppFWPolicy() {} -func (s *AppFWService) UpdateAppFWPolicy() {} -func (s *AppFWService) UnsetAppFWPolicy() {} -func (s *AppFWService) GetAllAppFWPolicy() {} -func (s *AppFWService) GetAppFWPolicy() {} -func (s *AppFWService) CountAppFWPolicy() {} -func (s *AppFWService) RenameAppFWPolicy() {} +func (s *AppFWService) CountAppFWGlobalAppFWPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAppFWPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } -// appfwpolicylabel -// Configuration for application firewall policy label resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel -func (s *AppFWService) AddAppFWPolicyLabel() {} -func (s *AppFWService) DeleteAppFWPolicyLabel() {} -func (s *AppFWService) GetAllAppFWPolicyLabel() {} -func (s *AppFWService) GetAppFWPolicyLabel() {} -func (s *AppFWService) CountAppFWPolicyLabel() {} -func (s *AppFWService) RenameAppFWPolicyLabel() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// appfwpolicylabel_appfwpolicy_binding -// Binding object showing the appfwpolicy that can be bound to appfwpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_appfwpolicy_binding -func (s *AppFWService) AddAppFWPolicyLabelAppFWPolicyBinding() {} -func (s *AppFWService) DeleteAppFWPolicyLabelAppFWPolicyBinding() {} -func (s *AppFWService) GetAllAppFWPolicyLabelAppFWPolicyBinding() {} -func (s *AppFWService) GetAppFWPolicyLabelAppFWPolicyBinding() {} -func (s *AppFWService) CountAppFWPolicyLabelAppFWPolicyBinding() {} + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwglobal_appfwpolicy_binding"` + } -// appfwpolicylabel_binding -// Binding object which returns the resources bound to appfwpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_binding -func (s *AppFWService) GetAllAppFWPolicyLabelBinding() {} -func (s *AppFWService) GetAppFWPolicyLabelBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwpolicylabel_policybinding_binding -// Binding object showing the policybinding that can be bound to appfwpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_policybinding_binding -func (s *AppFWService) GetAllAppFWPolicyLabelPolicyBindingBinding() {} -func (s *AppFWService) GetAppFWPolicyLabelPolicyBindingBinding() {} -func (s *AppFWService) CountAppFWPolicyLabelPolicyBindingBinding() {} + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } -// appfwpolicy_appfwglobal_binding -// Binding object showing the appfwglobal that can be bound to appfwpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_appfwglobal_binding -func (s *AppFWService) GetAllAppFWPolicyAppFWGlobalBinding() {} -func (s *AppFWService) GetAppFWPolicyAppFWGlobalBinding() {} -func (s *AppFWService) CountAppFWPolicyAppFWGlobalBinding() {} + return 0, nil +} -// appfwpolicy_appfwpolicylabel_binding -// Binding object showing the appfwpolicylabel that can be bound to appfwpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_appfwpolicylabel_binding -func (s *AppFWService) GetAllAppFWPolicyAppFWPolicyLabelBinding() {} -func (s *AppFWService) GetAppFWPolicyAppFWPolicyLabelBinding() {} -func (s *AppFWService) CountAppFWPolicyAppFWPolicyLabelBinding() {} +// appfwglobal_auditnslogpolicy_binding +// Binding object showing the auditnslogpolicy that can be bound to appfwglobal. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_auditnslogpolicy_binding +func (s *AppFWService) AddAppFWGlobalAuditNSLogPolicyBinding(resource models.AppFWGlobalAuditNSLogPolicyBinding) error { + payload := map[string]any{ + "appfwglobal_auditnslogpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } -// appfwpolicy_binding -// Binding object which returns the resources bound to appfwpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_binding -func (s *AppFWService) GetAllAppFWPolicyBinding() {} -func (s *AppFWService) GetAppFWPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, appFWGlobalAuditNSLogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } -// appfwpolicy_csvserver_binding -// Binding object showing the csvserver that can be bound to appfwpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_csvserver_binding -func (s *AppFWService) GetAllAppFWPolicyCSVServerBinding() {} -func (s *AppFWService) GetAppFWPolicyCSVServerBinding() {} -func (s *AppFWService) CountAppFWPolicyCSVServerBinding() {} + _, err = s.client.Do(req) + return err +} -// appfwpolicy_lbvserver_binding -// Binding object showing the lbvserver that can be bound to appfwpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_lbvserver_binding -func (s *AppFWService) GetAllAppFWPolicyLBVServerBinding() {} -func (s *AppFWService) GetAppFWPolicyLBVServerBinding() {} -func (s *AppFWService) CountAppFWPolicyLBVServerBinding() {} +func (s *AppFWService) DeleteAppFWGlobalAuditNSLogPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWGlobalAuditNSLogPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } -// appfwprofile -// Configuration for application firewall profile resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile -func (s *AppFWService) AddAppFWProfile() {} -func (s *AppFWService) DeleteAppFWProfile() {} -func (s *AppFWService) UpdateAppFWProfile() {} -func (s *AppFWService) UnsetAppFWProfile() {} -func (s *AppFWService) GetAllAppFWProfile() {} -func (s *AppFWService) GetAppFWProfile() {} -func (s *AppFWService) CountAppFWProfile() {} -func (s *AppFWService) RestoreAppFWProfile() {} + _, err = s.client.Do(req) + return err +} -// appfwprofile_binding -// Binding object which returns the resources bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_binding -func (s *AppFWService) GetAllAppFWProfileBinding() {} -func (s *AppFWService) GetAppFWProfileBinding() {} +func (s *AppFWService) GetAppFWGlobalAuditNSLogPolicyBinding() ([]models.AppFWGlobalAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// appfwprofile_cmdinjection_binding -// Binding object showing the cmdinjection that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_cmdinjection_binding -func (s *AppFWService) AddAppFWProfileCMDInjectionBinding() {} -func (s *AppFWService) DeleteAppFWProfileCMDInjectionBinding() {} -func (s *AppFWService) GetAllAppFWProfileCMDInjectionBinding() {} -func (s *AppFWService) GetAppFWProfileCMDInjectionBinding() {} -func (s *AppFWService) CountAppFWProfileCMDInjectionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// appfwprofile_contenttype_binding -// Binding object showing the contenttype that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_contenttype_binding -func (s *AppFWService) AddAppFWProfileContentTypeBinding() {} -func (s *AppFWService) DeleteAppFWProfileContentTypeBinding() {} -func (s *AppFWService) GetAllAppFWProfileContentTypeBinding() {} -func (s *AppFWService) GetAppFWProfileContentTypeBinding() {} -func (s *AppFWService) CountAppFWProfileContentTypeBinding() {} + var result struct { + Bindings []models.AppFWGlobalAuditNSLogPolicyBinding `json:"appfwglobal_auditnslogpolicy_binding"` + } -// appfwprofile_cookieconsistency_binding -// Binding object showing the cookieconsistency that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_cookieconsistency_binding -func (s *AppFWService) AddAppFWProfileCookieConsistencyBinding() {} -func (s *AppFWService) DeleteAppFWProfileCookieConsistencyBinding() {} -func (s *AppFWService) GetAllAppFWProfileCookieConsistencyBinding() {} -func (s *AppFWService) GetAppFWProfileCookieConsistencyBinding() {} -func (s *AppFWService) CountAppFWProfileCookieConsistencyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwprofile_creditcardnumber_binding -// Binding object showing the creditcardnumber that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_creditcardnumber_binding -func (s *AppFWService) AddAppFWProfileCreditCardNumberBinding() {} -func (s *AppFWService) DeleteAppFWProfileCreditCardNumberBinding() {} -func (s *AppFWService) GetAllAppFWProfileCreditCardNumberBinding() {} -func (s *AppFWService) GetAppFWProfileCreditCardNumberBinding() {} -func (s *AppFWService) CountAppFWProfileCreditCardNumberBinding() {} + return result.Bindings, nil +} -// appfwprofile_crosssitescripting_binding -// Binding object showing the crosssitescripting that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_crosssitescripting_binding -func (s *AppFWService) AddAppFWProfileCrossSiteScriptingBinding() {} -func (s *AppFWService) DeleteAppFWProfileCrossSiteScriptingBinding() {} -func (s *AppFWService) GetAllAppFWProfileCrossSiteScriptingBinding() {} -func (s *AppFWService) GetAppFWProfileCrossSiteScriptingBinding() {} -func (s *AppFWService) CountAppFWProfileCrossSiteScriptingBinding() {} +func (s *AppFWService) CountAppFWGlobalAuditNSLogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAuditNSLogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } -// appfwprofile_csrftag_binding -// Binding object showing the csrftag that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_csrftag_binding -func (s *AppFWService) AddAppFWProfileCSRFTagBinding() {} -func (s *AppFWService) DeleteAppFWProfileCSRFTagBinding() {} -func (s *AppFWService) GetAllAppFWProfileCSRFTagBinding() {} -func (s *AppFWService) GetAppFWProfileCSRFTagBinding() {} -func (s *AppFWService) CountAppFWProfileCSRFTagBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// appfwprofile_denyurl_binding -// Binding object showing the denyurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_denyurl_binding -func (s *AppFWService) AddAppFWProfileDenyURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileDenyURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileDenyURLBinding() {} -func (s *AppFWService) GetAppFWProfileDenyURLBinding() {} -func (s *AppFWService) CountAppFWProfileDenyURLBinding() {} + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwglobal_auditnslogpolicy_binding"` + } -// appfwprofile_excluderescontenttype_binding -// Binding object showing the excluderescontenttype that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_excluderescontenttype_binding -func (s *AppFWService) AddAppFWProfileExcludeRESContentTypeBinding() {} -func (s *AppFWService) DeleteAppFWProfileExcludeRESContentTypeBinding() {} -func (s *AppFWService) GetAllAppFWProfileExcludeRESContentTypeBinding() {} -func (s *AppFWService) GetAppFWProfileExcludeRESContentTypeBinding() {} -func (s *AppFWService) CountAppFWProfileExcludeRESContentTypeBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwprofile_fieldconsistency_binding -// Binding object showing the fieldconsistency that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fieldconsistency_binding -func (s *AppFWService) AddAppFWProfileFieldConsistencyBinding() {} -func (s *AppFWService) DeleteAppFWProfileFieldConsistencyBinding() {} -func (s *AppFWService) GetAllAppFWProfileFieldConsistencyBinding() {} -func (s *AppFWService) GetAppFWProfileFieldConsistencyBinding() {} -func (s *AppFWService) CountAppFWProfileFieldConsistencyBinding() {} + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } -// appfwprofile_fieldformat_binding -// Binding object showing the fieldformat that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fieldformat_binding -func (s *AppFWService) AddAppFWProfileFieldFormatBinding() {} -func (s *AppFWService) DeleteAppFWProfileFieldFormatBinding() {} -func (s *AppFWService) GetAllAppFWProfileFieldFormatBinding() {} -func (s *AppFWService) GetAppFWProfileFieldFormatBinding() {} -func (s *AppFWService) CountAppFWProfileFieldFormatBinding() {} + return 0, nil +} -// appfwprofile_fileuploadtype_binding -// Binding object showing the fileuploadtype that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fileuploadtype_binding -func (s *AppFWService) AddAppFWProfileFileUploadTypeBinding() {} -func (s *AppFWService) DeleteAppFWProfileFileUploadTypeBinding() {} -func (s *AppFWService) GetAllAppFWProfileFileUploadTypeBinding() {} -func (s *AppFWService) GetAppFWProfileFileUploadTypeBinding() {} -func (s *AppFWService) CountAppFWProfileFileUploadTypeBinding() {} +// appfwglobal_audtisyslogpolicy_binding +// Binding object showing the auditsyslogpolicy that can be bound to appfwglobal. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_auditsyslogpolicy_binding +func (s *AppFWService) AddAppFWGlobalAuditSyslogPolicyBinding(resource models.AppFWGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{ + "appfwglobal_auditsyslogpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } -// appfwprofile_jsondosurl_binding -// Binding object showing the jsondosurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsondosurl_binding -func (s *AppFWService) AddAppFWProfileJSONDOSURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileJSONDOSURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileJSONDOSURLBinding() {} -func (s *AppFWService) GetAppFWProfileJSONDOSURLBinding() {} -func (s *AppFWService) CountAppFWProfileJSONDOSURLBinding() {} + req, err := s.client.NewRequest(http.MethodPost, appFWGlobalAuditSyslogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } -// appfwprofile_jsonsqlurl_binding -// Binding object showing the jsonsqlurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsonsqlurl_binding -func (s *AppFWService) AddAppFWProfileJSONSQLURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileJSONSQLURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileJSONSQLURLBinding() {} -func (s *AppFWService) GetAppFWProfileJSONSQLURLBinding() {} -func (s *AppFWService) CountAppFWProfileJSONSQLURLBinding() {} + _, err = s.client.Do(req) + return err +} -// appfwprofile_jsonxssurl_binding -// Binding object showing the jsonxssurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsonxssurl_binding -func (s *AppFWService) AddAppFWProfileJSONXSSURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileJSONXSSURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileJSONXSSURLBinding() {} -func (s *AppFWService) GetAppFWProfileJSONXSSURLBinding() {} -func (s *AppFWService) CountAppFWProfileJSONXSSURLBinding() {} +func (s *AppFWService) DeleteAppFWGlobalAuditSyslogPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWGlobalAuditSyslogPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } -// appfwprofile_logexpression_binding -// Binding object showing the logexpression that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_logexpression_binding -func (s *AppFWService) AddAppFWProfileLogExpressionBinding() {} -func (s *AppFWService) DeleteAppFWProfileLogExpressionBinding() {} -func (s *AppFWService) GetAllAppFWProfileLogExpressionBinding() {} -func (s *AppFWService) GetAppFWProfileLogExpressionBinding() {} -func (s *AppFWService) CountAppFWProfileLogExpressionBinding() {} + _, err = s.client.Do(req) + return err +} -// appfwprofile_safeobject_binding -// Binding object showing the safeobject that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_safeobject_binding -func (s *AppFWService) AddAppFWProfileSafeObjectBinding() {} -func (s *AppFWService) DeleteAppFWProfileSafeObjectBinding() {} -func (s *AppFWService) GetAllAppFWProfileSafeObjectBinding() {} -func (s *AppFWService) GetAppFWProfileSafeObjectBinding() {} -func (s *AppFWService) CountAppFWProfileSafeObjectBinding() {} +func (s *AppFWService) GetAppFWGlobalAuditSyslogPolicyBinding() ([]models.AppFWGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// appfwprofile_sqlinjection_binding -// Binding object showing the sqlinjection that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_sqlinjection_binding -func (s *AppFWService) AddAppFWProfileSQLInjectionBinding() {} -func (s *AppFWService) DeleteAppFWProfileSQLInjectionBinding() {} -func (s *AppFWService) GetAllAppFWProfileSQLInjectionBinding() {} -func (s *AppFWService) GetAppFWProfileSQLInjectionBinding() {} -func (s *AppFWService) CountAppFWProfileSQLInjectionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// appfwprofile_starturl_binding -// Binding object showing the starturl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_starturl_binding -func (s *AppFWService) AddAppFWProfileStartURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileStartURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileStartURLBinding() {} -func (s *AppFWService) GetAppFWProfileStartURLBinding() {} -func (s *AppFWService) CountAppFWProfileStartURLBinding() {} + var result struct { + Bindings []models.AppFWGlobalAuditSyslogPolicyBinding `json:"appfwglobal_auditsyslogpolicy_binding"` + } -// appfwprofile_trustedlearningclients_binding -// Binding object showing the trustedlearningclients that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_trustedlearningclients_binding -func (s *AppFWService) AddAppFWProfileTrustedLearningClientsBinding() {} -func (s *AppFWService) DeleteAppFWProfileTrustedLearningClientsBinding() {} -func (s *AppFWService) GetAllAppFWProfileTrustedLearningClientsBinding() {} -func (s *AppFWService) GetAppFWProfileTrustedLearningClientsBinding() {} -func (s *AppFWService) CountAppFWProfileTrustedLearningClientsBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwprofile_xmlattachmenturl_binding -// Binding object showing the xmlattachmenturl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlattachmenturl_binding -func (s *AppFWService) AddAppFWProfileXMLAttachmentURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLAttachmentURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLAttachmentURLBinding() {} -func (s *AppFWService) GetAppFWProfileXMLAttachmentURLBinding() {} -func (s *AppFWService) CountAppFWProfileXMLAttachmentURLBinding() {} + return result.Bindings, nil +} -// appfwprofile_xmldosurl_binding -// Binding object showing the xmldosurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmldosurl_binding -func (s *AppFWService) AddAppFWProfileXMLDOSURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLDOSURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLDOSURLBinding() {} -func (s *AppFWService) GetAppFWProfileXMLDOSURLBinding() {} -func (s *AppFWService) CountAppFWProfileXMLDOSURLBinding() {} +func (s *AppFWService) CountAppFWGlobalAuditSyslogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalAuditSyslogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } -// appfwprofile_xmlsqlinjection_binding -// Binding object showing the xmlsqlinjection that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlsqlinjection_binding -func (s *AppFWService) AddAppFWProfileXMLSQLInjectionBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLSQLInjectionBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLSQLInjectionBinding() {} -func (s *AppFWService) GetAppFWProfileXMLSQLInjectionBinding() {} -func (s *AppFWService) CountAppFWProfileXMLSQLInjectionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// appfwprofile_xmlvalidationurl_binding -// Binding object showing the xmlvalidationurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlvalidationurl_binding -func (s *AppFWService) AddAppFWProfileXMLValidationURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLValidationURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLValidationURLBinding() {} -func (s *AppFWService) GetAppFWProfileXMLValidationURLBinding() {} -func (s *AppFWService) CountAppFWProfileXMLValidationURLBinding() {} + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwglobal_auditsyslogpolicy_binding"` + } -// appfwprofile_xmlwsiurl_binding -// Binding object showing the xmlwsiurl that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlwsiurl_binding -func (s *AppFWService) AddAppFWProfileXMLWSIURLBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLWSIURLBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLWSIURLBinding() {} -func (s *AppFWService) GetAppFWProfileXMLWSIURLBinding() {} -func (s *AppFWService) CountAppFWProfileXMLWSIURLBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwprofile_xmlxss_binding -// Binding object showing the xmlxss that can be bound to appfwprofile. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlxss_binding -func (s *AppFWService) AddAppFWProfileXMLXSSBinding() {} -func (s *AppFWService) DeleteAppFWProfileXMLXSSBinding() {} -func (s *AppFWService) GetAllAppFWProfileXMLXSSBinding() {} -func (s *AppFWService) GetAppFWProfileXMLXSSBinding() {} -func (s *AppFWService) CountAppFWProfileXMLXSSBinding() {} + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } -// appfwsettings -// Configuration for AS settings resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwsettings -func (s *AppFWService) UpdateAppFWSettings() {} -func (s *AppFWService) UnsetAppFWSettings() {} -func (s *AppFWService) GetAllAppFWSettings() {} + return 0, nil +} -// appfwsignatures -// Configuration for application firewall signatures XML configuration resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwsignatures -func (s *AppFWService) DeleteAppFWSignatures() {} -func (s *AppFWService) GetAllAppFWSignatures() {} -func (s *AppFWService) GetAppFWSignatures() {} -func (s *AppFWService) ImportAppFWSignatures() {} -func (s *AppFWService) ChangeAppFWSignatures() {} +// appfwglobal_binding +// Binding object which returns the resources bound to appfwglobal. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwglobal_binding +func (s *AppFWService) GetAppFWGlobalBinding() (*models.AppFWGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWGlobalBindingURL, nil) + if err != nil { + return nil, err + } -// appfwtransactionrecords -// Configuration for Application firewall transaction record resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwtransactionrecords -func (s *AppFWService) GetAllAppFWTransactionRecords() {} -func (s *AppFWService) CountAppFWTransactionRecords() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// appfwurlencodedformcontenttype -// Configuration for Urlencoded form content type resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwurlencodedformcontenttype -func (s *AppFWService) AddAppFWURLEncodedFormContentType() {} -func (s *AppFWService) DeleteAppFWURLEncodedFormContentType() {} -func (s *AppFWService) GetAllAppFWURLEncodedFormContentType() {} -func (s *AppFWService) GetAppFWURLEncodedFormContentType() {} -func (s *AppFWService) CountAppFWURLEncodedFormContentType() {} + var result struct { + Bindings []models.AppFWGlobalBinding `json:"appfwglobal_binding"` + } -// appfwwsdl -// Configuration for WSDL file resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwwsdl -func (s *AppFWService) DeleteAppFWWSDL() {} -func (s *AppFWService) GetAllAppFWWSDL() {} -func (s *AppFWService) GetAppFWWSDL() {} -func (s *AppFWService) ImportAppFWWSDL() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// appfwxmlcontenttype -// Configuration for XML Content type resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwxmlcontenttype -func (s *AppFWService) AddAppFWXMLContentType() {} -func (s *AppFWService) DeleteAppFWXMLContentType() {} -func (s *AppFWService) GetAllAppFWXMLContentType() {} -func (s *AppFWService) GetAppFWXMLContentType() {} -func (s *AppFWService) CountAppFWXMLContentType() {} + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("appfwglobal_binding not found") + } + + return &result.Bindings[0], nil +} + +// appfwhtmlerrorpage +// Configuration for HTML error page resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwhtmlerrorpage +func (s *AppFWService) DeleteAppFWHTMLErrorPage(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWHTMLErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWHTMLErrorPage() ([]models.AppFWHTMLErrorPage, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWHTMLErrorPageURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWHTMLErrorPage `json:"appfwhtmlerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Pages, nil +} + +func (s *AppFWService) GetAppFWHTMLErrorPage(name string) (*models.AppFWHTMLErrorPage, error) { + reqURL := fmt.Sprintf("%s/%s", appFWHTMLErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWHTMLErrorPage `json:"appfwhtmlerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Pages) == 0 { + return nil, fmt.Errorf("appfwhtmlerrorpage not found") + } + + return &result.Pages[0], nil +} + +func (s *AppFWService) ImportAppFWHTMLErrorPage(resource models.AppFWHTMLErrorPage) error { + payload := map[string]any{ + "appfwhtmlerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWHTMLErrorPageURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ChangeAppFWHTMLErrorPage(resource models.AppFWHTMLErrorPage) error { + payload := map[string]any{ + "appfwhtmlerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWHTMLErrorPageURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwjsoncontenttype +// Configuration for JSON content type resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwjsoncontenttype +func (s *AppFWService) AddAppFWJSONContentType(resource models.AppFWJSONContentType) error { + payload := map[string]any{ + "appfwjsoncontenttype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWJSONContentTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWJSONContentType(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWJSONContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWJSONContentType() ([]models.AppFWJSONContentType, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWJSONContentTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWJSONContentType `json:"appfwjsoncontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Types, nil +} + +func (s *AppFWService) GetAppFWJSONContentType(name string) (*models.AppFWJSONContentType, error) { + reqURL := fmt.Sprintf("%s/%s", appFWJSONContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWJSONContentType `json:"appfwjsoncontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) == 0 { + return nil, fmt.Errorf("appfwjsoncontenttype not found") + } + + return &result.Types[0], nil +} + +func (s *AppFWService) CountAppFWJSONContentType() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWJSONContentTypeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Types []struct { + Count float64 `json:"__count"` + } `json:"appfwjsoncontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) > 0 { + return result.Types[0].Count, nil + } + + return 0, nil +} + +// appfwjsonerrorpage +// Configuration for JSON error page resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwjsonerrorpage +func (s *AppFWService) DeleteAppFWJSONErrorPage(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWJSONErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWJSONErrorPage() ([]models.AppFWJSONErrorPage, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWJSONErrorPageURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWJSONErrorPage `json:"appfwjsonerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Pages, nil +} + +func (s *AppFWService) GetAppFWJSONErrorPage(name string) (*models.AppFWJSONErrorPage, error) { + reqURL := fmt.Sprintf("%s/%s", appFWJSONErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWJSONErrorPage `json:"appfwjsonerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Pages) == 0 { + return nil, fmt.Errorf("appfwjsonerrorpage not found") + } + + return &result.Pages[0], nil +} + +func (s *AppFWService) ImportAppFWJSONErrorPage(resource models.AppFWJSONErrorPage) error { + payload := map[string]any{ + "appfwjsonerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWJSONErrorPageURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ChangeAppFWJSONErrorPage(resource models.AppFWJSONErrorPage) error { + payload := map[string]any{ + "appfwjsonerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWJSONErrorPageURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwlearningdata +// Configuration for learning data resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwlearningdata +func (s *AppFWService) DeleteAppFWLearningData(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWLearningDataURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWLearningData() ([]models.AppFWLearningData, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWLearningDataURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AppFWLearningData `json:"appfwlearningdata"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *AppFWService) CountAppFWLearningData() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWLearningDataURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []struct { + Count float64 `json:"__count"` + } `json:"appfwlearningdata"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return result.Data[0].Count, nil + } + + return 0, nil +} + +func (s *AppFWService) ResetAppFWLearningData(resource models.AppFWLearningData) error { + payload := map[string]any{ + "appfwlearningdata": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWLearningDataURL+"?action=reset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ExportAppFWLearningData(resource models.AppFWLearningData) error { + payload := map[string]any{ + "appfwlearningdata": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWLearningDataURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwlearningsettings +// Configuration for learning settings resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwlearningsettings +func (s *AppFWService) UpdateAppFWLearningSettings(resource models.AppFWLearningSettings) error { + payload := map[string]any{ + "appfwlearningsettings": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWLearningSettingsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UnsetAppFWLearningSettings(resource models.AppFWLearningSettings) error { + payload := map[string]any{ + "appfwlearningsettings": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWLearningSettingsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWLearningSettings() ([]models.AppFWLearningSettings, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWLearningSettingsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Settings []models.AppFWLearningSettings `json:"appfwlearningsettings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Settings, nil +} + +func (s *AppFWService) GetAppFWLearningSettings(name string) (*models.AppFWLearningSettings, error) { + reqURL := fmt.Sprintf("%s/%s", appFWLearningSettingsURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Settings []models.AppFWLearningSettings `json:"appfwlearningsettings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Settings) == 0 { + return nil, fmt.Errorf("appfwlearningsettings not found") + } + + return &result.Settings[0], nil +} + +func (s *AppFWService) CountAppFWLearningSettings() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWLearningSettingsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Settings []struct { + Count float64 `json:"__count"` + } `json:"appfwlearningsettings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Settings) > 0 { + return result.Settings[0].Count, nil + } + + return 0, nil +} + +// appfwmultipartformcontenttype +// Configuration for Multipart form content type resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwmultipartformcontenttype +func (s *AppFWService) AddAppFWMultipartFormContentType(resource models.AppFWMultipartFormContentType) error { + payload := map[string]any{ + "appfwmultipartformcontenttype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWMultipartFormContentTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWMultipartFormContentType(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWMultipartFormContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWMultipartFormContentType() ([]models.AppFWMultipartFormContentType, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWMultipartFormContentTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWMultipartFormContentType `json:"appfwmultipartformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Types, nil +} + +func (s *AppFWService) GetAppFWMultipartFormContentType(name string) (*models.AppFWMultipartFormContentType, error) { + reqURL := fmt.Sprintf("%s/%s", appFWMultipartFormContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWMultipartFormContentType `json:"appfwmultipartformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) == 0 { + return nil, fmt.Errorf("appfwmultipartformcontenttype not found") + } + + return &result.Types[0], nil +} + +func (s *AppFWService) CountAppFWMultipartFormContentType() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWMultipartFormContentTypeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Types []struct { + Count float64 `json:"__count"` + } `json:"appfwmultipartformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) > 0 { + return result.Types[0].Count, nil + } + + return 0, nil +} + +// appfwpolicy +// Configuration for application firewall policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy +func (s *AppFWService) AddAppFWPolicy(resource models.AppFWPolicy) error { + payload := map[string]any{ + "appfwpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UpdateAppFWPolicy(resource models.AppFWPolicy) error { + payload := map[string]any{ + "appfwpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UnsetAppFWPolicy(resource models.AppFWPolicy) error { + payload := map[string]any{ + "appfwpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWPolicy() ([]models.AppFWPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AppFWPolicy `json:"appfwpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *AppFWService) GetAppFWPolicy(name string) (*models.AppFWPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AppFWPolicy `json:"appfwpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) == 0 { + return nil, fmt.Errorf("appfwpolicy not found") + } + + return &result.Policies[0], nil +} + +func (s *AppFWService) CountAppFWPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} + +func (s *AppFWService) RenameAppFWPolicy(resource models.AppFWPolicy) error { + payload := map[string]any{ + "appfwpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwpolicylabel +// Configuration for application firewall policy label resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel +func (s *AppFWService) AddAppFWPolicyLabel(resource models.AppFWPolicyLabel) error { + payload := map[string]any{ + "appfwpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWPolicyLabel(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWPolicyLabel() ([]models.AppFWPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLabelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.AppFWPolicyLabel `json:"appfwpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Labels, nil +} + +func (s *AppFWService) GetAppFWPolicyLabel(name string) (*models.AppFWPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.AppFWPolicyLabel `json:"appfwpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) == 0 { + return nil, fmt.Errorf("appfwpolicylabel not found") + } + + return &result.Labels[0], nil +} + +func (s *AppFWService) CountAppFWPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + + return 0, nil +} + +func (s *AppFWService) RenameAppFWPolicyLabel(resource models.AppFWPolicyLabel) error { + payload := map[string]any{ + "appfwpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwpolicylabel_appfwpolicy_binding +// Binding object showing the appfwpolicy that can be bound to appfwpolicylabel. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_appfwpolicy_binding +func (s *AppFWService) AddAppFWPolicyLabelAppFWPolicyBinding(resource models.AppFWPolicyLabelAppFWPolicyBinding) error { + payload := map[string]any{ + "appfwpolicylabel_appfwpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWPolicyLabelAppFWPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWPolicyLabelAppFWPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelAppFWPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWPolicyLabelAppFWPolicyBinding() ([]models.AppFWPolicyLabelAppFWPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLabelAppFWPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelAppFWPolicyBinding `json:"appfwpolicylabel_appfwpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyLabelAppFWPolicyBinding(name string) ([]models.AppFWPolicyLabelAppFWPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelAppFWPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelAppFWPolicyBinding `json:"appfwpolicylabel_appfwpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyLabelAppFWPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyLabelAppFWPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicylabel_appfwpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwpolicylabel_binding +// Binding object which returns the resources bound to appfwpolicylabel. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_binding +func (s *AppFWService) GetAllAppFWPolicyLabelBinding() ([]models.AppFWPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelBinding `json:"appfwpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyLabelBinding(name string) (*models.AppFWPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelBinding `json:"appfwpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("appfwpolicylabel_binding not found") + } + + return &result.Bindings[0], nil +} + +// appfwpolicylabel_policybinding_binding +// Binding object showing the policybinding that can be bound to appfwpolicylabel. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicylabel_policybinding_binding +func (s *AppFWService) GetAllAppFWPolicyLabelPolicyBindingBinding() ([]models.AppFWPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelPolicyBindingBinding `json:"appfwpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyLabelPolicyBindingBinding(name string) ([]models.AppFWPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLabelPolicyBindingBinding `json:"appfwpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyLabelPolicyBindingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwpolicy_appfwglobal_binding +// Binding object showing the appfwglobal that can be bound to appfwpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_appfwglobal_binding +func (s *AppFWService) GetAllAppFWPolicyAppFWGlobalBinding() ([]models.AppFWPolicyAppFWGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyAppFWGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyAppFWGlobalBinding `json:"appfwpolicy_appfwglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyAppFWGlobalBinding(name string) ([]models.AppFWPolicyAppFWGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyAppFWGlobalBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyAppFWGlobalBinding `json:"appfwpolicy_appfwglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyAppFWGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyAppFWGlobalBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicy_appfwglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwpolicy_appfwpolicylabel_binding +// Binding object showing the appfwpolicylabel that can be bound to appfwpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_appfwpolicylabel_binding +func (s *AppFWService) GetAllAppFWPolicyAppFWPolicyLabelBinding() ([]models.AppFWPolicyAppFWPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyAppFWPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyAppFWPolicyLabelBinding `json:"appfwpolicy_appfwpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyAppFWPolicyLabelBinding(name string) ([]models.AppFWPolicyAppFWPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyAppFWPolicyLabelBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyAppFWPolicyLabelBinding `json:"appfwpolicy_appfwpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyAppFWPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyAppFWPolicyLabelBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicy_appfwpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwpolicy_binding +// Binding object which returns the resources bound to appfwpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_binding +func (s *AppFWService) GetAllAppFWPolicyBinding() ([]models.AppFWPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyBinding `json:"appfwpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyBinding(name string) (*models.AppFWPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyBinding `json:"appfwpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("appfwpolicy_binding not found") + } + + return &result.Bindings[0], nil +} + +// appfwpolicy_csvserver_binding +// Binding object showing the csvserver that can be bound to appfwpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_csvserver_binding +func (s *AppFWService) GetAllAppFWPolicyCSVServerBinding() ([]models.AppFWPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyCSVServerBinding `json:"appfwpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyCSVServerBinding(name string) ([]models.AppFWPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyCSVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyCSVServerBinding `json:"appfwpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyCSVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwpolicy_lbvserver_binding +// Binding object showing the lbvserver that can be bound to appfwpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwpolicy_lbvserver_binding +func (s *AppFWService) GetAllAppFWPolicyLBVServerBinding() ([]models.AppFWPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLBVServerBinding `json:"appfwpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWPolicyLBVServerBinding(name string) ([]models.AppFWPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWPolicyLBVServerBinding `json:"appfwpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile +// Configuration for application firewall profile resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile +func (s *AppFWService) AddAppFWProfile(resource models.AppFWProfile) error { + payload := map[string]interface{}{ + "appfwprofile": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UpdateAppFWProfile(resource models.AppFWProfile) error { + payload := map[string]interface{}{ + "appfwprofile": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UnsetAppFWProfile(resource models.AppFWProfile) error { + payload := map[string]interface{}{ + "appfwprofile": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfile() ([]models.AppFWProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.AppFWProfile `json:"appfwprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *AppFWService) GetAppFWProfile(name string) (*models.AppFWProfile, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.AppFWProfile `json:"appfwprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) == 0 { + return nil, fmt.Errorf("appfwprofile not found") + } + + return &result.Profiles[0], nil +} + +func (s *AppFWService) CountAppFWProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} + +func (s *AppFWService) RestoreAppFWProfile(resource models.AppFWProfile) error { + payload := map[string]interface{}{ + "appfwprofile": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileURL+"?action=restore", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwprofile_binding +// Binding object which returns the resources bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_binding +func (s *AppFWService) GetAllAppFWProfileBinding() ([]models.AppFWProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileBinding `json:"appfwprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileBinding(name string) (*models.AppFWProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileBinding `json:"appfwprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("appfwprofile_binding not found") + } + + return &result.Bindings[0], nil +} + +// appfwprofile_cmdinjection_binding +// Binding object showing the cmdinjection that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_cmdinjection_binding +func (s *AppFWService) AddAppFWProfileCMDInjectionBinding(resource models.AppFWProfileCMDInjectionBinding) error { + payload := map[string]interface{}{ + "appfwprofile_cmdinjection_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileCMDInjectionBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileCMDInjectionBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCMDInjectionBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileCMDInjectionBinding() ([]models.AppFWProfileCMDInjectionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileCMDInjectionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCMDInjectionBinding `json:"appfwprofile_cmdinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileCMDInjectionBinding(name string) ([]models.AppFWProfileCMDInjectionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCMDInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCMDInjectionBinding `json:"appfwprofile_cmdinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileCMDInjectionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileCMDInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_cmdinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_contenttype_binding +// Binding object showing the contenttype that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_contenttype_binding +func (s *AppFWService) AddAppFWProfileContentTypeBinding(resource models.AppFWProfileContentTypeBinding) error { + payload := map[string]interface{}{ + "appfwprofile_contenttype_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileContentTypeBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileContentTypeBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileContentTypeBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileContentTypeBinding() ([]models.AppFWProfileContentTypeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileContentTypeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileContentTypeBinding `json:"appfwprofile_contenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileContentTypeBinding(name string) ([]models.AppFWProfileContentTypeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileContentTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileContentTypeBinding `json:"appfwprofile_contenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileContentTypeBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileContentTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_contenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_cookieconsistency_binding +// Binding object showing the cookieconsistency that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_cookieconsistency_binding +func (s *AppFWService) AddAppFWProfileCookieConsistencyBinding(resource models.AppFWProfileCookieConsistencyBinding) error { + payload := map[string]interface{}{ + "appfwprofile_cookieconsistency_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileCookieConsistencyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileCookieConsistencyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCookieConsistencyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileCookieConsistencyBinding() ([]models.AppFWProfileCookieConsistencyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileCookieConsistencyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCookieConsistencyBinding `json:"appfwprofile_cookieconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileCookieConsistencyBinding(name string) ([]models.AppFWProfileCookieConsistencyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCookieConsistencyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCookieConsistencyBinding `json:"appfwprofile_cookieconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileCookieConsistencyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileCookieConsistencyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_cookieconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_creditcardnumber_binding +// Binding object showing the creditcardnumber that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_creditcardnumber_binding +func (s *AppFWService) AddAppFWProfileCreditCardNumberBinding(resource models.AppFWProfileCreditCardNumberBinding) error { + payload := map[string]interface{}{ + "appfwprofile_creditcardnumber_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileCreditCardNumberBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileCreditCardNumberBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCreditCardNumberBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileCreditCardNumberBinding() ([]models.AppFWProfileCreditCardNumberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileCreditCardNumberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCreditCardNumberBinding `json:"appfwprofile_creditcardnumber_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileCreditCardNumberBinding(name string) ([]models.AppFWProfileCreditCardNumberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCreditCardNumberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCreditCardNumberBinding `json:"appfwprofile_creditcardnumber_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileCreditCardNumberBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileCreditCardNumberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_creditcardnumber_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_crosssitescripting_binding +// Binding object showing the crosssitescripting that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_crosssitescripting_binding +func (s *AppFWService) AddAppFWProfileCrossSiteScriptingBinding(resource models.AppFWProfileCrossSiteScriptingBinding) error { + payload := map[string]interface{}{ + "appfwprofile_crosssitescripting_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileCrossSiteScriptingBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileCrossSiteScriptingBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCrossSiteScriptingBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileCrossSiteScriptingBinding() ([]models.AppFWProfileCrossSiteScriptingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileCrossSiteScriptingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCrossSiteScriptingBinding `json:"appfwprofile_crosssitescripting_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileCrossSiteScriptingBinding(name string) ([]models.AppFWProfileCrossSiteScriptingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCrossSiteScriptingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCrossSiteScriptingBinding `json:"appfwprofile_crosssitescripting_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileCrossSiteScriptingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileCrossSiteScriptingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_crosssitescripting_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_csrftag_binding +// Binding object showing the csrftag that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_csrftag_binding +func (s *AppFWService) AddAppFWProfileCSRFTagBinding(resource models.AppFWProfileCSRFTagBinding) error { + payload := map[string]interface{}{ + "appfwprofile_csrftag_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileCSRFTagBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileCSRFTagBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCSRFTagBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileCSRFTagBinding() ([]models.AppFWProfileCSRFTagBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileCSRFTagBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCSRFTagBinding `json:"appfwprofile_csrftag_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileCSRFTagBinding(name string) ([]models.AppFWProfileCSRFTagBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileCSRFTagBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileCSRFTagBinding `json:"appfwprofile_csrftag_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileCSRFTagBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileCSRFTagBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_csrftag_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_denyurl_binding +// Binding object showing the denyurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_denyurl_binding +func (s *AppFWService) AddAppFWProfileDenyURLBinding(resource models.AppFWProfileDenyURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_denyurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileDenyURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileDenyURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileDenyURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileDenyURLBinding() ([]models.AppFWProfileDenyURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileDenyURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileDenyURLBinding `json:"appfwprofile_denyurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileDenyURLBinding(name string) ([]models.AppFWProfileDenyURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileDenyURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileDenyURLBinding `json:"appfwprofile_denyurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileDenyURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileDenyURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_denyurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_excluderescontenttype_binding +// Binding object showing the excluderescontenttype that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_excluderescontenttype_binding +func (s *AppFWService) AddAppFWProfileExcludeRESContentTypeBinding(resource models.AppFWProfileExcludeRESContentTypeBinding) error { + payload := map[string]interface{}{ + "appfwprofile_excluderescontenttype_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileExcludeRESContentTypeBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileExcludeRESContentTypeBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileExcludeRESContentTypeBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileExcludeRESContentTypeBinding() ([]models.AppFWProfileExcludeRESContentTypeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileExcludeRESContentTypeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileExcludeRESContentTypeBinding `json:"appfwprofile_excluderescontenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileExcludeRESContentTypeBinding(name string) ([]models.AppFWProfileExcludeRESContentTypeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileExcludeRESContentTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileExcludeRESContentTypeBinding `json:"appfwprofile_excluderescontenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileExcludeRESContentTypeBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileExcludeRESContentTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_excluderescontenttype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_fieldconsistency_binding +// Binding object showing the fieldconsistency that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fieldconsistency_binding +func (s *AppFWService) AddAppFWProfileFieldConsistencyBinding(resource models.AppFWProfileFieldConsistencyBinding) error { + payload := map[string]interface{}{ + "appfwprofile_fieldconsistency_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileFieldConsistencyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileFieldConsistencyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFieldConsistencyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileFieldConsistencyBinding() ([]models.AppFWProfileFieldConsistencyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileFieldConsistencyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFieldConsistencyBinding `json:"appfwprofile_fieldconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileFieldConsistencyBinding(name string) ([]models.AppFWProfileFieldConsistencyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFieldConsistencyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFieldConsistencyBinding `json:"appfwprofile_fieldconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileFieldConsistencyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileFieldConsistencyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_fieldconsistency_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_fieldformat_binding +// Binding object showing the fieldformat that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fieldformat_binding +func (s *AppFWService) AddAppFWProfileFieldFormatBinding(resource models.AppFWProfileFieldFormatBinding) error { + payload := map[string]interface{}{ + "appfwprofile_fieldformat_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileFieldFormatBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileFieldFormatBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFieldFormatBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileFieldFormatBinding() ([]models.AppFWProfileFieldFormatBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileFieldFormatBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFieldFormatBinding `json:"appfwprofile_fieldformat_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileFieldFormatBinding(name string) ([]models.AppFWProfileFieldFormatBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFieldFormatBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFieldFormatBinding `json:"appfwprofile_fieldformat_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileFieldFormatBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileFieldFormatBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_fieldformat_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_fileuploadtype_binding +// Binding object showing the fileuploadtype that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_fileuploadtype_binding +func (s *AppFWService) AddAppFWProfileFileUploadTypeBinding(resource models.AppFWProfileFileUploadTypeBinding) error { + payload := map[string]interface{}{ + "appfwprofile_fileuploadtype_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileFileUploadTypeBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileFileUploadTypeBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFileUploadTypeBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileFileUploadTypeBinding() ([]models.AppFWProfileFileUploadTypeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileFileUploadTypeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFileUploadTypeBinding `json:"appfwprofile_fileuploadtype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileFileUploadTypeBinding(name string) ([]models.AppFWProfileFileUploadTypeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileFileUploadTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileFileUploadTypeBinding `json:"appfwprofile_fileuploadtype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileFileUploadTypeBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileFileUploadTypeBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_fileuploadtype_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_jsondosurl_binding +// Binding object showing the jsondosurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsondosurl_binding +func (s *AppFWService) AddAppFWProfileJSONDOSURLBinding(resource models.AppFWProfileJSONDOSURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_jsondosurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileJSONDOSURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileJSONDOSURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONDOSURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileJSONDOSURLBinding() ([]models.AppFWProfileJSONDOSURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileJSONDOSURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONDOSURLBinding `json:"appfwprofile_jsondosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileJSONDOSURLBinding(name string) ([]models.AppFWProfileJSONDOSURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONDOSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONDOSURLBinding `json:"appfwprofile_jsondosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileJSONDOSURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileJSONDOSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_jsondosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_jsonsqlurl_binding +// Binding object showing the jsonsqlurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsonsqlurl_binding +func (s *AppFWService) AddAppFWProfileJSONSQLURLBinding(resource models.AppFWProfileJSONSQLURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_jsonsqlurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileJSONSQLURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileJSONSQLURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONSQLURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileJSONSQLURLBinding() ([]models.AppFWProfileJSONSQLURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileJSONSQLURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONSQLURLBinding `json:"appfwprofile_jsonsqlurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileJSONSQLURLBinding(name string) ([]models.AppFWProfileJSONSQLURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONSQLURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONSQLURLBinding `json:"appfwprofile_jsonsqlurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileJSONSQLURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileJSONSQLURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_jsonsqlurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_jsonxssurl_binding +// Binding object showing the jsonxssurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_jsonxssurl_binding +func (s *AppFWService) AddAppFWProfileJSONXSSURLBinding(resource models.AppFWProfileJSONXSSURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_jsonxssurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileJSONXSSURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileJSONXSSURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONXSSURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileJSONXSSURLBinding() ([]models.AppFWProfileJSONXSSURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileJSONXSSURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONXSSURLBinding `json:"appfwprofile_jsonxssurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileJSONXSSURLBinding(name string) ([]models.AppFWProfileJSONXSSURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileJSONXSSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileJSONXSSURLBinding `json:"appfwprofile_jsonxssurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileJSONXSSURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileJSONXSSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_jsonxssurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_logexpression_binding +// Binding object showing the logexpression that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_logexpression_binding +func (s *AppFWService) AddAppFWProfileLogExpressionBinding(resource models.AppFWProfileLogExpressionBinding) error { + payload := map[string]interface{}{ + "appfwprofile_logexpression_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileLogExpressionBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileLogExpressionBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileLogExpressionBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileLogExpressionBinding() ([]models.AppFWProfileLogExpressionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileLogExpressionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileLogExpressionBinding `json:"appfwprofile_logexpression_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileLogExpressionBinding(name string) ([]models.AppFWProfileLogExpressionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileLogExpressionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileLogExpressionBinding `json:"appfwprofile_logexpression_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileLogExpressionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileLogExpressionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_logexpression_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_safeobject_binding +// Binding object showing the safeobject that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_safeobject_binding +func (s *AppFWService) AddAppFWProfileSafeObjectBinding(resource models.AppFWProfileSafeObjectBinding) error { + payload := map[string]interface{}{ + "appfwprofile_safeobject_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileSafeObjectBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileSafeObjectBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileSafeObjectBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileSafeObjectBinding() ([]models.AppFWProfileSafeObjectBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileSafeObjectBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileSafeObjectBinding `json:"appfwprofile_safeobject_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileSafeObjectBinding(name string) ([]models.AppFWProfileSafeObjectBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileSafeObjectBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileSafeObjectBinding `json:"appfwprofile_safeobject_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileSafeObjectBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileSafeObjectBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_safeobject_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_sqlinjection_binding +// Binding object showing the sqlinjection that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_sqlinjection_binding +func (s *AppFWService) AddAppFWProfileSQLInjectionBinding(resource models.AppFWProfileSQLInjectionBinding) error { + payload := map[string]interface{}{ + "appfwprofile_sqlinjection_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileSQLInjectionBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileSQLInjectionBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileSQLInjectionBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileSQLInjectionBinding() ([]models.AppFWProfileSQLInjectionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileSQLInjectionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileSQLInjectionBinding `json:"appfwprofile_sqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileSQLInjectionBinding(name string) ([]models.AppFWProfileSQLInjectionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileSQLInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileSQLInjectionBinding `json:"appfwprofile_sqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileSQLInjectionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileSQLInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_sqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_starturl_binding +// Binding object showing the starturl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_starturl_binding +func (s *AppFWService) AddAppFWProfileStartURLBinding(resource models.AppFWProfileStartURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_starturl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileStartURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileStartURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileStartURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileStartURLBinding() ([]models.AppFWProfileStartURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileStartURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileStartURLBinding `json:"appfwprofile_starturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileStartURLBinding(name string) ([]models.AppFWProfileStartURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileStartURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileStartURLBinding `json:"appfwprofile_starturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileStartURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileStartURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_starturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_trustedlearningclients_binding +// Binding object showing the trustedlearningclients that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_trustedlearningclients_binding +func (s *AppFWService) AddAppFWProfileTrustedLearningClientsBinding(resource models.AppFWProfileTrustedLearningClientsBinding) error { + payload := map[string]interface{}{ + "appfwprofile_trustedlearningclients_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileTrustedLearningClientsBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileTrustedLearningClientsBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileTrustedLearningClientsBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileTrustedLearningClientsBinding() ([]models.AppFWProfileTrustedLearningClientsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileTrustedLearningClientsBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileTrustedLearningClientsBinding `json:"appfwprofile_trustedlearningclients_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileTrustedLearningClientsBinding(name string) ([]models.AppFWProfileTrustedLearningClientsBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileTrustedLearningClientsBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileTrustedLearningClientsBinding `json:"appfwprofile_trustedlearningclients_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileTrustedLearningClientsBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileTrustedLearningClientsBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_trustedlearningclients_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmlattachmenturl_binding +// Binding object showing the xmlattachmenturl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlattachmenturl_binding +func (s *AppFWService) AddAppFWProfileXMLAttachmentURLBinding(resource models.AppFWProfileXMLAttachmentURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmlattachmenturl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLAttachmentURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLAttachmentURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLAttachmentURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLAttachmentURLBinding() ([]models.AppFWProfileXMLAttachmentURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLAttachmentURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLAttachmentURLBinding `json:"appfwprofile_xmlattachmenturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLAttachmentURLBinding(name string) ([]models.AppFWProfileXMLAttachmentURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLAttachmentURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLAttachmentURLBinding `json:"appfwprofile_xmlattachmenturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLAttachmentURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLAttachmentURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmlattachmenturl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmldosurl_binding +// Binding object showing the xmldosurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmldosurl_binding +func (s *AppFWService) AddAppFWProfileXMLDOSURLBinding(resource models.AppFWProfileXMLDOSURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmldosurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLDOSURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLDOSURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLDOSURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLDOSURLBinding() ([]models.AppFWProfileXMLDOSURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLDOSURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLDOSURLBinding `json:"appfwprofile_xmldosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLDOSURLBinding(name string) ([]models.AppFWProfileXMLDOSURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLDOSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLDOSURLBinding `json:"appfwprofile_xmldosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLDOSURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLDOSURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmldosurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmlsqlinjection_binding +// Binding object showing the xmlsqlinjection that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlsqlinjection_binding +func (s *AppFWService) AddAppFWProfileXMLSQLInjectionBinding(resource models.AppFWProfileXMLSQLInjectionBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmlsqlinjection_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLSQLInjectionBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLSQLInjectionBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLSQLInjectionBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLSQLInjectionBinding() ([]models.AppFWProfileXMLSQLInjectionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLSQLInjectionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLSQLInjectionBinding `json:"appfwprofile_xmlsqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLSQLInjectionBinding(name string) ([]models.AppFWProfileXMLSQLInjectionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLSQLInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLSQLInjectionBinding `json:"appfwprofile_xmlsqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLSQLInjectionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLSQLInjectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmlsqlinjection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmlvalidationurl_binding +// Binding object showing the xmlvalidationurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlvalidationurl_binding +func (s *AppFWService) AddAppFWProfileXMLValidationURLBinding(resource models.AppFWProfileXMLValidationURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmlvalidationurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLValidationURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLValidationURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLValidationURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLValidationURLBinding() ([]models.AppFWProfileXMLValidationURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLValidationURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLValidationURLBinding `json:"appfwprofile_xmlvalidationurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLValidationURLBinding(name string) ([]models.AppFWProfileXMLValidationURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLValidationURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLValidationURLBinding `json:"appfwprofile_xmlvalidationurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLValidationURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLValidationURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmlvalidationurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmlwsiurl_binding +// Binding object showing the xmlwsiurl that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlwsiurl_binding +func (s *AppFWService) AddAppFWProfileXMLWSIURLBinding(resource models.AppFWProfileXMLWSIURLBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmlwsiurl_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLWSIURLBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLWSIURLBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLWSIURLBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLWSIURLBinding() ([]models.AppFWProfileXMLWSIURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLWSIURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLWSIURLBinding `json:"appfwprofile_xmlwsiurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLWSIURLBinding(name string) ([]models.AppFWProfileXMLWSIURLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLWSIURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLWSIURLBinding `json:"appfwprofile_xmlwsiurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLWSIURLBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLWSIURLBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmlwsiurl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwprofile_xmlxss_binding +// Binding object showing the xmlxss that can be bound to appfwprofile. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwprofile_xmlxss_binding +func (s *AppFWService) AddAppFWProfileXMLXSSBinding(resource models.AppFWProfileXMLXSSBinding) error { + payload := map[string]interface{}{ + "appfwprofile_xmlxss_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWProfileXMLXSSBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWProfileXMLXSSBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLXSSBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWProfileXMLXSSBinding() ([]models.AppFWProfileXMLXSSBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWProfileXMLXSSBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLXSSBinding `json:"appfwprofile_xmlxss_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) GetAppFWProfileXMLXSSBinding(name string) ([]models.AppFWProfileXMLXSSBinding, error) { + reqURL := fmt.Sprintf("%s/%s", appFWProfileXMLXSSBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppFWProfileXMLXSSBinding `json:"appfwprofile_xmlxss_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppFWService) CountAppFWProfileXMLXSSBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", appFWProfileXMLXSSBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appfwprofile_xmlxss_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// appfwsettings +// Configuration for AS settings resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwsettings +func (s *AppFWService) UpdateAppFWSettings(resource models.AppFWSettings) error { + payload := map[string]interface{}{ + "appfwsettings": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appFWSettingsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) UnsetAppFWSettings(resource models.AppFWSettings) error { + payload := map[string]interface{}{ + "appfwsettings": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWSettingsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWSettings() (*models.AppFWSettings, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWSettingsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Settings []models.AppFWSettings `json:"appfwsettings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Settings) == 0 { + return nil, fmt.Errorf("appfwsettings not found") + } + + return &result.Settings[0], nil +} + +// appfwsignatures +// Configuration for application firewall signatures XML configuration resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwsignatures +func (s *AppFWService) DeleteAppFWSignatures(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWSignaturesURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWSignatures() ([]models.AppFWSignatures, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWSignaturesURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Signatures []models.AppFWSignatures `json:"appfwsignatures"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Signatures, nil +} + +func (s *AppFWService) GetAppFWSignatures(name string) (*models.AppFWSignatures, error) { + reqURL := fmt.Sprintf("%s/%s", appFWSignaturesURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Signatures []models.AppFWSignatures `json:"appfwsignatures"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Signatures) == 0 { + return nil, fmt.Errorf("appfwsignatures not found") + } + + return &result.Signatures[0], nil +} + +func (s *AppFWService) ImportAppFWSignatures(resource models.AppFWSignatures) error { + payload := map[string]interface{}{ + "appfwsignatures": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWSignaturesURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ChangeAppFWSignatures(resource models.AppFWSignatures) error { + payload := map[string]interface{}{ + "appfwsignatures": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWSignaturesURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwtransactionrecords +// Configuration for Application firewall transaction record resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwtransactionrecords +func (s *AppFWService) GetAllAppFWTransactionRecords() ([]models.AppFWTransactionRecords, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWTransactionRecordsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Records []models.AppFWTransactionRecords `json:"appfwtransactionrecords"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Records, nil +} + +func (s *AppFWService) CountAppFWTransactionRecords() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWTransactionRecordsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Records []struct { + Count float64 `json:"__count"` + } `json:"appfwtransactionrecords"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Records) > 0 { + return result.Records[0].Count, nil + } + + return 0, nil +} + +// appfwurlencodedformcontenttype +// Configuration for Urlencoded form content type resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwurlencodedformcontenttype +func (s *AppFWService) AddAppFWURLEncodedFormContentType(resource models.AppFWURLEncodedFormContentType) error { + payload := map[string]interface{}{ + "appfwurlencodedformcontenttype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWURLEncodedFormContentTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWURLEncodedFormContentType(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWURLEncodedFormContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWURLEncodedFormContentType() ([]models.AppFWURLEncodedFormContentType, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWURLEncodedFormContentTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWURLEncodedFormContentType `json:"appfwurlencodedformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Types, nil +} + +func (s *AppFWService) GetAppFWURLEncodedFormContentType(name string) (*models.AppFWURLEncodedFormContentType, error) { + reqURL := fmt.Sprintf("%s/%s", appFWURLEncodedFormContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWURLEncodedFormContentType `json:"appfwurlencodedformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) == 0 { + return nil, fmt.Errorf("appfwurlencodedformcontenttype not found") + } + + return &result.Types[0], nil +} + +func (s *AppFWService) CountAppFWURLEncodedFormContentType() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWURLEncodedFormContentTypeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Types []struct { + Count float64 `json:"__count"` + } `json:"appfwurlencodedformcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) > 0 { + return result.Types[0].Count, nil + } + + return 0, nil +} + +// appfwwsdl +// Configuration for WSDL file resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwwsdl +func (s *AppFWService) DeleteAppFWWSDL(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWWSDLURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWWSDL() ([]models.AppFWWSDL, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWWSDLURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + WSDLs []models.AppFWWSDL `json:"appfwwsdl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.WSDLs, nil +} + +func (s *AppFWService) GetAppFWWSDL(name string) (*models.AppFWWSDL, error) { + reqURL := fmt.Sprintf("%s/%s", appFWWSDLURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + WSDLs []models.AppFWWSDL `json:"appfwwsdl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.WSDLs) == 0 { + return nil, fmt.Errorf("appfwwsdl not found") + } + + return &result.WSDLs[0], nil +} + +func (s *AppFWService) ImportAppFWWSDL(resource models.AppFWWSDL) error { + payload := map[string]interface{}{ + "appfwwsdl": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWWSDLURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// appfwxmlcontenttype +// Configuration for XML Content type resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwxmlcontenttype +func (s *AppFWService) AddAppFWXMLContentType(resource models.AppFWXMLContentType) error { + payload := map[string]interface{}{ + "appfwxmlcontenttype": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWXMLContentTypeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) DeleteAppFWXMLContentType(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWXMLContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWXMLContentType() ([]models.AppFWXMLContentType, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWXMLContentTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWXMLContentType `json:"appfwxmlcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Types, nil +} + +func (s *AppFWService) GetAppFWXMLContentType(name string) (*models.AppFWXMLContentType, error) { + reqURL := fmt.Sprintf("%s/%s", appFWXMLContentTypeURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Types []models.AppFWXMLContentType `json:"appfwxmlcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) == 0 { + return nil, fmt.Errorf("appfwxmlcontenttype not found") + } + + return &result.Types[0], nil +} + +func (s *AppFWService) CountAppFWXMLContentType() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWXMLContentTypeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Types []struct { + Count float64 `json:"__count"` + } `json:"appfwxmlcontenttype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Types) > 0 { + return result.Types[0].Count, nil + } + + return 0, nil +} // appfwxmlerrorpage // Configuration for xml error page resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwxmlerrorpage -func (s *AppFWService) DeleteAppFWXMLErrorPage() {} -func (s *AppFWService) GetAllAppFWXMLErrorPage() {} -func (s *AppFWService) GetAppFWXMLErrorPage() {} -func (s *AppFWService) ImportAppFWXMLErrorPage() {} -func (s *AppFWService) ChangeAppFWXMLErrorPage() {} +func (s *AppFWService) DeleteAppFWXMLErrorPage(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWXMLErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWXMLErrorPage() ([]models.AppFWXMLErrorPage, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWXMLErrorPageURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWXMLErrorPage `json:"appfwxmlerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Pages, nil +} + +func (s *AppFWService) GetAppFWXMLErrorPage(name string) (*models.AppFWXMLErrorPage, error) { + reqURL := fmt.Sprintf("%s/%s", appFWXMLErrorPageURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Pages []models.AppFWXMLErrorPage `json:"appfwxmlerrorpage"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Pages) == 0 { + return nil, fmt.Errorf("appfwxmlerrorpage not found") + } + + return &result.Pages[0], nil +} + +func (s *AppFWService) ImportAppFWXMLErrorPage(resource models.AppFWXMLErrorPage) error { + payload := map[string]interface{}{ + "appfwxmlerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWXMLErrorPageURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) ChangeAppFWXMLErrorPage(resource models.AppFWXMLErrorPage) error { + payload := map[string]interface{}{ + "appfwxmlerrorpage": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWXMLErrorPageURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // appfwxmlschema // Configuration for XML schema resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appfw/appfwxmlschema -func (s *AppFWService) DeleteAppFWXMLSchema() {} -func (s *AppFWService) GetAllAppFWXMLSchema() {} -func (s *AppFWService) GetAppFWXMLSchema() {} -func (s *AppFWService) ImportAppFWXMLSchema() {} +func (s *AppFWService) DeleteAppFWXMLSchema(name string) error { + reqURL := fmt.Sprintf("%s/%s", appFWXMLSchemaURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppFWService) GetAllAppFWXMLSchema() ([]models.AppFWXMLSchema, error) { + req, err := s.client.NewRequest(http.MethodGet, appFWXMLSchemaURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Schemas []models.AppFWXMLSchema `json:"appfwxmlschema"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Schemas, nil +} + +func (s *AppFWService) GetAppFWXMLSchema(name string) (*models.AppFWXMLSchema, error) { + reqURL := fmt.Sprintf("%s/%s", appFWXMLSchemaURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Schemas []models.AppFWXMLSchema `json:"appfwxmlschema"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Schemas) == 0 { + return nil, fmt.Errorf("appfwxmlschema not found") + } + + return &result.Schemas[0], nil +} + +func (s *AppFWService) ImportAppFWXMLSchema(resource models.AppFWXMLSchema) error { + payload := map[string]interface{}{ + "appfwxmlschema": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appFWXMLSchemaURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/appqoe.go b/nitrogo/appqoe.go index 62708fd..f75a04f 100644 --- a/nitrogo/appqoe.go +++ b/nitrogo/appqoe.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( appQOEActionURL = "/nitro/v1/config/appqoeaction" appQOECustomRespURL = "/nitro/v1/config/appqoecustomresp" @@ -18,49 +28,583 @@ type AppQOEService struct { // appqoeaction // Configuration for AppQoS action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoeaction -func (s *AppQOEService) AddAppQOEAction() {} -func (s *AppQOEService) DeleteAppQOEAction() {} -func (s *AppQOEService) UpdateAppQOEAction() {} -func (s *AppQOEService) UnsetAppQOEAction() {} -func (s *AppQOEService) GetAllAppQOEAction() {} -func (s *AppQOEService) GetAppQOEAction() {} -func (s *AppQOEService) CountAppQOEAction() {} + +func (s *AppQOEService) AddAppQOEAction(action models.AppQOEAction) error { + payload := map[string]any{ + "appqoeaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOEActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) DeleteAppQOEAction(name string) error { + urlReq := fmt.Sprintf("%s/%s", appQOEActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) UpdateAppQOEAction(action models.AppQOEAction) error { + payload := map[string]any{ + "appqoeaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appQOEActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) UnsetAppQOEAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "appqoeaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOEActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) GetAllAppQOEAction() ([]models.AppQOEAction, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.AppQOEAction `json:"appqoeaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *AppQOEService) GetAppQOEAction(name string) ([]models.AppQOEAction, error) { + urlReq := fmt.Sprintf("%s/%s", appQOEActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.AppQOEAction `json:"appqoeaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *AppQOEService) CountAppQOEAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"appqoeaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} // appqoecustomerresp // Configuration for AppQoE custom response page resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoecustomresp -func (s *AppQOEService) ImportAppQOECustomResp() {} -func (s *AppQOEService) DeleteAppQOECustomResp() {} -func (s *AppQOEService) GetAllAppQOECustomResp() {} -func (s *AppQOEService) CountAppQOECustomResp() {} -func (s *AppQOEService) ChangeAppQOECustomResp() {} + +func (s *AppQOEService) ImportAppQOECustomResp(resp models.AppQOECustomResp) error { + payload := map[string]any{ + "appqoecustomresp": resp, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOECustomRespURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) DeleteAppQOECustomResp(name string) error { + urlReq := fmt.Sprintf("%s/%s", appQOECustomRespURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) GetAllAppQOECustomResp() ([]models.AppQOECustomResp, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOECustomRespURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + CustomResps []models.AppQOECustomResp `json:"appqoecustomresp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.CustomResps, nil +} + +func (s *AppQOEService) CountAppQOECustomResp() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOECustomRespURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + CustomResps []struct { + Count float64 `json:"__count"` + } `json:"appqoecustomresp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.CustomResps) > 0 { + return result.CustomResps[0].Count, nil + } + + return 0, nil +} + +func (s *AppQOEService) ChangeAppQOECustomResp(resp models.AppQOECustomResp) error { + payload := map[string]any{ + "appqoecustomresp": resp, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOECustomRespURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // appqoeparameter // Configuration for QOS parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoeparameter -func (s *AppQOEService) UpdateAppQOEParameter() {} -func (s *AppQOEService) UnsetAppQOEParameter() {} -func (s *AppQOEService) GetAllAppQOEParameter() {} + +func (s *AppQOEService) UpdateAppQOEParameter(param models.AppQOEParameter) error { + payload := map[string]any{ + "appqoeparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appQOEParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) UnsetAppQOEParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "appqoeparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOEParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) GetAllAppQOEParameter() (models.AppQOEParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEParameterURL, nil) + if err != nil { + return models.AppQOEParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.AppQOEParameter{}, err + } + + var result struct { + Parameters []models.AppQOEParameter `json:"appqoeparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AppQOEParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0], nil + } + + return models.AppQOEParameter{}, nil +} // appqoepolicy // Configuration for AppQoS policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoepolicy -func (s *AppQOEService) AddAppQOEPolicy() {} -func (s *AppQOEService) DeleteAppQOEPolicy() {} -func (s *AppQOEService) UpdateAppQOEPolicy() {} -func (s *AppQOEService) GetAllAppQOEPolicy() {} -func (s *AppQOEService) GetAppQOEPolicy() {} -func (s *AppQOEService) CountAppQOEPolicy() {} + +func (s *AppQOEService) AddAppQOEPolicy(policy models.AppQOEPolicy) error { + payload := map[string]any{ + "appqoepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, appQOEPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) DeleteAppQOEPolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", appQOEPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) UpdateAppQOEPolicy(policy models.AppQOEPolicy) error { + payload := map[string]any{ + "appqoepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, appQOEPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AppQOEService) GetAllAppQOEPolicy() ([]models.AppQOEPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AppQOEPolicy `json:"appqoepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *AppQOEService) GetAppQOEPolicy(name string) ([]models.AppQOEPolicy, error) { + urlReq := fmt.Sprintf("%s/%s", appQOEPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AppQOEPolicy `json:"appqoepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *AppQOEService) CountAppQOEPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"appqoepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} // appqoepolicy_binding // Binding object which returns the resources bound to appqoepolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoepolicy_binding -func (s *AppQOEService) GetAllAppQOEPolicyBinding() {} -func (s *AppQOEService) GetAppQOEPolicyBinding() {} + +func (s *AppQOEService) GetAllAppQOEPolicyBinding() ([]models.AppQOEPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppQOEPolicyBinding `json:"appqoepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppQOEService) GetAppQOEPolicyBinding(name string) ([]models.AppQOEPolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", appQOEPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppQOEPolicyBinding `json:"appqoepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // appqoepolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to appqoepolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/appqoe/appqoepolicy_lbvserver_binding -func (s *AppQOEService) GetAllAppQOEPolicyLBVServerBinding() {} -func (s *AppQOEService) GetAppQOEPolicyLBVServerBinding() {} -func (s *AppQOEService) CountAppQOEPolicyLBVServerBinding() {} + +func (s *AppQOEService) GetAllAppQOEPolicyLBVServerBinding() ([]models.AppQOEPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, appQOEPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppQOEPolicyLBVServerBinding `json:"appqoepolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppQOEService) GetAppQOEPolicyLBVServerBinding(name string) ([]models.AppQOEPolicyLBVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", appQOEPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AppQOEPolicyLBVServerBinding `json:"appqoepolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AppQOEService) CountAppQOEPolicyLBVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", appQOEPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"appqoepolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/audit.go b/nitrogo/audit.go index d6fe779..99ac67d 100644 --- a/nitrogo/audit.go +++ b/nitrogo/audit.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( auditMessageActionURL = "/nitro/v1/config/auditmessageaction" auditMessagesURL = "/nitro/v1/config/auditmessages" @@ -48,264 +58,2511 @@ type AuditService struct { // auditmessageaction // Configuration for message action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditmessageaction -func (s *AuditService) AddAuditMessageAction() {} -func (s *AuditService) DeleteAuditMessageAction() {} -func (s *AuditService) UpdateAuditMessageAction() {} -func (s *AuditService) UnsetAuditMessageAction() {} -func (s *AuditService) GetAllAuditMessageAction() {} -func (s *AuditService) GetAuditMessageAction() {} -func (s *AuditService) CountAuditMessageAction() {} + +func (s *AuditService) AddAuditMessageAction(action models.AuditMessageAction) error { + payload := map[string]any{"auditmessageaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditMessageActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditMessageAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", auditMessageActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UpdateAuditMessageAction(action models.AuditMessageAction) error { + payload := map[string]any{"auditmessageaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditMessageActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UnsetAuditMessageAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"auditmessageaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditMessageActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditMessageAction() ([]models.AuditMessageAction, error) { + req, err := s.client.NewRequest(http.MethodGet, auditMessageActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditMessageAction `json:"auditmessageaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) GetAuditMessageAction(name string) ([]models.AuditMessageAction, error) { + reqURL := fmt.Sprintf("%s/%s", auditMessageActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditMessageAction `json:"auditmessageaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) CountAuditMessageAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditMessageActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"auditmessageaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // auditmessages // Configuration for audit message resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditmessages -func (s *AuditService) GetAllAuditMessages() {} -func (s *AuditService) CountAuditMessages() {} + +func (s *AuditService) GetAllAuditMessages() ([]models.AuditMessages, error) { + req, err := s.client.NewRequest(http.MethodGet, auditMessagesURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Messages []models.AuditMessages `json:"auditmessages"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Messages, nil +} + +func (s *AuditService) CountAuditMessages() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditMessagesURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Messages []struct { + Count float64 `json:"__count"` + } `json:"auditmessages"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Messages) > 0 { + return result.Messages[0].Count, nil + } + return 0, nil +} // auditnslogaction // Configuration for ns log action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogaction -func (s *AuditService) AddAuditNSLogAction() {} -func (s *AuditService) DeleteAuditNSLogAction() {} -func (s *AuditService) UpdateAuditNSLogAction() {} -func (s *AuditService) UnsetAuditNSLogAction() {} -func (s *AuditService) GetAllAuditNSLogAction() {} -func (s *AuditService) GetAuditNSLogAction() {} -func (s *AuditService) CountAuditNSLogAction() {} + +func (s *AuditService) AddAuditNSLogAction(action models.AuditNSLogAction) error { + payload := map[string]any{"auditnslogaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditNSLogActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditNSLogAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", auditNSLogActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UpdateAuditNSLogAction(action models.AuditNSLogAction) error { + payload := map[string]any{"auditnslogaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditNSLogActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UnsetAuditNSLogAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"auditnslogaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditNSLogActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditNSLogAction() ([]models.AuditNSLogAction, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditNSLogAction `json:"auditnslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) GetAuditNSLogAction(name string) ([]models.AuditNSLogAction, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditNSLogAction `json:"auditnslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) CountAuditNSLogAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"auditnslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // auditnslogglobal_auditnslogpolicy_binding // Binding object showing the auditnslogpolicy that can be bound to auditnslogglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogglobal_auditnslogpolicy_binding -func (s *AuditService) AddAuditNSLogGlobalAuditNSLogPolicyBinding() {} -func (s *AuditService) DeleteAuditNSLogGlobalAuditNSLogPolicyBinding() {} -func (s *AuditService) GetAuditNSLogGlobalAuditNSLogPolicyBinding() {} -func (s *AuditService) CountAuditNSLogGlobalAuditNSLogPolicyBinding() {} + +func (s *AuditService) AddAuditNSLogGlobalAuditNSLogPolicyBinding(binding models.AuditNSLogGlobalAuditNSLogPolicyBinding) error { + payload := map[string]any{"auditnslogglobal_auditnslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditNSLogGlobalAuditNSLogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditNSLogGlobalAuditNSLogPolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", auditNSLogGlobalAuditNSLogPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAuditNSLogGlobalAuditNSLogPolicyBinding() ([]models.AuditNSLogGlobalAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogGlobalAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogGlobalAuditNSLogPolicyBinding `json:"auditnslogglobal_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogGlobalAuditNSLogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogGlobalAuditNSLogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogglobal_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogglobal_binding // Binding object which returns the resources bound to auditnslogglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogglobal_binding -func (s *AuditService) GetAuditNSLogGlobalBinding() {} + +func (s *AuditService) GetAuditNSLogGlobalBinding() ([]models.AuditNSLogGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogGlobalBinding `json:"auditnslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // auditnslogparams // Configuration for ns log parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogparams -func (s *AuditService) UpdateAuditNSLogParams() {} -func (s *AuditService) UnsetAuditNSLogParams() {} -func (s *AuditService) GetAllAuditNSLogParams() {} + +func (s *AuditService) UpdateAuditNSLogParams(params models.AuditNSLogParams) error { + payload := map[string]any{"auditnslogparams": params} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditNSLogParamsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UnsetAuditNSLogParams(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"auditnslogparams": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditNSLogParamsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditNSLogParams() (models.AuditNSLogParams, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogParamsURL, nil) + if err != nil { + return models.AuditNSLogParams{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.AuditNSLogParams{}, err + } + var result struct { + Params []models.AuditNSLogParams `json:"auditnslogparams"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AuditNSLogParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.AuditNSLogParams{}, nil +} // auditnslogpolicy // Configuration for ns log policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy -func (s *AuditService) AddAuditNSLogPolicy() {} -func (s *AuditService) DeleteAuditNSLogPolicy() {} -func (s *AuditService) UpdateAuditNSLogPolicy() {} -func (s *AuditService) GetAllAuditNSLogPolicy() {} -func (s *AuditService) GetAuditNSLogPolicy() {} -func (s *AuditService) CountAuditNSLogPolicy() {} + +func (s *AuditService) AddAuditNSLogPolicy(policy models.AuditNSLogPolicy) error { + payload := map[string]any{"auditnslogpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditNSLogPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditNSLogPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UpdateAuditNSLogPolicy(policy models.AuditNSLogPolicy) error { + payload := map[string]any{"auditnslogpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditNSLogPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditNSLogPolicy() ([]models.AuditNSLogPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuditNSLogPolicy `json:"auditnslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuditService) GetAuditNSLogPolicy(name string) ([]models.AuditNSLogPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuditNSLogPolicy `json:"auditnslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuditService) CountAuditNSLogPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_aaagroup_binding // Binding object showing the aaagroup that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_aaagroup_binding -func (s *AuditService) GetAllAuditNSLogPolicyAAAGroupBinding() {} -func (s *AuditService) GetAuditNSLogPolicyAAAGroupBinding() {} -func (s *AuditService) CountAuditNSLogPolicyAAAGroupBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyAAAGroupBinding() ([]models.AuditNSLogPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAAAGroupBinding `json:"auditnslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyAAAGroupBinding(name string) ([]models.AuditNSLogPolicyAAAGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAAAGroupBinding `json:"auditnslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyAAAGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_aaauser_binding // Binding object showing the aaauser that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_aaauser_binding -func (s *AuditService) GetAllAuditNSLogPolicyAAAUserBinding() {} -func (s *AuditService) GetAuditNSLogPolicyAAAUserBinding() {} -func (s *AuditService) CountAuditNSLogPolicyAAAUserBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyAAAUserBinding() ([]models.AuditNSLogPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAAAUserBinding `json:"auditnslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyAAAUserBinding(name string) ([]models.AuditNSLogPolicyAAAUserBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAAAUserBinding `json:"auditnslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyAAAUserBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_appfwglobal_binding // Binding object showing the appfwglobal that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_appfwglobal_binding -func (s *AuditService) GetAllAuditNSLogPolicyAppFWGlobalBinding() {} -func (s *AuditService) GetAuditNSLogPolicyAppFWGlobalBinding() {} -func (s *AuditService) CountAuditNSLogPolicyAppFWGlobalBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyAppFWGlobalBinding() ([]models.AuditNSLogPolicyAppFWGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyAppFWGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAppFWGlobalBinding `json:"auditnslogpolicy_appfwglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyAppFWGlobalBinding(name string) ([]models.AuditNSLogPolicyAppFWGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyAppFWGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAppFWGlobalBinding `json:"auditnslogpolicy_appfwglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyAppFWGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyAppFWGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_appfwglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_auditnslogglobal_binding // Binding object showing the auditnslogglobal that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_auditnslogglobal_binding -func (s *AuditService) GetAllAuditNSLogPolicyAuditNSLogGlobalBinding() {} -func (s *AuditService) GetAuditNSLogPolicyAuditNSLogGlobalBinding() {} -func (s *AuditService) CountAuditNSLogPolicyAuditNSLogGlobalBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyAuditNSLogGlobalBinding() ([]models.AuditNSLogPolicyAuditNSLogGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyAuditNSLogGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAuditNSLogGlobalBinding `json:"auditnslogpolicy_auditnslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyAuditNSLogGlobalBinding(name string) ([]models.AuditNSLogPolicyAuditNSLogGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyAuditNSLogGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAuditNSLogGlobalBinding `json:"auditnslogpolicy_auditnslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyAuditNSLogGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyAuditNSLogGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_auditnslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_authenticationvserver_binding // Binding object showing the authenticationvserver that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_authenticationvserver_binding -func (s *AuditService) GetAllAuditNSLogPolicyAuthenticationVServerBinding() {} -func (s *AuditService) GetAuditNSLogPolicyAuthenticationVServerBinding() {} -func (s *AuditService) CountAuditNSLogPolicyAuthenticationVServerBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyAuthenticationVServerBinding() ([]models.AuditNSLogPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAuthenticationVServerBinding `json:"auditnslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyAuthenticationVServerBinding(name string) ([]models.AuditNSLogPolicyAuthenticationVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyAuthenticationVServerBinding `json:"auditnslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyAuthenticationVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_binding // Binding object which returns the resources bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_binding -func (s *AuditService) GetAllAuditNSLogPolicyBinding() {} -func (s *AuditService) GetAuditNSLogPolicyBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyBinding() ([]models.AuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyBinding `json:"auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyBinding(name string) ([]models.AuditNSLogPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyBinding `json:"auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // auditnslogpolicy_csvserver_binding // Binding object showing the csvserver that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_csvserver_binding -func (s *AuditService) GetAllAuditNSLogPolicyCSVServerBinding() {} -func (s *AuditService) GetAuditNSLogPolicyCSVServerBinding() {} -func (s *AuditService) CountAuditNSLogPolicyCSVServerBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyCSVServerBinding() ([]models.AuditNSLogPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyCSVServerBinding `json:"auditnslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyCSVServerBinding(name string) ([]models.AuditNSLogPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyCSVServerBinding `json:"auditnslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_lbvserver_binding -func (s *AuditService) GetAllAuditNSLogPolicyLBVServerBinding() {} -func (s *AuditService) GetAuditNSLogPolicyLBVServerBinding() {} -func (s *AuditService) CountAuditNSLogPolicyLBVServerBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyLBVServerBinding() ([]models.AuditNSLogPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyLBVServerBinding `json:"auditnslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyLBVServerBinding(name string) ([]models.AuditNSLogPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyLBVServerBinding `json:"auditnslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_systemglobal_binding // Binding object showing the systemglobal that can be bound to auditnslogpolicy // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_systemglobal_binding -func (s *AuditService) GetAllAuditNSLogPolicySystemGlobalBinding() {} -func (s *AuditService) GetAuditNSLogPolicySystemGlobalBinding() {} -func (s *AuditService) CountAuditNSLogPolicySystemGlobalBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicySystemGlobalBinding() ([]models.AuditNSLogPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicySystemGlobalBinding `json:"auditnslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicySystemGlobalBinding(name string) ([]models.AuditNSLogPolicySystemGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicySystemGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicySystemGlobalBinding `json:"auditnslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicySystemGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicySystemGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_tmglobal_binding // Binding object showing the tmglobal that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_tmglobal_binding -func (s *AuditService) GetAllAuditNSLogPolicyTMGlobalBinding() {} -func (s *AuditService) GetAuditNSLogPolicyTMGlobalBinding() {} -func (s *AuditService) CountAuditNSLogPolicyTMGlobalBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyTMGlobalBinding() ([]models.AuditNSLogPolicyTMGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyTMGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyTMGlobalBinding `json:"auditnslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyTMGlobalBinding(name string) ([]models.AuditNSLogPolicyTMGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyTMGlobalBinding `json:"auditnslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyTMGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_vpnglobal_binding // Binding object showing the vpnglobal that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_vpnglobal_binding -func (s *AuditService) GetAllAuditNSLogPolicyVPNGlobalBinding() {} -func (s *AuditService) GetAuditNSLogPolicyVPNGlobalBinding() {} -func (s *AuditService) CountAuditNSLogPolicyVPNGlobalBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyVPNGlobalBinding() ([]models.AuditNSLogPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyVPNGlobalBinding `json:"auditnslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyVPNGlobalBinding(name string) ([]models.AuditNSLogPolicyVPNGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyVPNGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyVPNGlobalBinding `json:"auditnslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyVPNGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyVPNGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditnslogpolicy_vpnvserver_binding // Binding object showing the vpnvserver that can be bound to auditnslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditnslogpolicy_vpnvserver_binding -func (s *AuditService) GetAllAuditNSLogPolicyVPNVServerBinding() {} -func (s *AuditService) GetAuditNSLogPolicyVPNVServerBinding() {} -func (s *AuditService) CountAuditNSLogPolicyVPNVServerBinding() {} + +func (s *AuditService) GetAllAuditNSLogPolicyVPNVServerBinding() ([]models.AuditNSLogPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditNSLogPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyVPNVServerBinding `json:"auditnslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditNSLogPolicyVPNVServerBinding(name string) ([]models.AuditNSLogPolicyVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditNSLogPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditNSLogPolicyVPNVServerBinding `json:"auditnslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditNSLogPolicyVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditNSLogPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditnslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogaction // Configuration for system log action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogaction -func (s *AuditService) AddAuditSyslogAction() {} -func (s *AuditService) DeleteAuditSyslogAction() {} -func (s *AuditService) UpdateAuditSyslogAction() {} -func (s *AuditService) UnsetAuditSyslogAction() {} -func (s *AuditService) GetAllAuditSyslogAction() {} -func (s *AuditService) GetAuditSyslogAction() {} -func (s *AuditService) CountAuditSyslogAction() {} + +func (s *AuditService) AddAuditSyslogAction(action models.AuditSyslogAction) error { + payload := map[string]any{"auditsyslogaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditSyslogActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditSyslogAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", auditSyslogActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UpdateAuditSyslogAction(action models.AuditSyslogAction) error { + payload := map[string]any{"auditsyslogaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditSyslogActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UnsetAuditSyslogAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"auditsyslogaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditSyslogActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditSyslogAction() ([]models.AuditSyslogAction, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditSyslogAction `json:"auditsyslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) GetAuditSyslogAction(name string) ([]models.AuditSyslogAction, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuditSyslogAction `json:"auditsyslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuditService) CountAuditSyslogAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // auditsyslogglobal_auditsyslogpolicy_binding // Binding object showing the auditsyslogpolicy that can be bound to auditsyslogglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogglobal_auditsyslogpolicy_binding -func (s *AuditService) AddAuditSyslogGlobalAuditSyslogPolicyBinding() {} -func (s *AuditService) DeleteAuditSyslogGlobalAuditSyslogPolicyBinding() {} -func (s *AuditService) GetAuditSyslogGlobalAuditSyslogPolicyBinding() {} -func (s *AuditService) CountAuditSyslogGlobalAuditSyslogPolicyBinding() {} + +func (s *AuditService) AddAuditSyslogGlobalAuditSyslogPolicyBinding(binding models.AuditSyslogGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{"auditsyslogglobal_auditsyslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditSyslogGlobalAuditSyslogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditSyslogGlobalAuditSyslogPolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", auditSyslogGlobalAuditSyslogPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAuditSyslogGlobalAuditSyslogPolicyBinding() ([]models.AuditSyslogGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogGlobalAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogGlobalAuditSyslogPolicyBinding `json:"auditsyslogglobal_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogGlobalAuditSyslogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogGlobalAuditSyslogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogglobal_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogglobal_binding // Binding object which returns the resources bound to auditsyslogglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogglobal_binding -func (s *AuditService) GetAuditSyslogGlobalBinding() {} + +func (s *AuditService) GetAuditSyslogGlobalBinding() ([]models.AuditSyslogGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogGlobalBinding `json:"auditsyslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // auditsyslogparams // Configuration for system log parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogparams -func (s *AuditService) UpdateAuditSyslogParams() {} -func (s *AuditService) UnsetAuditSyslogParams() {} -func (s *AuditService) GetAllAuditSyslogParams() {} + +func (s *AuditService) UpdateAuditSyslogParams(params models.AuditSyslogParams) error { + payload := map[string]any{"auditsyslogparams": params} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditSyslogParamsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UnsetAuditSyslogParams(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"auditsyslogparams": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditSyslogParamsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditSyslogParams() (models.AuditSyslogParams, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogParamsURL, nil) + if err != nil { + return models.AuditSyslogParams{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.AuditSyslogParams{}, err + } + var result struct { + Params []models.AuditSyslogParams `json:"auditsyslogparams"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.AuditSyslogParams{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.AuditSyslogParams{}, nil +} // auditsyslogpolicy // Configuration for system log policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy -func (s *AuditService) AddAuditSyslogPolicy() {} -func (s *AuditService) DeleteAuditSyslogPolicy() {} -func (s *AuditService) UpdateAuditSyslogPolicy() {} -func (s *AuditService) GetAllAuditSyslogPolicy() {} -func (s *AuditService) GetAuditSyslogPolicy() {} -func (s *AuditService) CountAuditSyslogPolicy() {} + +func (s *AuditService) AddAuditSyslogPolicy(policy models.AuditSyslogPolicy) error { + payload := map[string]any{"auditsyslogpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, auditSyslogPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) DeleteAuditSyslogPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) UpdateAuditSyslogPolicy(policy models.AuditSyslogPolicy) error { + payload := map[string]any{"auditsyslogpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, auditSyslogPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuditService) GetAllAuditSyslogPolicy() ([]models.AuditSyslogPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuditSyslogPolicy `json:"auditsyslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuditService) GetAuditSyslogPolicy(name string) ([]models.AuditSyslogPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuditSyslogPolicy `json:"auditsyslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuditService) CountAuditSyslogPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_aaagroup_binding // Binding object showing the aaagroup that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_aaagroup_binding -func (s *AuditService) GetAllAuditSyslogPolicyAAAGroupBinding() {} -func (s *AuditService) GetAuditSyslogPolicyAAAGroupBinding() {} -func (s *AuditService) CountAuditSyslogPolicyAAAGroupBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyAAAGroupBinding() ([]models.AuditSyslogPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAAAGroupBinding `json:"auditsyslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyAAAGroupBinding(name string) ([]models.AuditSyslogPolicyAAAGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAAAGroupBinding `json:"auditsyslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyAAAGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_aaauser_binding // Binding object showing the aaauser that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_aaauser_binding -func (s *AuditService) GetAllAuditSyslogPolicyAAAUserBinding() {} -func (s *AuditService) GetAuditSyslogPolicyAAAUserBinding() {} -func (s *AuditService) CountAuditSyslogPolicyAAAUserBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyAAAUserBinding() ([]models.AuditSyslogPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAAAUserBinding `json:"auditsyslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyAAAUserBinding(name string) ([]models.AuditSyslogPolicyAAAUserBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAAAUserBinding `json:"auditsyslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyAAAUserBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_auditsyslogglobal_binding // Binding object showing the auditsyslogglobal that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_auditsyslogglobal_binding -func (s *AuditService) GetAllAuditSyslogPolicyAuditSyslogGlobalBinding() {} -func (s *AuditService) GetAuditSyslogPolicyAuditSyslogGlobalBinding() {} -func (s *AuditService) CountAuditSyslogPolicyAuditSyslogGlobalBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyAuditSyslogGlobalBinding() ([]models.AuditSyslogPolicyAuditSyslogGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyAuditSyslogGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAuditSyslogGlobalBinding `json:"auditsyslogpolicy_auditsyslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyAuditSyslogGlobalBinding(name string) ([]models.AuditSyslogPolicyAuditSyslogGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyAuditSyslogGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAuditSyslogGlobalBinding `json:"auditsyslogpolicy_auditsyslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyAuditSyslogGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyAuditSyslogGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_auditsyslogglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_authenticationvserver_binding // Binding object showing the authenticationvserver that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_authenticationvserver_binding -func (s *AuditService) GetAllAuditSyslogPolicyAuthenticationVServerBinding() {} -func (s *AuditService) GetAuditSyslogPolicyAuthenticationVServerBinding() {} -func (s *AuditService) CountAuditSyslogPolicyAuthenticationVServerBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyAuthenticationVServerBinding() ([]models.AuditSyslogPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAuthenticationVServerBinding `json:"auditsyslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyAuthenticationVServerBinding(name string) ([]models.AuditSyslogPolicyAuthenticationVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyAuthenticationVServerBinding `json:"auditsyslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyAuthenticationVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_binding // Binding object which returns the resources bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_binding -func (s *AuditService) GetAllAuditSyslogPolicyBinding() {} -func (s *AuditService) GetAuditSyslogPolicyBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyBinding() ([]models.AuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyBinding `json:"auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyBinding(name string) ([]models.AuditSyslogPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyBinding `json:"auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // auditsyslogpolicy_csvserver_binding // Binding object showing the csvserver that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_csvserver_binding -func (s *AuditService) GetAllAuditSyslogPolicyCSVServerBinding() {} -func (s *AuditService) GetAuditSyslogPolicyCSVServerBinding() {} -func (s *AuditService) CountAuditSyslogPolicyCSVServerBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyCSVServerBinding() ([]models.AuditSyslogPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyCSVServerBinding `json:"auditsyslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyCSVServerBinding(name string) ([]models.AuditSyslogPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyCSVServerBinding `json:"auditsyslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_lbvserver_binding -func (s *AuditService) GetAllAuditSyslogPolicyLBVServerBinding() {} -func (s *AuditService) GetAuditSyslogPolicyLBVServerBinding() {} -func (s *AuditService) CountAuditSyslogPolicyLBVServerBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyLBVServerBinding() ([]models.AuditSyslogPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyLBVServerBinding `json:"auditsyslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyLBVServerBinding(name string) ([]models.AuditSyslogPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyLBVServerBinding `json:"auditsyslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_rnatglobal_binding // Binding object showing the rnatglobal that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_rnatglobal_binding -func (s *AuditService) GetAllAuditSyslogPolicyRNATGlobalBinding() {} -func (s *AuditService) GetAuditSyslogPolicyRNATGlobalBinding() {} -func (s *AuditService) CountAuditSyslogPolicyRNATGlobalBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyRNATGlobalBinding() ([]models.AuditSyslogPolicyRNATGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyRNATGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyRNATGlobalBinding `json:"auditsyslogpolicy_rnatglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyRNATGlobalBinding(name string) ([]models.AuditSyslogPolicyRNATGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyRNATGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyRNATGlobalBinding `json:"auditsyslogpolicy_rnatglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyRNATGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyRNATGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_rnatglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_systemglobal_binding // Binding object showing the systemglobal that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_systemglobal_binding -func (s *AuditService) GetAllAuditSyslogPolicySystemGlobalBinding() {} -func (s *AuditService) GetAuditSyslogPolicySystemGlobalBinding() {} -func (s *AuditService) CountAuditSyslogPolicySystemGlobalBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicySystemGlobalBinding() ([]models.AuditSyslogPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicySystemGlobalBinding `json:"auditsyslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicySystemGlobalBinding(name string) ([]models.AuditSyslogPolicySystemGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicySystemGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicySystemGlobalBinding `json:"auditsyslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicySystemGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicySystemGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_systemglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_tmpglobal_binding // Binding object showing the tmglobal that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_tmglobal_binding -func (s *AuditService) GetAllAuditSyslogPolicyTMGlobalBinding() {} -func (s *AuditService) GetAuditSyslogPolicyTMGlobalBinding() {} -func (s *AuditService) CountAuditSyslogPolicyTMGlobalBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyTMGlobalBinding() ([]models.AuditSyslogPolicyTMGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyTMGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyTMGlobalBinding `json:"auditsyslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyTMGlobalBinding(name string) ([]models.AuditSyslogPolicyTMGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyTMGlobalBinding `json:"auditsyslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyTMGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_vpnglobal_binding // Binding object showing the vpnglobal that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_vpnglobal_binding -func (s *AuditService) GetAllAuditSyslogPolicyVPNGlobalBinding() {} -func (s *AuditService) GetAuditSyslogPolicyVPNGlobalBinding() {} -func (s *AuditService) CountAuditSyslogPolicyVPNGlobalBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyVPNGlobalBinding() ([]models.AuditSyslogPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyVPNGlobalBinding `json:"auditsyslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyVPNGlobalBinding(name string) ([]models.AuditSyslogPolicyVPNGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyVPNGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyVPNGlobalBinding `json:"auditsyslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyVPNGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyVPNGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_vpnglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // auditsyslogpolicy_vpnvserver_binding // Binding object showing the vpnvserver that can be bound to auditsyslogpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/audit/auditsyslogpolicy_vpnvserver_binding -func (s *AuditService) GetAllAuditSyslogPolicyVPNVServerBinding() {} -func (s *AuditService) GetAuditSyslogPolicyVPNVServerBinding() {} -func (s *AuditService) CountAuditSyslogPolicyVPNVServerBinding() {} + +func (s *AuditService) GetAllAuditSyslogPolicyVPNVServerBinding() ([]models.AuditSyslogPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, auditSyslogPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyVPNVServerBinding `json:"auditsyslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) GetAuditSyslogPolicyVPNVServerBinding(name string) ([]models.AuditSyslogPolicyVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", auditSyslogPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuditSyslogPolicyVPNVServerBinding `json:"auditsyslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuditService) CountAuditSyslogPolicyVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", auditSyslogPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"auditsyslogpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/authentication.go b/nitrogo/authentication.go index 111c8c3..8f4b017 100644 --- a/nitrogo/authentication.go +++ b/nitrogo/authentication.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( authenticationADFSProxyProfileURL = "/nitro/v1/config/authenticationadfsproxyprofile" authenticationAuthnProfileURL = "/nitro/v1/config/authenticationauthnprofile" @@ -123,951 +132,10566 @@ type AuthenticationService struct { // authenticationadfsproxyprofile // Configuration for ADFSProxy Profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationadfsproxyprofile -func (s *AuthenticationService) AddAuthenticationADFSProxyProfile() {} -func (s *AuthenticationService) DeleteAuthenticationADFSProxyProfile() {} -func (s *AuthenticationService) UpdateAuthenticationADFSProxyProfile() {} -func (s *AuthenticationService) GetAllAuthenticationADFSProxyProfile() {} -func (s *AuthenticationService) GetAuthenticationADFSProxyProfile() {} -func (s *AuthenticationService) CountAuthenticationADFSProxyProfile() {} +func (s *AuthenticationService) AddAuthenticationADFSProxyProfile(resource models.AuthenticationADFSProxyProfile) error { + payload := map[string]any{"authenticationadfsproxyprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationauthnprofile -// Configuration for Authentication profile resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile -func (s *AuthenticationService) AddAuthenticationAuthnProfile() {} -func (s *AuthenticationService) DeleteAuthenticationAuthnProfile() {} -func (s *AuthenticationService) UpdateAuthenticationAuthnProfile() {} -func (s *AuthenticationService) UnsetAuthenticationAuthnProfile() {} -func (s *AuthenticationService) GetAllAuthenticationAuthnProfile() {} -func (s *AuthenticationService) GetAuthenticationAuthnProfile() {} -func (s *AuthenticationService) CountAuthenticationAuthnProfile() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationADFSProxyProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationazurekeyvault -// Configuration for Azure Key Vault entity resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault -func (s *AuthenticationService) AddAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) DeleteAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) UpdateAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) UnsetAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) GetAllAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) GetAuthenticationAzureKeyVault() {} -func (s *AuthenticationService) CountAuthenticationAzureKeyVault() {} + _, err = s.client.Do(req) + return err +} -// authenticationcaptchaaction -// Configuration for Captcha Action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction -func (s *AuthenticationService) AddAuthenticationCaptchaAction() {} -func (s *AuthenticationService) DeleteAuthenticationCaptchaAction() {} -func (s *AuthenticationService) UpdateAuthenticationCaptchaAction() {} -func (s *AuthenticationService) UnsetAuthenticationCaptchaAction() {} -func (s *AuthenticationService) GetAllAuthenticationCaptchaAction() {} -func (s *AuthenticationService) GetAuthenticationCaptchaAction() {} -func (s *AuthenticationService) CountAuthenticationCaptchaAction() {} +func (s *AuthenticationService) DeleteAuthenticationADFSProxyProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationADFSProxyProfileURL, name), nil) + if err != nil { + return err + } -// authenticationcertaction -// Configuration for CERT action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction -func (s *AuthenticationService) AddAuthenticationCertAction() {} -func (s *AuthenticationService) DeleteAuthenticationCertAction() {} -func (s *AuthenticationService) UpdateAuthenticationCertAction() {} -func (s *AuthenticationService) UnsetAuthenticationCertAction() {} -func (s *AuthenticationService) GetAllAuthenticationCertAction() {} -func (s *AuthenticationService) GetAuthenticationCertAction() {} -func (s *AuthenticationService) CountAuthenticationCertAction() {} + _, err = s.client.Do(req) + return err +} -// authenticationcertpolicy -// Configuration for CERT policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy -func (s *AuthenticationService) AddAuthenticationCertPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationCertPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationCertPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationCertPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationCertPolicy() {} -func (s *AuthenticationService) GetAuthenticationCertPolicy() {} -func (s *AuthenticationService) CountAuthenticationCertPolicy() {} +func (s *AuthenticationService) UpdateAuthenticationADFSProxyProfile(resource models.AuthenticationADFSProxyProfile) error { + payload := map[string]any{"authenticationadfsproxyprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationcertpolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationcertpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationCertPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationCertPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationCertPolicyAuthenticationVServerBinding() {} + req, err := s.client.NewRequest(http.MethodPut, authenticationADFSProxyProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationcertpolicy_binding -// Binding object which returns the resources bound to authenticationcertpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_binding -func (s *AuthenticationService) GetAllAuthenticationCertPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationCertPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationcertpolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationcertpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationCertPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationCertPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationCertPolicyVPNGlobalBinding() {} +func (s *AuthenticationService) GetAllAuthenticationADFSProxyProfile() ([]models.AuthenticationADFSProxyProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationADFSProxyProfileURL, nil) + if err != nil { + return nil, err + } -// authenticationcertpolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationcertpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationCertPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationCertPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationCertPolicyVPNVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationcitrixauthaction -// Configuration for Citrix Authentication action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction -func (s *AuthenticationService) AddAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) DeleteAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) UpdateAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) UnsetAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) GetAllAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) GetAuthenticationCitrixAuthAction() {} -func (s *AuthenticationService) CountAuthenticationCitrixAuthAction() {} + var result struct { + Data []models.AuthenticationADFSProxyProfile `json:"authenticationadfsproxyprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationdfaaction -// Configuration for Dfa authentication action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction -func (s *AuthenticationService) AddAuthenticationDFAAction() {} -func (s *AuthenticationService) DeleteAuthenticationDFAAction() {} -func (s *AuthenticationService) UpdateAuthenticationDFAAction() {} -func (s *AuthenticationService) UnsetAuthenticationDFAAction() {} -func (s *AuthenticationService) GetAllAuthenticationDFAAction() {} -func (s *AuthenticationService) GetAuthenticationDFAAction() {} -func (s *AuthenticationService) CountAuthenticationDFAAction() {} + return result.Data, nil +} -// authenticationdfapolicy -// Configuration for Dfa authentication policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy -func (s *AuthenticationService) AddAuthenticationDFAPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationDFAPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationDFAPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationDFAPolicy() {} -func (s *AuthenticationService) GetAuthenticationDFAPolicy() {} -func (s *AuthenticationService) CountAuthenticationDFAPolicy() {} +func (s *AuthenticationService) GetAuthenticationADFSProxyProfile(name string) (*models.AuthenticationADFSProxyProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationADFSProxyProfileURL, name), nil) + if err != nil { + return nil, err + } -// authenticationdfapolicy_binding -// Binding object which returns the resources bound to authenticationdfapolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_binding -func (s *AuthenticationService) GetAllAuthenticationDFAPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationDFAPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationdfapolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationdfapolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationDFAPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationDFAPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationDFAPolicyVPNVServerBinding() {} + var result struct { + Data []models.AuthenticationADFSProxyProfile `json:"authenticationadfsproxyprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationemailaction -// Configuration for Email entity resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction -func (s *AuthenticationService) AddAuthenticationEmailAction() {} -func (s *AuthenticationService) DeleteAuthenticationEmailAction() {} -func (s *AuthenticationService) UpdateAuthenticationEmailAction() {} -func (s *AuthenticationService) UnsetAuthenticationEmailAction() {} -func (s *AuthenticationService) GetAllAuthenticationEmailAction() {} -func (s *AuthenticationService) GetAuthenticationEmailAction() {} -func (s *AuthenticationService) CountAuthenticationEmailAction() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationadfsproxyprofile %s not found", name) + } -// authenticationepaaction -// Configuration for epa action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction -func (s *AuthenticationService) AddAuthenticationEPAAction() {} -func (s *AuthenticationService) DeleteAuthenticationEPAAction() {} -func (s *AuthenticationService) UpdateAuthenticationEPAAction() {} -func (s *AuthenticationService) UnsetAuthenticationEPAAction() {} -func (s *AuthenticationService) GetAllAuthenticationEPAAction() {} -func (s *AuthenticationService) GetAuthenticationEPAAction() {} -func (s *AuthenticationService) CountAuthenticationEPAAction() {} + return &result.Data[0], nil +} -// authenticationldapaction -// Configuration for LDAP action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction -func (s *AuthenticationService) AddAuthenticationLDAPAction() {} -func (s *AuthenticationService) DeleteAuthenticationLDAPAction() {} -func (s *AuthenticationService) UpdateAuthenticationLDAPAction() {} -func (s *AuthenticationService) UnsetAuthenticationLDAPAction() {} -func (s *AuthenticationService) GetAllAuthenticationLDAPAction() {} -func (s *AuthenticationService) GetAuthenticationLDAPAction() {} -func (s *AuthenticationService) CountAuthenticationLDAPAction() {} +func (s *AuthenticationService) CountAuthenticationADFSProxyProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationADFSProxyProfileURL), nil) + if err != nil { + return 0, err + } -// authenticationldappolicy -// Configuration for LDAP policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy -func (s *AuthenticationService) AddAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicy() {} -func (s *AuthenticationService) CountAuthenticationLDAPPolicy() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// authenticationldappolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationldappolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLDAPPolicyAuthenticationVServerBinding() {} + var result struct { + Data []models.AuthenticationADFSProxyProfile `json:"authenticationadfsproxyprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } -// authenticationldappolicy_binding -// Binding object which returns the resources bound to authenticationldappolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_binding -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicyBinding() {} + if len(result.Data) == 0 { + return 0, nil + } -// authenticationldappolicy_systemglobal_binding -// Binding object showing the systemglobal that can be bound to authenticationldappolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationLDAPPolicySystemGlobalBinding() {} + return int(result.Data[0].Count), nil +} -// authenticationldappolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationldappolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationLDAPPolicyVPNGlobalBinding() {} +// authenticationauthnprofile +// Configuration for Authentication profile resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationauthnprofile +func (s *AuthenticationService) AddAuthenticationAuthnProfile(resource models.AuthenticationAuthNProfile) error { + payload := map[string]any{"authenticationauthnprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationldappolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationldappolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLDAPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLDAPPolicyVPNVServerBinding() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationAuthnProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationlocalpolicy -// Configuration for LOCAL policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy -func (s *AuthenticationService) AddAuthenticationLocalPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationLocalPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationLocalPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationLocalPolicy() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicy() {} -func (s *AuthenticationService) CountAuthenticationLocalPolicy() {} + _, err = s.client.Do(req) + return err +} -// authenticationlocalpolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationlocalpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLocalPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLocalPolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) DeleteAuthenticationAuthnProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationAuthnProfileURL, name), nil) + if err != nil { + return err + } -// authenticationlocalpolicy_binding -// Binding object which returns the resources bound to authenticationlocalpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_binding -func (s *AuthenticationService) GetAllAuthenticationLocalPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationlocalpolicy_systemglobal_binding -// Binding object showing the systemglobal that can be bound to authenticationlocalpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationLocalPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationLocalPolicySystemGlobalBinding() {} +func (s *AuthenticationService) UpdateAuthenticationAuthnProfile(resource models.AuthenticationAuthNProfile) error { + payload := map[string]any{"authenticationauthnprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationlocalpolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationlocalpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationLocalPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationLocalPolicyVPNGlobalBinding() {} + req, err := s.client.NewRequest(http.MethodPut, authenticationAuthnProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationlocalpolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationlocalpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLocalPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLocalPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLocalPolicyVPNVServerBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationloginschema -// Configuration for Login Schema resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema -func (s *AuthenticationService) AddAuthenticationLoginSchema() {} -func (s *AuthenticationService) DeleteAuthenticationLoginSchema() {} -func (s *AuthenticationService) UpdateAuthenticationLoginSchema() {} -func (s *AuthenticationService) UnsetAuthenticationLoginSchema() {} -func (s *AuthenticationService) GetAllAuthenticationLoginSchema() {} -func (s *AuthenticationService) GetAuthenticationLoginSchema() {} -func (s *AuthenticationService) CountAuthenticationLoginSchema() {} +func (s *AuthenticationService) UnsetAuthenticationAuthnProfile(resource models.AuthenticationAuthNProfile) error { + payload := map[string]any{"authenticationauthnprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationloginschemapolicy -// Configuration for Login Schema Policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy -func (s *AuthenticationService) AddAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicy() {} -func (s *AuthenticationService) RenameAuthenticationLoginSchemaPolicy() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationAuthnProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationloginschemapolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationloginschemapolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicyAuthenticationVServerBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationloginschemapolicy_binding -// Binding object which returns the resources bound to authenticationloginschemapolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_binding -func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyBinding() {} +func (s *AuthenticationService) GetAllAuthenticationAuthnProfile() ([]models.AuthenticationAuthNProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationAuthnProfileURL, nil) + if err != nil { + return nil, err + } -// authenticationloginschemapolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationloginschemapolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicyVPNVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationnegotiataction -// Configuration for Negotiate action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction -func (s *AuthenticationService) AddAuthenticationNegotiateAction() {} -func (s *AuthenticationService) DeleteAuthenticationNegotiateAction() {} -func (s *AuthenticationService) UpdateAuthenticationNegotiateAction() {} -func (s *AuthenticationService) UnsetAuthenticationNegotiateAction() {} -func (s *AuthenticationService) GetAllAuthenticationNegotiateAction() {} -func (s *AuthenticationService) GetAuthenticationNegotiateAction() {} -func (s *AuthenticationService) CountAuthenticationNegotiateAction() {} + var result struct { + Data []models.AuthenticationAuthNProfile `json:"authenticationauthnprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationnegotiatpolicy -// Configuration for Negotiate Policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy -func (s *AuthenticationService) AddAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) DeleteAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) UpdateAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) UnsetAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicy() {} -func (s *AuthenticationService) CountAuthenticationNegotiatePolicy() {} + return result.Data, nil +} -// authenticationnegotiatepolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationnegotiatepolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationNegotiatePolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) GetAuthenticationAuthnProfile(name string) (*models.AuthenticationAuthNProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationAuthnProfileURL, name), nil) + if err != nil { + return nil, err + } -// authenticationnegotiatepolicy_binding -// Binding object which returns the resources bound to authenticationnegotiatepolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_binding -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationnegotiatepolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationnegotiatepolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationNegotiatePolicyVPNGlobalBinding() {} + var result struct { + Data []models.AuthenticationAuthNProfile `json:"authenticationauthnprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationnegotiatepolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationnegotiatepolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationNegotiatePolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationNegotiatePolicyVPNVServerBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationauthnprofile %s not found", name) + } -// authenticationnoauthaction -// Configuration for no authentication action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction -func (s *AuthenticationService) AddAuthenticationNoAuthAction() {} -func (s *AuthenticationService) DeleteAuthenticationNoAuthAction() {} -func (s *AuthenticationService) UpdateAuthenticationNoAuthAction() {} -func (s *AuthenticationService) UnsetAuthenticationNoAuthAction() {} -func (s *AuthenticationService) GetAllAuthenticationNoAuthAction() {} -func (s *AuthenticationService) GetAuthenticationNoAuthAction() {} -func (s *AuthenticationService) CountAuthenticationNoAuthAction() {} + return &result.Data[0], nil +} -// authenticationoauthaction -// Configuration for OAuth authentication action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction -func (s *AuthenticationService) AddAuthenticationOAuthAction() {} -func (s *AuthenticationService) DeleteAuthenticationOAuthAction() {} -func (s *AuthenticationService) UpdateAuthenticationOAuthAction() {} -func (s *AuthenticationService) UnsetAuthenticationOAuthAction() {} -func (s *AuthenticationService) GetAllAuthenticationOAuthAction() {} -func (s *AuthenticationService) GetAuthenticationOAuthAction() {} -func (s *AuthenticationService) CountAuthenticationOAuthAction() {} +func (s *AuthenticationService) CountAuthenticationAuthnProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationAuthnProfileURL), nil) + if err != nil { + return 0, err + } -// authenticationoauthidppolicy -// Configuration for AAA OAuth IdentityProvider (IdP) policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy -func (s *AuthenticationService) AddAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicy() {} -func (s *AuthenticationService) RenameAuthenticationOAuthIdPPolicy() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// authenticationoauthidppolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationoauthidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicyAuthenticationVServerBinding() {} + var result struct { + Data []models.AuthenticationAuthNProfile `json:"authenticationauthnprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } -// authenticationoauthidppolicy_binding -// Binding object which returns the resources bound to authenticationoauthidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_binding -func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyBinding() {} + if len(result.Data) == 0 { + return 0, nil + } -// authenticationoauthidppolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationoauthidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicyVPNVServerBinding() {} + return int(result.Data[0].Count), nil +} -// authenticationoauthidpprofile -// Configuration for OAuth Identity Provider (IdP) profile resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile -func (s *AuthenticationService) AddAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) DeleteAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) UpdateAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) UnsetAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) GetAllAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) GetAuthenticationOAuthIdPProfile() {} -func (s *AuthenticationService) CountAuthenticationOAuthIdPProfile() {} +// authenticationazurekeyvault +// Configuration for Azure Key Vault entity resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationazurekeyvault +func (s *AuthenticationService) AddAuthenticationAzureKeyVault(resource models.AuthenticationAzureKeyVault) error { + payload := map[string]any{"authenticationazurekeyvault": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationpolicy -// Configuration for Authentication Policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy -func (s *AuthenticationService) AddAuthenticationPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationPolicy() {} -func (s *AuthenticationService) GetAuthenticationPolicy() {} -func (s *AuthenticationService) CountAuthenticationPolicy() {} -func (s *AuthenticationService) RenameAuthenticationPolicy() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationAzureKeyVaultURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationpolicylabel -// Configuration for authentication policy label resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel -func (s *AuthenticationService) AddAuthenticationPolicyLabel() {} -func (s *AuthenticationService) DeleteAuthenticationPolicyLabel() {} -func (s *AuthenticationService) GetAllAuthenticationPolicyLabel() {} -func (s *AuthenticationService) GetAuthenticationPolicyLabel() {} -func (s *AuthenticationService) CountAuthenticationPolicyLabel() {} -func (s *AuthenticationService) RenameAuthenticationPolicyLabel() {} + _, err = s.client.Do(req) + return err +} -// authenticationpolicylabel_authenticationpolicy_binding -// Binding object showing the authenticationpolicy that can be bound to authenticationpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_authenticationpolicy_binding -func (s *AuthenticationService) AddAuthenticationPolicyLabelAuthenticationPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationPolicyLabelAuthenticationPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationPolicyLabelAuthenticationPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicyLabelAuthenticationPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationPolicyLabelAuthenticationPolicyBinding() {} +func (s *AuthenticationService) DeleteAuthenticationAzureKeyVault(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationAzureKeyVaultURL, name), nil) + if err != nil { + return err + } -// authenticaitonpolicylabel_binding -// Binding object which returns the resources bound to authenticationpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_binding -func (s *AuthenticationService) GetAllAuthenticationPolicyLabelBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicyLabelBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationpolicy_authenticationpolicylabel_binding -// Binding object showing the authenticationpolicylabel that can be bound to authenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationpolicylabel_binding -func (s *AuthenticationService) GetAllAuthenticationPolicyAuthenticationPolicyLabelBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicyAuthenticationPolicyLabelBinding() {} -func (s *AuthenticationService) CountAuthenticationPolicyAuthenticationPolicyLabelBinding() {} +func (s *AuthenticationService) UpdateAuthenticationAzureKeyVault(resource models.AuthenticationAzureKeyVault) error { + payload := map[string]any{"authenticationazurekeyvault": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationpolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationPolicyAuthenticationVServerBinding() {} + req, err := s.client.NewRequest(http.MethodPut, authenticationAzureKeyVaultURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationpolicy_binding -// Binding object which returns the resources bound to authenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_binding -func (s *AuthenticationService) GetAllAuthenticationPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// authenicationpolicy_systemglobal_binding -// Binding object showing the systemglobal that can be bound to authenticationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationPolicySystemGlobalBinding() {} +func (s *AuthenticationService) UnsetAuthenticationAzureKeyVault(resource models.AuthenticationAzureKeyVault) error { + payload := map[string]any{"authenticationazurekeyvault": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationpushservice -// Configuration for Service details for sending push notifications resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice -func (s *AuthenticationService) AddAuthenticationPushService() {} -func (s *AuthenticationService) DeleteAuthenticationPushService() {} -func (s *AuthenticationService) UpdateAuthenticationPushService() {} -func (s *AuthenticationService) UnsetAuthenticationPushService() {} -func (s *AuthenticationService) GetAllAuthenticationPushService() {} -func (s *AuthenticationService) GetAuthenticationPushService() {} -func (s *AuthenticationService) CountAuthenticationPushService() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationAzureKeyVaultURL), bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationradiusaction -// Configuration for RADIUS action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction -func (s *AuthenticationService) AddAuthenticationRADIUSAction() {} -func (s *AuthenticationService) DeleteAuthenticationRADIUSAction() {} -func (s *AuthenticationService) UpdateAuthenticationRADIUSAction() {} -func (s *AuthenticationService) UnsetAuthenticationRADIUSAction() {} -func (s *AuthenticationService) GetAllAuthenticationRADIUSAction() {} -func (s *AuthenticationService) GetAuthenticationRADIUSAction() {} -func (s *AuthenticationService) CountAuthenticationRADIUSAction() {} + _, err = s.client.Do(req) + return err +} -// authenticationradiuspolicy -// Configuration for RADIUS policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy -func (s *AuthenticationService) AddAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicy() {} -func (s *AuthenticationService) CountAuthenticationRADIUSPolicy() {} +func (s *AuthenticationService) GetAllAuthenticationAzureKeyVault() ([]models.AuthenticationAzureKeyVault, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationAzureKeyVaultURL, nil) + if err != nil { + return nil, err + } -// authenticationradiuspolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationradiuspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationRADIUSPolicyAuthenticationVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationradiuspolicy_binding -// Binding object which returns the resources bound to authenticationradiuspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_binding -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicyBinding() {} + var result struct { + Data []models.AuthenticationAzureKeyVault `json:"authenticationazurekeyvault"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationradiuspolicy_systemglobal_binding -// Binding object showing the systemglobal that can be bound to authenticationradiuspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationRADIUSPolicySystemGlobalBinding() {} + return result.Data, nil +} -// authenticationradiuspolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationradiuspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationRADIUSPolicyVPNGlobalBinding() {} +func (s *AuthenticationService) GetAuthenticationAzureKeyVault(name string) (*models.AuthenticationAzureKeyVault, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationAzureKeyVaultURL, name), nil) + if err != nil { + return nil, err + } -// authenticationradiuspolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationradiuspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationRADIUSPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationRADIUSPolicyVPNVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationsamlaction -// Configuration for AAA Saml action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction -func (s *AuthenticationService) AddAuthenticationSAMLAction() {} -func (s *AuthenticationService) DeleteAuthenticationSAMLAction() {} -func (s *AuthenticationService) UpdateAuthenticationSAMLAction() {} -func (s *AuthenticationService) UnsetAuthenticationSAMLAction() {} -func (s *AuthenticationService) GetAllAuthenticationSAMLAction() {} -func (s *AuthenticationService) GetAuthenticationSAMLAction() {} -func (s *AuthenticationService) CountAuthenticationSAMLAction() {} + var result struct { + Data []models.AuthenticationAzureKeyVault `json:"authenticationazurekeyvault"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationsamlidppolicy -// Configuration for AAA Saml IdentityProvider (IdP) policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy -func (s *AuthenticationService) AddAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicy() {} -func (s *AuthenticationService) RenameAuthenticationSAMLIdPPolicy() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationazurekeyvault %s not found", name) + } -// authenticationsamlidppolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationsamlidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicyAuthenticationVServerBinding() {} + return &result.Data[0], nil +} -// authenticationsamlidppolicy_binding -// Binding object which returns the resources bound to authenticationsamlidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyBinding() {} +func (s *AuthenticationService) CountAuthenticationAzureKeyVault() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationAzureKeyVaultURL), nil) + if err != nil { + return 0, err + } -// authenticationsamlidppolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationsamlidppolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicyVPNVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// authenticationsamlidpprofile -// Configuration for AAA Saml IdentityProvider (IdP) profile resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile -func (s *AuthenticationService) AddAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) DeleteAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) UpdateAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) UnsetAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) GetAllAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) GetAuthenticationSAMLIdPProfile() {} -func (s *AuthenticationService) CountAuthenticationSAMLIdPProfile() {} + var result struct { + Data []models.AuthenticationAzureKeyVault `json:"authenticationazurekeyvault"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } -// authenticaitonsamlpolicy -// Configuration for AAA Saml policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy -func (s *AuthenticationService) AddAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) GetAuthenticationSAMLPolicy() {} -func (s *AuthenticationService) CountAuthenticationSAMLPolicy() {} + if len(result.Data) == 0 { + return 0, nil + } -// authenticationsamlpolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationsamlpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationSAMLPolicyAuthenticationVServerBinding() {} + return int(result.Data[0].Count), nil +} -// authenticationsamlpolicy_binding -// Binding object which returns the resources bound to authenticationsamlpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLPolicyBinding() {} +// authenticationcaptchaaction +// Configuration for Captcha Action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcaptchaaction +func (s *AuthenticationService) AddAuthenticationCaptchaAction(resource models.AuthenticationCaptchaAction) error { + payload := map[string]any{"authenticationcaptchaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationsamlpolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationsamlpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationSAMLPolicyVPNGlobalBinding() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationCaptchaActionURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationsamlpolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationsamlpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationSAMLPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationSAMLPolicyVPNVServerBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationstorefrontauthaction +func (s *AuthenticationService) DeleteAuthenticationCaptchaAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationCaptchaActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationCaptchaAction(resource models.AuthenticationCaptchaAction) error { + payload := map[string]any{"authenticationcaptchaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationCaptchaActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationCaptchaAction(resource models.AuthenticationCaptchaAction) error { + payload := map[string]any{"authenticationcaptchaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationCaptchaActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationCaptchaAction() ([]models.AuthenticationCaptchaAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCaptchaActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCaptchaAction `json:"authenticationcaptchaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCaptchaAction(name string) (*models.AuthenticationCaptchaAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCaptchaActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCaptchaAction `json:"authenticationcaptchaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcaptchaaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCaptchaAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCaptchaActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCaptchaAction `json:"authenticationcaptchaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcertaction +// Configuration for CERT action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertaction +func (s *AuthenticationService) AddAuthenticationCertAction(resource models.AuthenticationCertAction) error { + payload := map[string]any{"authenticationcertaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationCertActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationCertAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationCertActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationCertAction(resource models.AuthenticationCertAction) error { + payload := map[string]any{"authenticationcertaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationCertActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationCertAction(resource models.AuthenticationCertAction) error { + payload := map[string]any{"authenticationcertaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationCertActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationCertAction() ([]models.AuthenticationCertAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertAction `json:"authenticationcertaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertAction(name string) (*models.AuthenticationCertAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertAction `json:"authenticationcertaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCertAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCertActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCertAction `json:"authenticationcertaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcertpolicy +// Configuration for CERT policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy +func (s *AuthenticationService) AddAuthenticationCertPolicy(resource models.AuthenticationCertPolicy) error { + payload := map[string]any{"authenticationcertpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationCertPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationCertPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationCertPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationCertPolicy(resource models.AuthenticationCertPolicy) error { + payload := map[string]any{"authenticationcertpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationCertPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationCertPolicy(resource models.AuthenticationCertPolicy) error { + payload := map[string]any{"authenticationcertpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationCertPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationCertPolicy() ([]models.AuthenticationCertPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicy `json:"authenticationcertpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertPolicy(name string) (*models.AuthenticationCertPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicy `json:"authenticationcertpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCertPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCertPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCertPolicy `json:"authenticationcertpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcertpolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationcertpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationCertPolicyAuthenticationVServerBinding() ([]models.AuthenticationCertPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyAuthenticationVServerBinding `json:"authenticationcertpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationCertPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyAuthenticationVServerBinding `json:"authenticationcertpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertpolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCertPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCertPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCertPolicyAuthenticationVServerBinding `json:"authenticationcertpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcertpolicy_binding +// Binding object which returns the resources bound to authenticationcertpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_binding +func (s *AuthenticationService) GetAllAuthenticationCertPolicyBinding() ([]models.AuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyBinding `json:"authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertPolicyBinding(name string) (*models.AuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyBinding `json:"authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationcertpolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationcertpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationCertPolicyVPNGlobalBinding() ([]models.AuthenticationCertPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNGlobalBinding `json:"authenticationcertpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertPolicyVPNGlobalBinding(name string) (*models.AuthenticationCertPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNGlobalBinding `json:"authenticationcertpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCertPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCertPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNGlobalBinding `json:"authenticationcertpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcertpolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationcertpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcertpolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationCertPolicyVPNVServerBinding() ([]models.AuthenticationCertPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCertPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNVServerBinding `json:"authenticationcertpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCertPolicyVPNVServerBinding(name string) (*models.AuthenticationCertPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCertPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNVServerBinding `json:"authenticationcertpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcertpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCertPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCertPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCertPolicyVPNVServerBinding `json:"authenticationcertpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationcitrixauthaction +// Configuration for Citrix Authentication action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationcitrixauthaction +func (s *AuthenticationService) AddAuthenticationCitrixAuthAction(resource models.AuthenticationCitrixAuthAction) error { + payload := map[string]any{"authenticationcitrixauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationCitrixAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationCitrixAuthAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationCitrixAuthActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationCitrixAuthAction(resource models.AuthenticationCitrixAuthAction) error { + payload := map[string]any{"authenticationcitrixauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationCitrixAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationCitrixAuthAction(resource models.AuthenticationCitrixAuthAction) error { + payload := map[string]any{"authenticationcitrixauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationCitrixAuthActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationCitrixAuthAction() ([]models.AuthenticationCitrixAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationCitrixAuthActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCitrixAuthAction `json:"authenticationcitrixauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationCitrixAuthAction(name string) (*models.AuthenticationCitrixAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationCitrixAuthActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationCitrixAuthAction `json:"authenticationcitrixauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationcitrixauthaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationCitrixAuthAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationCitrixAuthActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationCitrixAuthAction `json:"authenticationcitrixauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationdfaaction +// Configuration for Dfa authentication action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfaaction +func (s *AuthenticationService) AddAuthenticationDFAAction(resource models.AuthenticationDFAAction) error { + payload := map[string]any{"authenticationdfaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationDFAActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationDFAAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationDFAActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationDFAAction(resource models.AuthenticationDFAAction) error { + payload := map[string]any{"authenticationdfaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationDFAActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationDFAAction(resource models.AuthenticationDFAAction) error { + payload := map[string]any{"authenticationdfaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationDFAActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationDFAAction() ([]models.AuthenticationDFAAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationDFAActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAAction `json:"authenticationdfaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationDFAAction(name string) (*models.AuthenticationDFAAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationDFAActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAAction `json:"authenticationdfaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationdfaaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationDFAAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationDFAActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationDFAAction `json:"authenticationdfaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationdfapolicy +// Configuration for Dfa authentication policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy +func (s *AuthenticationService) AddAuthenticationDFAPolicy(resource models.AuthenticationDFAPolicy) error { + payload := map[string]any{"authenticationdfapolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationDFAPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationDFAPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationDFAPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationDFAPolicy(resource models.AuthenticationDFAPolicy) error { + payload := map[string]any{"authenticationdfapolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationDFAPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationDFAPolicy() ([]models.AuthenticationDFAPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationDFAPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicy `json:"authenticationdfapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationDFAPolicy(name string) (*models.AuthenticationDFAPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationDFAPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicy `json:"authenticationdfapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationdfapolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationDFAPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationDFAPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationDFAPolicy `json:"authenticationdfapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationdfapolicy_binding +// Binding object which returns the resources bound to authenticationdfapolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_binding +func (s *AuthenticationService) GetAllAuthenticationDFAPolicyBinding() ([]models.AuthenticationDFAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationDFAPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicyBinding `json:"authenticationdfapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationDFAPolicyBinding(name string) (*models.AuthenticationDFAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationDFAPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicyBinding `json:"authenticationdfapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationdfapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationdfapolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationdfapolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationdfapolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationDFAPolicyVPNVServerBinding() ([]models.AuthenticationDFAPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationDFAPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicyVPNVServerBinding `json:"authenticationdfapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationDFAPolicyVPNVServerBinding(name string) (*models.AuthenticationDFAPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationDFAPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationDFAPolicyVPNVServerBinding `json:"authenticationdfapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationdfapolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationDFAPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationDFAPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationDFAPolicyVPNVServerBinding `json:"authenticationdfapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationemailaction +// Configuration for Email entity resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationemailaction +func (s *AuthenticationService) AddAuthenticationEmailAction(resource models.AuthenticationEmailAction) error { + payload := map[string]any{"authenticationemailaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationEmailActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationEmailAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationEmailActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationEmailAction(resource models.AuthenticationEmailAction) error { + payload := map[string]any{"authenticationemailaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationEmailActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationEmailAction(resource models.AuthenticationEmailAction) error { + payload := map[string]any{"authenticationemailaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationEmailActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationEmailAction() ([]models.AuthenticationEmailAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationEmailActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationEmailAction `json:"authenticationemailaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationEmailAction(name string) (*models.AuthenticationEmailAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationEmailActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationEmailAction `json:"authenticationemailaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationemailaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationEmailAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationEmailActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationEmailAction `json:"authenticationemailaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationepaaction +// Configuration for epa action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationepaaction +func (s *AuthenticationService) AddAuthenticationEPAAction(resource models.AuthenticationEPAAction) error { + payload := map[string]any{"authenticationepaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationEPAActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationEPAAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationEPAActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationEPAAction(resource models.AuthenticationEPAAction) error { + payload := map[string]any{"authenticationepaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationEPAActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationEPAAction(resource models.AuthenticationEPAAction) error { + payload := map[string]any{"authenticationepaaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationEPAActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationEPAAction() ([]models.AuthenticationEPAAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationEPAActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationEPAAction `json:"authenticationepaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationEPAAction(name string) (*models.AuthenticationEPAAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationEPAActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationEPAAction `json:"authenticationepaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationepaaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationEPAAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationEPAActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationEPAAction `json:"authenticationepaaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldapaction +// Configuration for LDAP action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldapaction +func (s *AuthenticationService) AddAuthenticationLDAPAction(resource models.AuthenticationLDAPAction) error { + payload := map[string]any{"authenticationldapaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationLDAPActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationLDAPAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationLDAPActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationLDAPAction(resource models.AuthenticationLDAPAction) error { + payload := map[string]any{"authenticationldapaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationLDAPActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationLDAPAction(resource models.AuthenticationLDAPAction) error { + payload := map[string]any{"authenticationldapaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationLDAPActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationLDAPAction() ([]models.AuthenticationLDAPAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPAction `json:"authenticationldapaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPAction(name string) (*models.AuthenticationLDAPAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPAction `json:"authenticationldapaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldapaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPAction `json:"authenticationldapaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldappolicy +// Configuration for LDAP policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy +func (s *AuthenticationService) AddAuthenticationLDAPPolicy(resource models.AuthenticationLDAPPolicy) error { + payload := map[string]any{"authenticationldappolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationLDAPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationLDAPPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationLDAPPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationLDAPPolicy(resource models.AuthenticationLDAPPolicy) error { + payload := map[string]any{"authenticationldappolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationLDAPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationLDAPPolicy(resource models.AuthenticationLDAPPolicy) error { + payload := map[string]any{"authenticationldappolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationLDAPPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicy() ([]models.AuthenticationLDAPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicy `json:"authenticationldappolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicy(name string) (*models.AuthenticationLDAPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicy `json:"authenticationldappolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicy `json:"authenticationldappolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldappolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationldappolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyAuthenticationVServerBinding() ([]models.AuthenticationLDAPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyAuthenticationVServerBinding `json:"authenticationldappolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationLDAPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyAuthenticationVServerBinding `json:"authenticationldappolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyAuthenticationVServerBinding `json:"authenticationldappolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldappolicy_binding +// Binding object which returns the resources bound to authenticationldappolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_binding +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyBinding() ([]models.AuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyBinding `json:"authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicyBinding(name string) (*models.AuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyBinding `json:"authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationldappolicy_systemglobal_binding +// Binding object showing the systemglobal that can be bound to authenticationldappolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_systemglobal_binding +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicySystemGlobalBinding() ([]models.AuthenticationLDAPPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicySystemGlobalBinding `json:"authenticationldappolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicySystemGlobalBinding(name string) (*models.AuthenticationLDAPPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicySystemGlobalBinding `json:"authenticationldappolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicySystemGlobalBinding `json:"authenticationldappolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldappolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationldappolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyVPNGlobalBinding() ([]models.AuthenticationLDAPPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNGlobalBinding `json:"authenticationldappolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicyVPNGlobalBinding(name string) (*models.AuthenticationLDAPPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNGlobalBinding `json:"authenticationldappolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNGlobalBinding `json:"authenticationldappolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationldappolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationldappolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationldappolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLDAPPolicyVPNVServerBinding() ([]models.AuthenticationLDAPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLDAPPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNVServerBinding `json:"authenticationldappolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLDAPPolicyVPNVServerBinding(name string) (*models.AuthenticationLDAPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLDAPPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNVServerBinding `json:"authenticationldappolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationldappolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLDAPPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLDAPPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLDAPPolicyVPNVServerBinding `json:"authenticationldappolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationlocalpolicy +// Configuration for LOCAL policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy +func (s *AuthenticationService) AddAuthenticationLocalPolicy(resource models.AuthenticationLocalPolicy) error { + payload := map[string]any{"authenticationlocalpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationLocalPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationLocalPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationLocalPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationLocalPolicy(resource models.AuthenticationLocalPolicy) error { + payload := map[string]any{"authenticationlocalpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationLocalPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationLocalPolicy() ([]models.AuthenticationLocalPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicy `json:"authenticationlocalpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicy(name string) (*models.AuthenticationLocalPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicy `json:"authenticationlocalpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLocalPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLocalPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLocalPolicy `json:"authenticationlocalpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationlocalpolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationlocalpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLocalPolicyAuthenticationVServerBinding() ([]models.AuthenticationLocalPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyAuthenticationVServerBinding `json:"authenticationlocalpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationLocalPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyAuthenticationVServerBinding `json:"authenticationlocalpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLocalPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLocalPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyAuthenticationVServerBinding `json:"authenticationlocalpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationlocalpolicy_binding +// Binding object which returns the resources bound to authenticationlocalpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_binding +func (s *AuthenticationService) GetAllAuthenticationLocalPolicyBinding() ([]models.AuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyBinding `json:"authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicyBinding(name string) (*models.AuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyBinding `json:"authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationlocalpolicy_systemglobal_binding +// Binding object showing the systemglobal that can be bound to authenticationlocalpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_systemglobal_binding +func (s *AuthenticationService) GetAllAuthenticationLocalPolicySystemGlobalBinding() ([]models.AuthenticationLocalPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicySystemGlobalBinding `json:"authenticationlocalpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicySystemGlobalBinding(name string) (*models.AuthenticationLocalPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicySystemGlobalBinding `json:"authenticationlocalpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLocalPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLocalPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLocalPolicySystemGlobalBinding `json:"authenticationlocalpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationlocalpolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationlocalpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationLocalPolicyVPNGlobalBinding() ([]models.AuthenticationLocalPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNGlobalBinding `json:"authenticationlocalpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicyVPNGlobalBinding(name string) (*models.AuthenticationLocalPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNGlobalBinding `json:"authenticationlocalpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLocalPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLocalPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNGlobalBinding `json:"authenticationlocalpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationlocalpolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationlocalpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationlocalpolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLocalPolicyVPNVServerBinding() ([]models.AuthenticationLocalPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLocalPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNVServerBinding `json:"authenticationlocalpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLocalPolicyVPNVServerBinding(name string) (*models.AuthenticationLocalPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLocalPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNVServerBinding `json:"authenticationlocalpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationlocalpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLocalPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLocalPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLocalPolicyVPNVServerBinding `json:"authenticationlocalpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationloginschema +// Configuration for Login Schema resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschema +func (s *AuthenticationService) AddAuthenticationLoginSchema(resource models.AuthenticationLoginSchema) error { + payload := map[string]any{"authenticationloginschema": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationLoginSchemaURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationLoginSchema(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationLoginSchemaURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationLoginSchema(resource models.AuthenticationLoginSchema) error { + payload := map[string]any{"authenticationloginschema": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationLoginSchemaURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationLoginSchema(resource models.AuthenticationLoginSchema) error { + payload := map[string]any{"authenticationloginschema": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationLoginSchemaURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationLoginSchema() ([]models.AuthenticationLoginSchema, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLoginSchemaURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchema `json:"authenticationloginschema"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLoginSchema(name string) (*models.AuthenticationLoginSchema, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLoginSchemaURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchema `json:"authenticationloginschema"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationloginschema %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLoginSchema() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLoginSchemaURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLoginSchema `json:"authenticationloginschema"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationloginschemapolicy +// Configuration for Login Schema Policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy +func (s *AuthenticationService) AddAuthenticationLoginSchemaPolicy(resource models.AuthenticationLoginSchemaPolicy) error { + payload := map[string]any{"authenticationloginschemapolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationLoginSchemaPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationLoginSchemaPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationLoginSchemaPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationLoginSchemaPolicy(resource models.AuthenticationLoginSchemaPolicy) error { + payload := map[string]any{"authenticationloginschemapolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationLoginSchemaPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationLoginSchemaPolicy(resource models.AuthenticationLoginSchemaPolicy) error { + payload := map[string]any{"authenticationloginschemapolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationLoginSchemaPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicy() ([]models.AuthenticationLoginSchemaPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLoginSchemaPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicy `json:"authenticationloginschemapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicy(name string) (*models.AuthenticationLoginSchemaPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLoginSchemaPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicy `json:"authenticationloginschemapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationloginschemapolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLoginSchemaPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicy `json:"authenticationloginschemapolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationLoginSchemaPolicy(name string, newname string) error { + payload := map[string]any{ + "authenticationloginschemapolicy": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationLoginSchemaPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationloginschemapolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationloginschemapolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyAuthenticationVServerBinding() ([]models.AuthenticationLoginSchemaPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLoginSchemaPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyAuthenticationVServerBinding `json:"authenticationloginschemapolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationLoginSchemaPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLoginSchemaPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyAuthenticationVServerBinding `json:"authenticationloginschemapolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationloginschemapolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLoginSchemaPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyAuthenticationVServerBinding `json:"authenticationloginschemapolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationloginschemapolicy_binding +// Binding object which returns the resources bound to authenticationloginschemapolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_binding +func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyBinding() ([]models.AuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLoginSchemaPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyBinding `json:"authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyBinding(name string) (*models.AuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLoginSchemaPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyBinding `json:"authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationloginschemapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationloginschemapolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationloginschemapolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationloginschemapolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationLoginSchemaPolicyVPNVServerBinding() ([]models.AuthenticationLoginSchemaPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationLoginSchemaPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyVPNVServerBinding `json:"authenticationloginschemapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationLoginSchemaPolicyVPNVServerBinding(name string) (*models.AuthenticationLoginSchemaPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationLoginSchemaPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyVPNVServerBinding `json:"authenticationloginschemapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationloginschemapolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationLoginSchemaPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationLoginSchemaPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationLoginSchemaPolicyVPNVServerBinding `json:"authenticationloginschemapolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnegotiataction +// Configuration for Negotiate action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiateaction +func (s *AuthenticationService) AddAuthenticationNegotiateAction(resource models.AuthenticationNegotiateAction) error { + payload := map[string]any{"authenticationnegotiateaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationNegotiateActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationNegotiateAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationNegotiateActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationNegotiateAction(resource models.AuthenticationNegotiateAction) error { + payload := map[string]any{"authenticationnegotiateaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationNegotiateActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationNegotiateAction(resource models.AuthenticationNegotiateAction) error { + payload := map[string]any{"authenticationnegotiateaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationNegotiateActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationNegotiateAction() ([]models.AuthenticationNegotiateAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiateActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiateAction `json:"authenticationnegotiateaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiateAction(name string) (*models.AuthenticationNegotiateAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiateActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiateAction `json:"authenticationnegotiateaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiateaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNegotiateAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNegotiateActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNegotiateAction `json:"authenticationnegotiateaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnegotiatpolicy +// Configuration for Negotiate Policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy +func (s *AuthenticationService) AddAuthenticationNegotiatePolicy(resource models.AuthenticationNegotiatePolicy) error { + payload := map[string]any{"authenticationnegotiatepolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationNegotiatePolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationNegotiatePolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationNegotiatePolicy(resource models.AuthenticationNegotiatePolicy) error { + payload := map[string]any{"authenticationnegotiatepolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationNegotiatePolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationNegotiatePolicy(resource models.AuthenticationNegotiatePolicy) error { + payload := map[string]any{"authenticationnegotiatepolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationNegotiatePolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicy() ([]models.AuthenticationNegotiatePolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiatePolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicy `json:"authenticationnegotiatepolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiatePolicy(name string) (*models.AuthenticationNegotiatePolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicy `json:"authenticationnegotiatepolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiatepolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNegotiatePolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNegotiatePolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicy `json:"authenticationnegotiatepolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnegotiatepolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationnegotiatepolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyAuthenticationVServerBinding() ([]models.AuthenticationNegotiatePolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiatePolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyAuthenticationVServerBinding `json:"authenticationnegotiatepolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiatePolicyAuthenticationVServerBinding(name string) (*models.AuthenticationNegotiatePolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyAuthenticationVServerBinding `json:"authenticationnegotiatepolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiatepolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNegotiatePolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNegotiatePolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyAuthenticationVServerBinding `json:"authenticationnegotiatepolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnegotiatepolicy_binding +// Binding object which returns the resources bound to authenticationnegotiatepolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_binding +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyBinding() ([]models.AuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiatePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyBinding `json:"authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiatePolicyBinding(name string) (*models.AuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyBinding `json:"authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiatepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationnegotiatepolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationnegotiatepolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyVPNGlobalBinding() ([]models.AuthenticationNegotiatePolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiatePolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNGlobalBinding `json:"authenticationnegotiatepolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiatePolicyVPNGlobalBinding(name string) (*models.AuthenticationNegotiatePolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNGlobalBinding `json:"authenticationnegotiatepolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiatepolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNegotiatePolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNegotiatePolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNGlobalBinding `json:"authenticationnegotiatepolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnegotiatepolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationnegotiatepolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnegotiatepolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationNegotiatePolicyVPNVServerBinding() ([]models.AuthenticationNegotiatePolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNegotiatePolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNVServerBinding `json:"authenticationnegotiatepolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNegotiatePolicyVPNVServerBinding(name string) (*models.AuthenticationNegotiatePolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNegotiatePolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNVServerBinding `json:"authenticationnegotiatepolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnegotiatepolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNegotiatePolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNegotiatePolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNegotiatePolicyVPNVServerBinding `json:"authenticationnegotiatepolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationnoauthaction +// Configuration for no authentication action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationnoauthaction +func (s *AuthenticationService) AddAuthenticationNoAuthAction(resource models.AuthenticationNoAuthAction) error { + payload := map[string]any{"authenticationnoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationNoAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationNoAuthAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationNoAuthActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationNoAuthAction(resource models.AuthenticationNoAuthAction) error { + payload := map[string]any{"authenticationnoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationNoAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationNoAuthAction(resource models.AuthenticationNoAuthAction) error { + payload := map[string]any{"authenticationnoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationNoAuthActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationNoAuthAction() ([]models.AuthenticationNoAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationNoAuthActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNoAuthAction `json:"authenticationnoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationNoAuthAction(name string) (*models.AuthenticationNoAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationNoAuthActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationNoAuthAction `json:"authenticationnoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationnoauthaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationNoAuthAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationNoAuthActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationNoAuthAction `json:"authenticationnoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationoauthaction +// Configuration for OAuth authentication action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthaction +func (s *AuthenticationService) AddAuthenticationOAuthAction(resource models.AuthenticationOAuthAction) error { + payload := map[string]any{"authenticationoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationOAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationOAuthAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationOAuthActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationOAuthAction(resource models.AuthenticationOAuthAction) error { + payload := map[string]any{"authenticationoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationOAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationOAuthAction(resource models.AuthenticationOAuthAction) error { + payload := map[string]any{"authenticationoauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationOAuthActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationOAuthAction() ([]models.AuthenticationOAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthAction `json:"authenticationoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthAction(name string) (*models.AuthenticationOAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthAction `json:"authenticationoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationOAuthAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationOAuthActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationOAuthAction `json:"authenticationoauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationoauthidppolicy +// Configuration for AAA OAuth IdentityProvider (IdP) policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy +func (s *AuthenticationService) AddAuthenticationOAuthIdPPolicy(resource models.AuthenticationOAuthIDPPolicy) error { + payload := map[string]any{"authenticationoauthidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationOAuthIdPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationOAuthIdPPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationOAuthIdPPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationOAuthIdPPolicy(resource models.AuthenticationOAuthIDPPolicy) error { + payload := map[string]any{"authenticationoauthidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationOAuthIdPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationOAuthIdPPolicy(resource models.AuthenticationOAuthIDPPolicy) error { + payload := map[string]any{"authenticationoauthidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationOAuthIdPPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicy() ([]models.AuthenticationOAuthIDPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthIdPPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicy `json:"authenticationoauthidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicy(name string) (*models.AuthenticationOAuthIDPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthIdPPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicy `json:"authenticationoauthidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthidppolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationOAuthIdPPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicy `json:"authenticationoauthidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationOAuthIdPPolicy(name string, newname string) error { + payload := map[string]any{ + "authenticationoauthidppolicy": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationOAuthIdPPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationoauthidppolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationoauthidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyAuthenticationVServerBinding() ([]models.AuthenticationOAuthIDPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthIdPPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyAuthenticationVServerBinding `json:"authenticationoauthidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationOAuthIDPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthIdPPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyAuthenticationVServerBinding `json:"authenticationoauthidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthidppolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationOAuthIdPPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyAuthenticationVServerBinding `json:"authenticationoauthidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationoauthidppolicy_binding +// Binding object which returns the resources bound to authenticationoauthidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_binding +func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyBinding() ([]models.AuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthIdPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyBinding `json:"authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyBinding(name string) (*models.AuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthIdPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyBinding `json:"authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationoauthidppolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationoauthidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidppolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationOAuthIdPPolicyVPNVServerBinding() ([]models.AuthenticationOAuthIDPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthIdPPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyVPNVServerBinding `json:"authenticationoauthidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthIdPPolicyVPNVServerBinding(name string) (*models.AuthenticationOAuthIDPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthIdPPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyVPNVServerBinding `json:"authenticationoauthidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthidppolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationOAuthIdPPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationOAuthIdPPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPPolicyVPNVServerBinding `json:"authenticationoauthidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationoauthidpprofile +// Configuration for OAuth Identity Provider (IdP) profile resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationoauthidpprofile +func (s *AuthenticationService) AddAuthenticationOAuthIdPProfile(resource models.AuthenticationOAuthIDPProfile) error { + payload := map[string]any{"authenticationoauthidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationOAuthIdPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationOAuthIdPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationOAuthIdPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationOAuthIdPProfile(resource models.AuthenticationOAuthIDPProfile) error { + payload := map[string]any{"authenticationoauthidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationOAuthIdPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationOAuthIdPProfile(resource models.AuthenticationOAuthIDPProfile) error { + payload := map[string]any{"authenticationoauthidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationOAuthIdPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationOAuthIdPProfile() ([]models.AuthenticationOAuthIDPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationOAuthIdPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPProfile `json:"authenticationoauthidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationOAuthIdPProfile(name string) (*models.AuthenticationOAuthIDPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationOAuthIdPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPProfile `json:"authenticationoauthidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationoauthidpprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationOAuthIdPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationOAuthIdPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationOAuthIDPProfile `json:"authenticationoauthidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationpolicy +// Configuration for Authentication Policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy +func (s *AuthenticationService) AddAuthenticationPolicy(resource models.AuthenticationPolicy) error { + payload := map[string]any{"authenticationpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationPolicy(resource models.AuthenticationPolicy) error { + payload := map[string]any{"authenticationpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationPolicy(resource models.AuthenticationPolicy) error { + payload := map[string]any{"authenticationpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationPolicy() ([]models.AuthenticationPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicy `json:"authenticationpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicy(name string) (*models.AuthenticationPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicy `json:"authenticationpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicy `json:"authenticationpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationPolicy(name string, newname string) error { + payload := map[string]any{ + "authenticationpolicy": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationpolicylabel +// Configuration for authentication policy label resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel +func (s *AuthenticationService) AddAuthenticationPolicyLabel(resource models.AuthenticationPolicyLabel) error { + payload := map[string]any{"authenticationpolicylabel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationPolicyLabelURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationPolicyLabel(labelname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationPolicyLabelURL, labelname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationPolicyLabel() ([]models.AuthenticationPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyLabelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabel `json:"authenticationpolicylabel"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyLabel(labelname string) (*models.AuthenticationPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyLabelURL, labelname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabel `json:"authenticationpolicylabel"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicylabel %s not found", labelname) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicyLabel() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicyLabelURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicyLabel `json:"authenticationpolicylabel"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationPolicyLabel(labelname string, newname string) error { + payload := map[string]any{ + "authenticationpolicylabel": map[string]any{ + "labelname": labelname, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationPolicyLabelURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationpolicylabel_authenticationpolicy_binding +// Binding object showing the authenticationpolicy that can be bound to authenticationpolicylabel. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_authenticationpolicy_binding +func (s *AuthenticationService) AddAuthenticationPolicyLabelAuthenticationPolicyBinding(resource models.AuthenticationPolicyLabelAuthenticationPolicyBinding) error { + payload := map[string]any{"authenticationpolicylabel_authenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationPolicyLabelAuthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationPolicyLabelAuthenticationPolicyBinding(labelname string, policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policyname:%s", authenticationPolicyLabelAuthenticationPolicyBindingURL, labelname, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationPolicyLabelAuthenticationPolicyBinding() ([]models.AuthenticationPolicyLabelAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyLabelAuthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabelAuthenticationPolicyBinding `json:"authenticationpolicylabel_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyLabelAuthenticationPolicyBinding(labelname string) (*models.AuthenticationPolicyLabelAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyLabelAuthenticationPolicyBindingURL, labelname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabelAuthenticationPolicyBinding `json:"authenticationpolicylabel_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicylabel_authenticationpolicy_binding %s not found", labelname) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicyLabelAuthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicyLabelAuthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicyLabelAuthenticationPolicyBinding `json:"authenticationpolicylabel_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticaitonpolicylabel_binding +// Binding object which returns the resources bound to authenticationpolicylabel. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicylabel_binding +func (s *AuthenticationService) GetAllAuthenticationPolicyLabelBinding() ([]models.AuthenticationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabelBinding `json:"authenticationpolicylabel_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyLabelBinding(labelname string) (*models.AuthenticationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyLabelBindingURL, labelname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyLabelBinding `json:"authenticationpolicylabel_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicylabel_binding %s not found", labelname) + } + + return &result.Data[0], nil +} + +// authenticationpolicy_authenticationpolicylabel_binding +// Binding object showing the authenticationpolicylabel that can be bound to authenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationpolicylabel_binding +func (s *AuthenticationService) GetAllAuthenticationPolicyAuthenticationPolicyLabelBinding() ([]models.AuthenticationPolicyAuthenticationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyAuthenticationPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationPolicyLabelBinding `json:"authenticationpolicy_authenticationpolicylabel_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyAuthenticationPolicyLabelBinding(name string) (*models.AuthenticationPolicyAuthenticationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyAuthenticationPolicyLabelBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationPolicyLabelBinding `json:"authenticationpolicy_authenticationpolicylabel_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicy_authenticationpolicylabel_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicyAuthenticationPolicyLabelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicyAuthenticationPolicyLabelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationPolicyLabelBinding `json:"authenticationpolicy_authenticationpolicylabel_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationpolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationPolicyAuthenticationVServerBinding() ([]models.AuthenticationPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationVServerBinding `json:"authenticationpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationVServerBinding `json:"authenticationpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicyAuthenticationVServerBinding `json:"authenticationpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationpolicy_binding +// Binding object which returns the resources bound to authenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_binding +func (s *AuthenticationService) GetAllAuthenticationPolicyBinding() ([]models.AuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyBinding `json:"authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicyBinding(name string) (*models.AuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicyBinding `json:"authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenicationpolicy_systemglobal_binding +// Binding object showing the systemglobal that can be bound to authenticationpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpolicy_systemglobal_binding +func (s *AuthenticationService) GetAllAuthenticationPolicySystemGlobalBinding() ([]models.AuthenticationPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicySystemGlobalBinding `json:"authenticationpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPolicySystemGlobalBinding(name string) (*models.AuthenticationPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPolicySystemGlobalBinding `json:"authenticationpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPolicySystemGlobalBinding `json:"authenticationpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationpushservice +// Configuration for Service details for sending push notifications resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationpushservice +func (s *AuthenticationService) AddAuthenticationPushService(resource models.AuthenticationPushService) error { + payload := map[string]any{"authenticationpushservice": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationPushServiceURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationPushService(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationPushServiceURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationPushService(resource models.AuthenticationPushService) error { + payload := map[string]any{"authenticationpushservice": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationPushServiceURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationPushService(resource models.AuthenticationPushService) error { + payload := map[string]any{"authenticationpushservice": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationPushServiceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationPushService() ([]models.AuthenticationPushService, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationPushServiceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPushService `json:"authenticationpushservice"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationPushService(name string) (*models.AuthenticationPushService, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationPushServiceURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationPushService `json:"authenticationpushservice"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationpushservice %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationPushService() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationPushServiceURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationPushService `json:"authenticationpushservice"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiusaction +// Configuration for RADIUS action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiusaction +func (s *AuthenticationService) AddAuthenticationRADIUSAction(resource models.AuthenticationRADIUSAction) error { + payload := map[string]any{"authenticationradiusaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationRADIUSActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationRADIUSAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationRADIUSActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationRADIUSAction(resource models.AuthenticationRADIUSAction) error { + payload := map[string]any{"authenticationradiusaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationRADIUSActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationRADIUSAction(resource models.AuthenticationRADIUSAction) error { + payload := map[string]any{"authenticationradiusaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationRADIUSActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationRADIUSAction() ([]models.AuthenticationRADIUSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSAction `json:"authenticationradiusaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSAction(name string) (*models.AuthenticationRADIUSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSAction `json:"authenticationradiusaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiusaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSAction `json:"authenticationradiusaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiuspolicy +// Configuration for RADIUS policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy +func (s *AuthenticationService) AddAuthenticationRADIUSPolicy(resource models.AuthenticationRADIUSPolicy) error { + payload := map[string]any{"authenticationradiuspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationRADIUSPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationRADIUSPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationRADIUSPolicy(resource models.AuthenticationRADIUSPolicy) error { + payload := map[string]any{"authenticationradiuspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationRADIUSPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationRADIUSPolicy(resource models.AuthenticationRADIUSPolicy) error { + payload := map[string]any{"authenticationradiuspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationRADIUSPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicy() ([]models.AuthenticationRADIUSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicy `json:"authenticationradiuspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicy(name string) (*models.AuthenticationRADIUSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicy `json:"authenticationradiuspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicy `json:"authenticationradiuspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiuspolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationradiuspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyAuthenticationVServerBinding() ([]models.AuthenticationRADIUSPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyAuthenticationVServerBinding `json:"authenticationradiuspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationRADIUSPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyAuthenticationVServerBinding `json:"authenticationradiuspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyAuthenticationVServerBinding `json:"authenticationradiuspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiuspolicy_binding +// Binding object which returns the resources bound to authenticationradiuspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_binding +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyBinding() ([]models.AuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyBinding `json:"authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicyBinding(name string) (*models.AuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyBinding `json:"authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationradiuspolicy_systemglobal_binding +// Binding object showing the systemglobal that can be bound to authenticationradiuspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_systemglobal_binding +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicySystemGlobalBinding() ([]models.AuthenticationRADIUSPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicySystemGlobalBinding `json:"authenticationradiuspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicySystemGlobalBinding(name string) (*models.AuthenticationRADIUSPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicySystemGlobalBinding `json:"authenticationradiuspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicySystemGlobalBinding `json:"authenticationradiuspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiuspolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationradiuspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyVPNGlobalBinding() ([]models.AuthenticationRADIUSPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNGlobalBinding `json:"authenticationradiuspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicyVPNGlobalBinding(name string) (*models.AuthenticationRADIUSPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNGlobalBinding `json:"authenticationradiuspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNGlobalBinding `json:"authenticationradiuspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationradiuspolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationradiuspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationradiuspolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationRADIUSPolicyVPNVServerBinding() ([]models.AuthenticationRADIUSPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationRADIUSPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNVServerBinding `json:"authenticationradiuspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationRADIUSPolicyVPNVServerBinding(name string) (*models.AuthenticationRADIUSPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationRADIUSPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNVServerBinding `json:"authenticationradiuspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationradiuspolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationRADIUSPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationRADIUSPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationRADIUSPolicyVPNVServerBinding `json:"authenticationradiuspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlaction +// Configuration for AAA Saml action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlaction +func (s *AuthenticationService) AddAuthenticationSAMLAction(resource models.AuthenticationSAMLAction) error { + payload := map[string]any{"authenticationsamlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationSAMLActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationSAMLAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationSAMLActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationSAMLAction(resource models.AuthenticationSAMLAction) error { + payload := map[string]any{"authenticationsamlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationSAMLActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationSAMLAction(resource models.AuthenticationSAMLAction) error { + payload := map[string]any{"authenticationsamlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationSAMLActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationSAMLAction() ([]models.AuthenticationSAMLAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLAction `json:"authenticationsamlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLAction(name string) (*models.AuthenticationSAMLAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLAction `json:"authenticationsamlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLAction `json:"authenticationsamlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlidppolicy +// Configuration for AAA Saml IdentityProvider (IdP) policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy +func (s *AuthenticationService) AddAuthenticationSAMLIdPPolicy(resource models.AuthenticationSAMLIDPPolicy) error { + payload := map[string]any{"authenticationsamlidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationSAMLIdPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationSAMLIdPPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationSAMLIdPPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationSAMLIdPPolicy(resource models.AuthenticationSAMLIDPPolicy) error { + payload := map[string]any{"authenticationsamlidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationSAMLIdPPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationSAMLIdPPolicy(resource models.AuthenticationSAMLIDPPolicy) error { + payload := map[string]any{"authenticationsamlidppolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationSAMLIdPPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicy() ([]models.AuthenticationSAMLIDPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLIdPPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicy `json:"authenticationsamlidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicy(name string) (*models.AuthenticationSAMLIDPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLIdPPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicy `json:"authenticationsamlidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlidppolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLIdPPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicy `json:"authenticationsamlidppolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationSAMLIdPPolicy(name string, newname string) error { + payload := map[string]any{ + "authenticationsamlidppolicy": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationSAMLIdPPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationsamlidppolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationsamlidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyAuthenticationVServerBinding() ([]models.AuthenticationSAMLIDPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLIdPPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyAuthenticationVServerBinding `json:"authenticationsamlidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationSAMLIDPPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLIdPPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyAuthenticationVServerBinding `json:"authenticationsamlidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlidppolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLIdPPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyAuthenticationVServerBinding `json:"authenticationsamlidppolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlidppolicy_binding +// Binding object which returns the resources bound to authenticationsamlidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyBinding() ([]models.AuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLIdPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyBinding `json:"authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyBinding(name string) (*models.AuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLIdPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyBinding `json:"authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationsamlidppolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationsamlidppolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidppolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLIdPPolicyVPNVServerBinding() ([]models.AuthenticationSAMLIDPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLIdPPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyVPNVServerBinding `json:"authenticationsamlidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLIdPPolicyVPNVServerBinding(name string) (*models.AuthenticationSAMLIDPPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLIdPPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyVPNVServerBinding `json:"authenticationsamlidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlidppolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLIdPPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLIdPPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPPolicyVPNVServerBinding `json:"authenticationsamlidppolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlidpprofile +// Configuration for AAA Saml IdentityProvider (IdP) profile resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlidpprofile +func (s *AuthenticationService) AddAuthenticationSAMLIdPProfile(resource models.AuthenticationSAMLIDPProfile) error { + payload := map[string]any{"authenticationsamlidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationSAMLIdPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationSAMLIdPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationSAMLIdPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationSAMLIdPProfile(resource models.AuthenticationSAMLIDPProfile) error { + payload := map[string]any{"authenticationsamlidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationSAMLIdPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationSAMLIdPProfile(resource models.AuthenticationSAMLIDPProfile) error { + payload := map[string]any{"authenticationsamlidpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationSAMLIdPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationSAMLIdPProfile() ([]models.AuthenticationSAMLIDPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLIdPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPProfile `json:"authenticationsamlidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLIdPProfile(name string) (*models.AuthenticationSAMLIDPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLIdPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPProfile `json:"authenticationsamlidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlidpprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLIdPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLIdPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLIDPProfile `json:"authenticationsamlidpprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticaitonsamlpolicy +// Configuration for AAA Saml policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy +func (s *AuthenticationService) AddAuthenticationSAMLPolicy(resource models.AuthenticationSAMLPolicy) error { + payload := map[string]any{"authenticationsamlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationSAMLPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationSAMLPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationSAMLPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationSAMLPolicy(resource models.AuthenticationSAMLPolicy) error { + payload := map[string]any{"authenticationsamlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationSAMLPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationSAMLPolicy(resource models.AuthenticationSAMLPolicy) error { + payload := map[string]any{"authenticationsamlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationSAMLPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationSAMLPolicy() ([]models.AuthenticationSAMLPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicy `json:"authenticationsamlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLPolicy(name string) (*models.AuthenticationSAMLPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicy `json:"authenticationsamlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicy `json:"authenticationsamlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlpolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationsamlpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyAuthenticationVServerBinding() ([]models.AuthenticationSAMLPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyAuthenticationVServerBinding `json:"authenticationsamlpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationSAMLPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyAuthenticationVServerBinding `json:"authenticationsamlpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlpolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyAuthenticationVServerBinding `json:"authenticationsamlpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlpolicy_binding +// Binding object which returns the resources bound to authenticationsamlpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyBinding() ([]models.AuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyBinding `json:"authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLPolicyBinding(name string) (*models.AuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyBinding `json:"authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationsamlpolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationsamlpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyVPNGlobalBinding() ([]models.AuthenticationSAMLPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNGlobalBinding `json:"authenticationsamlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLPolicyVPNGlobalBinding(name string) (*models.AuthenticationSAMLPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNGlobalBinding `json:"authenticationsamlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNGlobalBinding `json:"authenticationsamlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationsamlpolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationsamlpolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationsamlpolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationSAMLPolicyVPNVServerBinding() ([]models.AuthenticationSAMLPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationSAMLPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNVServerBinding `json:"authenticationsamlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationSAMLPolicyVPNVServerBinding(name string) (*models.AuthenticationSAMLPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationSAMLPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNVServerBinding `json:"authenticationsamlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationsamlpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationSAMLPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationSAMLPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationSAMLPolicyVPNVServerBinding `json:"authenticationsamlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationstorefrontauthaction // Configuration for Storefront authentication action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationstorefrontauthaction -func (s *AuthenticationService) AddAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) DeleteAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) UpdateAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) UnsetAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) GetAllAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) GetAuthenticationStoreFrontAuthAction() {} -func (s *AuthenticationService) CountAuthenticationStoreFrontAuthAction() {} +func (s *AuthenticationService) AddAuthenticationStoreFrontAuthAction(resource models.AuthenticationStoreFrontAuthAction) error { + payload := map[string]any{"authenticationstorefrontauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationStoreFrontAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationStoreFrontAuthAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationStoreFrontAuthActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationStoreFrontAuthAction(resource models.AuthenticationStoreFrontAuthAction) error { + payload := map[string]any{"authenticationstorefrontauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationStoreFrontAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationStoreFrontAuthAction(resource models.AuthenticationStoreFrontAuthAction) error { + payload := map[string]any{"authenticationstorefrontauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationStoreFrontAuthActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationStoreFrontAuthAction() ([]models.AuthenticationStoreFrontAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationStoreFrontAuthActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationStoreFrontAuthAction `json:"authenticationstorefrontauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationStoreFrontAuthAction(name string) (*models.AuthenticationStoreFrontAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationStoreFrontAuthActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationStoreFrontAuthAction `json:"authenticationstorefrontauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationstorefrontauthaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationStoreFrontAuthAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationStoreFrontAuthActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationStoreFrontAuthAction `json:"authenticationstorefrontauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacsaction +// Configuration for TACACS action resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction +func (s *AuthenticationService) AddAuthenticationTACACSAction(resource models.AuthenticationTACACSAction) error { + payload := map[string]any{"authenticationtacacsaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationTACACSActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationTACACSAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationTACACSActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationTACACSAction(resource models.AuthenticationTACACSAction) error { + payload := map[string]any{"authenticationtacacsaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationTACACSActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationTACACSAction(resource models.AuthenticationTACACSAction) error { + payload := map[string]any{"authenticationtacacsaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationTACACSActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationTACACSAction() ([]models.AuthenticationTACACSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSAction `json:"authenticationtacacsaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSAction(name string) (*models.AuthenticationTACACSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSAction `json:"authenticationtacacsaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacsaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSAction `json:"authenticationtacacsaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacspolicy +// Configuration for TACACS policy resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy +func (s *AuthenticationService) AddAuthenticationTACACSPolicy(resource models.AuthenticationTACACSPolicy) error { + payload := map[string]any{"authenticationtacacspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationTACACSPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationTACACSPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationTACACSPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationTACACSPolicy(resource models.AuthenticationTACACSPolicy) error { + payload := map[string]any{"authenticationtacacspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationTACACSPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationTACACSPolicy(resource models.AuthenticationTACACSPolicy) error { + payload := map[string]any{"authenticationtacacspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationTACACSPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicy() ([]models.AuthenticationTACACSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicy `json:"authenticationtacacspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicy(name string) (*models.AuthenticationTACACSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicy `json:"authenticationtacacspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicy `json:"authenticationtacacspolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacspolicy_authenticationvserver_binding +// Binding object showing the authenticationvserver that can be bound to authenticationtacacspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyAuthenticationVServerBinding() ([]models.AuthenticationTACACSPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyAuthenticationVServerBinding `json:"authenticationtacacspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationTACACSPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyAuthenticationVServerBinding `json:"authenticationtacacspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyAuthenticationVServerBinding `json:"authenticationtacacspolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacspolicy_binding +// Binding object which returns the resources bound to authenticationtacacspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_binding +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyBinding() ([]models.AuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyBinding `json:"authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicyBinding(name string) (*models.AuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyBinding `json:"authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationtacacspolicy_systemglobal_binding +// Binding object showing the systemglobal that can be bound to authenticationtacacspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_systemglobal_binding +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicySystemGlobalBinding() ([]models.AuthenticationTACACSPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicySystemGlobalBinding `json:"authenticationtacacspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicySystemGlobalBinding(name string) (*models.AuthenticationTACACSPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicySystemGlobalBinding `json:"authenticationtacacspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicySystemGlobalBinding `json:"authenticationtacacspolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacspolicy_vpnglobal_binding +// Binding object showing the vpnglobal that can be bound to authenticationtacacspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnglobal_binding +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNGlobalBinding() ([]models.AuthenticationTACACSPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNGlobalBinding `json:"authenticationtacacspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNGlobalBinding(name string) (*models.AuthenticationTACACSPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNGlobalBinding `json:"authenticationtacacspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNGlobalBinding `json:"authenticationtacacspolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationtacacspolicy_vpnvserver_binding +// Binding object showing the vpnvserver that can be bound to authenticationtacacspolicy. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnvserver_binding +func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNVServerBinding() ([]models.AuthenticationTACACSPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationTACACSPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNVServerBinding `json:"authenticationtacacspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNVServerBinding(name string) (*models.AuthenticationTACACSPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationTACACSPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNVServerBinding `json:"authenticationtacacspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationtacacspolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationTACACSPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationTACACSPolicyVPNVServerBinding `json:"authenticationtacacspolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticaitonvserver +// Configuration for authentication virtual server resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver +func (s *AuthenticationService) AddAuthenticationVServer(resource models.AuthenticationVServer) error { + payload := map[string]any{"authenticationvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationVServerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationVServer(resource models.AuthenticationVServer) error { + payload := map[string]any{"authenticationvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationVServer(resource models.AuthenticationVServer) error { + payload := map[string]any{"authenticationvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) EnableAuthenticationVServer(name string) error { + payload := map[string]any{"authenticationvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", authenticationVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DisableAuthenticationVServer(name string) error { + payload := map[string]any{"authenticationvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", authenticationVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServer() ([]models.AuthenticationVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServer `json:"authenticationvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServer(name string) (*models.AuthenticationVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServer `json:"authenticationvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServer `json:"authenticationvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +func (s *AuthenticationService) RenameAuthenticationVServer(name string, newname string) error { + payload := map[string]any{ + "authenticationvserver": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", authenticationVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// authenticationvserver_auditnslogpolicy_binding +// Binding object showing the auditnslogpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditnslogpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuditNSLogPolicyBinding(resource models.AuthenticationVServerAuditNSLogPolicyBinding) error { + payload := map[string]any{"authenticationvserver_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuditNSLogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuditNSLogPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuditNSLogPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuditNSLogPolicyBinding() ([]models.AuthenticationVServerAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuditNSLogPolicyBinding `json:"authenticationvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuditNSLogPolicyBinding(name string) (*models.AuthenticationVServerAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuditNSLogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuditNSLogPolicyBinding `json:"authenticationvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_auditnslogpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuditNSLogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuditNSLogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuditNSLogPolicyBinding `json:"authenticationvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_auditsyslogpolicy_binding +// Binding object showing the auditsyslogpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditsyslogpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuditSyslogPolicyBinding(resource models.AuthenticationVServerAuditSyslogPolicyBinding) error { + payload := map[string]any{"authenticationvserver_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuditSyslogPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuditSyslogPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuditSyslogPolicyBinding() ([]models.AuthenticationVServerAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuditSyslogPolicyBinding `json:"authenticationvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuditSyslogPolicyBinding(name string) (*models.AuthenticationVServerAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuditSyslogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuditSyslogPolicyBinding `json:"authenticationvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_auditsyslogpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuditSyslogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuditSyslogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuditSyslogPolicyBinding `json:"authenticationvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationcertpolicy_binding +// Binding object showing the authenticationcertpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationcertpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationCertPolicyBinding(resource models.AuthenticationVServerAuthenticationCertPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationcertpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationCertPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationCertPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationCertPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationCertPolicyBinding() ([]models.AuthenticationVServerAuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationCertPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationCertPolicyBinding `json:"authenticationvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationCertPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationCertPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationCertPolicyBinding `json:"authenticationvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationcertpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationCertPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationCertPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationCertPolicyBinding `json:"authenticationvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationldappolicy_binding +// Binding object showing the authenticationldappolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationldappolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLDAPPolicyBinding(resource models.AuthenticationVServerAuthenticationLDAPPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationldappolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationLDAPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLDAPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationLDAPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLDAPPolicyBinding() ([]models.AuthenticationVServerAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationLDAPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLDAPPolicyBinding `json:"authenticationvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLDAPPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationLDAPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLDAPPolicyBinding `json:"authenticationvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationldappolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLDAPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationLDAPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLDAPPolicyBinding `json:"authenticationvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationlocalpolicy_binding +// Binding object showing the authenticationlocalpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationlocalpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLocalPolicyBinding(resource models.AuthenticationVServerAuthenticationLocalPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationlocalpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationLocalPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLocalPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationLocalPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLocalPolicyBinding() ([]models.AuthenticationVServerAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationLocalPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLocalPolicyBinding `json:"authenticationvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLocalPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationLocalPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLocalPolicyBinding `json:"authenticationvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationlocalpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLocalPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationLocalPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLocalPolicyBinding `json:"authenticationvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationloginschemapolicy_binding +// Binding object showing the authenticationloginschemapolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationloginschemapolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLoginSchemaPolicyBinding(resource models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationloginschemapolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationLoginSchemaPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLoginSchemaPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationLoginSchemaPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() ([]models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationLoginSchemaPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding `json:"authenticationvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLoginSchemaPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationLoginSchemaPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding `json:"authenticationvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationloginschemapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationLoginSchemaPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationLoginSchemaPolicyBinding `json:"authenticationvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationnegotiatepolicy_binding +// Binding object showing the authenticationnegotiatepolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationnegotiatepolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationNegotiatePolicyBinding(resource models.AuthenticationVServerAuthenticationNegotiatePolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationnegotiatepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationNegotiatePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationNegotiatePolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationNegotiatePolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationNegotiatePolicyBinding() ([]models.AuthenticationVServerAuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationNegotiatePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationNegotiatePolicyBinding `json:"authenticationvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationNegotiatePolicyBinding(name string) (*models.AuthenticationVServerAuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationNegotiatePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationNegotiatePolicyBinding `json:"authenticationvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationnegotiatepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationNegotiatePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationNegotiatePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationNegotiatePolicyBinding `json:"authenticationvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationoauthidppolicy_binding +// Binding object showing the authenticationoauthidppolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationoauthidppolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationOAuthIdPPolicyBinding(resource models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationoauthidppolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationtacacsaction -// Configuration for TACACS action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacsaction -func (s *AuthenticationService) AddAuthenticationTACACSAction() {} -func (s *AuthenticationService) DeleteAuthenticationTACACSAction() {} -func (s *AuthenticationService) UpdateAuthenticationTACACSAction() {} -func (s *AuthenticationService) UnsetAuthenticationTACACSAction() {} -func (s *AuthenticationService) GetAllAuthenticationTACACSAction() {} -func (s *AuthenticationService) GetAuthenticationTACACSAction() {} -func (s *AuthenticationService) CountAuthenticationTACACSAction() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationOAuthIdPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationtacacspolicy -// Configuration for TACACS policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy -func (s *AuthenticationService) AddAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) UnsetAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicy() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicy() {} + _, err = s.client.Do(req) + return err +} -// authenticationtacacspolicy_authenticationvserver_binding -// Binding object showing the authenticationvserver that can be bound to authenticationtacacspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationOAuthIdPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationOAuthIdPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() ([]models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationOAuthIdPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding `json:"authenticationvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationOAuthIdPPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationOAuthIdPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding `json:"authenticationvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationoauthidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationOAuthIdPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationOAuthIDPPolicyBinding `json:"authenticationvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationpolicy_binding +// Binding object showing the authenticationpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationPolicyBinding(resource models.AuthenticationVServerAuthenticationPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationPolicyBinding() ([]models.AuthenticationVServerAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationPolicyBinding `json:"authenticationvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationPolicyBinding `json:"authenticationvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationPolicyBinding `json:"authenticationvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationradiuspolicy_binding +// Binding object showing the authenticationradiuspolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationradiuspolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationRADIUSPolicyBinding(resource models.AuthenticationVServerAuthenticationRADIUSPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationradiuspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationRADIUSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationRADIUSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationRADIUSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationRADIUSPolicyBinding() ([]models.AuthenticationVServerAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationRADIUSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationRADIUSPolicyBinding `json:"authenticationvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationRADIUSPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationRADIUSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationRADIUSPolicyBinding `json:"authenticationvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationradiuspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationRADIUSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationRADIUSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationRADIUSPolicyBinding `json:"authenticationvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationsamlidppolicy_binding +// Binding object showing the authenticationsamlidppolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlidppolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationSAMLIdPPolicyBinding(resource models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationsamlidppolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationSAMLIdPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationSAMLIdPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationSAMLIdPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() ([]models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationSAMLIdPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding `json:"authenticationvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationSAMLIdPPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationSAMLIdPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding `json:"authenticationvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationsamlidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationSAMLIdPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLIDPPolicyBinding `json:"authenticationvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationsamlpolicy_binding +// Binding object showing the authenticationsamlpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationSAMLPolicyBinding(resource models.AuthenticationVServerAuthenticationSAMLPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationsamlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationSAMLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationSAMLPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationSAMLPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationSAMLPolicyBinding() ([]models.AuthenticationVServerAuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationSAMLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLPolicyBinding `json:"authenticationvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationSAMLPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationSAMLPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLPolicyBinding `json:"authenticationvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationsamlpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationSAMLPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationSAMLPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationSAMLPolicyBinding `json:"authenticationvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationtacacspolicy_binding +// Binding object showing the authenticationtacacspolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationtacacspolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationTACACSPolicyBinding(resource models.AuthenticationVServerAuthenticationTACACSPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationtacacspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationTACACSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationTACACSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationTACACSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationTACACSPolicyBinding() ([]models.AuthenticationVServerAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationTACACSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationTACACSPolicyBinding `json:"authenticationvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationTACACSPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationTACACSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationTACACSPolicyBinding `json:"authenticationvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationtacacspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationTACACSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationTACACSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationTACACSPolicyBinding `json:"authenticationvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_authenticationwebauthpolicy_binding +// Binding object showing the authenticationwebauthpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationwebauthpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerAuthenticationWebAuthPolicyBinding(resource models.AuthenticationVServerAuthenticationWebAuthPolicyBinding) error { + payload := map[string]any{"authenticationvserver_authenticationwebauthpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerAuthenticationWebAuthPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationWebAuthPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerAuthenticationWebAuthPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationWebAuthPolicyBinding() ([]models.AuthenticationVServerAuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerAuthenticationWebAuthPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationWebAuthPolicyBinding `json:"authenticationvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerAuthenticationWebAuthPolicyBinding(name string) (*models.AuthenticationVServerAuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerAuthenticationWebAuthPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationWebAuthPolicyBinding `json:"authenticationvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_authenticationwebauthpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerAuthenticationWebAuthPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerAuthenticationWebAuthPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerAuthenticationWebAuthPolicyBinding `json:"authenticationvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_binding +// Binding object which returns the resources bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_binding +func (s *AuthenticationService) GetAllAuthenticationVServerBinding() ([]models.AuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerBinding `json:"authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerBinding(name string) (*models.AuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerBinding `json:"authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// authenticationvserver_cachepolicy_binding +// Binding object showing the cachepolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cachepolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerCachePolicyBinding(resource models.AuthenticationVServerCachePolicyBinding) error { + payload := map[string]any{"authenticationvserver_cachepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerCachePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerCachePolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerCachePolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerCachePolicyBinding() ([]models.AuthenticationVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerCachePolicyBinding `json:"authenticationvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerCachePolicyBinding(name string) (*models.AuthenticationVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerCachePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerCachePolicyBinding `json:"authenticationvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_cachepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerCachePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerCachePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerCachePolicyBinding `json:"authenticationvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// authenticationvserver_cspolicy_binding +// Binding object showing the cspolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cspolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerCSPolicyBinding(resource models.AuthenticationVServerCSPolicyBinding) error { + payload := map[string]any{"authenticationvserver_cspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerCSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerCSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerCSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerCSPolicyBinding() ([]models.AuthenticationVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerCSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerCSPolicyBinding `json:"authenticationvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerCSPolicyBinding(name string) (*models.AuthenticationVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerCSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerCSPolicyBinding `json:"authenticationvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_cspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerCSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerCSPolicyBindingURL), nil) + if err != nil { + return 0, err + } -// authenticationtacacspolicy_binding -// Binding object which returns the resources bound to authenticationtacacspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// authenticationtacacspolicy_systemglobal_binding -// Binding object showing the systemglobal that can be bound to authenticationtacacspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicySystemGlobalBinding() {} + var result struct { + Data []models.AuthenticationVServerCSPolicyBinding `json:"authenticationvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } -// authenticationtacacspolicy_vpnglobal_binding -// Binding object showing the vpnglobal that can be bound to authenticationtacacspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNGlobalBinding() {} + if len(result.Data) == 0 { + return 0, nil + } -// authenticationtacacspolicy_vpnvserver_binding -// Binding object showing the vpnvserver that can be bound to authenticationtacacspolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationtacacspolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationTACACSPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationTACACSPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationTACACSPolicyVPNVServerBinding() {} + return int(result.Data[0].Count), nil +} -// authenticaitonvserver -// Configuration for authentication virtual server resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver -func (s *AuthenticationService) AddAuthenticationVServer() {} -func (s *AuthenticationService) DeleteAuthenticationVServer() {} -func (s *AuthenticationService) UpdateAuthenticationVServer() {} -func (s *AuthenticationService) UnsetAuthenticationVServer() {} -func (s *AuthenticationService) EnableAuthenticationVServer() {} -func (s *AuthenticationService) DisableAuthenticationVServer() {} -func (s *AuthenticationService) GetAllAuthenticationVServer() {} -func (s *AuthenticationService) GetAuthenticationVServer() {} -func (s *AuthenticationService) CountAuthenticationVServer() {} -func (s *AuthenticationService) RenameAuthenticationVServer() {} +// authenticationvserver_responderpolicy_binding +// Binding object showing the responderpolicy that can be bound to authenticationvserver. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_responderpolicy_binding +func (s *AuthenticationService) AddAuthenticationVServerResponderPolicyBinding(resource models.AuthenticationVServerResponderPolicyBinding) error { + payload := map[string]any{"authenticationvserver_responderpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// authenticationvserver_auditnslogpolicy_binding -// Binding object showing the auditnslogpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditnslogpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuditNSLogPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuditNSLogPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuditNSLogPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuditNSLogPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuditNSLogPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerResponderPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// authenticationvserver_auditsyslogpolicy_binding -// Binding object showing the auditsyslogpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_auditsyslogpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuditSyslogPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuditSyslogPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuditSyslogPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuditSyslogPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuditSyslogPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationvserver_authenticationcertpolicy_binding -// Binding object showing the authenticationcertpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationcertpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationCertPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationCertPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationCertPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationCertPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationCertPolicyBinding() {} +func (s *AuthenticationService) DeleteAuthenticationVServerResponderPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerResponderPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } -// authenticationvserver_authenticationldappolicy_binding -// Binding object showing the authenticationldappolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationldappolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLDAPPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLDAPPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLDAPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLDAPPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLDAPPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// authenticationvserver_authenticationlocalpolicy_binding -// Binding object showing the authenticationlocalpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationlocalpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLocalPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLocalPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLocalPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLocalPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLocalPolicyBinding() {} +func (s *AuthenticationService) GetAllAuthenticationVServerResponderPolicyBinding() ([]models.AuthenticationVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } -// authenticationvserver_authenticationloginschemapolicy_binding -// Binding object showing the authenticationloginschemapolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationloginschemapolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationLoginSchemaPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationvserver_authenticationnegotiatepolicy_binding -// Binding object showing the authenticationnegotiatepolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationnegotiatepolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationNegotiatePolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationNegotiatePolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationNegotiatePolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationNegotiatePolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationNegotiatePolicyBinding() {} + var result struct { + Data []models.AuthenticationVServerResponderPolicyBinding `json:"authenticationvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationvserver_authenticationoauthidppolicy_binding -// Binding object showing the authenticationoauthidppolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationoauthidppolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationOAuthIdPPolicyBinding() {} + return result.Data, nil +} -// authenticationvserver_authenticationpolicy_binding -// Binding object showing the authenticationpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationPolicyBinding() {} +func (s *AuthenticationService) GetAuthenticationVServerResponderPolicyBinding(name string) (*models.AuthenticationVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerResponderPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } -// authenticationvserver_authenticationradiuspolicy_binding -// Binding object showing the authenticationradiuspolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationradiuspolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationRADIUSPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationRADIUSPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationRADIUSPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationRADIUSPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationRADIUSPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// authenticationvserver_authenticationsamlidppolicy_binding -// Binding object showing the authenticationsamlidppolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlidppolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationSAMLIdPPolicyBinding() {} + var result struct { + Data []models.AuthenticationVServerResponderPolicyBinding `json:"authenticationvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } -// authenticationvserver_authenticationsamlpolicy_binding -// Binding object showing the authenticationsamlpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationsamlpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationSAMLPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationSAMLPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationSAMLPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationSAMLPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationSAMLPolicyBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_responderpolicy_binding %s not found", name) + } -// authenticationvserver_authenticationtacacspolicy_binding -// Binding object showing the authenticationtacacspolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationtacacspolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationTACACSPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationTACACSPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationTACACSPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationTACACSPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationTACACSPolicyBinding() {} + return &result.Data[0], nil +} -// authenticationvserver_authenticationwebauthpolicy_binding -// Binding object showing the authenticationwebauthpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_authenticationwebauthpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerAuthenticationWebAuthPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerAuthenticationWebAuthPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerAuthenticationWebAuthPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerAuthenticationWebAuthPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerAuthenticationWebAuthPolicyBinding() {} +func (s *AuthenticationService) CountAuthenticationVServerResponderPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerResponderPolicyBindingURL), nil) + if err != nil { + return 0, err + } -// authenticationvserver_binding -// Binding object which returns the resources bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// authenticationvserver_cachepolicy_binding -// Binding object showing the cachepolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cachepolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerCachePolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerCachePolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerCachePolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerCachePolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerCachePolicyBinding() {} + var result struct { + Data []models.AuthenticationVServerResponderPolicyBinding `json:"authenticationvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } -// authenticationvserver_cspolicy_binding -// Binding object showing the cspolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_cspolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerCSPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerCSPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerCSPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerCSPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerCSPolicyBinding() {} + if len(result.Data) == 0 { + return 0, nil + } -// authenticationvserver_responderpolicy_binding -// Binding object showing the responderpolicy that can be bound to authenticationvserver. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_responderpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerResponderPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerResponderPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerResponderPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerResponderPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerResponderPolicyBinding() {} + return int(result.Data[0].Count), nil +} // authenticationvserver_tmsessionpolicy_binding // Binding object showing the tmsessionpolicy that can be bound to authenticationvserver. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_tmsessionpolicy_binding -func (s *AuthenticationService) AddAuthenticationVServerTMSessionPolicyBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerTMSessionPolicyBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerTMSessionPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerTMSessionPolicyBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerTMSessionPolicyBinding() {} +func (s *AuthenticationService) AddAuthenticationVServerTMSessionPolicyBinding(resource models.AuthenticationVServerTMSessionPolicyBinding) error { + payload := map[string]any{"authenticationvserver_tmsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerTMSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerTMSessionPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", authenticationVServerTMSessionPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerTMSessionPolicyBinding() ([]models.AuthenticationVServerTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerTMSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerTMSessionPolicyBinding `json:"authenticationvserver_tmsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerTMSessionPolicyBinding(name string) (*models.AuthenticationVServerTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerTMSessionPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerTMSessionPolicyBinding `json:"authenticationvserver_tmsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_tmsessionpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerTMSessionPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerTMSessionPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerTMSessionPolicyBinding `json:"authenticationvserver_tmsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationvserver_vpnportaltheme_binding // Binding object showing the vpnportaltheme that can be bound to authenticationvserver. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationvserver_vpnportaltheme_binding -func (s *AuthenticationService) AddAuthenticationVServerVPNPortalThemeBinding() {} -func (s *AuthenticationService) DeleteAuthenticationVServerVPNPortalThemeBinding() {} -func (s *AuthenticationService) GetAllAuthenticationVServerVPNPortalThemeBinding() {} -func (s *AuthenticationService) GetAuthenticationVServerVPNPortalThemeBinding() {} -func (s *AuthenticationService) CountAuthenticationVServerVPNPortalThemeBinding() {} +func (s *AuthenticationService) AddAuthenticationVServerVPNPortalThemeBinding(resource models.AuthenticationVServerVPNPortalThemeBinding) error { + payload := map[string]any{"authenticationvserver_vpnportaltheme_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationVServerVPNPortalThemeBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationVServerVPNPortalThemeBinding(name string, portaltheme string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=portaltheme:%s", authenticationVServerVPNPortalThemeBindingURL, name, portaltheme), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationVServerVPNPortalThemeBinding() ([]models.AuthenticationVServerVPNPortalThemeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationVServerVPNPortalThemeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerVPNPortalThemeBinding `json:"authenticationvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationVServerVPNPortalThemeBinding(name string) (*models.AuthenticationVServerVPNPortalThemeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationVServerVPNPortalThemeBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationVServerVPNPortalThemeBinding `json:"authenticationvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationvserver_vpnportaltheme_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationVServerVPNPortalThemeBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationVServerVPNPortalThemeBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationVServerVPNPortalThemeBinding `json:"authenticationvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthaction // Configuration for Web authentication action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthaction -func (s *AuthenticationService) AddAuthenticationWebAuthAction() {} -func (s *AuthenticationService) DeleteAuthenticationWebAuthAction() {} -func (s *AuthenticationService) UpdateAuthenticationWebAuthAction() {} -func (s *AuthenticationService) UnsetAuthenticationWebAuthAction() {} -func (s *AuthenticationService) GetAllAuthenticationWebAuthAction() {} -func (s *AuthenticationService) GetAuthenticationWebAuthAction() {} -func (s *AuthenticationService) CountAuthenticationWebAuthAction() {} +func (s *AuthenticationService) AddAuthenticationWebAuthAction(resource models.AuthenticationWebAuthAction) error { + payload := map[string]any{"authenticationwebauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationWebAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationWebAuthAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationWebAuthActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationWebAuthAction(resource models.AuthenticationWebAuthAction) error { + payload := map[string]any{"authenticationwebauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationWebAuthActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UnsetAuthenticationWebAuthAction(resource models.AuthenticationWebAuthAction) error { + payload := map[string]any{"authenticationwebauthaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", authenticationWebAuthActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationWebAuthAction() ([]models.AuthenticationWebAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthAction `json:"authenticationwebauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthAction(name string) (*models.AuthenticationWebAuthAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthAction `json:"authenticationwebauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthAction `json:"authenticationwebauthaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthpolicy // Configuration for Web authentication policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy -func (s *AuthenticationService) AddAuthenticationWebAuthPolicy() {} -func (s *AuthenticationService) DeleteAuthenticationWebAuthPolicy() {} -func (s *AuthenticationService) UpdateAuthenticationWebAuthPolicy() {} -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicy() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicy() {} -func (s *AuthenticationService) CountAuthenticationWebAuthPolicy() {} +func (s *AuthenticationService) AddAuthenticationWebAuthPolicy(resource models.AuthenticationWebAuthPolicy) error { + payload := map[string]any{"authenticationwebauthpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, authenticationWebAuthPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) DeleteAuthenticationWebAuthPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) UpdateAuthenticationWebAuthPolicy(resource models.AuthenticationWebAuthPolicy) error { + payload := map[string]any{"authenticationwebauthpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, authenticationWebAuthPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicy() ([]models.AuthenticationWebAuthPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicy `json:"authenticationwebauthpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicy(name string) (*models.AuthenticationWebAuthPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicy `json:"authenticationwebauthpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicy `json:"authenticationwebauthpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthpolicy_authenticationvserver_binding // Binding object showing the authenticationvserver that can be bound to authenticationwebauthpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_authenticationvserver_binding -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicyAuthenticationVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationWebAuthPolicyAuthenticationVServerBinding() {} +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyAuthenticationVServerBinding() ([]models.AuthenticationWebAuthPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyAuthenticationVServerBinding `json:"authenticationwebauthpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicyAuthenticationVServerBinding(name string) (*models.AuthenticationWebAuthPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyAuthenticationVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyAuthenticationVServerBinding `json:"authenticationwebauthpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy_authenticationvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthPolicyAuthenticationVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthPolicyAuthenticationVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyAuthenticationVServerBinding `json:"authenticationwebauthpolicy_authenticationvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthpolicy_binding // Binding object which returns the resources bound to authenticationwebauthpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_binding -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyBinding() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicyBinding() {} +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyBinding() ([]models.AuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyBinding `json:"authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicyBinding(name string) (*models.AuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyBinding `json:"authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} // authenticationwebauthpolicy_systemglobal_binding // Binding object showing the systemglobal that can be bound to authenticationwebauthpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_systemglobal_binding -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicySystemGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicySystemGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationWebAuthPolicySystemGlobalBinding() {} +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicySystemGlobalBinding() ([]models.AuthenticationWebAuthPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicySystemGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicySystemGlobalBinding `json:"authenticationwebauthpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicySystemGlobalBinding(name string) (*models.AuthenticationWebAuthPolicySystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicySystemGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicySystemGlobalBinding `json:"authenticationwebauthpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy_systemglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthPolicySystemGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthPolicySystemGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicySystemGlobalBinding `json:"authenticationwebauthpolicy_systemglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthpolicy_vpnglobal_binding // Binding object showing the vpnglobal that can be bound to authenticationwebauthpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_vpnglobal_binding -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicyVPNGlobalBinding() {} -func (s *AuthenticationService) CountAuthenticationWebAuthPolicyVPNGlobalBinding() {} +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyVPNGlobalBinding() ([]models.AuthenticationWebAuthPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNGlobalBinding `json:"authenticationwebauthpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicyVPNGlobalBinding(name string) (*models.AuthenticationWebAuthPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNGlobalBinding `json:"authenticationwebauthpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNGlobalBinding `json:"authenticationwebauthpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} // authenticationwebauthpolicy_vpnvserver_binding // Binding object showing the vpnvserver that can be bound to authenticationwebauthpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authentication/authenticationwebauthpolicy_vpnvserver_binding -func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyVPNVServerBinding() {} -func (s *AuthenticationService) GetAuthenticationWebAuthPolicyVPNVServerBinding() {} -func (s *AuthenticationService) CountAuthenticationWebAuthPolicyVPNVServerBinding() {} +func (s *AuthenticationService) GetAllAuthenticationWebAuthPolicyVPNVServerBinding() ([]models.AuthenticationWebAuthPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authenticationWebAuthPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNVServerBinding `json:"authenticationwebauthpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *AuthenticationService) GetAuthenticationWebAuthPolicyVPNVServerBinding(name string) (*models.AuthenticationWebAuthPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", authenticationWebAuthPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNVServerBinding `json:"authenticationwebauthpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("authenticationwebauthpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *AuthenticationService) CountAuthenticationWebAuthPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", authenticationWebAuthPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.AuthenticationWebAuthPolicyVPNVServerBinding `json:"authenticationwebauthpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} diff --git a/nitrogo/authorization.go b/nitrogo/authorization.go index 84f536f..c97a28a 100644 --- a/nitrogo/authorization.go +++ b/nitrogo/authorization.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( authorizationActionURL = "/nitro/v1/config/authorizationaction" authorizationPolicyURL = "/nitro/v1/config/authorizationpolicy" @@ -21,85 +31,806 @@ type AuthorizationService struct { } // authorizationaction -// Configuration for authorization action resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationaction -func (s *AuthorizationService) GetAllAuthorizationAction() {} -func (s *AuthorizationService) GetAuthorizationAction() {} -func (s *AuthorizationService) CountAuthorizationAction() {} + +func (s *AuthorizationService) GetAllAuthorizationAction() ([]models.AuthorizationAction, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuthorizationAction `json:"authorizationaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuthorizationService) GetAuthorizationAction(name string) ([]models.AuthorizationAction, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.AuthorizationAction `json:"authorizationaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *AuthorizationService) CountAuthorizationAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"authorizationaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // authorizationpolicy -// Configuration for authorization policy resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy -func (s *AuthorizationService) AddAuthorizationPolicy() {} -func (s *AuthorizationService) DeleteAuthorizationPolicy() {} -func (s *AuthorizationService) UpdateAuthorizationPolicy() {} -func (s *AuthorizationService) RenameAuthorizationPolicy() {} -func (s *AuthorizationService) GetAllAuthorizationPolicy() {} -func (s *AuthorizationService) GetAuthorizationPolicy() {} -func (s *AuthorizationService) CountAuthorizationPolicy() {} + +func (s *AuthorizationService) AddAuthorizationPolicy(policy models.AuthorizationPolicy) error { + payload := map[string]any{ + "authorizationpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, authorizationPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) DeleteAuthorizationPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) UpdateAuthorizationPolicy(policy models.AuthorizationPolicy) error { + payload := map[string]any{ + "authorizationpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, authorizationPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) RenameAuthorizationPolicy(name, newname string) error { + payload := map[string]any{ + "authorizationpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, authorizationPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) GetAllAuthorizationPolicy() ([]models.AuthorizationPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuthorizationPolicy `json:"authorizationpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicy(name string) ([]models.AuthorizationPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.AuthorizationPolicy `json:"authorizationpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // authorizationpolicylabel -// Configuration for authorization policy label resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicylabel -func (s *AuthorizationService) AddAuthorizationPolicyLabel() {} -func (s *AuthorizationService) DeleteAuthorizationPolicyLabel() {} -func (s *AuthorizationService) RenameAuthorizationPolicyLabel() {} -func (s *AuthorizationService) GetAllAuthorizationPolicyLabel() {} -func (s *AuthorizationService) GetAuthorizationPolicyLabel() {} -func (s *AuthorizationService) CountAuthorizationPolicyLabel() {} + +func (s *AuthorizationService) AddAuthorizationPolicyLabel(label models.AuthorizationPolicyLabel) error { + payload := map[string]any{ + "authorizationpolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, authorizationPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) DeleteAuthorizationPolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) RenameAuthorizationPolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "authorizationpolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, authorizationPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) GetAllAuthorizationPolicyLabel() ([]models.AuthorizationPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.AuthorizationPolicyLabel `json:"authorizationpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyLabel(labelname string) ([]models.AuthorizationPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.AuthorizationPolicyLabel `json:"authorizationpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} // authorizationpolicylabel_authorizationpolicy_binding -// Binding object showing the authorizationpolicy that can be bound to authorizationpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicylabel_authorizationpolicy_binding -func (s *AuthorizationService) AddAuthorizationPolicyLabelAuthorizationPolicyBinding() {} -func (s *AuthorizationService) DeleteAuthorizationPolicyLabelAuthorizationPolicyBinding() {} -func (s *AuthorizationService) GetAllAuthorizationPolicyLabelAuthorizationPolicyBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyLabelAuthorizationPolicyBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyLabelAuthorizationPolicyBinding() {} + +func (s *AuthorizationService) AddAuthorizationPolicyLabelAuthorizationPolicyBinding(binding models.AuthorizationPolicyLabelAuthorizationPolicyBinding) error { + payload := map[string]any{ + "authorizationpolicylabel_authorizationpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, authorizationPolicyLabelAuthorizationPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) DeleteAuthorizationPolicyLabelAuthorizationPolicyBinding(labelname, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", authorizationPolicyLabelAuthorizationPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *AuthorizationService) GetAllAuthorizationPolicyLabelAuthorizationPolicyBinding() ([]models.AuthorizationPolicyLabelAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyLabelAuthorizationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLabelAuthorizationPolicyBinding `json:"authorizationpolicylabel_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyLabelAuthorizationPolicyBinding(labelname string) ([]models.AuthorizationPolicyLabelAuthorizationPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyLabelAuthorizationPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLabelAuthorizationPolicyBinding `json:"authorizationpolicylabel_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyLabelAuthorizationPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyLabelAuthorizationPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicylabel_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // authorizationpolicylabel_binding -// Binding object which returns the resources bound to authorizationpolicylabel. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicylabel_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyLabelBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyLabelBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyLabelBinding() ([]models.AuthorizationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLabelBinding `json:"authorizationpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyLabelBinding(labelname string) ([]models.AuthorizationPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLabelBinding `json:"authorizationpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // authorizationpolicy_aaagroup_binding -// Binding object showing the aaagroup that can be bound to authorizationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_aaagroup_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyAAAGroupBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyAAAGroupBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyAAAGroupBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyAAAGroupBinding() ([]models.AuthorizationPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAAAGroupBinding `json:"authorizationpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyAAAGroupBinding(name string) ([]models.AuthorizationPolicyAAAGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAAAGroupBinding `json:"authorizationpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyAAAGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // authorizationpolicy_aaauser_binding -// Binding object showing the aaauser that can be bound to authorizationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_aaauser_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyAAAUserBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyAAAUserBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyAAAUserBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyAAAUserBinding() ([]models.AuthorizationPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAAAUserBinding `json:"authorizationpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyAAAUserBinding(name string) ([]models.AuthorizationPolicyAAAUserBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAAAUserBinding `json:"authorizationpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyAAAUserBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // authorizationpolicy_authorizationpolicylabel_binding -// Binding object showing the authorizationpolicylabel that can be bound to authorizationpolicy -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_authorizationpolicylabel_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyAuthorizationPolicyLabelBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyAuthorizationPolicyLabelBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyAuthorizationPolicyLabelBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyAuthorizationPolicyLabelBinding() ([]models.AuthorizationPolicyAuthorizationPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyAuthorizationPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAuthorizationPolicyLabelBinding `json:"authorizationpolicy_authorizationpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyAuthorizationPolicyLabelBinding(name string) ([]models.AuthorizationPolicyAuthorizationPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyAuthorizationPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyAuthorizationPolicyLabelBinding `json:"authorizationpolicy_authorizationpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyAuthorizationPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyAuthorizationPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy_authorizationpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // authorizationpolicy_binding -// Binding object which returns the resources bound to authorizationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyBinding() ([]models.AuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyBinding `json:"authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyBinding(name string) ([]models.AuthorizationPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyBinding `json:"authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // authorizationpolicy_csvserver_binding -// Binding object showing the csvserver that can be bound to authorizationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_csvserver_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyCSVServerBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyCSVServerBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyCSVServerBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyCSVServerBinding() ([]models.AuthorizationPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyCSVServerBinding `json:"authorizationpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyCSVServerBinding(name string) ([]models.AuthorizationPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyCSVServerBinding `json:"authorizationpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // authorizationpolicy_lbvserver_binding -// Binding object showing the lbvserver that can be bound to authorizationpolicy. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/authorization/authorizationpolicy_lbvserver_binding -func (s *AuthorizationService) GetAllAuthorizationPolicyLBVServerBinding() {} -func (s *AuthorizationService) GetAuthorizationPolicyLBVServerBinding() {} -func (s *AuthorizationService) CountAuthorizationPolicyLBVServerBinding() {} + +func (s *AuthorizationService) GetAllAuthorizationPolicyLBVServerBinding() ([]models.AuthorizationPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, authorizationPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLBVServerBinding `json:"authorizationpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) GetAuthorizationPolicyLBVServerBinding(name string) ([]models.AuthorizationPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", authorizationPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.AuthorizationPolicyLBVServerBinding `json:"authorizationpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *AuthorizationService) CountAuthorizationPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", authorizationPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"authorizationpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/autoscale.go b/nitrogo/autoscale.go index a9d9281..9ddba6e 100644 --- a/nitrogo/autoscale.go +++ b/nitrogo/autoscale.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( autoscaleActionURL = "/nitro/v1/config/autoscaleaction" autoscalePolicyURL = "/nitro/v1/config/autoscalepolicy" @@ -17,45 +27,579 @@ type AutoscaleService struct { // autoscaleaction // Configuration for autoscale action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscaleaction -func (s *AutoscaleService) AddAutoscaleAction() {} -func (s *AutoscaleService) DeleteAutoscaleAction() {} -func (s *AutoscaleService) UpdateAutoscaleAction() {} -func (s *AutoscaleService) UnsetAutoscaleAction() {} -func (s *AutoscaleService) GetAllAutoscaleAction() {} -func (s *AutoscaleService) GetAutoscaleAction() {} -func (s *AutoscaleService) CountAutoscaleAction() {} + +func (s *AutoscaleService) AddAutoscaleAction(action models.AutoscaleAction) error { + payload := map[string]any{ + "autoscaleaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscaleActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) DeleteAutoscaleAction(name string) error { + urlReq := fmt.Sprintf("%s/%s", autoscaleActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) UpdateAutoscaleAction(action models.AutoscaleAction) error { + payload := map[string]any{ + "autoscaleaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, autoscaleActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) UnsetAutoscaleAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "autoscaleaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscaleActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) GetAllAutoscaleAction() ([]models.AutoscaleAction, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscaleActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.AutoscaleAction `json:"autoscaleaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *AutoscaleService) GetAutoscaleAction(name string) ([]models.AutoscaleAction, error) { + urlReq := fmt.Sprintf("%s/%s", autoscaleActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.AutoscaleAction `json:"autoscaleaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *AutoscaleService) CountAutoscaleAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscaleActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"autoscaleaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} // autoscalepolicy // Configuration for Autoscale policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscalepolicy -func (s *AutoscaleService) AddAutoscalePolicy() {} -func (s *AutoscaleService) DeleteAutoscalePolicy() {} -func (s *AutoscaleService) UpdateAutoscalePolicy() {} -func (s *AutoscaleService) UnsetAutoscalePolicy() {} -func (s *AutoscaleService) GetAllAutoscalePolicy() {} -func (s *AutoscaleService) GetAutoscalePolicy() {} -func (s *AutoscaleService) CountAutoscalePolicy() {} -func (s *AutoscaleService) RenameAutoscalePolicy() {} + +func (s *AutoscaleService) AddAutoscalePolicy(policy models.AutoscalePolicy) error { + payload := map[string]any{ + "autoscalepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscalePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) DeleteAutoscalePolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", autoscalePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) UpdateAutoscalePolicy(policy models.AutoscalePolicy) error { + payload := map[string]any{ + "autoscalepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, autoscalePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) UnsetAutoscalePolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "autoscalepolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscalePolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) GetAllAutoscalePolicy() ([]models.AutoscalePolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscalePolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AutoscalePolicy `json:"autoscalepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *AutoscaleService) GetAutoscalePolicy(name string) ([]models.AutoscalePolicy, error) { + urlReq := fmt.Sprintf("%s/%s", autoscalePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.AutoscalePolicy `json:"autoscalepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *AutoscaleService) CountAutoscalePolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscalePolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"autoscalepolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} + +func (s *AutoscaleService) RenameAutoscalePolicy(name string, newname string) error { + payload := map[string]any{ + "autoscalepolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscalePolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // autoscalepolicy_binding // Binding object which returns the resources bound to autoscalepolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscalepolicy_binding -func (s *AutoscaleService) GetAllAutoscalePolicyBinding() {} -func (s *AutoscaleService) GetAutoscalePolicyBinding() {} + +func (s *AutoscaleService) GetAllAutoscalePolicyBinding() ([]models.AutoscalePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscalePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AutoscalePolicyBinding `json:"autoscalepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AutoscaleService) GetAutoscalePolicyBinding(name string) ([]models.AutoscalePolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", autoscalePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AutoscalePolicyBinding `json:"autoscalepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // autoscalepolicy_nstimer_binding // Binding object showing the nstimer that can be bound to autoscalepolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscalepolicy_nstimer_binding -func (s *AutoscaleService) GetAllAutoscalePolicyNSTimerBinding() {} -func (s *AutoscaleService) GetAutoscalePolicyNSTimerBinding() {} -func (s *AutoscaleService) CountAutoscalePolicyNSTimerBinding() {} + +func (s *AutoscaleService) GetAllAutoscalePolicyNSTimerBinding() ([]models.AutoscalePolicyNSTimerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscalePolicyNSTimerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AutoscalePolicyNSTimerBinding `json:"autoscalepolicy_nstimer_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AutoscaleService) GetAutoscalePolicyNSTimerBinding(name string) ([]models.AutoscalePolicyNSTimerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", autoscalePolicyNSTimerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.AutoscalePolicyNSTimerBinding `json:"autoscalepolicy_nstimer_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *AutoscaleService) CountAutoscalePolicyNSTimerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", autoscalePolicyNSTimerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"autoscalepolicy_nstimer_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // autoscaleprofile // Configuration for autoscale profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/autoscale/autoscaleprofile -func (s *AutoscaleService) AddAutoscaleProfile() {} -func (s *AutoscaleService) DeleteAutoscaleProfile() {} -func (s *AutoscaleService) UpdateAutoscaleProfile() {} -func (s *AutoscaleService) GetAllAutoscaleProfile() {} -func (s *AutoscaleService) GetAutoscaleProfile() {} -func (s *AutoscaleService) CountAutoscaleProfile() {} + +func (s *AutoscaleService) AddAutoscaleProfile(profile models.AutoscaleProfile) error { + payload := map[string]any{ + "autoscaleprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, autoscaleProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) DeleteAutoscaleProfile(name string) error { + urlReq := fmt.Sprintf("%s/%s", autoscaleProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) UpdateAutoscaleProfile(profile models.AutoscaleProfile) error { + payload := map[string]any{ + "autoscaleprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, autoscaleProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AutoscaleService) GetAllAutoscaleProfile() ([]models.AutoscaleProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscaleProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.AutoscaleProfile `json:"autoscaleprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *AutoscaleService) GetAutoscaleProfile(name string) ([]models.AutoscaleProfile, error) { + urlReq := fmt.Sprintf("%s/%s", autoscaleProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.AutoscaleProfile `json:"autoscaleprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *AutoscaleService) CountAutoscaleProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, autoscaleProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"autoscaleprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/azure.go b/nitrogo/azure.go index 84644ad..f7a36cd 100644 --- a/nitrogo/azure.go +++ b/nitrogo/azure.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( azureApplicationURL = "/nitro/v1/config/azureapplication" azureKeyVaultURL = "/nitro/v1/config/azurekeyvault" @@ -14,17 +23,217 @@ type AzureService struct { // azureapplication // Configuration for Azure Application resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/azure/azureapplication -func (s *AzureService) AddAzureApplication() {} -func (s *AzureService) DeleteAzureApplication() {} -func (s *AzureService) GetAllAzureApplication() {} -func (s *AzureService) GetAzureApplication() {} -func (s *AzureService) CountAzureApplication() {} + +func (s *AzureService) AddAzureApplication(application models.AzureApplication) error { + payload := map[string]any{ + "azureapplication": application, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, azureApplicationURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AzureService) DeleteAzureApplication(name string) error { + url := fmt.Sprintf("%s/%s", azureApplicationURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AzureService) GetAllAzureApplication() ([]models.AzureApplication, error) { + req, err := s.client.NewRequest(http.MethodGet, azureApplicationURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AzureApplications []models.AzureApplication `json:"azureapplication"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AzureApplications, nil +} + +func (s *AzureService) GetAzureApplication(name string) ([]models.AzureApplication, error) { + url := fmt.Sprintf("%s/%s", azureApplicationURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AzureApplications []models.AzureApplication `json:"azureapplication"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AzureApplications, nil +} + +func (s *AzureService) CountAzureApplication() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, azureApplicationURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + AzureApplications []struct { + Count float64 `json:"__count"` + } `json:"azureapplication"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.AzureApplications) > 0 { + return result.AzureApplications[0].Count, nil + } + + return 0, nil +} // azurekeyvault // Configuration for Azure Key Vault entity resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/azure/azurekeyvault -func (s *AzureService) AddAzureKeyVault() {} -func (s *AzureService) DeleteAzureKeyVault() {} -func (s *AzureService) GetAllAzureKeyVault() {} -func (s *AzureService) GetAzureKeyVault() {} -func (s *AzureService) CountAzureKeyVault() {} + +func (s *AzureService) AddAzureKeyVault(keyVault models.AzureKeyVault) error { + payload := map[string]any{ + "azurekeyvault": keyVault, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, azureKeyVaultURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AzureService) DeleteAzureKeyVault(name string) error { + url := fmt.Sprintf("%s/%s", azureKeyVaultURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *AzureService) GetAllAzureKeyVault() ([]models.AzureKeyVault, error) { + req, err := s.client.NewRequest(http.MethodGet, azureKeyVaultURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AzureKeyVaults []models.AzureKeyVault `json:"azurekeyvault"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AzureKeyVaults, nil +} + +func (s *AzureService) GetAzureKeyVault(name string) ([]models.AzureKeyVault, error) { + url := fmt.Sprintf("%s/%s", azureKeyVaultURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + AzureKeyVaults []models.AzureKeyVault `json:"azurekeyvault"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.AzureKeyVaults, nil +} + +func (s *AzureService) CountAzureKeyVault() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, azureKeyVaultURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + AzureKeyVaults []struct { + Count float64 `json:"__count"` + } `json:"azurekeyvault"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.AzureKeyVaults) > 0 { + return result.AzureKeyVaults[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/basic.go b/nitrogo/basic.go index 79a0fbc..cd61f14 100644 --- a/nitrogo/basic.go +++ b/nitrogo/basic.go @@ -1,9 +1,12 @@ package nitrogo import ( + "bytes" "encoding/json" "fmt" "net/http" + "net/url" + "strings" "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) @@ -33,7 +36,7 @@ const ( serviceLBMonitorBindingURL = "/nitro/v1/config/service_lbmonitor_binding" serviceGroupServiceGroupEntityMonBindingsBindingURL = "/nitro/v1/config/servicegroup_servicegroupentitymonbindings_binding" serviceGroupServiceGroupMemberBindingURL = "/nitro/v1/config/servicegroup_servicegroupmember_binding" - serviceGroupServiceGroupMemberListBinding = "/nitro/v1/config/servicegroup_servicegoupmemberlist_binding" + serviceGroupServiceGroupMemberListBindingURL = "/nitro/v1/config/servicegroup_servicegoupmemberlist_binding" serviceGroupBindingsURL = "/nitro/v1/config/servicegroupbindings" svcBindingsURL = "/nitro/v1/config/svcbindings" vServerURL = "/nitro/v1/config/vserver" @@ -48,164 +51,301 @@ type BasicService struct { // dbsmonitors // Configuration for DB monitors resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/dbsmonitors -func (s *BasicService) RestartDBSMonitors() {} +func (s *BasicService) RestartDBSMonitors() error { + req, err := s.client.NewRequest(http.MethodPost, dbsMonitorsURL+"?action=restart", nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // extendedmemoryparam // Configuration for Parameter for extended memory used by LSN and Subscriber Store resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/extendedmemoryparam -func (s *BasicService) UpdateExtendedMemoryParam() {} -func (s *BasicService) UnsetExtendedMemoryParam() {} -func (s *BasicService) GetAllExtendedMemoryParam() {} +func (s *BasicService) UpdateExtendedMemoryParam(resource models.ExtendedMemoryParam) error { + payload := map[string]any{"extendedmemoryparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, extendedMemoryParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UnsetExtendedMemoryParam(resource models.ExtendedMemoryParam) error { + payload := map[string]any{"extendedmemoryparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", extendedMemoryParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllExtendedMemoryParam() (models.ExtendedMemoryParam, error) { + req, err := s.client.NewRequest(http.MethodGet, extendedMemoryParamURL, nil) + if err != nil { + return models.ExtendedMemoryParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ExtendedMemoryParam{}, err + } + + var result struct { + ExtendedMemoryParam models.ExtendedMemoryParam `json:"extendedmemoryparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ExtendedMemoryParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ExtendedMemoryParam, nil +} // location // Configuration for location resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/location -func (s *BasicService) AddLocation() {} -func (s *BasicService) DeleteLocation() {} -func (s *BasicService) GetAllLocation() {} -func (s *BasicService) GetLocation() {} -func (s *BasicService) CountLocation() {} +func (s *BasicService) AddLocation(resource models.Location) error { + payload := map[string]any{"location": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, locationURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteLocation(ip string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", locationURL, ip), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllLocation() ([]models.Location, error) { + req, err := s.client.NewRequest(http.MethodGet, locationURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Location []models.Location `json:"location"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Location, nil +} + +func (s *BasicService) GetLocation(ip string) (models.Location, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", locationURL, ip), nil) + if err != nil { + return models.Location{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Location{}, err + } + + var result struct { + Location []models.Location `json:"location"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Location{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Location) == 0 { + return models.Location{}, fmt.Errorf("location %s not found", ip) + } + + return result.Location[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountLocation() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, locationURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"location"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // locationdata // Configuration for location data resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationdata -func (s *BasicService) ClearLocationData() {} +func (s *BasicService) ClearLocationData() error { + payload := map[string]any{"locationdata": models.LocationData{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", locationDataURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // locationfile // Configuration for location file resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationfile -func (s *BasicService) AddLocationFile() {} -func (s *BasicService) DeleteLocationFile() {} -func (s *BasicService) GetAllLocationFile() {} -func (s *BasicService) ImportLocationFile() {} +func (s *BasicService) AddLocationFile(resource models.LocationFile) error { + payload := map[string]any{"locationfile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// locationfile6 -// Configuration for location file6 resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationfile6 -func (s *BasicService) AddLocationFile6() {} -func (s *BasicService) DeleteLocationFile6() {} -func (s *BasicService) GetAllLocationFile6() {} -func (s *BasicService) CountLocationFile6() {} -func (s *BasicService) ImportLocationFile6() {} + req, err := s.client.NewRequest(http.MethodPost, locationFileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// locationparameter -// Configuration for location parameter resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationparameter -func (s *BasicService) UpdateLocationParameter() {} -func (s *BasicService) UnsetLocationParameter() {} -func (s *BasicService) GetAllLocationParameter() {} + _, err = s.client.Do(req) + return err +} -// nstrace -// Configuration for nstrace operations resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/nstrace -func (s *BasicService) GetAllNSTrace() {} +func (s *BasicService) DeleteLocationFile(LocationFile string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", locationFileURL, LocationFile), nil) + if err != nil { + return err + } -// radiusnode -// Configuration for RADIUS Node resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/radiusnode -func (s *BasicService) AddRADIUSNode() {} -func (s *BasicService) DeleteRADIUSNode() {} -func (s *BasicService) UpdateRADIUSNode() {} -func (s *BasicService) GetAllRADIUSNode() {} -func (s *BasicService) GetRADIUSNode() {} -func (s *BasicService) CountRADIUSNode() {} + _, err = s.client.Do(req) + return err +} -// reporting -// Configuration for reporting resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/reporting -func (s *BasicService) EnableReporting() {} -func (s *BasicService) DisableReporting() {} -func (s *BasicService) GetAllReporting() {} +func (s *BasicService) GetAllLocationFile() ([]models.LocationFile, error) { + req, err := s.client.NewRequest(http.MethodGet, locationFileURL, nil) + if err != nil { + return nil, err + } -// server -// Configuration for server resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server -func (s *BasicService) AddServer() {} -func (s *BasicService) DeleteServer() {} -func (s *BasicService) UpdateServer() {} -func (s *BasicService) UnsetServer() {} -func (s *BasicService) EnableServer() {} -func (s *BasicService) DisableServer() {} -func (s *BasicService) GetAllServer() {} -func (s *BasicService) GetServer() {} -func (s *BasicService) CountServer() {} -func (s *BasicService) RenameServer() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// server_binding -// Binding object which returns the resources bound to server. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_binding -func (s *BasicService) GetAllServerBinding() {} -func (s *BasicService) GetServerBinding() {} + var result struct { + LocationFile []models.LocationFile `json:"locationfile"` + } -// server_gslbservicegroup_binding -// Binding object showing the gslbservicegroup that can be bound to server. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_gslbservicegroup_binding -func (s *BasicService) GetAllServerGSLBServiceGroupBinding() {} -func (s *BasicService) GetServerGSLBServiceGroupBinding() {} -func (s *BasicService) CountServerGSLBServiceGroupBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// server_gslbservice_binding -// Binding object showing the gslbservice that can be bound to server. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_gslbservice_binding -func (s *BasicService) GetAllServerGSLBServiceBinding() {} -func (s *BasicService) GetServerGSLBServiceBinding() {} -func (s *BasicService) CountServerGSLBServiceBinding() {} + return result.LocationFile, nil +} -// server_servicegroup_binding -// Binding object showing the servicegroup that can be bound to server. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_servicegroup_binding -func (s *BasicService) GetAllServerServiceGroupBinding() {} -func (s *BasicService) GetServerServiceGroupBinding() {} -func (s *BasicService) CountServerServiceGroupBinding() {} +func (s *BasicService) ImportLocationFile(resource models.LocationFile) error { + payload := map[string]any{"locationfile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// server_service_binding -// Binding object showing the service that can be bound to server. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_service_binding -func (s *BasicService) GetAllServerServiceBinding() {} -func (s *BasicService) GetServerServiceBinding() {} -func (s *BasicService) CountServerServiceBinding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=import", locationFileURL), bytes.NewReader(data)) + if err != nil { + return err + } -// service -// Configuration for service resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service -func (s *BasicService) AddService() {} -func (s *BasicService) DeleteService() {} -func (s *BasicService) UpdateService() {} -func (s *BasicService) UnsetService() {} -func (s *BasicService) EnableService() {} -func (s *BasicService) DisableService() {} -func (s *BasicService) GetAllService() {} -func (s *BasicService) GetService() {} -func (s *BasicService) CountService() {} -func (s *BasicService) RenameService() {} + _, err = s.client.Do(req) + return err +} -// servicegroup -// Configuration for service group resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup -func (s *BasicService) AddServiceGroup() {} -func (s *BasicService) DeleteServiceGroup() {} -func (s *BasicService) UpdateServiceGroup() {} -func (s *BasicService) UnsetServiceGroup() {} -func (s *BasicService) EnableServiceGroup() {} -func (s *BasicService) DisableServiceGroup() {} -func (s *BasicService) GetAllServiceGroup() {} -func (s *BasicService) GetServiceGroup() {} -func (s *BasicService) CountServiceGroup() {} -func (s *BasicService) RenameServiceGroup() {} +// locationfile6 +// Configuration for location file6 resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationfile6 +func (s *BasicService) AddLocationFile6(resource models.LocationFile6) error { + payload := map[string]any{"locationfile6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// servicegroupbindings -// Configuration for servicegroupbind resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroupbindings -func (s *BasicService) GetAllServiceGroupBindings() {} -func (s *BasicService) GetServiceGroupBindings() {} -func (s *BasicService) CountServiceGroupBindings() {} + req, err := s.client.NewRequest(http.MethodPost, locationFile6URL, bytes.NewReader(data)) + if err != nil { + return err + } -// servicegroup_binding -// Binding object which returns the resources bound to servicegroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_binding -func (s *BasicService) GetAllServiceGroupBinding() {} -func (s *BasicService) GetServiceGroupBinding(serviceGroupName string) ([]models.ServiceGroupBinding, error) { - req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupBindingURL, serviceGroupName), nil) + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteLocationFile6() error { + req, err := s.client.NewRequest(http.MethodDelete, locationFile6URL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllLocationFile6() ([]models.LocationFile6, error) { + req, err := s.client.NewRequest(http.MethodGet, locationFile6URL, nil) if err != nil { return nil, err } @@ -216,73 +356,2051 @@ func (s *BasicService) GetServiceGroupBinding(serviceGroupName string) ([]models } var result struct { - ServiceGroupBinding []models.ServiceGroupBinding `json:"servicegroup_binding"` + LocationFile6 []models.LocationFile6 `json:"locationfile6"` } - if err := json.Unmarshal(resp, &result); err != nil { + err = json.Unmarshal(resp, &result) + if err != nil { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - return result.ServiceGroupBinding, nil + return result.LocationFile6, nil } -// servicegroup_lbmonitor_binding -// Binding object showing the lbmonitor that can be bound to servicegroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_lbmonitor_binding -func (s *BasicService) AddServiceGroupLBMonitorBinding() {} -func (s *BasicService) DeleteServiceGroupLBMonitorBinding() {} -func (s *BasicService) GetAllServiceGroupLBMonitorBinding() {} -func (s *BasicService) GetServiceGroupLBMonitorBinding() {} -func (s *BasicService) CountServiceGroupLBMonitorBinding() {} +// Struct lacks Count field, leaving for later +func (s *BasicService) CountLocationFile6() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, locationFile6URL+"?count=yes", nil) + if err != nil { + return 0, err + } -// servicegroup_servicegroupentitymonbindings_binding -// Binding object showing the servicegroupentitymonbindings that can be bound to servicegroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupentitymonbindings_binding -func (s *BasicService) GetAllServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *BasicService) GetServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *BasicService) CountServiceGroupServiceGroupEntityMonBindingsBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// servicegroup_servicegoupmemberlist_binding -// Binding object showing the servicegroupmemberlist that can be bound to servicegroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupmemberlist_binding -func (s *BasicService) AddServiceGroupServiceGroupMemberListBinding() {} -func (s *BasicService) DeleteServiceGroupServiceGroupMemberListBinding() {} + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"locationfile6"` + } -// servicegroup_servicegroupmember_binding -// Binding object showing the servicegroupmember that can be bound to servicegroup. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupmember_binding -func (s *BasicService) AddServiceGroupServiceGroupMemberBinding() {} -func (s *BasicService) DeleteServiceGroupServiceGroupMemberBinding() {} -func (s *BasicService) GetAllServiceGroupServiceGroupMemberBinding() {} -func (s *BasicService) GetServiceGroupServiceGroupMemberBinding() {} -func (s *BasicService) CountServiceGroupServiceGroupMemberBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// service_binding -// Binding object which returns the resources bound to service. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service_binding -func (s *BasicService) GetAllServiceBinding() {} -func (s *BasicService) GetServiceBinding() {} + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } -// service_lbmonitor_binding -// Binding object showing the lbmonitor that can be bound to service. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service_lbmonitor_binding -func (s *BasicService) AddServiceLBMonitorBinding() {} -func (s *BasicService) DeleteServiceLBMonitorBinding() {} -func (s *BasicService) GetAllServiceLBMonitorBinding() {} -func (s *BasicService) GetServiceLBMonitorBinding() {} -func (s *BasicService) CountServiceLBMonitorBinding() {} + return 0, nil +} -// svcbindings -// Configuration for service bindings resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/svcbindings -func (s *BasicService) GetAllSVCBindings() {} -func (s *BasicService) GetSVCBindings() {} -func (s *BasicService) CountSVCBindings() {} +func (s *BasicService) ImportLocationFile6(resource models.LocationFile6) error { + payload := map[string]any{"locationfile6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vserver -// Configuration for virtual server resource. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/vserver -func (s *BasicService) DeleteVServer() {} -func (s *BasicService) UpdateVServer() {} -func (s *BasicService) EnableVServer() {} -func (s *BasicService) DisableVServer() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=import", locationFile6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// locationparameter +// Configuration for location parameter resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/locationparameter +func (s *BasicService) UpdateLocationParameter(resource models.LocationParameter) error { + payload := map[string]any{"locationparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, locationParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UnsetLocationParameter(resource models.LocationParameter) error { + payload := map[string]any{"locationparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", locationParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllLocationParameter() (models.LocationParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, locationParameterURL, nil) + if err != nil { + return models.LocationParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LocationParameter{}, err + } + + var result struct { + LocationParameter models.LocationParameter `json:"locationparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LocationParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.LocationParameter, nil +} + +// nstrace +// Configuration for nstrace operations resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/nstrace +func (s *BasicService) GetAllNSTrace() ([]models.NSTrace, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTraceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + NSTrace []models.NSTrace `json:"nstrace"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.NSTrace, nil +} + +// radiusnode +// Configuration for RADIUS Node resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/radiusnode +func (s *BasicService) AddRADIUSNode(resource models.RADIUSNode) error { + payload := map[string]any{"radiusnode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, radiusNodeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteRADIUSNode(nodeprefix string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", radiusNodeURL, nodeprefix), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UpdateRADIUSNode(resource models.RADIUSNode) error { + payload := map[string]any{"radiusnode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, radiusNodeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllRADIUSNode() ([]models.RADIUSNode, error) { + req, err := s.client.NewRequest(http.MethodGet, radiusNodeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RADIUSNode []models.RADIUSNode `json:"radiusnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RADIUSNode, nil +} + +func (s *BasicService) GetRADIUSNode(nodeprefix string) (models.RADIUSNode, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", radiusNodeURL, nodeprefix), nil) + if err != nil { + return models.RADIUSNode{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.RADIUSNode{}, err + } + + var result struct { + RADIUSNode []models.RADIUSNode `json:"radiusnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.RADIUSNode{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.RADIUSNode) == 0 { + return models.RADIUSNode{}, fmt.Errorf("radiusnode %s not found", nodeprefix) + } + + return result.RADIUSNode[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountRADIUSNode() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, radiusNodeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"radiusnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// reporting +// Configuration for reporting resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/reporting +func (s *BasicService) EnableReporting() error { + payload := map[string]any{"reporting": models.Reporting{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", reportingURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DisableReporting() error { + payload := map[string]any{"reporting": models.Reporting{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", reportingURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllReporting() (models.Reporting, error) { + req, err := s.client.NewRequest(http.MethodGet, reportingURL, nil) + if err != nil { + return models.Reporting{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Reporting{}, err + } + + var result struct { + Data models.Reporting `json:"reporting"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Reporting{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// server +// Configuration for server resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server +func (s *BasicService) AddServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serverURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", serverURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UpdateServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, serverURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UnsetServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", serverURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) EnableServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", serverURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DisableServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", serverURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllServer() ([]models.Server, error) { + req, err := s.client.NewRequest(http.MethodGet, serverURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Server []models.Server `json:"server"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Server, nil +} + +func (s *BasicService) GetServer(name string) (models.Server, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serverURL, name), nil) + if err != nil { + return models.Server{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Server{}, err + } + + var result struct { + Server []models.Server `json:"server"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Server{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Server) == 0 { + return models.Server{}, fmt.Errorf("server %s not found", name) + } + + return result.Server[0], nil +} + +func (s *BasicService) CountServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", serverURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Server []models.Server `json:"server"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Server) > 0 { + return int(result.Server[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *BasicService) RenameServer(resource models.Server) error { + payload := map[string]any{"server": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", serverURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// server_binding +// Binding object which returns the resources bound to server. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_binding +func (s *BasicService) GetAllServerBinding() ([]models.ServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serverBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerBinding []models.ServerBinding `json:"server_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerBinding, nil +} + +func (s *BasicService) GetServerBinding(name string) (models.ServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serverBindingURL, name), nil) + if err != nil { + return models.ServerBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ServerBinding{}, err + } + + var result struct { + ServerBinding []models.ServerBinding `json:"server_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ServerBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ServerBinding) == 0 { + return models.ServerBinding{}, fmt.Errorf("server_binding %s not found", name) + } + + return result.ServerBinding[0], nil +} + +// server_gslbservicegroup_binding +// Binding object showing the gslbservicegroup that can be bound to server. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_gslbservicegroup_binding +func (s *BasicService) GetAllServerGSLBServiceGroupBinding() ([]models.ServerGSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serverGSLBServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerGSLBServiceGroupBinding []models.ServerGSLBServiceGroupBinding `json:"server_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerGSLBServiceGroupBinding, nil +} + +func (s *BasicService) GetServerGSLBServiceGroupBinding(name string) ([]models.ServerGSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serverGSLBServiceGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerGSLBServiceGroupBinding []models.ServerGSLBServiceGroupBinding `json:"server_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerGSLBServiceGroupBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServerGSLBServiceGroupBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serverGSLBServiceGroupBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"server_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// server_gslbservice_binding +// Binding object showing the gslbservice that can be bound to server. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_gslbservice_binding +func (s *BasicService) GetAllServerGSLBServiceBinding() ([]models.ServerGSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serverGSLBServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerGSLBServiceBinding []models.ServerGSLBServiceBinding `json:"server_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerGSLBServiceBinding, nil +} + +func (s *BasicService) GetServerGSLBServiceBinding(name string) ([]models.ServerGSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", serverGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerGSLBServiceBinding []models.ServerGSLBServiceBinding `json:"server_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerGSLBServiceBinding, nil +} + +func (s *BasicService) CountServerGSLBServiceBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serverGSLBServiceBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"server_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// server_servicegroup_binding +// Binding object showing the servicegroup that can be bound to server. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_servicegroup_binding +func (s *BasicService) GetAllServerServiceGroupBinding() ([]models.ServerServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serverServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerServiceGroupBinding []models.ServerServiceGroupBinding `json:"server_servicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerServiceGroupBinding, nil +} + +func (s *BasicService) GetServerServiceGroupBinding(name string) ([]models.ServerServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", serverServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerServiceGroupBinding []models.ServerServiceGroupBinding `json:"server_servicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerServiceGroupBinding, nil +} + +func (s *BasicService) CountServerServiceGroupBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serverServiceGroupBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"server_servicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// server_service_binding +// Binding object showing the service that can be bound to server. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/server_service_binding +func (s *BasicService) GetAllServerServiceBinding() ([]models.ServerServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serverServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerServiceBinding []models.ServerServiceBinding `json:"server_service_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerServiceBinding, nil +} + +func (s *BasicService) GetServerServiceBinding(name string) ([]models.ServerServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", serverServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServerServiceBinding []models.ServerServiceBinding `json:"server_service_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServerServiceBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServerServiceBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serverServiceBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"server_service_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// service +// Configuration for service resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service +func (s *BasicService) AddService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, serviceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteService(name string) error { + reqURL := fmt.Sprintf("%s/%s", serviceURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UpdateService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, serviceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UnsetService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, serviceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) EnableService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, serviceURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DisableService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, serviceURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllService() ([]models.Service, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Services []models.Service `json:"service"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Services, nil +} + +func (s *BasicService) GetService(name string) (*models.Service, error) { + reqURL := fmt.Sprintf("%s/%s", serviceURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Services []models.Service `json:"service"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Services) == 0 { + return nil, fmt.Errorf("service not found") + } + + return &result.Services[0], nil +} + +func (s *BasicService) CountService() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Services []struct { + Count float64 `json:"__count"` + } `json:"service"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Services) > 0 { + return result.Services[0].Count, nil + } + + return 0, nil +} + +func (s *BasicService) RenameService(resource models.Service) error { + payload := map[string]interface{}{ + "service": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, serviceURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// servicegroup +// Configuration for service group resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup +func (s *BasicService) AddServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serviceGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServiceGroup(servicegroupname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", serviceGroupURL, servicegroupname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UpdateServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, serviceGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UnsetServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", serviceGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) EnableServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", serviceGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DisableServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", serviceGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllServiceGroup() ([]models.ServiceGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroup []models.ServiceGroup `json:"servicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroup, nil +} + +func (s *BasicService) GetServiceGroup(servicegroupname string) (models.ServiceGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupURL, servicegroupname), nil) + if err != nil { + return models.ServiceGroup{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ServiceGroup{}, err + } + + var result struct { + ServiceGroup []models.ServiceGroup `json:"servicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ServiceGroup{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ServiceGroup) == 0 { + return models.ServiceGroup{}, fmt.Errorf("servicegroup %s not found", servicegroupname) + } + + return result.ServiceGroup[0], nil +} + +func (s *BasicService) CountServiceGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", serviceGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + ServiceGroup []models.ServiceGroup `json:"servicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ServiceGroup) > 0 { + return int(result.ServiceGroup[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *BasicService) RenameServiceGroup(resource models.ServiceGroup) error { + payload := map[string]any{"servicegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", serviceGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// servicegroupbindings +// Configuration for servicegroupbind resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroupbindings +func (s *BasicService) GetAllServiceGroupBindings() ([]models.ServiceGroupBindings, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupBindingsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupBindings []models.ServiceGroupBindings `json:"servicegroupbindings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupBindings, nil +} + +func (s *BasicService) GetServiceGroupBindings(servicegroupname string) (models.ServiceGroupBindings, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupBindingsURL, servicegroupname), nil) + if err != nil { + return models.ServiceGroupBindings{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ServiceGroupBindings{}, err + } + + var result struct { + ServiceGroupBindings []models.ServiceGroupBindings `json:"servicegroupbindings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ServiceGroupBindings{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ServiceGroupBindings) == 0 { + return models.ServiceGroupBindings{}, fmt.Errorf("servicegroupbindings %s not found", servicegroupname) + } + + return result.ServiceGroupBindings[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServiceGroupBindings() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupBindingsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"servicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// servicegroup_binding +// Binding object which returns the resources bound to servicegroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_binding +func (s *BasicService) GetAllServiceGroupBinding() ([]models.ServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupBinding []models.ServiceGroupBinding `json:"servicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupBinding, nil +} + +func (s *BasicService) GetServiceGroupBinding(serviceGroupName string) ([]models.ServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupBindingURL, serviceGroupName), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupBinding []models.ServiceGroupBinding `json:"servicegroup_binding"` + } + + if err := json.Unmarshal(resp, &result); err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupBinding, nil +} + +// servicegroup_lbmonitor_binding +// Binding object showing the lbmonitor that can be bound to servicegroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_lbmonitor_binding +func (s *BasicService) AddServiceGroupLBMonitorBinding(resource models.ServiceGroupLBMonitorBinding) error { + payload := map[string]any{"servicegroup_lbmonitor_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serviceGroupLBMonitorBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServiceGroupLBMonitorBinding(servicegroupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", serviceGroupLBMonitorBindingURL, servicegroupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllServiceGroupLBMonitorBinding() ([]models.ServiceGroupLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupLBMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupLBMonitorBinding []models.ServiceGroupLBMonitorBinding `json:"servicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupLBMonitorBinding, nil +} + +func (s *BasicService) GetServiceGroupLBMonitorBinding(servicegroupname string) ([]models.ServiceGroupLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupLBMonitorBindingURL, servicegroupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupLBMonitorBinding []models.ServiceGroupLBMonitorBinding `json:"servicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupLBMonitorBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServiceGroupLBMonitorBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupLBMonitorBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"servicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// servicegroup_servicegroupentitymonbindings_binding +// Binding object showing the servicegroupentitymonbindings that can be bound to servicegroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupentitymonbindings_binding +func (s *BasicService) GetAllServiceGroupServiceGroupEntityMonBindingsBinding() ([]models.ServiceGroupServiceGroupEntityMonBindingsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupServiceGroupEntityMonBindingsBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupServiceGroupEntityMonBindingsBinding []models.ServiceGroupServiceGroupEntityMonBindingsBinding `json:"servicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupServiceGroupEntityMonBindingsBinding, nil +} + +func (s *BasicService) GetServiceGroupServiceGroupEntityMonBindingsBinding(servicegroupname string) ([]models.ServiceGroupServiceGroupEntityMonBindingsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupServiceGroupEntityMonBindingsBindingURL, servicegroupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupServiceGroupEntityMonBindingsBinding []models.ServiceGroupServiceGroupEntityMonBindingsBinding `json:"servicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupServiceGroupEntityMonBindingsBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServiceGroupServiceGroupEntityMonBindingsBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupServiceGroupEntityMonBindingsBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"servicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// servicegroup_servicegroupmemberlist_binding +// Binding object showing the servicegroupmemberlist that can be bound to servicegroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupmemberlist_binding +func (s *BasicService) AddServiceGroupServiceGroupMemberListBinding(resource models.ServiceGroupServiceGroupMemberListBinding) error { + payload := map[string]any{"servicegroup_servicegroupmemberlist_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serviceGroupServiceGroupMemberListBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServiceGroupServiceGroupMemberListBinding(servicegroupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", serviceGroupServiceGroupMemberListBindingURL, servicegroupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// servicegroup_servicegroupmember_binding +// Binding object showing the servicegroupmember that can be bound to servicegroup. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/servicegroup_servicegroupmember_binding +func (s *BasicService) AddServiceGroupServiceGroupMemberBinding(resource models.ServiceGroupServiceGroupMemberBinding) error { + payload := map[string]any{"servicegroup_servicegroupmember_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serviceGroupServiceGroupMemberBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServiceGroupServiceGroupMemberBinding(servicegroupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", serviceGroupServiceGroupMemberBindingURL, servicegroupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllServiceGroupServiceGroupMemberBinding() ([]models.ServiceGroupServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupServiceGroupMemberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupServiceGroupMemberBinding []models.ServiceGroupServiceGroupMemberBinding `json:"servicegroup_servicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupServiceGroupMemberBinding, nil +} + +func (s *BasicService) GetServiceGroupServiceGroupMemberBinding(servicegroupname string) ([]models.ServiceGroupServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceGroupServiceGroupMemberBindingURL, servicegroupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceGroupServiceGroupMemberBinding []models.ServiceGroupServiceGroupMemberBinding `json:"servicegroup_servicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceGroupServiceGroupMemberBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServiceGroupServiceGroupMemberBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceGroupServiceGroupMemberBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"servicegroup_servicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// service_binding +// Binding object which returns the resources bound to service. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service_binding +func (s *BasicService) GetAllServiceBinding() ([]models.ServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceBinding []models.ServiceBinding `json:"service_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceBinding, nil +} + +func (s *BasicService) GetServiceBinding(name string) (models.ServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceBindingURL, name), nil) + if err != nil { + return models.ServiceBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ServiceBinding{}, err + } + + var result struct { + ServiceBinding []models.ServiceBinding `json:"service_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ServiceBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ServiceBinding) == 0 { + return models.ServiceBinding{}, fmt.Errorf("service_binding %s not found", name) + } + + return result.ServiceBinding[0], nil +} + +// service_lbmonitor_binding +// Binding object showing the lbmonitor that can be bound to service. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/service_lbmonitor_binding +func (s *BasicService) AddServiceLBMonitorBinding(resource models.ServiceLBMonitorBinding) error { + payload := map[string]any{"service_lbmonitor_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, serviceLBMonitorBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DeleteServiceLBMonitorBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", serviceLBMonitorBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) GetAllServiceLBMonitorBinding() ([]models.ServiceLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceLBMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceLBMonitorBinding []models.ServiceLBMonitorBinding `json:"service_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceLBMonitorBinding, nil +} + +func (s *BasicService) GetServiceLBMonitorBinding(name string) ([]models.ServiceLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", serviceLBMonitorBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ServiceLBMonitorBinding []models.ServiceLBMonitorBinding `json:"service_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ServiceLBMonitorBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountServiceLBMonitorBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, serviceLBMonitorBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"service_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// svcbindings +// Configuration for service bindings resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/svcbindings +func (s *BasicService) GetAllSVCBindings() ([]models.SVCBindings, error) { + req, err := s.client.NewRequest(http.MethodGet, svcBindingsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SVCBindings []models.SVCBindings `json:"svcbindings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SVCBindings, nil +} + +func (s *BasicService) GetSVCBindings(name string) ([]models.SVCBindings, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", svcBindingsURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SVCBindings []models.SVCBindings `json:"svcbindings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SVCBindings, nil +} + +// Struct lacks Count field, leaving for later +func (s *BasicService) CountSVCBindings() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, svcBindingsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"svcbindings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// vserver +// Configuration for virtual server resource. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/basic/vserver +func (s *BasicService) DeleteVServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vServerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) UpdateVServer(resource models.VServer) error { + payload := map[string]any{"vserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) EnableVServer(resource models.VServer) error { + payload := map[string]any{"vserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", vServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *BasicService) DisableVServer(resource models.VServer) error { + payload := map[string]any{"vserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", vServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/bfd.go b/nitrogo/bfd.go index 4b18301..77bff85 100644 --- a/nitrogo/bfd.go +++ b/nitrogo/bfd.go @@ -1,5 +1,13 @@ package nitrogo +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( bfdSessionURL = "/nitro/v1/config/bfdsession" ) @@ -13,5 +21,55 @@ type BFDService struct { // bfdsession // Configuration for BFD configuration resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/bfd/bfdsession -func (s *BFDService) GetAllBFDSession() {} -func (s *BFDService) CountBFDSession() {} + +func (s *BFDService) GetAllBFDSession() ([]models.BFDSession, error) { + req, err := s.client.NewRequest(http.MethodGet, bfdSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + BFDSessions []models.BFDSession `json:"bfdsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.BFDSessions, nil +} + +func (s *BFDService) CountBFDSession() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, bfdSessionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + BFDSessions []struct { + Count float64 `json:"__count"` + } `json:"bfdsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.BFDSessions) > 0 { + return result.BFDSessions[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/bot.go b/nitrogo/bot.go index 55fa163..29eabba 100644 --- a/nitrogo/bot.go +++ b/nitrogo/bot.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( botGlobalBindingURL = "/nitro/v1/config/botglobal_binding" botGlobalBotPolicyBindingURL = "/nitro/v1/config/botglobal_botpolicy_binding" @@ -32,135 +42,1716 @@ type BotService struct { } // botglobal_binding -func (s *BotService) GetBotGlobalBinding() {} + +func (s *BotService) GetBotGlobalBinding() ([]models.BotGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotGlobalBinding `json:"botglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // botglobal_botpolicy_binding -func (s *BotService) AddBotGlobalBotPolicyBinding() {} -func (s *BotService) DeleteBotGlobalBotPolicyBinding() {} -func (s *BotService) GetBotGlobalBotPolicyBinding() {} -func (s *BotService) CountBotGlobalBotPolicyBinding() {} + +func (s *BotService) AddBotGlobalBotPolicyBinding(binding models.BotGlobalBotPolicyBinding) error { + payload := map[string]any{ + "botglobal_botpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botGlobalBotPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotGlobalBotPolicyBinding(policyname, typeField string, priority int) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s,type:%s,priority:%d", botGlobalBotPolicyBindingURL, url.QueryEscape(policyname), url.QueryEscape(typeField), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetBotGlobalBotPolicyBinding() ([]models.BotGlobalBotPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botGlobalBotPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotGlobalBotPolicyBinding `json:"botglobal_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotGlobalBotPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, botGlobalBotPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botglobal_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botpolicy -func (s *BotService) AddBotPolicy() {} -func (s *BotService) DeleteBotPolicy() {} -func (s *BotService) UpdateBotPolicy() {} -func (s *BotService) UnsetBotPolicy() {} -func (s *BotService) GetAllBotPolicy() {} -func (s *BotService) GetBotPolicy() {} -func (s *BotService) CountBotPolicy() {} -func (s *BotService) RenameBotPolicy() {} + +func (s *BotService) AddBotPolicy(policy models.BotPolicy) error { + payload := map[string]any{ + "botpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", botPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) UpdateBotPolicy(policy models.BotPolicy) error { + payload := map[string]any{ + "botpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) UnsetBotPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "botpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) RenameBotPolicy(name, newname string) error { + payload := map[string]any{ + "botpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotPolicy() ([]models.BotPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.BotPolicy `json:"botpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *BotService) GetBotPolicy(name string) ([]models.BotPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.BotPolicy `json:"botpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *BotService) CountBotPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"botpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // botpolicylabel -func (s *BotService) AddBotPolicyLabel() {} -func (s *BotService) DeleteBotPolicyLabel() {} -func (s *BotService) GetAllBotPolicyLabel() {} -func (s *BotService) GetBotPolicyLabel() {} -func (s *BotService) CountBotPolicyLabel() {} -func (s *BotService) RenameBotPolicyLabel() {} + +func (s *BotService) AddBotPolicyLabel(label models.BotPolicyLabel) error { + payload := map[string]any{ + "botpolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotPolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", botPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) RenameBotPolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "botpolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotPolicyLabel() ([]models.BotPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.BotPolicyLabel `json:"botpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *BotService) GetBotPolicyLabel(labelname string) ([]models.BotPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.BotPolicyLabel `json:"botpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *BotService) CountBotPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"botpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} // botpolicylabel_binding -func (s *BotService) GetAllBotPolicyLabelBinding() {} -func (s *BotService) GetBotPolicyLabelBinding() {} + +func (s *BotService) GetAllBotPolicyLabelBinding() ([]models.BotPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelBinding `json:"botpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyLabelBinding(labelname string) ([]models.BotPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelBinding `json:"botpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // botpolicylabel_botpolicy_binding -func (s *BotService) AddBotPolicyLabelBotPolicyBinding() {} -func (s *BotService) DeleteBotPolicyLabelBotPolicyBinding() {} -func (s *BotService) GetAllBotPolicyLabelBotPolicyBinding() {} -func (s *BotService) GetBotPolicyLabelBotPolicyBinding() {} -func (s *BotService) CountBotPolicyLabelBotPolicyBinding() {} + +func (s *BotService) AddBotPolicyLabelBotPolicyBinding(binding models.BotPolicyLabelBotPolicyBinding) error { + payload := map[string]any{ + "botpolicylabel_botpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botPolicyLabelBotPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotPolicyLabelBotPolicyBinding(labelname, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", botPolicyLabelBotPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotPolicyLabelBotPolicyBinding() ([]models.BotPolicyLabelBotPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLabelBotPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelBotPolicyBinding `json:"botpolicylabel_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyLabelBotPolicyBinding(labelname string) ([]models.BotPolicyLabelBotPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyLabelBotPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelBotPolicyBinding `json:"botpolicylabel_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyLabelBotPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyLabelBotPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicylabel_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botpolicylabel_policybinding_binding -func (s *BotService) GetAllBotPolicyLabelPolicyBindingBinding() {} -func (s *BotService) GetBotPolicyLabelPolicyBindingBinding() {} -func (s *BotService) CountBotPolicyLabelPolicyBindingBinding() {} -// botpolcy_binding -func (s *BotService) GetAllBotPolicyBinding() {} -func (s *BotService) GetBotPolicyBinding() {} +func (s *BotService) GetAllBotPolicyLabelPolicyBindingBinding() ([]models.BotPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelPolicyBindingBinding `json:"botpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyLabelPolicyBindingBinding(labelname string) ([]models.BotPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLabelPolicyBindingBinding `json:"botpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyLabelPolicyBindingBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// botpolicy_binding + +func (s *BotService) GetAllBotPolicyBinding() ([]models.BotPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBinding `json:"botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyBinding(name string) ([]models.BotPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBinding `json:"botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // botpolicy_botglobal_binding -func (s *BotService) GetAllBotPolicyBotGlobalBinding() {} -func (s *BotService) GetBotPolicyBotGlobalBinding() {} -func (s *BotService) CountBotPolicyBotGlobalBinding() {} -// gotpolicy_botpolicylabel_binding -func (s *BotService) GetAllBotPolicyBotPolicyLabelBinding() {} -func (s *BotService) GetBotPolicyBotPolicyLabelBinding() {} -func (s *BotService) CountBotPolicyBotPolicyLabelBinding() {} +func (s *BotService) GetAllBotPolicyBotGlobalBinding() ([]models.BotPolicyBotGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyBotGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBotGlobalBinding `json:"botpolicy_botglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyBotGlobalBinding(name string) ([]models.BotPolicyBotGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyBotGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBotGlobalBinding `json:"botpolicy_botglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyBotGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyBotGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicy_botglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// botpolicy_botpolicylabel_binding + +func (s *BotService) GetAllBotPolicyBotPolicyLabelBinding() ([]models.BotPolicyBotPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyBotPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBotPolicyLabelBinding `json:"botpolicy_botpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyBotPolicyLabelBinding(name string) ([]models.BotPolicyBotPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyBotPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyBotPolicyLabelBinding `json:"botpolicy_botpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyBotPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyBotPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicy_botpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botpolicy_csvserver_binding -func (s *BotService) GetAllBotPolicyCSVServerBinding() {} -func (s *BotService) GetBotPolicyCSVServerBinding() {} -func (s *BotService) CountBotPolicyCSVServerBinding() {} + +func (s *BotService) GetAllBotPolicyCSVServerBinding() ([]models.BotPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyCSVServerBinding `json:"botpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyCSVServerBinding(name string) ([]models.BotPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyCSVServerBinding `json:"botpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botpolicy_lbvserver_binding -func (s *BotService) GetAllBotPolicyLBVServerBinding() {} -func (s *BotService) GetBotPolicyLBVServerBinding() {} -func (s *BotService) CountBotPolicyLBVServerBinding() {} + +func (s *BotService) GetAllBotPolicyLBVServerBinding() ([]models.BotPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLBVServerBinding `json:"botpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotPolicyLBVServerBinding(name string) ([]models.BotPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotPolicyLBVServerBinding `json:"botpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile -func (s *BotService) AddBotProfile() {} -func (s *BotService) DeleteBotProfile() {} -func (s *BotService) UpdateBotProfile() {} -func (s *BotService) UnsetBotProfile() {} -func (s *BotService) GetAllBotProfile() {} -func (s *BotService) GetBotProfile() {} -func (s *BotService) CountBotProfile() {} + +func (s *BotService) AddBotProfile(profile models.BotProfile) error { + payload := map[string]any{ + "botprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", botProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) UpdateBotProfile(profile models.BotProfile) error { + payload := map[string]any{ + "botprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) UnsetBotProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "botprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfile() ([]models.BotProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.BotProfile `json:"botprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *BotService) GetBotProfile(name string) ([]models.BotProfile, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.BotProfile `json:"botprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *BotService) CountBotProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"botprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + return 0, nil +} // botprofile_binding -func (s *BotService) GetAllBotProfileBinding() {} -func (s *BotService) GetBotProfileBinding() {} + +func (s *BotService) GetAllBotProfileBinding() ([]models.BotProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileBinding `json:"botprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileBinding(name string) ([]models.BotProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileBinding `json:"botprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // botprofile_blacklist_binding -func (s *BotService) AddBotProfileBlacklistBinding() {} -func (s *BotService) DeleteBotProfileBlacklistBinding() {} -func (s *BotService) GetAllBotProfileBlacklistBinding() {} -func (s *BotService) GetBotProfileBlacklistBinding() {} -func (s *BotService) CountBotProfileBlacklistBinding() {} + +func (s *BotService) AddBotProfileBlacklistBinding(binding models.BotProfileBlacklistBinding) error { + payload := map[string]any{ + "botprofile_blacklist_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileBlacklistBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileBlacklistBinding(name, blacklistType, blacklistValue string) error { + reqURL := fmt.Sprintf("%s/%s?args=bot_blacklist_type:%s,bot_blacklist_value:%s", botProfileBlacklistBindingURL, url.QueryEscape(name), url.QueryEscape(blacklistType), url.QueryEscape(blacklistValue)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileBlacklistBinding() ([]models.BotProfileBlacklistBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileBlacklistBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileBlacklistBinding `json:"botprofile_blacklist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileBlacklistBinding(name string) ([]models.BotProfileBlacklistBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileBlacklistBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileBlacklistBinding `json:"botprofile_blacklist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileBlacklistBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileBlacklistBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_blacklist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile_captcha_binding -func (s *BotService) AddBotProfileCaptchaBinding() {} -func (s *BotService) DeleteBotProfileCaptchaBinding() {} -func (s *BotService) GetAllBotProfileCaptchaBinding() {} -func (s *BotService) GetBotProfileCaptchaBinding() {} -func (s *BotService) CountBotProfileCaptchaBinding() {} + +func (s *BotService) AddBotProfileCaptchaBinding(binding models.BotProfileCaptchaBinding) error { + payload := map[string]any{ + "botprofile_captcha_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileCaptchaBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileCaptchaBinding(name, captchaURL string) error { + reqURL := fmt.Sprintf("%s/%s?args=bot_captcha_url:%s", botProfileCaptchaBindingURL, url.QueryEscape(name), url.QueryEscape(captchaURL)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileCaptchaBinding() ([]models.BotProfileCaptchaBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileCaptchaBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileCaptchaBinding `json:"botprofile_captcha_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileCaptchaBinding(name string) ([]models.BotProfileCaptchaBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileCaptchaBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileCaptchaBinding `json:"botprofile_captcha_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileCaptchaBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileCaptchaBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_captcha_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile_ipreputation_binding -func (s *BotService) AddBotProfileIPReputationBinding() {} -func (s *BotService) DeleteBotProfileIPReputationBinding() {} -func (s *BotService) GetAllBotProfileIPReputationBinding() {} -func (s *BotService) GetBotProfileIPReputationBinding() {} -func (s *BotService) CountBotProfileIPReputationBinding() {} + +func (s *BotService) AddBotProfileIPReputationBinding(binding models.BotProfileIPReputationBinding) error { + payload := map[string]any{ + "botprofile_ipreputation_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileIPReputationBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileIPReputationBinding(name, category string) error { + reqURL := fmt.Sprintf("%s/%s?args=category:%s", botProfileIPReputationBindingURL, url.QueryEscape(name), url.QueryEscape(category)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileIPReputationBinding() ([]models.BotProfileIPReputationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileIPReputationBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileIPReputationBinding `json:"botprofile_ipreputation_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileIPReputationBinding(name string) ([]models.BotProfileIPReputationBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileIPReputationBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileIPReputationBinding `json:"botprofile_ipreputation_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileIPReputationBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileIPReputationBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_ipreputation_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile_ratelimit_binding -func (s *BotService) AddBotProfileRatelimitBinding() {} -func (s *BotService) DeleteBotProfileRatelimitBinding() {} -func (s *BotService) GetAllBotProfileRatelimitBinding() {} -func (s *BotService) GetBotProfileRatelimitBinding() {} -func (s *BotService) CountBotProfileRatelimitBinding() {} + +func (s *BotService) AddBotProfileRatelimitBinding(binding models.BotProfileRateLimitBinding) error { + payload := map[string]any{ + "botprofile_ratelimit_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileRatelimitBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileRatelimitBinding(name, limitType, botRateLimitURL string) error { + reqURL := fmt.Sprintf("%s/%s?args=bot_rate_limit_type:%s,bot_rate_limit_url:%s", botProfileRatelimitBindingURL, url.QueryEscape(name), url.QueryEscape(limitType), url.QueryEscape(botRateLimitURL)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileRatelimitBinding() ([]models.BotProfileRateLimitBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileRatelimitBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileRateLimitBinding `json:"botprofile_ratelimit_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileRatelimitBinding(name string) ([]models.BotProfileRateLimitBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileRatelimitBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileRateLimitBinding `json:"botprofile_ratelimit_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileRatelimitBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileRatelimitBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_ratelimit_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile_tps_binding -func (s *BotService) AddBotProfileTPSBinding() {} -func (s *BotService) DeleteBotProfileTPSBinding() {} -func (s *BotService) GetAllBotProfileTPSBinding() {} -func (s *BotService) GetBotProfileTPSBinding() {} -func (s *BotService) CountBotProfileTPSBinding() {} + +func (s *BotService) AddBotProfileTPSBinding(binding models.BotProfileTPSBinding) error { + payload := map[string]any{ + "botprofile_tps_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileTPSBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileTPSBinding(name, tpsType string) error { + reqURL := fmt.Sprintf("%s/%s?args=bot_tps_type:%s", botProfileTPSBindingURL, url.QueryEscape(name), url.QueryEscape(tpsType)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileTPSBinding() ([]models.BotProfileTPSBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileTPSBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileTPSBinding `json:"botprofile_tps_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileTPSBinding(name string) ([]models.BotProfileTPSBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileTPSBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileTPSBinding `json:"botprofile_tps_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileTPSBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileTPSBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_tps_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botprofile_whitelist_binding -func (s *BotService) AddBotProfileWhitelistBinding() {} -func (s *BotService) DeleteBotProfileWhitelistBinding() {} -func (s *BotService) GetAllBotProfileWhitelistBinding() {} -func (s *BotService) GetBotProfileWhitelistBinding() {} -func (s *BotService) CountBotProfileWhitelistBinding() {} + +func (s *BotService) AddBotProfileWhitelistBinding(binding models.BotProfileWhitelistBinding) error { + payload := map[string]any{ + "botprofile_whitelist_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botProfileWhitelistBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotProfileWhitelistBinding(name, whitelistType, whitelistValue string) error { + reqURL := fmt.Sprintf("%s/%s?args=bot_whitelist_type:%s,bot_whitelist_value:%s", botProfileWhitelistBindingURL, url.QueryEscape(name), url.QueryEscape(whitelistType), url.QueryEscape(whitelistValue)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotProfileWhitelistBinding() ([]models.BotProfileWhitelistBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, botProfileWhitelistBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileWhitelistBinding `json:"botprofile_whitelist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) GetBotProfileWhitelistBinding(name string) ([]models.BotProfileWhitelistBinding, error) { + reqURL := fmt.Sprintf("%s/%s", botProfileWhitelistBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.BotProfileWhitelistBinding `json:"botprofile_whitelist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *BotService) CountBotProfileWhitelistBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", botProfileWhitelistBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"botprofile_whitelist_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // botsettings -func (s *BotService) UpdateBotSettings() {} -func (s *BotService) UnsetBotSettings() {} -func (s *BotService) GetAllBotSettings() {} + +func (s *BotService) UpdateBotSettings(settings models.BotSettings) error { + payload := map[string]any{ + "botsettings": settings, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, botSettingsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) UnsetBotSettings(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "botsettings": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botSettingsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotSettings() (models.BotSettings, error) { + req, err := s.client.NewRequest(http.MethodGet, botSettingsURL, nil) + if err != nil { + return models.BotSettings{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.BotSettings{}, err + } + var result struct { + Settings []models.BotSettings `json:"botsettings"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.BotSettings{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Settings) > 0 { + return result.Settings[0], nil + } + return models.BotSettings{}, nil +} // botsignature -func (s *BotService) ImportBotSignature() {} -func (s *BotService) DeleteBotSignature() {} -func (s *BotService) ChangeBotSignature() {} -func (s *BotService) GetAllBotSignature() {} -func (s *BotService) GetBotSignature() {} + +func (s *BotService) ImportBotSignature(signature models.BotSignature) error { + payload := map[string]any{ + "botsignature": signature, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botSignatureURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) DeleteBotSignature(name string) error { + reqURL := fmt.Sprintf("%s/%s", botSignatureURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) ChangeBotSignature(signature models.BotSignature) error { + payload := map[string]any{ + "botsignature": signature, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, botSignatureURL+"?action=update", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *BotService) GetAllBotSignature() ([]models.BotSignature, error) { + req, err := s.client.NewRequest(http.MethodGet, botSignatureURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Signatures []models.BotSignature `json:"botsignature"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Signatures, nil +} + +func (s *BotService) GetBotSignature(name string) ([]models.BotSignature, error) { + reqURL := fmt.Sprintf("%s/%s", botSignatureURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Signatures []models.BotSignature `json:"botsignature"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Signatures, nil +} diff --git a/nitrogo/cache.go b/nitrogo/cache.go index 98b22be..1d4584c 100644 --- a/nitrogo/cache.go +++ b/nitrogo/cache.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( cacheContentGroupURL = "/nitro/v1/config/cachecontentgroup" cacheForwardProxyURL = "/nitro/v1/config/cacheforwardproxy" @@ -27,106 +37,1359 @@ type CacheService struct { } // cachecontentgroup -func (s *CacheService) AddCacheContentGroup() {} -func (s *CacheService) DeleteCacheContentGroup() {} -func (s *CacheService) UpdateCacheContentGroup() {} -func (s *CacheService) UnsetCacheContentGroup() {} -func (s *CacheService) GetAllCacheContentGroup() {} -func (s *CacheService) GetCacheContentGroup() {} -func (s *CacheService) CountCacheContentGroup() {} -func (s *CacheService) ExpireCacheContentGroup() {} -func (s *CacheService) FlushCacheContentGroup() {} -func (s *CacheService) SaveCacheContentGroup() {} + +func (s *CacheService) AddCacheContentGroup(group models.CacheContentGroup) error { + payload := map[string]any{ + "cachecontentgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheContentGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCacheContentGroup(name string) error { + reqURL := fmt.Sprintf("%s/%s", cacheContentGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UpdateCacheContentGroup(group models.CacheContentGroup) error { + payload := map[string]any{ + "cachecontentgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cacheContentGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UnsetCacheContentGroup(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "cachecontentgroup": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheContentGroupURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCacheContentGroup() ([]models.CacheContentGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheContentGroupURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Groups []models.CacheContentGroup `json:"cachecontentgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Groups, nil +} + +func (s *CacheService) GetCacheContentGroup(name string) ([]models.CacheContentGroup, error) { + reqURL := fmt.Sprintf("%s/%s", cacheContentGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Groups []models.CacheContentGroup `json:"cachecontentgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Groups, nil +} + +func (s *CacheService) CountCacheContentGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheContentGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Groups []struct { + Count float64 `json:"__count"` + } `json:"cachecontentgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Groups) > 0 { + return result.Groups[0].Count, nil + } + return 0, nil +} + +func (s *CacheService) ExpireCacheContentGroup(group models.CacheContentGroup) error { + payload := map[string]any{ + "cachecontentgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheContentGroupURL+"?action=expire", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) FlushCacheContentGroup(group models.CacheContentGroup) error { + payload := map[string]any{ + "cachecontentgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheContentGroupURL+"?action=flush", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) SaveCacheContentGroup(group models.CacheContentGroup) error { + payload := map[string]any{ + "cachecontentgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheContentGroupURL+"?action=save", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cacheforwardproxy -func (s *CacheService) AddCacheForwardProxy() {} -func (s *CacheService) DeleteCacheForwardProxy() {} -func (s *CacheService) GetAllCacheForwardProxy() {} -func (s *CacheService) CountCacheForwardProxy() {} + +func (s *CacheService) AddCacheForwardProxy(proxy models.CacheForwardProxy) error { + payload := map[string]any{ + "cacheforwardproxy": proxy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheForwardProxyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCacheForwardProxy(ipaddress string, port int) error { + reqURL := fmt.Sprintf("%s/%s?args=port:%d", cacheForwardProxyURL, url.QueryEscape(ipaddress), port) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCacheForwardProxy() ([]models.CacheForwardProxy, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheForwardProxyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Proxies []models.CacheForwardProxy `json:"cacheforwardproxy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Proxies, nil +} + +func (s *CacheService) CountCacheForwardProxy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheForwardProxyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Proxies []struct { + Count float64 `json:"__count"` + } `json:"cacheforwardproxy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Proxies) > 0 { + return result.Proxies[0].Count, nil + } + return 0, nil +} // cacheglobal_binding -func (s *CacheService) GetCacheGlobalBinding() {} + +func (s *CacheService) GetCacheGlobalBinding() ([]models.CacheGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CacheGlobalBinding `json:"cacheglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cacheglobal_cachepolicy_binding -func (s *CacheService) AddCacheGlobalCachePolicyBinding() {} -func (s *CacheService) DeleteCacheGlobalCachePolicyBinding() {} -func (s *CacheService) GetCacheGlobalCachePolicyBinding() {} -func (s *CacheService) CountCacheGlobalCachePolicyBinding() {} + +func (s *CacheService) AddCacheGlobalCachePolicyBinding(binding models.CacheGlobalCachePolicyBinding) error { + payload := map[string]any{ + "cacheglobal_cachepolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cacheGlobalCachePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCacheGlobalCachePolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policy:%s", cacheGlobalCachePolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetCacheGlobalCachePolicyBinding() ([]models.CacheGlobalCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheGlobalCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CacheGlobalCachePolicyBinding `json:"cacheglobal_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCacheGlobalCachePolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheGlobalCachePolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cacheglobal_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cacheobject -func (s *CacheService) GetAllCacheObject() {} -func (s *CacheService) CountCacheObject() {} -func (s *CacheService) FlushCacheObject() {} -func (s *CacheService) ExpireCacheObject() {} -func (s *CacheService) SaveCacheObject() {} + +func (s *CacheService) GetAllCacheObject() ([]models.CacheObject, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheObjectURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Objects []models.CacheObject `json:"cacheobject"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Objects, nil +} + +func (s *CacheService) CountCacheObject() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheObjectURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Objects []struct { + Count float64 `json:"__count"` + } `json:"cacheobject"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Objects) > 0 { + return result.Objects[0].Count, nil + } + return 0, nil +} + +func (s *CacheService) FlushCacheObject(object models.CacheObject) error { + payload := map[string]any{ + "cacheobject": object, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheObjectURL+"?action=flush", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) ExpireCacheObject(object models.CacheObject) error { + payload := map[string]any{ + "cacheobject": object, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheObjectURL+"?action=expire", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) SaveCacheObject(object models.CacheObject) error { + payload := map[string]any{ + "cacheobject": object, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheObjectURL+"?action=save", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cacheparameter -func (s *CacheService) UpdateCacheParameter() {} -func (s *CacheService) UnsetCacheParameter() {} -func (s *CacheService) GetAllCacheParameter() {} + +func (s *CacheService) UpdateCacheParameter(param models.CacheParameter) error { + payload := map[string]any{ + "cacheparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cacheParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UnsetCacheParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "cacheparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCacheParameter() (models.CacheParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheParameterURL, nil) + if err != nil { + return models.CacheParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.CacheParameter{}, err + } + var result struct { + Params []models.CacheParameter `json:"cacheparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CacheParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.CacheParameter{}, nil +} // cachepolicy -func (s *CacheService) AddCachePolicy() {} -func (s *CacheService) DeleteCachePolicy() {} -func (s *CacheService) UpdateCachePolicy() {} -func (s *CacheService) UnsetCachePolicy() {} -func (s *CacheService) GetAllCachePolicy() {} -func (s *CacheService) GetCachePolicy() {} -func (s *CacheService) CountCachePolicy() {} -func (s *CacheService) RenameCachePolicy() {} + +func (s *CacheService) AddCachePolicy(policy models.CachePolicy) error { + payload := map[string]any{ + "cachepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cachePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCachePolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", cachePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UpdateCachePolicy(policy models.CachePolicy) error { + payload := map[string]any{ + "cachepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cachePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UnsetCachePolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "cachepolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cachePolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCachePolicy() ([]models.CachePolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CachePolicy `json:"cachepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CacheService) GetCachePolicy(name string) ([]models.CachePolicy, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CachePolicy `json:"cachepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CacheService) CountCachePolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"cachepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} + +func (s *CacheService) RenameCachePolicy(name, newname string) error { + payload := map[string]any{ + "cachepolicy": map[string]string{ + "policyname": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cachePolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cachepolicylabel -func (s *CacheService) AddCachePolicyLabel() {} -func (s *CacheService) DeleteCachePolicyLabel() {} -func (s *CacheService) GetAllCachePolicyLabel() {} -func (s *CacheService) GetCachePolicyLabel() {} -func (s *CacheService) CountCachePolicyLabel() {} -func (s *CacheService) RenameCachePolicyLabel() {} + +func (s *CacheService) AddCachePolicyLabel(label models.CachePolicyLabel) error { + payload := map[string]any{ + "cachepolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cachePolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCachePolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCachePolicyLabel() ([]models.CachePolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CachePolicyLabel `json:"cachepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CacheService) GetCachePolicyLabel(labelname string) ([]models.CachePolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CachePolicyLabel `json:"cachepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CacheService) CountCachePolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"cachepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} + +func (s *CacheService) RenameCachePolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "cachepolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cachePolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cachepolicylabel_binding -func (s *CacheService) GetAllCachePolicyLabelBinding() {} -func (s *CacheService) GetCachePolicyLabelBinding() {} + +func (s *CacheService) GetAllCachePolicyLabelBinding() ([]models.CachePolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelBinding `json:"cachepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyLabelBinding(labelname string) ([]models.CachePolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelBinding `json:"cachepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cachepolicylabel_cachepolicy_binding -func (s *CacheService) AddCachePolicyLabelCachePolicyBinding() {} -func (s *CacheService) DeleteCachePolicyLabelCachePolicyBinding() {} -func (s *CacheService) GetAllCachePolicyLabelCachePolicyBinding() {} -func (s *CacheService) GetCachePolicyLabelCachePolicyBinding() {} -func (s *CacheService) CountCachePolicyLabelCachePolicyBinding() {} + +func (s *CacheService) AddCachePolicyLabelCachePolicyBinding(binding models.CachePolicyLabelCachePolicyBinding) error { + payload := map[string]any{ + "cachepolicylabel_cachepolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cachePolicyLabelCachePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCachePolicyLabelCachePolicyBinding(labelname, policyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s", cachePolicyLabelCachePolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCachePolicyLabelCachePolicyBinding() ([]models.CachePolicyLabelCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLabelCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelCachePolicyBinding `json:"cachepolicylabel_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyLabelCachePolicyBinding(labelname string) ([]models.CachePolicyLabelCachePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLabelCachePolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelCachePolicyBinding `json:"cachepolicylabel_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyLabelCachePolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyLabelCachePolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicylabel_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cachepolicylabel_policybinding_binding -func (s *CacheService) GetAllCachePolicyLabelPolicyBindingBinding() {} -func (s *CacheService) GetCachePolicyLabelPolicyBindingBinding() {} -func (s *CacheService) CountCachePolicyLabelPolicyBindingBinding() {} + +func (s *CacheService) GetAllCachePolicyLabelPolicyBindingBinding() ([]models.CachePolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelPolicyBindingBinding `json:"cachepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyLabelPolicyBindingBinding(labelname string) ([]models.CachePolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLabelPolicyBindingBinding `json:"cachepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyLabelPolicyBindingBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cachepolicy_binding -func (s *CacheService) GetAllCachePolicyBinding() {} -func (s *CacheService) GetCachePolicyBinding() {} + +func (s *CacheService) GetAllCachePolicyBinding() ([]models.CachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyBinding `json:"cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyBinding(policyname string) ([]models.CachePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyBinding `json:"cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cachepolicy_cacheglobal_binding -func (s *CacheService) GetAllCachePolicyCacheGlobalBinding() {} -func (s *CacheService) GetCachePolicyCacheGlobalBinding() {} -func (s *CacheService) CountCachePolicyCacheGlobalBinding() {} + +func (s *CacheService) GetAllCachePolicyCacheGlobalBinding() ([]models.CachePolicyCacheGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyCacheGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCacheGlobalBinding `json:"cachepolicy_cacheglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyCacheGlobalBinding(policyname string) ([]models.CachePolicyCacheGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyCacheGlobalBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCacheGlobalBinding `json:"cachepolicy_cacheglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyCacheGlobalBinding(policyname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyCacheGlobalBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicy_cacheglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cachepolicy_cachepolicylabel_binding -func (s *CacheService) GetAllCachePolicyCachePolicyLabelBinding() {} -func (s *CacheService) GetCachePolicyCachePolicyLabelBinding() {} -func (s *CacheService) CountCachePolicyCachePolicyLabelBinding() {} + +func (s *CacheService) GetAllCachePolicyCachePolicyLabelBinding() ([]models.CachePolicyCachePolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyCachePolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCachePolicyLabelBinding `json:"cachepolicy_cachepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyCachePolicyLabelBinding(policyname string) ([]models.CachePolicyCachePolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyCachePolicyLabelBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCachePolicyLabelBinding `json:"cachepolicy_cachepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyCachePolicyLabelBinding(policyname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyCachePolicyLabelBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicy_cachepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cachepolicy_csvserver_binding -func (s *CacheService) GetAllCachePolicyCSVServerBinding() {} -func (s *CacheService) GetCachePolicyCSVServerBinding() {} -func (s *CacheService) CountCachePolicyCSVServerBinding() {} + +func (s *CacheService) GetAllCachePolicyCSVServerBinding() ([]models.CachePolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCSVServerBinding `json:"cachepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyCSVServerBinding(policyname string) ([]models.CachePolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyCSVServerBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyCSVServerBinding `json:"cachepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyCSVServerBinding(policyname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyCSVServerBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cachepolicy_lbvserver_binding -func (s *CacheService) GetAllCachePolicyLBVServerBinding() {} -func (s *CacheService) GetCachePolicyLBVServerBinding() {} -func (s *CacheService) CountCachePolicyLBVServerBinding() {} + +func (s *CacheService) GetAllCachePolicyLBVServerBinding() ([]models.CachePolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cachePolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLBVServerBinding `json:"cachepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) GetCachePolicyLBVServerBinding(policyname string) ([]models.CachePolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cachePolicyLBVServerBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CachePolicyLBVServerBinding `json:"cachepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CacheService) CountCachePolicyLBVServerBinding(policyname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cachePolicyLBVServerBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cachepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cacheselector -func (s *CacheService) AddCacheSelector() {} -func (s *CacheService) DeleteCacheSelector() {} -func (s *CacheService) UpdateCacheSelector() {} -func (s *CacheService) GetAllCacheSelector() {} -func (s *CacheService) GetCacheSelector() {} -func (s *CacheService) CountCacheSelector() {} + +func (s *CacheService) AddCacheSelector(selector models.CacheSelector) error { + payload := map[string]any{ + "cacheselector": selector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cacheSelectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) DeleteCacheSelector(selectorname string) error { + reqURL := fmt.Sprintf("%s/%s", cacheSelectorURL, url.QueryEscape(selectorname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) UpdateCacheSelector(selector models.CacheSelector) error { + payload := map[string]any{ + "cacheselector": selector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cacheSelectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CacheService) GetAllCacheSelector() ([]models.CacheSelector, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheSelectorURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Selectors []models.CacheSelector `json:"cacheselector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Selectors, nil +} + +func (s *CacheService) GetCacheSelector(selectorname string) ([]models.CacheSelector, error) { + reqURL := fmt.Sprintf("%s/%s", cacheSelectorURL, url.QueryEscape(selectorname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Selectors []models.CacheSelector `json:"cacheselector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Selectors, nil +} + +func (s *CacheService) CountCacheSelector() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cacheSelectorURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Selectors []struct { + Count float64 `json:"__count"` + } `json:"cacheselector"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Selectors) > 0 { + return result.Selectors[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/client.go b/nitrogo/client.go index bdfe3d4..f0f4b79 100644 --- a/nitrogo/client.go +++ b/nitrogo/client.go @@ -207,6 +207,7 @@ func (c *Client) Do(req *http.Request) ([]byte, error) { } defer func() { + // should do something with these errors io.Copy(io.Discard, resp.Body) resp.Body.Close() }() diff --git a/nitrogo/cloud.go b/nitrogo/cloud.go index 239cc2d..3b6904f 100644 --- a/nitrogo/cloud.go +++ b/nitrogo/cloud.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( cloudAllowedNGSTicketProfileURL = "/nitro/v1/config/cloudallowedngsticketprofile" cloudAutoscaleGroupURL = "/nitro/v1/config/cloudautoscalegroup" @@ -20,56 +30,588 @@ type CloudService struct { // cloudallowedngsticketprofile // Configuration for Allowed ticket profile for NGS resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudallowedngsticketprofile -func (s *CloudService) AddCloudAllowedNGSTicketProfile() {} -func (s *CloudService) DeleteCloudAllowedNGSTicketProfile() {} -func (s *CloudService) UpdateCloudAllowedNGSTicketProfile() {} -func (s *CloudService) GetAllCloudAllowedNGSTicketProfile() {} -func (s *CloudService) GetCloudAllowedNGSTicketProfile() {} -func (s *CloudService) CountCloudAllowedNGSTicketProfile() {} + +func (s *CloudService) AddCloudAllowedNGSTicketProfile(profile models.CloudAllowedNGSTicketProfile) error { + payload := map[string]any{ + "cloudallowedngsticketprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, cloudAllowedNGSTicketProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) DeleteCloudAllowedNGSTicketProfile(name string) error { + urlReq := fmt.Sprintf("%s/%s", cloudAllowedNGSTicketProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) UpdateCloudAllowedNGSTicketProfile(profile models.CloudAllowedNGSTicketProfile) error { + payload := map[string]any{ + "cloudallowedngsticketprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, cloudAllowedNGSTicketProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) GetAllCloudAllowedNGSTicketProfile() ([]models.CloudAllowedNGSTicketProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudAllowedNGSTicketProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.CloudAllowedNGSTicketProfile `json:"cloudallowedngsticketprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *CloudService) GetCloudAllowedNGSTicketProfile(name string) ([]models.CloudAllowedNGSTicketProfile, error) { + urlReq := fmt.Sprintf("%s/%s", cloudAllowedNGSTicketProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.CloudAllowedNGSTicketProfile `json:"cloudallowedngsticketprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *CloudService) CountCloudAllowedNGSTicketProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudAllowedNGSTicketProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"cloudallowedngsticketprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} // cloudautoscalegroup // Configuration for Cloud Autoscale Group resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudautoscalegroup -func (s *CloudService) GetAllCloudAutoscaleGroup() {} -func (s *CloudService) GetCloudAutoscaleGroup() {} -func (s *CloudService) CountCloudAutoscaleGroup() {} + +func (s *CloudService) GetAllCloudAutoscaleGroup() ([]models.CloudAutoscaleGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudAutoscaleGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.CloudAutoscaleGroup `json:"cloudautoscalegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Groups, nil +} + +func (s *CloudService) GetCloudAutoscaleGroup(name string) ([]models.CloudAutoscaleGroup, error) { + urlReq := fmt.Sprintf("%s/%s", cloudAutoscaleGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.CloudAutoscaleGroup `json:"cloudautoscalegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Groups, nil +} + +func (s *CloudService) CountCloudAutoscaleGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudAutoscaleGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Groups []struct { + Count float64 `json:"__count"` + } `json:"cloudautoscalegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Groups) > 0 { + return result.Groups[0].Count, nil + } + + return 0, nil +} // cloudcredential // Configuration for cloud credentials resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudcredential -func (s *CloudService) GetAllCloudCredential() {} -func (s *CloudService) UpdateCloudCredential() {} + +func (s *CloudService) GetAllCloudCredential() ([]models.CloudCredential, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudCredentialURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Credentials []models.CloudCredential `json:"cloudcredential"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Credentials, nil +} + +func (s *CloudService) UpdateCloudCredential(credential models.CloudCredential) error { + payload := map[string]any{ + "cloudcredential": credential, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, cloudCredentialURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // cloudparameter // Configuration for cloud parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudparameter -func (s *CloudService) UpdateCloudParameter() {} -func (s *CloudService) UnsetCloudParameter() {} -func (s *CloudService) GetAllCloudParameter() {} + +func (s *CloudService) UpdateCloudParameter(param models.CloudParameter) error { + payload := map[string]any{ + "cloudparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, cloudParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) UnsetCloudParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "cloudparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, cloudParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) GetAllCloudParameter() (models.CloudParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudParameterURL, nil) + if err != nil { + return models.CloudParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.CloudParameter{}, err + } + + var result struct { + Parameters []models.CloudParameter `json:"cloudparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CloudParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0], nil + } + + return models.CloudParameter{}, nil +} // cloudparaminternal // Configuration for cloud paramInternal resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudparaminternal -func (s *CloudService) GetAllCloudParamInternal() {} -func (s *CloudService) CountCloudParamInternal() {} -func (s *CloudService) UpdateCloudParamInternal() {} + +func (s *CloudService) GetAllCloudParamInternal() (models.CloudParamInternal, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudParamInternalURL, nil) + if err != nil { + return models.CloudParamInternal{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.CloudParamInternal{}, err + } + + var result struct { + Parameters []models.CloudParamInternal `json:"cloudparaminternal"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CloudParamInternal{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0], nil + } + + return models.CloudParamInternal{}, nil +} + +func (s *CloudService) CountCloudParamInternal() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudParamInternalURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Parameters []struct { + Count float64 `json:"__count"` + } `json:"cloudparaminternal"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0].Count, nil + } + + return 0, nil +} + +func (s *CloudService) UpdateCloudParamInternal(param models.CloudParamInternal) error { + payload := map[string]any{ + "cloudparaminternal": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, cloudParamInternalURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // cloudprofile // Configuration for cloud profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudprofile -func (s *CloudService) AddCloudProfile() {} -func (s *CloudService) DeleteCloudProfile() {} -func (s *CloudService) GetAllCloudProfile() {} -func (s *CloudService) GetCloudProfile() {} -func (s *CloudService) CountCloudProfile() {} + +func (s *CloudService) AddCloudProfile(profile models.CloudProfile) error { + payload := map[string]any{ + "cloudprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, cloudProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) DeleteCloudProfile(name string) error { + urlReq := fmt.Sprintf("%s/%s", cloudProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *CloudService) GetAllCloudProfile() ([]models.CloudProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.CloudProfile `json:"cloudprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *CloudService) GetCloudProfile(name string) ([]models.CloudProfile, error) { + urlReq := fmt.Sprintf("%s/%s", cloudProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.CloudProfile `json:"cloudprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *CloudService) CountCloudProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"cloudprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} // cloudservice // Configuration for cloud service resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudservice -func (s *CloudService) CheckCloudService() {} + +func (s *CloudService) CheckCloudService(service models.CloudService) error { + payload := map[string]any{ + "cloudservice": service, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, cloudServiceURL+"?action=check", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // cloudvserverip // Configuration for Cloud virtual server IPs resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cloud/cloudvserverip -func (s *CloudService) GetAllCloudVServerIP() {} -func (s *CloudService) CountCloudVServerIP() {} + +func (s *CloudService) GetAllCloudVServerIP() ([]models.CloudVServerIP, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudVServerIPURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + VServerIPs []models.CloudVServerIP `json:"cloudvserverip"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.VServerIPs, nil +} + +func (s *CloudService) CountCloudVServerIP() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cloudVServerIPURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + VServerIPs []struct { + Count float64 `json:"__count"` + } `json:"cloudvserverip"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.VServerIPs) > 0 { + return result.VServerIPs[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/cluster.go b/nitrogo/cluster.go index 666e0d1..1f7216b 100644 --- a/nitrogo/cluster.go +++ b/nitrogo/cluster.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( clusterFilesURL = "/nitro/v1/config/clusterfiles" clusterInstanceURL = "/nitro/v1/config/clusterinstance" @@ -25,149 +35,1741 @@ const ( clusterSyncURL = "/nitro/v1/config/clustersync" ) -// Configuration for 0 resource. +// Configuration for cluster resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cluster/cluster type ClusterService struct { client *Client } // clusterfiles -func (s *ClusterService) SyncClusterFiles() {} +func (s *ClusterService) SyncClusterFiles(files models.ClusterFiles) error { + payload := map[string]any{"clusterfiles": files} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterFilesURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // clusterinstance -func (s *ClusterService) AddClusterInstance() {} -func (s *ClusterService) DeleteClusterInstance() {} -func (s *ClusterService) UpdateClusterInstance() {} -func (s *ClusterService) UnsetClusterInstance() {} -func (s *ClusterService) EnableClusterInstance() {} -func (s *ClusterService) DisableClusterInstance() {} -func (s *ClusterService) GetAllClusterInstance() {} -func (s *ClusterService) GetClusterInstance() {} -func (s *ClusterService) CountClusterInstance() {} +func (s *ClusterService) AddClusterInstance(instance models.ClusterInstance) error { + payload := map[string]any{"clusterinstance": instance} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterInstanceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterInstance(clid int) error { + reqURL := fmt.Sprintf("%s/%d", clusterInstanceURL, clid) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UpdateClusterInstance(instance models.ClusterInstance) error { + payload := map[string]any{"clusterinstance": instance} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterInstanceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UnsetClusterInstance(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"clusterinstance": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterInstanceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) EnableClusterInstance(clid int) error { + payload := map[string]any{ + "clusterinstance": map[string]any{"clid": clid}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterInstanceURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DisableClusterInstance(clid int) error { + payload := map[string]any{ + "clusterinstance": map[string]any{"clid": clid}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterInstanceURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterInstance() ([]models.ClusterInstance, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterInstanceURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Instances []models.ClusterInstance `json:"clusterinstance"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Instances, nil +} + +func (s *ClusterService) GetClusterInstance(clid string) ([]models.ClusterInstance, error) { + reqURL := fmt.Sprintf("%s/%s", clusterInstanceURL, url.QueryEscape(clid)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Instances []models.ClusterInstance `json:"clusterinstance"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Instances, nil +} + +func (s *ClusterService) CountClusterInstance() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterInstanceURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Instances []struct { + Count float64 `json:"__count"` + } `json:"clusterinstance"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Instances) > 0 { + return result.Instances[0].Count, nil + } + return 0, nil +} // clusterinstance_binding -func (s *ClusterService) GetAllClusterInstanceBinding() {} -func (s *ClusterService) GetClusterInstanceBinding() {} +func (s *ClusterService) GetAllClusterInstanceBinding() ([]models.ClusterInstanceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterInstanceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterInstanceBinding `json:"clusterinstance_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} -// cluisterinstance_clusternode_binding -func (s *ClusterService) GetAllClusterInstanceClusterNodeBinding() {} -func (s *ClusterService) GetClusterInstanceClusterNodeBinding() {} -func (s *ClusterService) CountClusterInstanceClusterNodeBinding() {} +func (s *ClusterService) GetClusterInstanceBinding(clid string) ([]models.ClusterInstanceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterInstanceBindingURL, url.QueryEscape(clid)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterInstanceBinding `json:"clusterinstance_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +// clusterinstance_clusternode_binding +func (s *ClusterService) GetAllClusterInstanceClusterNodeBinding() ([]models.ClusterInstanceClusterNodeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterInstanceClusterNodeBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterInstanceClusterNodeBinding `json:"clusterinstance_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterInstanceClusterNodeBinding(clid string) ([]models.ClusterInstanceClusterNodeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterInstanceClusterNodeBindingURL, url.QueryEscape(clid)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterInstanceClusterNodeBinding `json:"clusterinstance_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterInstanceClusterNodeBinding(clid string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterInstanceClusterNodeBindingURL, url.QueryEscape(clid)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusterinstance_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternode -func (s *ClusterService) AddClusterNode() {} -func (s *ClusterService) DeleteClusterNode() {} -func (s *ClusterService) UpdateClusterNode() {} -func (s *ClusterService) UnsetClusterNode() {} -func (s *ClusterService) GetAllClusterNode() {} -func (s *ClusterService) GetClusterNode() {} -func (s *ClusterService) CountClusterNode() {} +func (s *ClusterService) AddClusterNode(node models.ClusterNode) error { + payload := map[string]any{"clusternode": node} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterNodeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNode(nodeID int) error { + reqURL := fmt.Sprintf("%s/%d", clusterNodeURL, nodeID) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UpdateClusterNode(node models.ClusterNode) error { + payload := map[string]any{"clusternode": node} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UnsetClusterNode(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"clusternode": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterNodeURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNode() ([]models.ClusterNode, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Nodes []models.ClusterNode `json:"clusternode"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Nodes, nil +} + +func (s *ClusterService) GetClusterNode(nodeID string) ([]models.ClusterNode, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeURL, url.QueryEscape(nodeID)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Nodes []models.ClusterNode `json:"clusternode"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Nodes, nil +} + +func (s *ClusterService) CountClusterNode() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Nodes []struct { + Count float64 `json:"__count"` + } `json:"clusternode"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Nodes) > 0 { + return result.Nodes[0].Count, nil + } + return 0, nil +} // clusternodegroup -func (s *ClusterService) AddClusterNodeGroup() {} -func (s *ClusterService) DeleteClusterNodeGroup() {} -func (s *ClusterService) UpdateClusterNodeGroup() {} -func (s *ClusterService) UnsetClusterNodeGroup() {} -func (s *ClusterService) GetAllClusterNodeGroup() {} -func (s *ClusterService) GetClusterNodeGroup() {} -func (s *ClusterService) CountClusterNodeGroup() {} +func (s *ClusterService) AddClusterNodeGroup(group models.ClusterNodeGroup) error { + payload := map[string]any{"clusternodegroup": group} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterNodeGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroup(name string) error { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UpdateClusterNodeGroup(group models.ClusterNodeGroup) error { + payload := map[string]any{"clusternodegroup": group} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) UnsetClusterNodeGroup(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"clusternodegroup": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterNodeGroupURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroup() ([]models.ClusterNodeGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Groups []models.ClusterNodeGroup `json:"clusternodegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Groups, nil +} + +func (s *ClusterService) GetClusterNodeGroup(name string) ([]models.ClusterNodeGroup, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Groups []models.ClusterNodeGroup `json:"clusternodegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Groups, nil +} + +func (s *ClusterService) CountClusterNodeGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Groups []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Groups) > 0 { + return result.Groups[0].Count, nil + } + return 0, nil +} // clusternodegroup_authenticationvserver_binding -func (s *ClusterService) AddClusternodeGroupAuthenticationVServerBinding() {} -func (s *ClusterService) DeleteClusternodeGroupAuthenticationVServerBinding() {} -func (s *ClusterService) GetAllClusternodeGroupAuthenticationVServerBinding() {} -func (s *ClusterService) GetClusternodeGroupAuthenticationVServerBinding() {} -func (s *ClusterService) CountClusternodeGroupAuthenticationVServerBinding() {} +func (s *ClusterService) AddClusternodeGroupAuthenticationVServerBinding(binding models.ClusterNodeGroupAuthenticationVServerBinding) error { + payload := map[string]any{"clusternodegroup_authenticationvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupAuthenticationVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusternodeGroupAuthenticationVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupAuthenticationVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusternodeGroupAuthenticationVServerBinding() ([]models.ClusterNodeGroupAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupAuthenticationVServerBinding `json:"clusternodegroup_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusternodeGroupAuthenticationVServerBinding(name string) ([]models.ClusterNodeGroupAuthenticationVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupAuthenticationVServerBinding `json:"clusternodegroup_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusternodeGroupAuthenticationVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_binding -func (s *ClusterService) GetAllClusterNodeGroupBinding() {} -func (s *ClusterService) GetClusterNodeGroupBinding() {} +func (s *ClusterService) GetAllClusterNodeGroupBinding() ([]models.ClusterNodeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupBinding `json:"clusternodegroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupBinding(name string) ([]models.ClusterNodeGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupBinding `json:"clusternodegroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // clusternodegroup_clusternode_binding -func (s *ClusterService) AddClusterNodeGroupClusterNodeBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupClusterNodeBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupClusterNodeBinding() {} -func (s *ClusterService) GetClusterNodeGroupClusterNodeBinding() {} -func (s *ClusterService) CountClusterNodeGroupClusterNodeBinding() {} +func (s *ClusterService) AddClusterNodeGroupClusterNodeBinding(binding models.ClusterNodeGroupClusterNodeBinding) error { + payload := map[string]any{"clusternodegroup_clusternode_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupClusterNodeBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupClusterNodeBinding(name string, node int) error { + reqURL := fmt.Sprintf("%s/%s?args=node:%d", clusterNodeGroupClusterNodeBindingURL, url.QueryEscape(name), node) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupClusterNodeBinding() ([]models.ClusterNodeGroupClusterNodeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupClusterNodeBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupClusterNodeBinding `json:"clusternodegroup_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupClusterNodeBinding(name string) ([]models.ClusterNodeGroupClusterNodeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupClusterNodeBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupClusterNodeBinding `json:"clusternodegroup_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupClusterNodeBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupClusterNodeBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_crvserver_binding -func (s *ClusterService) AddClusterNodeGroupCRVServerBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupCRVServerBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupCRVServerBinding() {} -func (s *ClusterService) GetClusterNodeGroupCRVServerBinding() {} -func (s *ClusterService) CountClusterNodeGroupCRVServerBinding() {} +func (s *ClusterService) AddClusterNodeGroupCRVServerBinding(binding models.ClusterNodeGroupCRVServerBinding) error { + payload := map[string]any{"clusternodegroup_crvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupCRVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupCRVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupCRVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupCRVServerBinding() ([]models.ClusterNodeGroupCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupCRVServerBinding `json:"clusternodegroup_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupCRVServerBinding(name string) ([]models.ClusterNodeGroupCRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupCRVServerBinding `json:"clusternodegroup_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupCRVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_csvserver_binding -func (s *ClusterService) AddClusterNodeGroupCSVServerBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupCSVServerBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupCSVServerBinding() {} -func (s *ClusterService) GetClusterNodeGroupCSVServerBinding() {} -func (s *ClusterService) CountClusterNodeGroupCSVServerBinding() {} +func (s *ClusterService) AddClusterNodeGroupCSVServerBinding(binding models.ClusterNodeGroupCSVServerBinding) error { + payload := map[string]any{"clusternodegroup_csvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupCSVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupCSVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupCSVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupCSVServerBinding() ([]models.ClusterNodeGroupCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupCSVServerBinding `json:"clusternodegroup_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupCSVServerBinding(name string) ([]models.ClusterNodeGroupCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupCSVServerBinding `json:"clusternodegroup_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_gslbsite_binding -func (s *ClusterService) AddClusterNodeGroupGSLBSiteBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupGSLBSiteBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupGSLBSiteBinding() {} -func (s *ClusterService) GetClusterNodeGroupGSLBSiteBinding() {} -func (s *ClusterService) CountClusterNodeGroupGSLBSiteBinding() {} +func (s *ClusterService) AddClusterNodeGroupGSLBSiteBinding(binding models.ClusterNodeGroupGSLBSiteBinding) error { + payload := map[string]any{"clusternodegroup_gslbsite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupGSLBSiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupGSLBSiteBinding(name string, gslbsite string) error { + reqURL := fmt.Sprintf("%s/%s?args=gslbsite:%s", clusterNodeGroupGSLBSiteBindingURL, url.QueryEscape(name), url.QueryEscape(gslbsite)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupGSLBSiteBinding() ([]models.ClusterNodeGroupGSLBSiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupGSLBSiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupGSLBSiteBinding `json:"clusternodegroup_gslbsite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupGSLBSiteBinding(name string) ([]models.ClusterNodeGroupGSLBSiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupGSLBSiteBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupGSLBSiteBinding `json:"clusternodegroup_gslbsite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupGSLBSiteBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupGSLBSiteBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_gslbsite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_gslbvserver_binding -func (s *ClusterService) AddClusterNodeGroupGSLBVServerBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupGSLBVServerBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupGSLBVServerBinding() {} -func (s *ClusterService) GetClusterNodeGroupGSLBVServerBinding() {} -func (s *ClusterService) CountClusterNodeGroupGSLBVServerBinding() {} +func (s *ClusterService) AddClusterNodeGroupGSLBVServerBinding(binding models.ClusterNodeGroupGSLBVServerBinding) error { + payload := map[string]any{"clusternodegroup_gslbvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupGSLBVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupGSLBVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupGSLBVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupGSLBVServerBinding() ([]models.ClusterNodeGroupGSLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupGSLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupGSLBVServerBinding `json:"clusternodegroup_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupGSLBVServerBinding(name string) ([]models.ClusterNodeGroupGSLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupGSLBVServerBinding `json:"clusternodegroup_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupGSLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_lbvserver_binding -func (s *ClusterService) AddClusterNodeGroupLBVServerBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupLBVServerBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupLBVServerBinding() {} -func (s *ClusterService) GetClusterNodeGroupLBVServerBinding() {} -func (s *ClusterService) CountClusterNodeGroupLBVServerBinding() {} +func (s *ClusterService) AddClusterNodeGroupLBVServerBinding(binding models.ClusterNodeGroupLBVServerBinding) error { + payload := map[string]any{"clusternodegroup_lbvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupLBVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupLBVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupLBVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupLBVServerBinding() ([]models.ClusterNodeGroupLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupLBVServerBinding `json:"clusternodegroup_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupLBVServerBinding(name string) ([]models.ClusterNodeGroupLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupLBVServerBinding `json:"clusternodegroup_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_nslimitidentifier_binding -func (s *ClusterService) AddClusterNodeGroupNSLimitIdentifierBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupNSLimitIdentifierBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupNSLimitIdentifierBinding() {} -func (s *ClusterService) GetClusterNodeGroupNSLimitIdentifierBinding() {} -func (s *ClusterService) CountClusterNodeGroupNSLimitIdentifierBinding() {} +func (s *ClusterService) AddClusterNodeGroupNSLimitIdentifierBinding(binding models.ClusterNodeGroupNSLimitIdentifierBinding) error { + payload := map[string]any{"clusternodegroup_nslimitidentifier_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupNSLimitIdentifierBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupNSLimitIdentifierBinding(name string, identifierName string) error { + reqURL := fmt.Sprintf("%s/%s?args=identifiername:%s", clusterNodeGroupNSLimitIdentifierBindingURL, url.QueryEscape(name), url.QueryEscape(identifierName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupNSLimitIdentifierBinding() ([]models.ClusterNodeGroupNSLimitIdentifierBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupNSLimitIdentifierBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupNSLimitIdentifierBinding `json:"clusternodegroup_nslimitidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupNSLimitIdentifierBinding(name string) ([]models.ClusterNodeGroupNSLimitIdentifierBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupNSLimitIdentifierBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupNSLimitIdentifierBinding `json:"clusternodegroup_nslimitidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupNSLimitIdentifierBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupNSLimitIdentifierBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_nslimitidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_service_binding -func (s *ClusterService) AddClusterNodeGroupServiceBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupServiceBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupServiceBinding() {} -func (s *ClusterService) GetClusterNodeGroupServiceBinding() {} -func (s *ClusterService) CountClusterNodeGroupServiceBinding() {} +func (s *ClusterService) AddClusterNodeGroupServiceBinding(binding models.ClusterNodeGroupServiceBinding) error { + payload := map[string]any{"clusternodegroup_service_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupServiceBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupServiceBinding(name string, service string) error { + reqURL := fmt.Sprintf("%s/%s?args=service:%s", clusterNodeGroupServiceBindingURL, url.QueryEscape(name), url.QueryEscape(service)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupServiceBinding() ([]models.ClusterNodeGroupServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupServiceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupServiceBinding `json:"clusternodegroup_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupServiceBinding(name string) ([]models.ClusterNodeGroupServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupServiceBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupServiceBinding `json:"clusternodegroup_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupServiceBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupServiceBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_streamidentifier_binding -func (s *ClusterService) AddClusterNodeGroupStreamIdentifierBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupStreamIdentifierBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupStreamIdentifierBinding() {} -func (s *ClusterService) GetClusterNodeGroupStreamIdentifierBinding() {} -func (s *ClusterService) CountClusterNodeGroupStreamIdentifierBinding() {} +func (s *ClusterService) AddClusterNodeGroupStreamIdentifierBinding(binding models.ClusterNodeGroupStreamIdentifierBinding) error { + payload := map[string]any{"clusternodegroup_streamidentifier_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupStreamIdentifierBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupStreamIdentifierBinding(name string, identifierName string) error { + reqURL := fmt.Sprintf("%s/%s?args=identifiername:%s", clusterNodeGroupStreamIdentifierBindingURL, url.QueryEscape(name), url.QueryEscape(identifierName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupStreamIdentifierBinding() ([]models.ClusterNodeGroupStreamIdentifierBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupStreamIdentifierBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupStreamIdentifierBinding `json:"clusternodegroup_streamidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupStreamIdentifierBinding(name string) ([]models.ClusterNodeGroupStreamIdentifierBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupStreamIdentifierBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupStreamIdentifierBinding `json:"clusternodegroup_streamidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupStreamIdentifierBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupStreamIdentifierBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_streamidentifier_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternodegroup_vpnvserver_binding -func (s *ClusterService) AddClusterNodeGroupVPNVServerBinding() {} -func (s *ClusterService) DeleteClusterNodeGroupVPNVServerBinding() {} -func (s *ClusterService) GetAllClusterNodeGroupVPNVServerBinding() {} -func (s *ClusterService) GetClusterNodeGroupVPNVServerBinding() {} -func (s *ClusterService) CountClusterNodeGroupVPNVServerBinding() {} +func (s *ClusterService) AddClusterNodeGroupVPNVServerBinding(binding models.ClusterNodeGroupVPNVServerBinding) error { + payload := map[string]any{"clusternodegroup_vpnvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeGroupVPNVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeGroupVPNVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", clusterNodeGroupVPNVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeGroupVPNVServerBinding() ([]models.ClusterNodeGroupVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeGroupVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupVPNVServerBinding `json:"clusternodegroup_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeGroupVPNVServerBinding(name string) ([]models.ClusterNodeGroupVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeGroupVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeGroupVPNVServerBinding `json:"clusternodegroup_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeGroupVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeGroupVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternodegroup_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusternode_binding -func (s *ClusterService) GetAllClusterNodeBinding() {} -func (s *ClusterService) GetClusterNodeBinding() {} +func (s *ClusterService) GetAllClusterNodeBinding() ([]models.ClusterNodeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeBinding `json:"clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeBinding(nodeID string) ([]models.ClusterNodeBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeBindingURL, url.QueryEscape(nodeID)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeBinding `json:"clusternode_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // clusternode_routemonitor_binding -func (s *ClusterService) AddClusterNodeRouteMonitorBinding() {} -func (s *ClusterService) DeleteClusterNodeRouteMonitorBinding() {} -func (s *ClusterService) GetAllClusterNodeRouteMonitorBinding() {} -func (s *ClusterService) GetClusterNodeRouteMonitorBinding() {} -func (s *ClusterService) CountClusterNodeRouteMonitorBinding() {} +func (s *ClusterService) AddClusterNodeRouteMonitorBinding(binding models.ClusterNodeRouteMonitorBinding) error { + payload := map[string]any{"clusternode_routemonitor_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, clusterNodeRouteMonitorBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) DeleteClusterNodeRouteMonitorBinding(nodeID int, routeMonitor string) error { + reqURL := fmt.Sprintf("%s/%d?args=routemonitor:%s", clusterNodeRouteMonitorBindingURL, nodeID, url.QueryEscape(routeMonitor)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ClusterService) GetAllClusterNodeRouteMonitorBinding() ([]models.ClusterNodeRouteMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterNodeRouteMonitorBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeRouteMonitorBinding `json:"clusternode_routemonitor_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) GetClusterNodeRouteMonitorBinding(nodeID string) ([]models.ClusterNodeRouteMonitorBinding, error) { + reqURL := fmt.Sprintf("%s/%s", clusterNodeRouteMonitorBindingURL, url.QueryEscape(nodeID)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ClusterNodeRouteMonitorBinding `json:"clusternode_routemonitor_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ClusterService) CountClusterNodeRouteMonitorBinding(nodeID string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", clusterNodeRouteMonitorBindingURL, url.QueryEscape(nodeID)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"clusternode_routemonitor_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // clusterpropstatus -func (s *ClusterService) GetAllClusterPropStatus() {} -func (s *ClusterService) CountClusterPropStatus() {} -func (s *ClusterService) ClearClusterPropStatus() {} +func (s *ClusterService) GetAllClusterPropStatus() ([]models.ClusterPropStatus, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterPropStatusURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Status []models.ClusterPropStatus `json:"clusterpropstatus"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Status, nil +} + +func (s *ClusterService) CountClusterPropStatus() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, clusterPropStatusURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Status []struct { + Count float64 `json:"__count"` + } `json:"clusterpropstatus"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Status) > 0 { + return result.Status[0].Count, nil + } + return 0, nil +} + +func (s *ClusterService) ClearClusterPropStatus() error { + payload := map[string]any{} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterPropStatusURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // clustersync -func (s *ClusterService) ForceClusterSync() {} +func (s *ClusterService) ForceClusterSync() error { + payload := map[string]any{} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, clusterSyncURL+"?action=force", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/cmp.go b/nitrogo/cmp.go index 02c403f..1377259 100644 --- a/nitrogo/cmp.go +++ b/nitrogo/cmp.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( cmpActionURL = "/nitro/v1/config/cmpaction" cmpGlobalBindingURL = "/nitro/v1/config/cmpglobal_binding" @@ -25,87 +35,1105 @@ type CMPService struct { } // cmpaction -func (s *CMPService) AddCMPAction() {} -func (s *CMPService) DeleteCMPAction() {} -func (s *CMPService) UpdateCMPAction() {} -func (s *CMPService) UnsetCMPAction() {} -func (s *CMPService) GetAllCMPAction() {} -func (s *CMPService) GetCMPAction() {} -func (s *CMPService) CountCMPAction() {} -func (s *CMPService) RenameCMPAction() {} + +func (s *CMPService) AddCMPAction(action models.CMPAction) error { + payload := map[string]any{ + "cmpaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) DeleteCMPAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", cmpActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) UpdateCMPAction(action models.CMPAction) error { + payload := map[string]any{ + "cmpaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cmpActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) UnsetCMPAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "cmpaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetAllCMPAction() ([]models.CMPAction, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CMPAction `json:"cmpaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CMPService) GetCMPAction(name string) ([]models.CMPAction, error) { + reqURL := fmt.Sprintf("%s/%s", cmpActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CMPAction `json:"cmpaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CMPService) CountCMPAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"cmpaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} + +func (s *CMPService) RenameCMPAction(name, newname string) error { + payload := map[string]any{ + "cmpaction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cmpglobal_binding -func (s *CMPService) GetCMPGlobalBinding() {} -// cmpglobal_cpmpolicy_binding -func (s *CMPService) AddCMPGlobalCMPPolicyBinding() {} -func (s *CMPService) DeleteCMPGlobalCMPPolicyBinding() {} -func (s *CMPService) GetCMPGlobalCMPPolicyBinding() {} -func (s *CMPService) CountCMPGlobalCMPPolicyBinding() {} +func (s *CMPService) GetCMPGlobalBinding() ([]models.CMPGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPGlobalBinding `json:"cmpglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +// cmpglobal_cmppolicy_binding + +func (s *CMPService) AddCMPGlobalCMPPolicyBinding(binding models.CMPGlobalCMPPolicyBinding) error { + payload := map[string]any{ + "cmpglobal_cmppolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cmpGlobalCMPPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) DeleteCMPGlobalCMPPolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", cmpGlobalCMPPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetCMPGlobalCMPPolicyBinding() ([]models.CMPGlobalCMPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpGlobalCMPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPGlobalCMPPolicyBinding `json:"cmpglobal_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPGlobalCMPPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpGlobalCMPPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmpglobal_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmpparameter -func (s *CMPService) UpdateCMPParameter() {} -func (s *CMPService) UnsetCMPParameter() {} -func (s *CMPService) GetAllCMPParameter() {} + +func (s *CMPService) UpdateCMPParameter(param models.CMPParameter) error { + payload := map[string]any{ + "cmpparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cmpParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) UnsetCMPParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "cmpparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetAllCMPParameter() (models.CMPParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpParameterURL, nil) + if err != nil { + return models.CMPParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.CMPParameter{}, err + } + var result struct { + Params []models.CMPParameter `json:"cmpparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CMPParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.CMPParameter{}, nil +} // cmppolicy -func (s *CMPService) AddCOMPolicy() {} -func (s *CMPService) DeleteCOMPolicy() {} -func (s *CMPService) UpdateCOMPolicy() {} -func (s *CMPService) GetAllCOMPolicy() {} -func (s *CMPService) GetCOMPolicy() {} -func (s *CMPService) CountCOMPolicy() {} -func (s *CMPService) RenameCOMPolicy() {} + +func (s *CMPService) AddCOMPolicy(policy models.CMPPolicy) error { + payload := map[string]any{ + "cmppolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) DeleteCOMPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) UpdateCOMPolicy(policy models.CMPPolicy) error { + payload := map[string]any{ + "cmppolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cmpPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetAllCOMPolicy() ([]models.CMPPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CMPPolicy `json:"cmppolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CMPService) GetCOMPolicy(name string) ([]models.CMPPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CMPPolicy `json:"cmppolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CMPService) CountCOMPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} + +func (s *CMPService) RenameCOMPolicy(name, newname string) error { + payload := map[string]any{ + "cmppolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cmppolicylabel -func (s *CMPService) AddCMPPolicyLabel() {} -func (s *CMPService) DeleteCMPPolicyLabel() {} -func (s *CMPService) GetAllCMPPolicyLabel() {} -func (s *CMPService) GetCMPPolicyLabel() {} -func (s *CMPService) CountCMPPolicyLabel() {} -func (s *CMPService) RenameCMPPolicyLabel() {} + +func (s *CMPService) AddCMPPolicyLabel(label models.CMPPolicyLabel) error { + payload := map[string]any{ + "cmppolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) DeleteCMPPolicyLabel(name string) error { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLabelURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetAllCMPPolicyLabel() ([]models.CMPPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CMPPolicyLabel `json:"cmppolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CMPService) GetCMPPolicyLabel(name string) ([]models.CMPPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLabelURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CMPPolicyLabel `json:"cmppolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CMPService) CountCMPPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"cmppolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} + +func (s *CMPService) RenameCMPPolicyLabel(name, newname string) error { + payload := map[string]any{ + "cmppolicylabel": map[string]string{ + "labelname": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, cmpPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // cmppolicylabel_binding -func (s *CMPService) GetAllCMPPolicyLabelBinding() {} -func (s *CMPService) GetCMPPolicyLabelBinding() {} + +func (s *CMPService) GetAllCMPPolicyLabelBinding() ([]models.CMPPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelBinding `json:"cmppolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyLabelBinding(name string) ([]models.CMPPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelBinding `json:"cmppolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cmppolicylabel_cmppolicy_binding -func (s *CMPService) AddCMPPolicyLabelCMPPolicyBinding() {} -func (s *CMPService) DeleteCMPPolicyLabelCMPPolicyBinding() {} -func (s *CMPService) GetAllCMPPolicyLabelCMPPolicyBinding() {} -func (s *CMPService) GetCMPPolicyLabelCMPPolicyBinding() {} -func (s *CMPService) CountCMPPolicyLabelCMPPolicyBinding() {} + +func (s *CMPService) AddCMPPolicyLabelCMPPolicyBinding(binding models.CMPPolicyLabelCMPPolicyBinding) error { + payload := map[string]any{ + "cmppolicylabel_cmppolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, cmpPolicyLabelCMPPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) DeleteCMPPolicyLabelCMPPolicyBinding(labelname, policyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s", cmpPolicyLabelCMPPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CMPService) GetAllCMPPolicyLabelCMPPolicyBinding() ([]models.CMPPolicyLabelCMPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLabelCMPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelCMPPolicyBinding `json:"cmppolicylabel_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyLabelCMPPolicyBinding(name string) ([]models.CMPPolicyLabelCMPPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLabelCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelCMPPolicyBinding `json:"cmppolicylabel_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyLabelCMPPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyLabelCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicylabel_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicylabel_policybinding_binding -func (s *CMPService) GetAllCMPPolicyLabelPolicyBindingBinding() {} -func (s *CMPService) GetCMPPolicyLabelPolicyBindingBinding() {} -func (s *CMPService) CountCMPPolicyLabelPolicyBindingBinding() {} + +func (s *CMPService) GetAllCMPPolicyLabelPolicyBindingBinding() ([]models.CMPPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelPolicyBindingBinding `json:"cmppolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyLabelPolicyBindingBinding(name string) ([]models.CMPPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLabelPolicyBindingBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLabelPolicyBindingBinding `json:"cmppolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyLabelPolicyBindingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyLabelPolicyBindingBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicy_binding -func (s *CMPService) GetAllCMPPolicyBinding() {} -func (s *CMPService) GetCMPPolicyBinding() {} + +func (s *CMPService) GetAllCMPPolicyBinding() ([]models.CMPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyBinding `json:"cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyBinding(name string) ([]models.CMPPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyBinding `json:"cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cmppolicy_cmpglobal_binding -func (s *CMPService) GetAllCMPPolicyCMPGlobalBinding() {} -func (s *CMPService) GetCMPPolicyCMPGlobalBinding() {} -func (s *CMPService) CountCMPPolicyCMPGlobalBinding() {} + +func (s *CMPService) GetAllCMPPolicyCMPGlobalBinding() ([]models.CMPPolicyCMPGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyCMPGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCMPGlobalBinding `json:"cmppolicy_cmpglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyCMPGlobalBinding(name string) ([]models.CMPPolicyCMPGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyCMPGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCMPGlobalBinding `json:"cmppolicy_cmpglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyCMPGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyCMPGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy_cmpglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicy_cmppolicylabel_binding -func (s *CMPService) GetAllCMPPolicyCMPPolicyLabelBinding() {} -func (s *CMPService) GetCMPPolicyCMPPolicyLabelBinding() {} -func (s *CMPService) CountCMPPolicyCMPPolicyLabelBinding() {} + +func (s *CMPService) GetAllCMPPolicyCMPPolicyLabelBinding() ([]models.CMPPolicyCMPPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyCMPPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCMPPolicyLabelBinding `json:"cmppolicy_cmppolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyCMPPolicyLabelBinding(name string) ([]models.CMPPolicyCMPPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyCMPPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCMPPolicyLabelBinding `json:"cmppolicy_cmppolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyCMPPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyCMPPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy_cmppolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicy_crvserver_binding -func (s *CMPService) GetAllCMPPolicyCRVserverBinding() {} -func (s *CMPService) GetCMPPolicyCRVserverBinding() {} -func (s *CMPService) CountCMPPolicyCRVserverBinding() {} + +func (s *CMPService) GetAllCMPPolicyCRVserverBinding() ([]models.CMPPolicyCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCRVServerBinding `json:"cmppolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyCRVserverBinding(name string) ([]models.CMPPolicyCRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCRVServerBinding `json:"cmppolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyCRVserverBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicy_csvserver_binding -func (s *CMPService) GetAllCMPPolicyCSVServerBinding() {} -func (s *CMPService) GetCMPPolicyCSVServerBinding() {} -func (s *CMPService) CountCMPPolicyCSVServerBinding() {} + +func (s *CMPService) GetAllCMPPolicyCSVServerBinding() ([]models.CMPPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCSVServerBinding `json:"cmppolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyCSVServerBinding(name string) ([]models.CMPPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyCSVServerBinding `json:"cmppolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cmppolicy_lbvserver_binding -func (s *CMPService) GetAllCMPPolicyLBVServerBinding() {} -func (s *CMPService) GetCMPPolicyLBVServerBinding() {} -func (s *CMPService) CountCMPPolicyLBVServerBinding() {} + +func (s *CMPService) GetAllCMPPolicyLBVServerBinding() ([]models.CMPPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, cmpPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLBVServerBinding `json:"cmppolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) GetCMPPolicyLBVServerBinding(name string) ([]models.CMPPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", cmpPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CMPPolicyLBVServerBinding `json:"cmppolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CMPService) CountCMPPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", cmpPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cmppolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/content_inspection.go b/nitrogo/content_inspection.go index e1c08a2..af29df8 100644 --- a/nitrogo/content_inspection.go +++ b/nitrogo/content_inspection.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( contentInspectionActionURL = "/nitro/v1/config/contentinspectionaction" contentInspectionCalloutURL = "/nitro/v1/config/contentinspectioncallout" @@ -26,105 +36,1405 @@ type ContentInspectionService struct { } // contentinspectionaction -func (s *ContentInspectionService) AddContentInspectionAction() {} -func (s *ContentInspectionService) DeleteContentInspectionAction() {} -func (s *ContentInspectionService) UpdateContentInspectionAction() {} -func (s *ContentInspectionService) UnsetContentInspectionAction() {} -func (s *ContentInspectionService) GetAllContentInspectionAction() {} -func (s *ContentInspectionService) GetContentInspectionAction() {} -func (s *ContentInspectionService) CountContentInspectionAction() {} +func (s *ContentInspectionService) AddContentInspectionAction(resource models.ContentInspectionAction) error { + payload := map[string]any{"contentinspectionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UpdateContentInspectionAction(resource models.ContentInspectionAction) error { + payload := map[string]any{"contentinspectionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, contentInspectionActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UnsetContentInspectionAction(resource models.ContentInspectionAction) error { + payload := map[string]any{"contentinspectionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", contentInspectionActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionAction() ([]models.ContentInspectionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionAction `json:"contentinspectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionAction(name string) (models.ContentInspectionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionActionURL, name), nil) + if err != nil { + return models.ContentInspectionAction{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionAction{}, err + } + + var result struct { + Data []models.ContentInspectionAction `json:"contentinspectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionAction{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionAction{}, fmt.Errorf("contentinspectionaction %s not found", name) + } + + return result.Data[0], nil +} + +func (s *ContentInspectionService) CountContentInspectionAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", contentInspectionActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ContentInspectionAction `json:"contentinspectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // contentinspectioncallout -func (s *ContentInspectionService) AddContentInspectionCallout() {} -func (s *ContentInspectionService) DeleteContentInspectionCallout() {} -func (s *ContentInspectionService) UpdateContentInspectionCallout() {} -func (s *ContentInspectionService) UnsetContentInspectionCallout() {} -func (s *ContentInspectionService) GetAllContentInspectionCallout() {} -func (s *ContentInspectionService) GetContentInspectionCallout() {} -func (s *ContentInspectionService) CountContentInspectionCallout() {} +func (s *ContentInspectionService) AddContentInspectionCallout(resource models.ContentInspectionCallout) error { + payload := map[string]any{"contentinspectioncallout": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionCalloutURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionCallout(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionCalloutURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UpdateContentInspectionCallout(resource models.ContentInspectionCallout) error { + payload := map[string]any{"contentinspectioncallout": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, contentInspectionCalloutURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UnsetContentInspectionCallout(resource models.ContentInspectionCallout) error { + payload := map[string]any{"contentinspectioncallout": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", contentInspectionCalloutURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionCallout() ([]models.ContentInspectionCallout, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionCalloutURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionCallout `json:"contentinspectioncallout"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionCallout(name string) (models.ContentInspectionCallout, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionCalloutURL, name), nil) + if err != nil { + return models.ContentInspectionCallout{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionCallout{}, err + } + + var result struct { + Data []models.ContentInspectionCallout `json:"contentinspectioncallout"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionCallout{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionCallout{}, fmt.Errorf("contentinspectioncallout %s not found", name) + } + + return result.Data[0], nil +} + +func (s *ContentInspectionService) CountContentInspectionCallout() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", contentInspectionCalloutURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ContentInspectionCallout `json:"contentinspectioncallout"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // contentinspectionglobal_binding -func (s *ContentInspectionService) GetContentInspectionGlobalBinding() {} +func (s *ContentInspectionService) GetContentInspectionGlobalBinding() (models.ContentInspectionGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionGlobalBindingURL, nil) + if err != nil { + return models.ContentInspectionGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionGlobalBinding{}, err + } + + var result struct { + Data []models.ContentInspectionGlobalBinding `json:"contentinspectionglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionGlobalBinding{}, fmt.Errorf("contentinspectionglobal_binding not found") + } + + return result.Data[0], nil +} // contentinspectionglobal_contentinspectionpolicy_binding -func (s *ContentInspectionService) AddContentInspectionGlobalContentInspectionPolicyBinding() {} -func (s *ContentInspectionService) DeleteContentInspectionGlobalContentInspectionPolicyBinding() {} -func (s *ContentInspectionService) GetContentInspectionGlobalContentInspectionPolicyBinding() {} -func (s *ContentInspectionService) CountContentInspectionGlobalContentInspectionPolicyBinding() {} +func (s *ContentInspectionService) AddContentInspectionGlobalContentInspectionPolicyBinding(resource models.ContentInspectionGlobalContentInspectionPolicyBinding) error { + payload := map[string]any{"contentinspectionglobal_contentinspectionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionGlobalContentInspectionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionGlobalContentInspectionPolicyBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionGlobalContentInspectionPolicyBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetContentInspectionGlobalContentInspectionPolicyBinding() ([]models.ContentInspectionGlobalContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionGlobalContentInspectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionGlobalContentInspectionPolicyBinding `json:"contentinspectionglobal_contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// Struct lacks Count field, leaving for later +func (s *ContentInspectionService) CountContentInspectionGlobalContentInspectionPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionGlobalContentInspectionPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"contentinspectionglobal_contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // contentinspectionparameter -func (s *ContentInspectionService) UpdateContentInspectionParameter() {} -func (s *ContentInspectionService) UnsetContentInspectionParameter() {} -func (s *ContentInspectionService) GetAllContentInspectionParameter() {} +func (s *ContentInspectionService) UpdateContentInspectionParameter(resource models.ContentInspectionParameter) error { + payload := map[string]any{"contentinspectionparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, contentInspectionParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UnsetContentInspectionParameter(resource models.ContentInspectionParameter) error { + payload := map[string]any{"contentinspectionparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", contentInspectionParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionParameter() (models.ContentInspectionParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionParameterURL, nil) + if err != nil { + return models.ContentInspectionParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionParameter{}, err + } + + var result struct { + Data models.ContentInspectionParameter `json:"contentinspectionparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} // contentinspectionpolicy -func (s *ContentInspectionService) AddContentInspectionPolicy() {} -func (s *ContentInspectionService) DeleteContentInspectionPolicy() {} -func (s *ContentInspectionService) UpdateContentInspectionPolicy() {} -func (s *ContentInspectionService) UnsetContentInspectionPolicy() {} -func (s *ContentInspectionService) GetAllContentInspectionPolicy() {} -func (s *ContentInspectionService) GetContentInspectionPolicy() {} -func (s *ContentInspectionService) CountContentInspectionPolicy() {} -func (s *ContentInspectionService) RenameContentInspectionPolicy() {} +func (s *ContentInspectionService) AddContentInspectionPolicy(resource models.ContentInspectionPolicy) error { + payload := map[string]any{"contentinspectionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UpdateContentInspectionPolicy(resource models.ContentInspectionPolicy) error { + payload := map[string]any{"contentinspectionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, contentInspectionPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UnsetContentInspectionPolicy(resource models.ContentInspectionPolicy) error { + payload := map[string]any{"contentinspectionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", contentInspectionPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionPolicy() ([]models.ContentInspectionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicy `json:"contentinspectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicy(name string) (models.ContentInspectionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyURL, name), nil) + if err != nil { + return models.ContentInspectionPolicy{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicy{}, err + } + + var result struct { + Data []models.ContentInspectionPolicy `json:"contentinspectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicy{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicy{}, fmt.Errorf("contentinspectionpolicy %s not found", name) + } + + return result.Data[0], nil +} + +func (s *ContentInspectionService) CountContentInspectionPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", contentInspectionPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ContentInspectionPolicy `json:"contentinspectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *ContentInspectionService) RenameContentInspectionPolicy(resource models.ContentInspectionPolicy) error { + payload := map[string]any{"contentinspectionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", contentInspectionPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // contentinspectionpolicylabel -func (s *ContentInspectionService) AddContentInspectionPolicyLabel() {} -func (s *ContentInspectionService) DeleteContentInspectionPolicyLabel() {} -func (s *ContentInspectionService) GetAllContentInspectionPolicyLabel() {} -func (s *ContentInspectionService) GetContentInspectionPolicyLabel() {} -func (s *ContentInspectionService) CountContentInspectionPolicyLabel() {} -func (s *ContentInspectionService) RenameContentInspectionPolicyLabel() {} +func (s *ContentInspectionService) AddContentInspectionPolicyLabel(resource models.ContentInspectionPolicyLabel) error { + payload := map[string]any{"contentinspectionpolicylabel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionPolicyLabelURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionPolicyLabel(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionPolicyLabel() ([]models.ContentInspectionPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLabelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabel `json:"contentinspectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicyLabel(name string) (models.ContentInspectionPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyLabel{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyLabel{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabel `json:"contentinspectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyLabel{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyLabel{}, fmt.Errorf("contentinspectionpolicylabel %s not found", name) + } + + return result.Data[0], nil +} + +func (s *ContentInspectionService) CountContentInspectionPolicyLabel() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", contentInspectionPolicyLabelURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabel `json:"contentinspectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *ContentInspectionService) RenameContentInspectionPolicyLabel(resource models.ContentInspectionPolicyLabel) error { + payload := map[string]any{"contentinspectionpolicylabel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", contentInspectionPolicyLabelURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // contentinspectionpolicylabel_binding -func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolicyLabelBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelBinding() ([]models.ContentInspectionPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelBinding `json:"contentinspectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicyLabelBinding(name string) (models.ContentInspectionPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyLabelBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyLabelBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelBinding `json:"contentinspectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyLabelBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyLabelBinding{}, fmt.Errorf("contentinspectionpolicylabel_binding %s not found", name) + } + + return result.Data[0], nil +} // contentinspectionpolicylabel_contentinspectionpolicy_binding -func (s *ContentInspectionService) AddContentInspectionPolicyLabelContentInspectionPolicyBinding() {} -func (s *ContentInspectionService) DeleteContentInspectionPolicyLabelContentInspectionPolicyBinding() { +func (s *ContentInspectionService) AddContentInspectionPolicyLabelContentInspectionPolicyBinding(resource models.ContentInspectionPolicyLabelContentInspectionPolicyBinding) error { + payload := map[string]any{"contentinspectionpolicylabel_contentinspectionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionPolicyLabelContentInspectionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionPolicyLabelContentInspectionPolicyBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelContentInspectionPolicyBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelContentInspectionPolicyBinding() { + +func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelContentInspectionPolicyBinding() ([]models.ContentInspectionPolicyLabelContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLabelContentInspectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelContentInspectionPolicyBinding `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil } -func (s *ContentInspectionService) GetContentInspectionPolicyLabelContentInspectionPolicyBinding() {} + +func (s *ContentInspectionService) GetContentInspectionPolicyLabelContentInspectionPolicyBinding(name string) (models.ContentInspectionPolicyLabelContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelContentInspectionPolicyBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyLabelContentInspectionPolicyBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyLabelContentInspectionPolicyBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelContentInspectionPolicyBinding `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyLabelContentInspectionPolicyBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyLabelContentInspectionPolicyBinding{}, fmt.Errorf("contentinspectionpolicylabel_contentinspectionpolicy_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later func (s *ContentInspectionService) CountContentInspectionPolicyLabelContentInspectionPolicyBinding() { } // contentinspectionpolicylabel_policybinding_binding -func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelPolicyBindingBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolicyLabelPolicyBindingBinding() {} -func (s *ContentInspectionService) CountContentInspectionPolicyLabelPolicyBindingBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolicyLabelPolicyBindingBinding() ([]models.ContentInspectionPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelPolicyBindingBinding `json:"contentinspectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicyLabelPolicyBindingBinding(name string) (models.ContentInspectionPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyLabelPolicyBindingBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyLabelPolicyBindingBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyLabelPolicyBindingBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyLabelPolicyBindingBinding `json:"contentinspectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyLabelPolicyBindingBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyLabelPolicyBindingBinding{}, fmt.Errorf("contentinspectionpolicylabel_policybinding_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *ContentInspectionService) CountContentInspectionPolicyLabelPolicyBindingBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLabelPolicyBindingBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"contentinspectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // contentinspectionpolicy_binding -func (s *ContentInspectionService) GetAllContentInspectionPolicyBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolicyBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolicyBinding() ([]models.ContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyBinding `json:"contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicyBinding(name string) (models.ContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyBinding `json:"contentinspectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyBinding{}, fmt.Errorf("contentinspectionpolicy_binding %s not found", name) + } + + return result.Data[0], nil +} // contentinspectionpolicy_contentinspectionglobal_binding -func (s *ContentInspectionService) GetAllContentInspectionPolcyContentInspectionGlobalBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolcyContentInspectionGlobalBinding() {} -func (s *ContentInspectionService) CountContentInspectionPolcyContentInspectionGlobalBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolcyContentInspectionGlobalBinding() ([]models.ContentInspectionPolicyContentInspectionGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyContentInspectionGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyContentInspectionGlobalBinding `json:"contentinspectionpolicy_contentinspectionglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolcyContentInspectionGlobalBinding(name string) (models.ContentInspectionPolicyContentInspectionGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyContentInspectionGlobalBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyContentInspectionGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyContentInspectionGlobalBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyContentInspectionGlobalBinding `json:"contentinspectionpolicy_contentinspectionglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyContentInspectionGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyContentInspectionGlobalBinding{}, fmt.Errorf("contentinspectionpolicy_contentinspectionglobal_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *ContentInspectionService) CountContentInspectionPolcyContentInspectionGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", contentInspectionPolicyContentInspectionGlobalBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"contentinspectionpolicy_contentinspectionglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // contentinspectionpolicy_contentinspectionpolicylabel_binding -func (s *ContentInspectionService) GetAllContentInspectionPolicyContentInspectionPolicyLabelBinding() { +func (s *ContentInspectionService) GetAllContentInspectionPolicyContentInspectionPolicyLabelBinding() ([]models.ContentInspectionPolicyContentInspectionPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyContentInspectionPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyContentInspectionPolicyLabelBinding `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil } -func (s *ContentInspectionService) GetContentInspectionPolicyContentInspectionPolicyLabelBinding() {} + +func (s *ContentInspectionService) GetContentInspectionPolicyContentInspectionPolicyLabelBinding(name string) (models.ContentInspectionPolicyContentInspectionPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyContentInspectionPolicyLabelBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyContentInspectionPolicyLabelBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyContentInspectionPolicyLabelBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyContentInspectionPolicyLabelBinding `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyContentInspectionPolicyLabelBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyContentInspectionPolicyLabelBinding{}, fmt.Errorf("contentinspectionpolicy_contentinspectionpolicylabel_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later func (s *ContentInspectionService) CountContentInspectionPolicyContentInspectionPolicyLabelBinding() { } // contentinspectionpolicy_csvserver_binding -func (s *ContentInspectionService) GetAllContentInspectionPolicyCSVServerBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolicyCSVServerBinding() {} -func (s *ContentInspectionService) CountContentInspectionPolicyCSVServerBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolicyCSVServerBinding() ([]models.ContentInspectionPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyCSVServerBinding `json:"contentinspectionpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolicyCSVServerBinding(name string) (models.ContentInspectionPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyCSVServerBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyCSVServerBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyCSVServerBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyCSVServerBinding `json:"contentinspectionpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyCSVServerBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyCSVServerBinding{}, fmt.Errorf("contentinspectionpolicy_csvserver_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *ContentInspectionService) CountContentInspectionPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", contentInspectionPolicyCSVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"contentinspectionpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // contentinspectionpolicy_lbvserver_binding -func (s *ContentInspectionService) GetAllContentInspectionPolcyLBVServerBinding() {} -func (s *ContentInspectionService) GetContentInspectionPolcyLBVServerBinding() {} -func (s *ContentInspectionService) CountContentInspectionPolcyLBVServerBinding() {} +func (s *ContentInspectionService) GetAllContentInspectionPolcyLBVServerBinding() ([]models.ContentInspectionPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionPolicyLBVServerBinding `json:"contentinspectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionPolcyLBVServerBinding(name string) (models.ContentInspectionPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionPolicyLBVServerBindingURL, name), nil) + if err != nil { + return models.ContentInspectionPolicyLBVServerBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionPolicyLBVServerBinding{}, err + } + + var result struct { + Data []models.ContentInspectionPolicyLBVServerBinding `json:"contentinspectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionPolicyLBVServerBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionPolicyLBVServerBinding{}, fmt.Errorf("contentinspectionpolicy_lbvserver_binding %s not found", name) + } + + return result.Data[0], nil +} + +// Struct lacks Count field, leaving for later +func (s *ContentInspectionService) CountContentInspectionPolcyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", contentInspectionPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"contentinspectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // contentinspectionprofile -func (s *ContentInspectionService) AddContentInspectionProfile() {} -func (s *ContentInspectionService) DeleteContentInspectionProfile() {} -func (s *ContentInspectionService) UpdateContentInspectionProfile() {} -func (s *ContentInspectionService) UnsetContentInspectionProfile() {} -func (s *ContentInspectionService) GetAllContentInspectionProfile() {} -func (s *ContentInspectionService) GetContentInspectionProfile() {} -func (s *ContentInspectionService) CountContentInspectionProfile() {} +func (s *ContentInspectionService) AddContentInspectionProfile(resource models.ContentInspectionProfile) error { + payload := map[string]any{"contentinspectionprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, contentInspectionProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) DeleteContentInspectionProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", contentInspectionProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UpdateContentInspectionProfile(resource models.ContentInspectionProfile) error { + payload := map[string]any{"contentinspectionprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, contentInspectionProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) UnsetContentInspectionProfile(resource models.ContentInspectionProfile) error { + payload := map[string]any{"contentinspectionprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", contentInspectionProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ContentInspectionService) GetAllContentInspectionProfile() ([]models.ContentInspectionProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, contentInspectionProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ContentInspectionProfile `json:"contentinspectionprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *ContentInspectionService) GetContentInspectionProfile(name string) (models.ContentInspectionProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", contentInspectionProfileURL, name), nil) + if err != nil { + return models.ContentInspectionProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ContentInspectionProfile{}, err + } + + var result struct { + Data []models.ContentInspectionProfile `json:"contentinspectionprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ContentInspectionProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.ContentInspectionProfile{}, fmt.Errorf("contentinspectionprofile %s not found", name) + } + + return result.Data[0], nil +} + +func (s *ContentInspectionService) CountContentInspectionProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", contentInspectionProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ContentInspectionProfile `json:"contentinspectionprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} diff --git a/nitrogo/cr.go b/nitrogo/cr.go index b16374b..8612195 100644 --- a/nitrogo/cr.go +++ b/nitrogo/cr.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( crActionURL = "/nitro/v1/config/craction" crPolicyURL = "/nitro/v1/config/crpolicy" @@ -24,156 +34,1862 @@ const ( crVServerSpilloverPolicyBindingURL = "/nitro/v1/config/crvserver_spilloverpolicy_binding" ) -// Cache redirection configuration. The cache redirection feature can transparently redirect cacheable HTTP -// requests to a cache and send non-cacheable or dynamic HTTP requests to the origin server. A cache stores -// or caches frequently requested web content and serves such web content to a client on behalf of the origin -// servers, alleviating the load on the origin server farm. +// Cache redirection configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cr/cr type CRService struct { client *Client } // craction -func (s *CRService) GetAllCRAction() {} -func (s *CRService) GetCRAction() {} -func (s *CRService) CountCRAction() {} +func (s *CRService) GetAllCRAction() ([]models.CRAction, error) { + req, err := s.client.NewRequest(http.MethodGet, crActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CRAction `json:"craction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CRService) GetCRAction(name string) ([]models.CRAction, error) { + reqURL := fmt.Sprintf("%s/%s", crActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CRAction `json:"craction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CRService) CountCRAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, crActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"craction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // crpolicy -func (s *CRService) AddCRPolicy() {} -func (s *CRService) DeleteCRPolicy() {} -func (s *CRService) UpdateCRPolicy() {} -func (s *CRService) UnsetCRPolicy() {} -func (s *CRService) GetAllCRPolicy() {} -func (s *CRService) GetCRPolicy() {} -func (s *CRService) CountCRPolicy() {} -func (s *CRService) RenameCRPolicy() {} +func (s *CRService) AddCRPolicy(policy models.CRPolicy) error { + payload := map[string]any{"crpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRPolicy(policyName string) error { + reqURL := fmt.Sprintf("%s/%s", crPolicyURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) UpdateCRPolicy(policy models.CRPolicy) error { + payload := map[string]any{"crpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) UnsetCRPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"crpolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) RenameCRPolicy(name string, newName string) error { + payload := map[string]any{ + "crpolicy": map[string]string{ + "policyname": name, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRPolicy() ([]models.CRPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, crPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CRPolicy `json:"crpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CRService) GetCRPolicy(policyName string) ([]models.CRPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", crPolicyURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CRPolicy `json:"crpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CRService) CountCRPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, crPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"crpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // crpolicy_binding -func (s *CRService) GetAllCRPolicyBinding() {} -func (s *CRService) GetCRPolicyBinding() {} +func (s *CRService) GetAllCRPolicyBinding() ([]models.CRPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRPolicyBinding `json:"crpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRPolicyBinding(policyName string) ([]models.CRPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRPolicyBinding `json:"crpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // crpolicy_crvserver_binding -func (s *CRService) GetAllCRPolicyCRVServerBinding() {} -func (s *CRService) GetCRPolicyCRVServerBinding() {} -func (s *CRService) CountCRPolicyCRVServerBinding() {} +func (s *CRService) GetAllCRPolicyCRVServerBinding() ([]models.CRPolicyCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crPolicyCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRPolicyCRVServerBinding `json:"crpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRPolicyCRVServerBinding(policyName string) ([]models.CRPolicyCRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crPolicyCRVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRPolicyCRVServerBinding `json:"crpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRPolicyCRVServerBinding(policyName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crPolicyCRVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver -func (s *CRService) AddCRVServer() {} -func (s *CRService) DeleteCRVServer() {} -func (s *CRService) UpdateCRVServer() {} -func (s *CRService) UnsetCRVServer() {} -func (s *CRService) EnableCRVServer() {} -func (s *CRService) DisableCRVServer() {} -func (s *CRService) GetAllCRVServer() {} -func (s *CRService) GetCRVServer() {} -func (s *CRService) CountCRVServer() {} -func (s *CRService) RenameCRVServer() {} +func (s *CRService) AddCRVServer(vserver models.CRVServer) error { + payload := map[string]any{"crvserver": vserver} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServer(name string) error { + reqURL := fmt.Sprintf("%s/%s", crVServerURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) UpdateCRVServer(vserver models.CRVServer) error { + payload := map[string]any{"crvserver": vserver} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) UnsetCRVServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"crvserver": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crVServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) EnableCRVServer(name string) error { + payload := map[string]any{ + "crvserver": map[string]string{"name": name}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crVServerURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DisableCRVServer(name string) error { + payload := map[string]any{ + "crvserver": map[string]string{"name": name}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crVServerURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) RenameCRVServer(name string, newName string) error { + payload := map[string]any{ + "crvserver": map[string]string{ + "name": name, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, crVServerURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServer() ([]models.CRVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + VServers []models.CRVServer `json:"crvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.VServers, nil +} + +func (s *CRService) GetCRVServer(name string) ([]models.CRVServer, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + VServers []models.CRVServer `json:"crvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.VServers, nil +} + +func (s *CRService) CountCRVServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + VServers []struct { + Count float64 `json:"__count"` + } `json:"crvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.VServers) > 0 { + return result.VServers[0].Count, nil + } + return 0, nil +} // crvserver_analyticsprofile_binding -func (s *CRService) AddCRVServerAnalyticsProfileBinding() {} -func (s *CRService) DeleteCRVServerAnalyticsProfileBinding() {} -func (s *CRService) GetAllCRVServerAnalyticsProfileBinding() {} -func (s *CRService) GetCRVServerAnalyticsProfileBinding() {} -func (s *CRService) CountCRVServerAnalyticsProfileBinding() {} +func (s *CRService) AddCRVServerAnalyticsProfileBinding(binding models.CRVServerAnalyticsProfileBinding) error { + payload := map[string]any{"crvserver_analyticsprofile_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerAnalyticsProfileBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerAnalyticsProfileBinding(name string, analyticsProfile string) error { + reqURL := fmt.Sprintf("%s/%s?args=analyticsprofile:%s", crVServerAnalyticsProfileBindingURL, url.QueryEscape(name), url.QueryEscape(analyticsProfile)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerAnalyticsProfileBinding() ([]models.CRVServerAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerAnalyticsProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAnalyticsProfileBinding `json:"crvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerAnalyticsProfileBinding(name string) ([]models.CRVServerAnalyticsProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAnalyticsProfileBinding `json:"crvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerAnalyticsProfileBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_appflowpolicy_binding -func (s *CRService) AddCRVServerAppFlowPolicyBinding() {} -func (s *CRService) DeleteCRVServerAppFlowPolicyBinding() {} -func (s *CRService) GetAllCRVServerAppFlowPolicyBinding() {} -func (s *CRService) GetCRVServerAppFlowPolicyBinding() {} -func (s *CRService) CountCRVServerAppFlowPolicyBinding() {} +func (s *CRService) AddCRVServerAppFlowPolicyBinding(binding models.CRVServerAppFlowPolicyBinding) error { + payload := map[string]any{"crvserver_appflowpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerAppFlowPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerAppFlowPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerAppFlowPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerAppFlowPolicyBinding() ([]models.CRVServerAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerAppFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppFlowPolicyBinding `json:"crvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerAppFlowPolicyBinding(name string) ([]models.CRVServerAppFlowPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerAppFlowPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppFlowPolicyBinding `json:"crvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerAppFlowPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerAppFlowPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_appfwpolicy_binding -func (s *CRService) AddCRVServerAppFWPolicyBinding() {} -func (s *CRService) DeleteCRVServerAppFWPolicyBinding() {} -func (s *CRService) GetAllCRVServerAppFWPolicyBinding() {} -func (s *CRService) GetCRVServerAppFWPolicyBinding() {} -func (s *CRService) CountCRVServerAppFWPolicyBinding() {} +func (s *CRService) AddCRVServerAppFWPolicyBinding(binding models.CRVServerAppFWPolicyBinding) error { + payload := map[string]any{"crvserver_appfwpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerAppFWPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerAppFWPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerAppFWPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerAppFWPolicyBinding() ([]models.CRVServerAppFWPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerAppFWPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppFWPolicyBinding `json:"crvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerAppFWPolicyBinding(name string) ([]models.CRVServerAppFWPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerAppFWPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppFWPolicyBinding `json:"crvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerAppFWPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerAppFWPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_appqoepolicy_binding -func (s *CRService) AddCRVServerAppQOEPolicyBinding() {} -func (s *CRService) DeleteCRVServerAppQOEPolicyBinding() {} -func (s *CRService) GetAllCRVServerAppQOEPolicyBinding() {} -func (s *CRService) GetCRVServerAppQOEPolicyBinding() {} -func (s *CRService) CountCRVServerAppQOEPolicyBinding() {} +func (s *CRService) AddCRVServerAppQOEPolicyBinding(binding models.CRVServerAppQOEPolicyBinding) error { + payload := map[string]any{"crvserver_appqoepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerAppQOEPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerAppQOEPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerAppQOEPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerAppQOEPolicyBinding() ([]models.CRVServerAppQOEPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerAppQOEPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppQOEPolicyBinding `json:"crvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerAppQOEPolicyBinding(name string) ([]models.CRVServerAppQOEPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerAppQOEPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerAppQOEPolicyBinding `json:"crvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerAppQOEPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerAppQOEPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_binding -func (s *CRService) GetAllCRVServerBinding() {} -func (s *CRService) GetCRVServerBinding() {} +func (s *CRService) GetAllCRVServerBinding() ([]models.CRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerBinding `json:"crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerBinding(name string) ([]models.CRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerBinding `json:"crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // crvserver_cachepolicy_binding -func (s *CRService) AddCRVServerCachePolicyBinding() {} -func (s *CRService) DeleteCRVServerCachePolicyBinding() {} -func (s *CRService) GetAllCRVServerCachePolicyBinding() {} -func (s *CRService) GetCRVServerCachePolicyBinding() {} -func (s *CRService) CountCRVServerCachePolicyBinding() {} +func (s *CRService) AddCRVServerCachePolicyBinding(binding models.CRVServerCachePolicyBinding) error { + payload := map[string]any{"crvserver_cachepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerCachePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerCachePolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerCachePolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerCachePolicyBinding() ([]models.CRVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCachePolicyBinding `json:"crvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerCachePolicyBinding(name string) ([]models.CRVServerCachePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerCachePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCachePolicyBinding `json:"crvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerCachePolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerCachePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_cmppolicy_binding -func (s *CRService) AddCRVServerCMPPolicyBinding() {} -func (s *CRService) DeleteCRVServerCMPPolicyBinding() {} -func (s *CRService) GetAllCRVServerCMPPolicyBinding() {} -func (s *CRService) GetCRVServerCMPPolicyBinding() {} -func (s *CRService) CountCRVServerCMPPolicyBinding() {} +func (s *CRService) AddCRVServerCMPPolicyBinding(binding models.CRVServerCMPPolicyBinding) error { + payload := map[string]any{"crvserver_cmppolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerCMPPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerCMPPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerCMPPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerCMPPolicyBinding() ([]models.CRVServerCMPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerCMPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCMPPolicyBinding `json:"crvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerCMPPolicyBinding(name string) ([]models.CRVServerCMPPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCMPPolicyBinding `json:"crvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerCMPPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_crpolicy_binding -func (s *CRService) AddCRVServerCRPolicyBinding() {} -func (s *CRService) DeleteCRVServerCRPolicyBinding() {} -func (s *CRService) GetAllCRVServerCRPolicyBinding() {} -func (s *CRService) GetCRVServerCRPolicyBinding() {} -func (s *CRService) CountCRVServerCRPolicyBinding() {} +func (s *CRService) AddCRVServerCRPolicyBinding(binding models.CRVServerCRPolicyBinding) error { + payload := map[string]any{"crvserver_crpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerCRPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerCRPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerCRPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerCRPolicyBinding() ([]models.CRVServerCRPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerCRPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCRPolicyBinding `json:"crvserver_crpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerCRPolicyBinding(name string) ([]models.CRVServerCRPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerCRPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCRPolicyBinding `json:"crvserver_crpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerCRPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerCRPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_crpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_cspolicy_binding -func (s *CRService) AddCRVServerCSPolicyBinding() {} -func (s *CRService) DeleteCRVServerCSPolicyBinding() {} -func (s *CRService) GetAllCRVServerCSPolicyBinding() {} -func (s *CRService) GetCRVServerCSPolicyBinding() {} -func (s *CRService) CountCRVServerCSPolicyBinding() {} +func (s *CRService) AddCRVServerCSPolicyBinding(binding models.CRVServerCSPolicyBinding) error { + payload := map[string]any{"crvserver_cspolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerCSPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerCSPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerCSPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerCSPolicyBinding() ([]models.CRVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerCSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCSPolicyBinding `json:"crvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerCSPolicyBinding(name string) ([]models.CRVServerCSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerCSPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerCSPolicyBinding `json:"crvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerCSPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerCSPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_feopolicy_binding -func (s *CRService) AddCRVServerFEOPolicyBinding() {} -func (s *CRService) DeleteCRVServerFEOPolicyBinding() {} -func (s *CRService) GetAllCRVServerFEOPolicyBinding() {} -func (s *CRService) GetCRVServerFEOPolicyBinding() {} -func (s *CRService) CountCRVServerFEOPolicyBinding() {} +func (s *CRService) AddCRVServerFEOPolicyBinding(binding models.CRVServerFEOPolicyBinding) error { + payload := map[string]any{"crvserver_feopolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerFEOPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerFEOPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerFEOPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerFEOPolicyBinding() ([]models.CRVServerFEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerFEOPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerFEOPolicyBinding `json:"crvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerFEOPolicyBinding(name string) ([]models.CRVServerFEOPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerFEOPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerFEOPolicyBinding `json:"crvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerFEOPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerFEOPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_icapolicy_binding -func (s *CRService) AddCRVServerICAPolicyBinding() {} -func (s *CRService) DeleteCRVServerICAPolicyBinding() {} -func (s *CRService) GetAllCRVServerICAPolicyBinding() {} -func (s *CRService) GetCRVServerICAPolicyBinding() {} -func (s *CRService) CountCRVServerICAPolicyBinding() {} +func (s *CRService) AddCRVServerICAPolicyBinding(binding models.CRVServerICAPolicyBinding) error { + payload := map[string]any{"crvserver_icapolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerICAPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerICAPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerICAPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerICAPolicyBinding() ([]models.CRVServerICAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerICAPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerICAPolicyBinding `json:"crvserver_icapolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerICAPolicyBinding(name string) ([]models.CRVServerICAPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerICAPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerICAPolicyBinding `json:"crvserver_icapolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerICAPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerICAPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_icapolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_lbvserver_binding -func (s *CRService) AddCRVServerLBVServerBinding() {} -func (s *CRService) DeleteCRVServerLBVServerBinding() {} -func (s *CRService) GetAllCRVServerLBVServerBinding() {} -func (s *CRService) GetCRVServerLBVServerBinding() {} -func (s *CRService) CountCRVServerLBVServerBinding() {} +func (s *CRService) AddCRVServerLBVServerBinding(binding models.CRVServerLBVServerBinding) error { + payload := map[string]any{"crvserver_lbvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerLBVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerLBVServerBinding(name string, lbvserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=lbvserver:%s", crVServerLBVServerBindingURL, url.QueryEscape(name), url.QueryEscape(lbvserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerLBVServerBinding() ([]models.CRVServerLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerLBVServerBinding `json:"crvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerLBVServerBinding(name string) ([]models.CRVServerLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerLBVServerBinding `json:"crvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_policymap_binding -func (s *CRService) AddCRVServerPolicyMapBinding() {} -func (s *CRService) DeleteCRVServerPolicyMapBinding() {} -func (s *CRService) GetAllCRVServerPolicyMapBinding() {} -func (s *CRService) GetCRVServerPolicyMapBinding() {} -func (s *CRService) CountCRVServerPolicyMapBinding() {} +func (s *CRService) AddCRVServerPolicyMapBinding(binding models.CRVServerPolicyMapBinding) error { + payload := map[string]any{"crvserver_policymap_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerPolicyMapBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerPolicyMapBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerPolicyMapBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerPolicyMapBinding() ([]models.CRVServerPolicyMapBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerPolicyMapBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerPolicyMapBinding `json:"crvserver_policymap_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerPolicyMapBinding(name string) ([]models.CRVServerPolicyMapBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerPolicyMapBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerPolicyMapBinding `json:"crvserver_policymap_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerPolicyMapBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerPolicyMapBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_policymap_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_responderpolicy_binding -func (s *CRService) AddCRVServerResponderPolicyBinding() {} -func (s *CRService) DeleteCRVServerResponderPolicyBinding() {} -func (s *CRService) GetAllCRVServerResponderPolicyBinding() {} -func (s *CRService) GetCRVServerResponderPolicyBinding() {} -func (s *CRService) CountCRVServerResponderPolicyBinding() {} +func (s *CRService) AddCRVServerResponderPolicyBinding(binding models.CRVServerResponderPolicyBinding) error { + payload := map[string]any{"crvserver_responderpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerResponderPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerResponderPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerResponderPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerResponderPolicyBinding() ([]models.CRVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerResponderPolicyBinding `json:"crvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerResponderPolicyBinding(name string) ([]models.CRVServerResponderPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerResponderPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerResponderPolicyBinding `json:"crvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerResponderPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerResponderPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_rewritepolicy_binding -func (s *CRService) AddCRVServerRewritePolicyBinding() {} -func (s *CRService) DeleteCRVServerRewritePolicyBinding() {} -func (s *CRService) GetAllCRVServerRewritePolicyBinding() {} -func (s *CRService) GetCRVServerRewritePolicyBinding() {} -func (s *CRService) CountCRVServerRewritePolicyBinding() {} +func (s *CRService) AddCRVServerRewritePolicyBinding(binding models.CRVServerRewritePolicyBinding) error { + payload := map[string]any{"crvserver_rewritepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerRewritePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerRewritePolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerRewritePolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerRewritePolicyBinding() ([]models.CRVServerRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerRewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerRewritePolicyBinding `json:"crvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerRewritePolicyBinding(name string) ([]models.CRVServerRewritePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerRewritePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerRewritePolicyBinding `json:"crvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerRewritePolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerRewritePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // crvserver_spilloverpolicy_binding -func (s *CRService) AddCRVServerSpilloverPolicyBinding() {} -func (s *CRService) DeleteCRVServerSpilloverPolicyBinding() {} -func (s *CRService) GetAllCRVServerSpilloverPolicyBinding() {} -func (s *CRService) GetCRVServerSpilloverPolicyBinding() {} -func (s *CRService) CountCRVServerSpilloverPolicyBinding() {} +func (s *CRService) AddCRVServerSpilloverPolicyBinding(binding models.CRVServerSpilloverPolicyBinding) error { + payload := map[string]any{"crvserver_spilloverpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, crVServerSpilloverPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) DeleteCRVServerSpilloverPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", crVServerSpilloverPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CRService) GetAllCRVServerSpilloverPolicyBinding() ([]models.CRVServerSpilloverPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, crVServerSpilloverPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerSpilloverPolicyBinding `json:"crvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) GetCRVServerSpilloverPolicyBinding(name string) ([]models.CRVServerSpilloverPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", crVServerSpilloverPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CRVServerSpilloverPolicyBinding `json:"crvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CRService) CountCRVServerSpilloverPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", crVServerSpilloverPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"crvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/cs.go b/nitrogo/cs.go index fe08dcf..7f687d5 100644 --- a/nitrogo/cs.go +++ b/nitrogo/cs.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( csActionURL = "/nitro/v1/config/csaction" csParameterURL = "/nitro/v1/config/csparameter" @@ -37,241 +47,2981 @@ const ( csVServerVPNVServerBindingURL = "/nitro/v1/config/csvserver_vpnvserver_binding" ) -// Content Switching configuration. Content Switching feature that enables you to direct traffic to servers on the basis of content. +// Content Switching configuration. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/cs/cs type CSService struct { client *Client } // csaction -func (s *CSService) AddCSAction() {} -func (s *CSService) DeleteCSAction() {} -func (s *CSService) UpdateCSAction() {} -func (s *CSService) UnsetCSAction() {} -func (s *CSService) GetAllCSAction() {} -func (s *CSService) GetCSAction() {} -func (s *CSService) CountCSAction() {} -func (s *CSService) RenameCSAction() {} +func (s *CSService) AddCSAction(action models.CSAction) error { + payload := map[string]any{"csaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", csActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UpdateCSAction(action models.CSAction) error { + payload := map[string]any{"csaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UnsetCSAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"csaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) RenameCSAction(name string, newName string) error { + payload := map[string]any{ + "csaction": map[string]string{ + "name": name, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSAction() ([]models.CSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, csActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CSAction `json:"csaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CSService) GetCSAction(name string) ([]models.CSAction, error) { + reqURL := fmt.Sprintf("%s/%s", csActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.CSAction `json:"csaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *CSService) CountCSAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, csActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"csaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // csparameter -func (s *CSService) UpdateCSParameter() {} -func (s *CSService) UnsetCSParameter() {} -func (s *CSService) GetAllCSParameter() {} +func (s *CSService) UpdateCSParameter(param models.CSParameter) error { + payload := map[string]any{"csparameter": param} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UnsetCSParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"csparameter": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSParameter() (models.CSParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, csParameterURL, nil) + if err != nil { + return models.CSParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.CSParameter{}, err + } + var result struct { + Params []models.CSParameter `json:"csparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CSParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.CSParameter{}, nil +} // cspolicy -func (s *CSService) AddCSPolicy() {} -func (s *CSService) DeleteCSPolicy() {} -func (s *CSService) UpdateCSPolicy() {} -func (s *CSService) UnsetCSPolicy() {} -func (s *CSService) GetAllCSPolicy() {} -func (s *CSService) GetCSPolicy() {} -func (s *CSService) CountCSPolicy() {} -func (s *CSService) RenameCSPolicy() {} +func (s *CSService) AddCSPolicy(policy models.CSPolicy) error { + payload := map[string]any{"cspolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSPolicy(policyName string) error { + reqURL := fmt.Sprintf("%s/%s", csPolicyURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UpdateCSPolicy(policy models.CSPolicy) error { + payload := map[string]any{"cspolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UnsetCSPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"cspolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) RenameCSPolicy(policyName string, newName string) error { + payload := map[string]any{ + "cspolicy": map[string]string{ + "policyname": policyName, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSPolicy() ([]models.CSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CSPolicy `json:"cspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CSService) GetCSPolicy(policyName string) ([]models.CSPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.CSPolicy `json:"cspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *CSService) CountCSPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"cspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // cspolicylabel -func (s *CSService) AddCSPolicyLabel() {} -func (s *CSService) DeleteCSPolicyLabel() {} -func (s *CSService) GetAllCSPolicyLabel() {} -func (s *CSService) GetCSPolicyLabel() {} -func (s *CSService) CountCSPolicyLabel() {} -func (s *CSService) RenameCSPolicyLabel() {} +func (s *CSService) AddCSPolicyLabel(label models.CSPolicyLabel) error { + payload := map[string]any{"cspolicylabel": label} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSPolicyLabel(labelName string) error { + reqURL := fmt.Sprintf("%s/%s", csPolicyLabelURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) RenameCSPolicyLabel(labelName string, newName string) error { + payload := map[string]any{ + "cspolicylabel": map[string]string{ + "labelname": labelName, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSPolicyLabel() ([]models.CSPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CSPolicyLabel `json:"cspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CSService) GetCSPolicyLabel(labelName string) ([]models.CSPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyLabelURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.CSPolicyLabel `json:"cspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *CSService) CountCSPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"cspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} // cspolicylabel_binding -func (s *CSService) GetAllCSPolicyLabelBinding() {} -func (s *CSService) GetCSPolicyLabelBinding() {} +func (s *CSService) GetAllCSPolicyLabelBinding() ([]models.CSPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyLabelBinding `json:"cspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyLabelBinding(labelName string) ([]models.CSPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyLabelBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyLabelBinding `json:"cspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cspolicylabel_cspolicy_binding -func (s *CSService) AddCSPolicyLabelCSPolicyBinding() {} -func (s *CSService) DeleteCSPolicyLabelCSPolicyBinding() {} -func (s *CSService) GetAllCSPolicyLabelCSPolicyBinding() {} -func (s *CSService) GetCSPolicyLabelCSPolicyBinding() {} -func (s *CSService) CountCSPolicyLabelCSPolicyBinding() {} +func (s *CSService) AddCSPolicyLabelCSPolicyBinding(binding models.CSPolicyLabelCSPolicyBinding) error { + payload := map[string]any{"cspolicylabel_cspolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csPolicyLabelCSPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSPolicyLabelCSPolicyBinding(labelName string, policyName string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", csPolicyLabelCSPolicyBindingURL, url.QueryEscape(labelName), url.QueryEscape(policyName), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSPolicyLabelCSPolicyBinding() ([]models.CSPolicyLabelCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyLabelCSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyLabelCSPolicyBinding `json:"cspolicylabel_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyLabelCSPolicyBinding(labelName string) ([]models.CSPolicyLabelCSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyLabelCSPolicyBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyLabelCSPolicyBinding `json:"cspolicylabel_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSPolicyLabelCSPolicyBinding(labelName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csPolicyLabelCSPolicyBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cspolicylabel_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cspolicy_binding -func (s *CSService) GetAllCSPolicyBinding() {} -func (s *CSService) GetCSPolicyBinding() {} +func (s *CSService) GetAllCSPolicyBinding() ([]models.CSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyBinding `json:"cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyBinding(policyName string) ([]models.CSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyBinding `json:"cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // cspolicy_crvserver_binding -func (s *CSService) GetAllCSPolicyCRVServerBinding() {} -func (s *CSService) GetCSPolicyCRVServerBinding() {} -func (s *CSService) CountCSPolicyCRVServerBinding() {} +func (s *CSService) GetAllCSPolicyCRVServerBinding() ([]models.CSPolicyCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCRVServerBinding `json:"cspolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyCRVServerBinding(policyName string) ([]models.CSPolicyCRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyCRVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCRVServerBinding `json:"cspolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSPolicyCRVServerBinding(policyName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csPolicyCRVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cspolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cspolicy_cspolicylabel_binding -func (s *CSService) GetAllCSPolicyCSPolicyLabelBinding() {} -func (s *CSService) GetCSPolicyCSPolicyLabelBinding() {} -func (s *CSService) CountCSPolicyCSPolicyLabelBinding() {} +func (s *CSService) GetAllCSPolicyCSPolicyLabelBinding() ([]models.CSPolicyCSPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyCSPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCSPolicyLabelBinding `json:"cspolicy_cspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyCSPolicyLabelBinding(policyName string) ([]models.CSPolicyCSPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyCSPolicyLabelBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCSPolicyLabelBinding `json:"cspolicy_cspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSPolicyCSPolicyLabelBinding(policyName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csPolicyCSPolicyLabelBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cspolicy_cspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // cspolicy_csvserver_binding -func (s *CSService) GetAllCSPolicyCSVServerBinding() {} -func (s *CSService) GetCSPolicyCSVServerBinding() {} -func (s *CSService) CountCSPolicyCSVServerBinding() {} +func (s *CSService) GetAllCSPolicyCSVServerBinding() ([]models.CSPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCSVServerBinding `json:"cspolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSPolicyCSVServerBinding(policyName string) ([]models.CSPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csPolicyCSVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSPolicyCSVServerBinding `json:"cspolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSPolicyCSVServerBinding(policyName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csPolicyCSVServerBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"cspolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver -func (s *CSService) AddCSVServer() {} -func (s *CSService) DeleteCSVServer() {} -func (s *CSService) UpdateCSVServer() {} -func (s *CSService) UnsetCSVServer() {} -func (s *CSService) EnableCSVServer() {} -func (s *CSService) DisableCSVServer() {} -func (s *CSService) GetAllCSVServer() {} -func (s *CSService) GetCSVServer() {} -func (s *CSService) CountCSVServer() {} -func (s *CSService) RenameCSVServer() {} +func (s *CSService) AddCSVServer(vserver models.CSVServer) error { + payload := map[string]any{"csvserver": vserver} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServer(name string) error { + reqURL := fmt.Sprintf("%s/%s", csVServerURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UpdateCSVServer(vserver models.CSVServer) error { + payload := map[string]any{"csvserver": vserver} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) UnsetCSVServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"csvserver": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csVServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) EnableCSVServer(name string) error { + payload := map[string]any{ + "csvserver": map[string]string{"name": name}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csVServerURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DisableCSVServer(name string) error { + payload := map[string]any{ + "csvserver": map[string]string{"name": name}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csVServerURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) RenameCSVServer(name string, newName string) error { + payload := map[string]any{ + "csvserver": map[string]string{ + "name": name, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, csVServerURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServer() ([]models.CSVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + VServers []models.CSVServer `json:"csvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.VServers, nil +} + +func (s *CSService) GetCSVServer(name string) ([]models.CSVServer, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + VServers []models.CSVServer `json:"csvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.VServers, nil +} + +func (s *CSService) CountCSVServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + VServers []struct { + Count float64 `json:"__count"` + } `json:"csvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.VServers) > 0 { + return result.VServers[0].Count, nil + } + return 0, nil +} // csvserver_analyticsprofile_binding -func (s *CSService) AddCSVServerAnalyticsProfileBinding() {} -func (s *CSService) DeleteCSVServerAnalyticsProfileBinding() {} -func (s *CSService) GetAllCSVServerAnalyticsProfileBinding() {} -func (s *CSService) GetCSVServerAnalyticsProfileBinding() {} -func (s *CSService) CountCSVServerAnalyticsProfileBinding() {} +func (s *CSService) AddCSVServerAnalyticsProfileBinding(binding models.CSVServerAnalyticsProfileBinding) error { + payload := map[string]any{"csvserver_analyticsprofile_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAnalyticsProfileBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAnalyticsProfileBinding(name string, analyticsProfile string) error { + reqURL := fmt.Sprintf("%s/%s?args=analyticsprofile:%s", csVServerAnalyticsProfileBindingURL, url.QueryEscape(name), url.QueryEscape(analyticsProfile)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAnalyticsProfileBinding() ([]models.CSVServerAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAnalyticsProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAnalyticsProfileBinding `json:"csvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAnalyticsProfileBinding(name string) ([]models.CSVServerAnalyticsProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAnalyticsProfileBinding `json:"csvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAnalyticsProfileBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAnalyticsProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_analyticsprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_appflowpolicy_binding -func (s *CSService) AddCSVServerAppFlowPolicyBinding() {} -func (s *CSService) DeleteCSVServerAppFlowPolicyBinding() {} -func (s *CSService) GetAllCSVServerAppFlowPolicyBinding() {} -func (s *CSService) GetCSVServerAppFlowPolicyBinding() {} -func (s *CSService) CountCSVServerAppFlowPolicyBinding() {} +func (s *CSService) AddCSVServerAppFlowPolicyBinding(binding models.CSVServerAppFlowPolicyBinding) error { + payload := map[string]any{"csvserver_appflowpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAppFlowPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAppFlowPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAppFlowPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAppFlowPolicyBinding() ([]models.CSVServerAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAppFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppFlowPolicyBinding `json:"csvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAppFlowPolicyBinding(name string) ([]models.CSVServerAppFlowPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAppFlowPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppFlowPolicyBinding `json:"csvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAppFlowPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAppFlowPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_appflowpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_appfwpolicy_binding -func (s *CSService) AddCSVServerAppFWPolicyBinding() {} -func (s *CSService) DeleteCSVServerAppFWPolicyBinding() {} -func (s *CSService) GetAllCSVServerAppFWPolicyBinding() {} -func (s *CSService) GetCSVServerAppFWPolicyBinding() {} -func (s *CSService) CountCSVServerAppFWPolicyBinding() {} +func (s *CSService) AddCSVServerAppFWPolicyBinding(binding models.CSVServerAppFWPolicyBinding) error { + payload := map[string]any{"csvserver_appfwpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAppFWPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAppFWPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAppFWPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAppFWPolicyBinding() ([]models.CSVServerAppFWPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAppFWPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppFWPolicyBinding `json:"csvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAppFWPolicyBinding(name string) ([]models.CSVServerAppFWPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAppFWPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppFWPolicyBinding `json:"csvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAppFWPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAppFWPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_appfwpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_appqoepolicy_binding -func (s *CSService) AddCSVServerAppQOEPolicyBinding() {} -func (s *CSService) DeleteCSVServerAppQOEPolicyBinding() {} -func (s *CSService) GetAllCSVServerAppQOEPolicyBinding() {} -func (s *CSService) GetCSVServerAppQOEPolicyBinding() {} -func (s *CSService) CountCSVServerAppQOEPolicyBinding() {} +func (s *CSService) AddCSVServerAppQOEPolicyBinding(binding models.CSVServerAppQOEPolicyBinding) error { + payload := map[string]any{"csvserver_appqoepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAppQOEPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAppQOEPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAppQOEPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAppQOEPolicyBinding() ([]models.CSVServerAppQOEPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAppQOEPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppQOEPolicyBinding `json:"csvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAppQOEPolicyBinding(name string) ([]models.CSVServerAppQOEPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAppQOEPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAppQOEPolicyBinding `json:"csvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAppQOEPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAppQOEPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_appqoepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_auditnslogpolicy_binding -func (s *CSService) AddCSVServerAuditNSLogPolicyBinding() {} -func (s *CSService) DeleteCSVServerAuditNSLogPolicyBinding() {} -func (s *CSService) GetAllCSVServerAuditNSLogPolicyBinding() {} -func (s *CSService) GetCSVServerAuditNSLogPolicyBinding() {} -func (s *CSService) CountCSVServerAuditNSLogPolicyBinding() {} +func (s *CSService) AddCSVServerAuditNSLogPolicyBinding(binding models.CSVServerAuditNSLogPolicyBinding) error { + payload := map[string]any{"csvserver_auditnslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAuditNSLogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAuditNSLogPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAuditNSLogPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAuditNSLogPolicyBinding() ([]models.CSVServerAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuditNSLogPolicyBinding `json:"csvserver_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAuditNSLogPolicyBinding(name string) ([]models.CSVServerAuditNSLogPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAuditNSLogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuditNSLogPolicyBinding `json:"csvserver_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAuditNSLogPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAuditNSLogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_auditsyslogpolicy_binding -func (s *CSService) AddCSVServerAuditSyslogPolicyBinding() {} -func (s *CSService) DeleteCSVServerAuditSyslogPolicyBinding() {} -func (s *CSService) GetAllCSVServerAuditSyslogPolicyBinding() {} -func (s *CSService) GetCSVServerAuditSyslogPolicyBinding() {} -func (s *CSService) CountCSVServerAuditSyslogPolicyBinding() {} +func (s *CSService) AddCSVServerAuditSyslogPolicyBinding(binding models.CSVServerAuditSyslogPolicyBinding) error { + payload := map[string]any{"csvserver_auditsyslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAuditSyslogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAuditSyslogPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAuditSyslogPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAuditSyslogPolicyBinding() ([]models.CSVServerAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuditSyslogPolicyBinding `json:"csvserver_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAuditSyslogPolicyBinding(name string) ([]models.CSVServerAuditSyslogPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAuditSyslogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuditSyslogPolicyBinding `json:"csvserver_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAuditSyslogPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAuditSyslogPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_authorizationpolicy_binding -func (s *CSService) AddCSVServerAuthorizationPolicyBinding() {} -func (s *CSService) DeleteCSVServerAuthorizationPolicyBinding() {} -func (s *CSService) GetAllCSVServerAuthorizationPolicyBinding() {} -func (s *CSService) GetCSVServerAuthorizationPolicyBinding() {} -func (s *CSService) CountCSVServerAuthorizationPolicyBinding() {} +func (s *CSService) AddCSVServerAuthorizationPolicyBinding(binding models.CSVServerAuthorizationPolicyBinding) error { + payload := map[string]any{"csvserver_authorizationpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerAuthorizationPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerAuthorizationPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerAuthorizationPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerAuthorizationPolicyBinding() ([]models.CSVServerAuthorizationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerAuthorizationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuthorizationPolicyBinding `json:"csvserver_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerAuthorizationPolicyBinding(name string) ([]models.CSVServerAuthorizationPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerAuthorizationPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerAuthorizationPolicyBinding `json:"csvserver_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerAuthorizationPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerAuthorizationPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_authorizationpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_binding -func (s *CSService) GetAllCSVServerBinding() {} -func (s *CSService) GetCSVServerBinding() {} +func (s *CSService) GetAllCSVServerBinding() ([]models.CSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerBinding `json:"csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerBinding(name string) ([]models.CSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerBinding `json:"csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // csvserver_botpolicy_binding -func (s *CSService) AddCSVServerBotPolicyBinding() {} -func (s *CSService) DeleteCSVServerBotPolicyBinding() {} -func (s *CSService) GetAllCSVServerBotPolicyBinding() {} -func (s *CSService) GetCSVServerBotPolicyBinding() {} -func (s *CSService) CountCSVServerBotPolicyBinding() {} +func (s *CSService) AddCSVServerBotPolicyBinding(binding models.CSVServerBotPolicyBinding) error { + payload := map[string]any{"csvserver_botpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerBotPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerBotPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerBotPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerBotPolicyBinding() ([]models.CSVServerBotPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerBotPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerBotPolicyBinding `json:"csvserver_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerBotPolicyBinding(name string) ([]models.CSVServerBotPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerBotPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerBotPolicyBinding `json:"csvserver_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerBotPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerBotPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_botpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_cachepolicy_binding -func (s *CSService) AddCSVServerCachePolicyBinding() {} -func (s *CSService) DeleteCSVServerCachePolicyBinding() {} -func (s *CSService) GetAllCSVServerCachePolicyBinding() {} -func (s *CSService) GetCSVServerCachePolicyBinding() {} -func (s *CSService) CountCSVServerCachePolicyBinding() {} +func (s *CSService) AddCSVServerCachePolicyBinding(binding models.CSVServerCachePolicyBinding) error { + payload := map[string]any{"csvserver_cachepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerCachePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerCachePolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerCachePolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerCachePolicyBinding() ([]models.CSVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCachePolicyBinding `json:"csvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerCachePolicyBinding(name string) ([]models.CSVServerCachePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerCachePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCachePolicyBinding `json:"csvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerCachePolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerCachePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_cachepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_cmppolicy_binding -func (s *CSService) AddCSVServerCMPPolicyBinding() {} -func (s *CSService) DeleteCSVServerCMPPolicyBinding() {} -func (s *CSService) GetAllCSVServerCMPPolicyBinding() {} -func (s *CSService) GetCSVServerCMPPolicyBinding() {} -func (s *CSService) CountCSVServerCMPPolicyBinding() {} +func (s *CSService) AddCSVServerCMPPolicyBinding(binding models.CSVServerCMPPolicyBinding) error { + payload := map[string]any{"csvserver_cmppolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerCMPPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerCMPPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerCMPPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerCMPPolicyBinding() ([]models.CSVServerCMPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerCMPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCMPPolicyBinding `json:"csvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerCMPPolicyBinding(name string) ([]models.CSVServerCMPPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCMPPolicyBinding `json:"csvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerCMPPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerCMPPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_cmppolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_contentinspectionpolicy_binding -func (s *CSService) AddCSVServerContentInspectionPolicyBinding() {} -func (s *CSService) DeleteCSVServerContentInspectionPolicyBinding() {} -func (s *CSService) GetAllCSVServerContentInspectionPolicyBinding() {} -func (s *CSService) GetCSVServerContentInspectionPolicyBinding() {} -func (s *CSService) CountCSVServerContentInspectionPolicyBinding() {} +func (s *CSService) AddCSVServerContentInspectionPolicyBinding(binding models.CSVServerContentInspectionPolicyBinding) error { + payload := map[string]any{"csvserver_contentinspectionpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerContentInspectionPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerContentInspectionPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerContentInspectionPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerContentInspectionPolicyBinding() ([]models.CSVServerContentInspectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerContentInspectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerContentInspectionPolicyBinding `json:"csvserver_contentinspectionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerContentInspectionPolicyBinding(name string) ([]models.CSVServerContentInspectionPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerContentInspectionPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerContentInspectionPolicyBinding `json:"csvserver_contentinspectionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerContentInspectionPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerContentInspectionPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_contentinspectionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_cspolicy_binding -func (s *CSService) AddCSVServerCSPolicyBinding() {} -func (s *CSService) DeleteCSVServerCSPolicyBinding() {} -func (s *CSService) GetAllCSVServerCSPolicyBinding() {} -func (s *CSService) GetCSVServerCSPolicyBinding() {} -func (s *CSService) CountCSVServerCSPolicyBinding() {} +func (s *CSService) AddCSVServerCSPolicyBinding(binding models.CSVServerCSPolicyBinding) error { + payload := map[string]any{"csvserver_cspolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerCSPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerCSPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerCSPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerCSPolicyBinding() ([]models.CSVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerCSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCSPolicyBinding `json:"csvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerCSPolicyBinding(name string) ([]models.CSVServerCSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerCSPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerCSPolicyBinding `json:"csvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerCSPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerCSPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_cspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_domain_binding -func (s *CSService) AddCSVServerDomainBinding() {} -func (s *CSService) DeleteCSVServerDomainBinding() {} -func (s *CSService) GetAllCSVServerDomainBinding() {} -func (s *CSService) GetCSVServerDomainBinding() {} -func (s *CSService) CountCSVServerDomainBinding() {} +func (s *CSService) AddCSVServerDomainBinding(binding models.CSVServerDomainBinding) error { + payload := map[string]any{"csvserver_domain_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerDomainBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerDomainBinding(name string, domainName string) error { + reqURL := fmt.Sprintf("%s/%s?args=domainname:%s", csVServerDomainBindingURL, url.QueryEscape(name), url.QueryEscape(domainName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerDomainBinding() ([]models.CSVServerDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerDomainBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerDomainBinding `json:"csvserver_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerDomainBinding(name string) ([]models.CSVServerDomainBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerDomainBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerDomainBinding `json:"csvserver_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerDomainBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerDomainBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_feopolicy_binding -func (s *CSService) AddCSVServerFEOPolicyBinding() {} -func (s *CSService) DeleteCSVServerFEOPolicyBinding() {} -func (s *CSService) GetAllCSVServerFEOPolicyBinding() {} -func (s *CSService) GetCSVServerFEOPolicyBinding() {} -func (s *CSService) CountCSVServerFEOPolicyBinding() {} +func (s *CSService) AddCSVServerFEOPolicyBinding(binding models.CSVServerFEOPolicyBinding) error { + payload := map[string]any{"csvserver_feopolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerFEOPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerFEOPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerFEOPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerFEOPolicyBinding() ([]models.CSVServerFEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerFEOPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerFEOPolicyBinding `json:"csvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerFEOPolicyBinding(name string) ([]models.CSVServerFEOPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerFEOPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerFEOPolicyBinding `json:"csvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerFEOPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerFEOPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_feopolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_gslbvserver_binding -func (s *CSService) AddCSVServerGSLBVServerBinding() {} -func (s *CSService) DeleteCSVServerGSLBVServerBinding() {} -func (s *CSService) GetAllCSVServerGSLBVServerBinding() {} -func (s *CSService) GetCSVServerGSLBVServerBinding() {} -func (s *CSService) CountCSVServerGSLBVServerBinding() {} +func (s *CSService) AddCSVServerGSLBVServerBinding(binding models.CSVServerGSLBVServerBinding) error { + payload := map[string]any{"csvserver_gslbvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerGSLBVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerGSLBVServerBinding(name string, vserverName string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", csVServerGSLBVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserverName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerGSLBVServerBinding() ([]models.CSVServerGSLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerGSLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerGSLBVServerBinding `json:"csvserver_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerGSLBVServerBinding(name string) ([]models.CSVServerGSLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerGSLBVServerBinding `json:"csvserver_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerGSLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_gslbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_lbvserver_binding -func (s *CSService) AddCSVServerLBVServerBinding() {} -func (s *CSService) DeleteCSVServerLBVServerBinding() {} -func (s *CSService) GetAllCSVServerLBVServerBinding() {} -func (s *CSService) GetCSVServerLBVServerBinding() {} -func (s *CSService) CountCSVServerLBVServerBinding() {} +func (s *CSService) AddCSVServerLBVServerBinding(binding models.CSVServerLBVServerBinding) error { + payload := map[string]any{"csvserver_lbvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerLBVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerLBVServerBinding(name string, lbvserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=lbvserver:%s", csVServerLBVServerBindingURL, url.QueryEscape(name), url.QueryEscape(lbvserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerLBVServerBinding() ([]models.CSVServerLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerLBVServerBinding `json:"csvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerLBVServerBinding(name string) ([]models.CSVServerLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerLBVServerBinding `json:"csvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_responderpolicy_binding -func (s *CSService) AddCSVServerResponderPolicyBinding() {} -func (s *CSService) DeleteCSVServerResponderPolicyBinding() {} -func (s *CSService) GetAllCSVServerResponderPolicyBinding() {} -func (s *CSService) GetCSVServerResponderPolicyBinding() {} -func (s *CSService) CountCSVServerResponderPolicyBinding() {} +func (s *CSService) AddCSVServerResponderPolicyBinding(binding models.CSVServerResponderPolicyBinding) error { + payload := map[string]any{"csvserver_responderpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerResponderPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerResponderPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerResponderPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerResponderPolicyBinding() ([]models.CSVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerResponderPolicyBinding `json:"csvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerResponderPolicyBinding(name string) ([]models.CSVServerResponderPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerResponderPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerResponderPolicyBinding `json:"csvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerResponderPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerResponderPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_rewritepolicy_binding -func (s *CSService) AddCSVServerRewritePolicyBinding() {} -func (s *CSService) DeleteCSVServerRewritePolicyBinding() {} -func (s *CSService) GetAllCSVServerRewritePolicyBinding() {} -func (s *CSService) GetCSVServerRewritePolicyBinding() {} -func (s *CSService) CountCSVServerRewritePolicyBinding() {} +func (s *CSService) AddCSVServerRewritePolicyBinding(binding models.CSVServerRewritePolicyBinding) error { + payload := map[string]any{"csvserver_rewritepolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerRewritePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerRewritePolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerRewritePolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerRewritePolicyBinding() ([]models.CSVServerRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerRewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerRewritePolicyBinding `json:"csvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerRewritePolicyBinding(name string) ([]models.CSVServerRewritePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerRewritePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerRewritePolicyBinding `json:"csvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerRewritePolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerRewritePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_spilloverpolicy_binding -func (s *CSService) AddCSVServerSpilloverPolicyBinding() {} -func (s *CSService) DeleteCSVServerSpilloverPolicyBinding() {} -func (s *CSService) GetAllCSVServerSpilloverPolicyBinding() {} -func (s *CSService) GetCSVServerSpilloverPolicyBinding() {} -func (s *CSService) CountCSVServerSpilloverPolicyBinding() {} +func (s *CSService) AddCSVServerSpilloverPolicyBinding(binding models.CSVServerSpilloverPolicyBinding) error { + payload := map[string]any{"csvserver_spilloverpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerSpilloverPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerSpilloverPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerSpilloverPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerSpilloverPolicyBinding() ([]models.CSVServerSpilloverPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerSpilloverPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerSpilloverPolicyBinding `json:"csvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerSpilloverPolicyBinding(name string) ([]models.CSVServerSpilloverPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerSpilloverPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerSpilloverPolicyBinding `json:"csvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerSpilloverPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerSpilloverPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_spilloverpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_tmtrafficpolicy_binding -func (s *CSService) AddCSVServerTMTrafficPolicyBinding() {} -func (s *CSService) DeleteCSVServerTMTrafficPolicyBinding() {} -func (s *CSService) GetAllCSVServerTMTrafficPolicyBinding() {} -func (s *CSService) GetCSVServerTMTrafficPolicyBinding() {} -func (s *CSService) CountCSVServerTMTrafficPolicyBinding() {} +func (s *CSService) AddCSVServerTMTrafficPolicyBinding(binding models.CSVServerTMTrafficPolicyBinding) error { + payload := map[string]any{"csvserver_tmtrafficpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerTMTrafficPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerTMTrafficPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerTMTrafficPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerTMTrafficPolicyBinding() ([]models.CSVServerTMTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerTMTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerTMTrafficPolicyBinding `json:"csvserver_tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerTMTrafficPolicyBinding(name string) ([]models.CSVServerTMTrafficPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerTMTrafficPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerTMTrafficPolicyBinding `json:"csvserver_tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerTMTrafficPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerTMTrafficPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // csvserver_transformpolicy_binding -func (s *CSService) AddCSVServerTransformPolicyBinding() {} -func (s *CSService) DeleteCSVServerTransformPolicyBinding() {} -func (s *CSService) GetAllCSVServerTransformPolicyBinding() {} -func (s *CSService) GetCSVServerTransformPolicyBinding() {} -func (s *CSService) CountCSVServerTransformPolicyBinding() {} - -// csvserver_vpnserver_binding -func (s *CSService) AddCSVServerVPNVServerBinding() {} -func (s *CSService) DeleteCSVServerVPNVServerBinding() {} -func (s *CSService) GetAllCSVServerVPNVServerBinding() {} -func (s *CSService) GetCSVServerVPNVServerBinding() {} -func (s *CSService) CountCSVServerVPNVServerBinding() {} +func (s *CSService) AddCSVServerTransformPolicyBinding(binding models.CSVServerTransformPolicyBinding) error { + payload := map[string]any{"csvserver_transformpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerTransformPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerTransformPolicyBinding(name string, policyName string, bindPoint string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,bindpoint:%s,priority:%d", csVServerTransformPolicyBindingURL, url.QueryEscape(name), url.QueryEscape(policyName), url.QueryEscape(bindPoint), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerTransformPolicyBinding() ([]models.CSVServerTransformPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerTransformPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerTransformPolicyBinding `json:"csvserver_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerTransformPolicyBinding(name string) ([]models.CSVServerTransformPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerTransformPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerTransformPolicyBinding `json:"csvserver_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerTransformPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerTransformPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// csvserver_vpnvserver_binding +func (s *CSService) AddCSVServerVPNVServerBinding(binding models.CSVServerVPNVServerBinding) error { + payload := map[string]any{"csvserver_vpnvserver_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, csVServerVPNVServerBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) DeleteCSVServerVPNVServerBinding(name string, vserver string) error { + reqURL := fmt.Sprintf("%s/%s?args=vserver:%s", csVServerVPNVServerBindingURL, url.QueryEscape(name), url.QueryEscape(vserver)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *CSService) GetAllCSVServerVPNVServerBinding() ([]models.CSVServerVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, csVServerVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerVPNVServerBinding `json:"csvserver_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) GetCSVServerVPNVServerBinding(name string) ([]models.CSVServerVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", csVServerVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.CSVServerVPNVServerBinding `json:"csvserver_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *CSService) CountCSVServerVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", csVServerVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"csvserver_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/db.go b/nitrogo/db.go index 84815ec..d103de4 100644 --- a/nitrogo/db.go +++ b/nitrogo/db.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( dbDBProfileURL = "/nitro/v1/config/dbdbprofile" dbUserURL = "/nitro/v1/config/dbuser" @@ -14,20 +23,276 @@ type DBService struct { // dbdbprofile // Configuration for DB profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/db/dbdbprofile -func (s *DBService) AddDBDBProfile() {} -func (s *DBService) DeleteDBDBProfile() {} -func (s *DBService) UpdateDBDBProfile() {} -func (s *DBService) UnsetDBDBProfile() {} -func (s *DBService) GetAllDBDBProfile() {} -func (s *DBService) GetDBDBProfile() {} -func (s *DBService) CountDBDBProfile() {} + +func (s *DBService) AddDBDBProfile(profile models.DBDBProfile) error { + payload := map[string]any{ + "dbdbprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, dbDBProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) DeleteDBDBProfile(name string) error { + url := fmt.Sprintf("%s/%s", dbDBProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) UpdateDBDBProfile(profile models.DBDBProfile) error { + payload := map[string]any{ + "dbdbprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, dbDBProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) UnsetDBDBProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "dbdbprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, dbDBProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) GetAllDBDBProfile() ([]models.DBDBProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, dbDBProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + DBDBProfiles []models.DBDBProfile `json:"dbdbprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.DBDBProfiles, nil +} + +func (s *DBService) GetDBDBProfile(name string) ([]models.DBDBProfile, error) { + url := fmt.Sprintf("%s/%s", dbDBProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + DBDBProfiles []models.DBDBProfile `json:"dbdbprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.DBDBProfiles, nil +} + +func (s *DBService) CountDBDBProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dbDBProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + DBDBProfiles []struct { + Count float64 `json:"__count"` + } `json:"dbdbprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.DBDBProfiles) > 0 { + return result.DBDBProfiles[0].Count, nil + } + + return 0, nil +} // dbuser // Configuration for DB user resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/db/dbuser -func (s *DBService) AddDBUser() {} -func (s *DBService) DeleteDBUser() {} -func (s *DBService) UpdateDBUser() {} -func (s *DBService) GetAllDBUser() {} -func (s *DBService) GetDBUser() {} -func (s *DBService) CountDBUser() {} + +func (s *DBService) AddDBUser(user models.DBUser) error { + payload := map[string]any{ + "dbuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, dbUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) DeleteDBUser(username string) error { + url := fmt.Sprintf("%s/%s", dbUserURL, username) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) UpdateDBUser(user models.DBUser) error { + payload := map[string]any{ + "dbuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, dbUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *DBService) GetAllDBUser() ([]models.DBUser, error) { + req, err := s.client.NewRequest(http.MethodGet, dbUserURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + DBUsers []models.DBUser `json:"dbuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.DBUsers, nil +} + +func (s *DBService) GetDBUser(username string) ([]models.DBUser, error) { + url := fmt.Sprintf("%s/%s", dbUserURL, username) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + DBUsers []models.DBUser `json:"dbuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.DBUsers, nil +} + +func (s *DBService) CountDBUser() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dbUserURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + DBUsers []struct { + Count float64 `json:"__count"` + } `json:"dbuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.DBUsers) > 0 { + return result.DBUsers[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/dns.go b/nitrogo/dns.go index f58793a..e9e2e43 100644 --- a/nitrogo/dns.go +++ b/nitrogo/dns.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( dnsAAAARecURL = "/nitro/v1/config/dnsaaaarec" dnsActionURL = "/nitro/v1/config/dnsaction" @@ -51,268 +61,3329 @@ type DNSService struct { } // dnsaaaarec -func (s *DNSService) AddDNSAAAARec() {} -func (s *DNSService) DeleteDNSAAAARec() {} -func (s *DNSService) GetAllDNSAAAARec() {} -func (s *DNSService) CountDNSAAAARec() {} +func (s *DNSService) AddDNSAAAARec(rec models.DNSAAAARec) error { + payload := map[string]any{"dnsaaaarec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsAAAARecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSAAAARec(hostname string) error { + reqURL := fmt.Sprintf("%s/%s", dnsAAAARecURL, url.QueryEscape(hostname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSAAAARec() ([]models.DNSAAAARec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAAAARecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAAAARec `json:"dnsaaaarec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSAAAARec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAAAARecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsaaaarec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsaction -func (s *DNSService) AddDNSAction() {} -func (s *DNSService) DeleteDNSAction() {} -func (s *DNSService) UpdateDNSAction() {} -func (s *DNSService) UnsetDNSAction() {} -func (s *DNSService) GetAllDNSAction() {} -func (s *DNSService) GetDNSAction() {} -func (s *DNSService) CountDNSAction() {} +func (s *DNSService) AddDNSAction(action models.DNSAction) error { + payload := map[string]any{"dnsaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSAction(actionName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsActionURL, url.QueryEscape(actionName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSAction(action models.DNSAction) error { + payload := map[string]any{"dnsaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSAction() ([]models.DNSAction, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAction `json:"dnsaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSAction(actionName string) ([]models.DNSAction, error) { + reqURL := fmt.Sprintf("%s/%s", dnsActionURL, url.QueryEscape(actionName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAction `json:"dnsaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsaction64 -func (s *DNSService) AddDNSAction64() {} -func (s *DNSService) DeleteDNSAction64() {} -func (s *DNSService) UpdateDNSAction64() {} -func (s *DNSService) UnsetDNSAction64() {} -func (s *DNSService) GetAllDNSAction64() {} -func (s *DNSService) GetDNSAction64() {} -func (s *DNSService) CountDNSAction64() {} +func (s *DNSService) AddDNSAction64(action models.DNSAction64) error { + payload := map[string]any{"dnsaction64": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsAction64URL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSAction64(actionName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsAction64URL, url.QueryEscape(actionName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSAction64(action models.DNSAction64) error { + payload := map[string]any{"dnsaction64": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsAction64URL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSAction64(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsaction64": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsAction64URL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSAction64() ([]models.DNSAction64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAction64URL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAction64 `json:"dnsaction64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSAction64(actionName string) ([]models.DNSAction64, error) { + reqURL := fmt.Sprintf("%s/%s", dnsAction64URL, url.QueryEscape(actionName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAction64 `json:"dnsaction64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSAction64() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAction64URL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsaction64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsaddrec -func (s *DNSService) AddDNSAddRec() {} -func (s *DNSService) DeleteDNSAddRec() {} -func (s *DNSService) GetAllDNSAddRec() {} -func (s *DNSService) GetDNSAddRec() {} -func (s *DNSService) CountDNSAddRec() {} +func (s *DNSService) AddDNSAddRec(rec models.DNSAddRec) error { + payload := map[string]any{"dnsaddrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsAddRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSAddRec(hostname string) error { + reqURL := fmt.Sprintf("%s/%s", dnsAddRecURL, url.QueryEscape(hostname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSAddRec() ([]models.DNSAddRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAddRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAddRec `json:"dnsaddrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSAddRec(hostname string) ([]models.DNSAddRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsAddRecURL, url.QueryEscape(hostname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSAddRec `json:"dnsaddrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSAddRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsAddRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsaddrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnscnamerec -func (s *DNSService) AddDNSCNameRec() {} -func (s *DNSService) DeleteDNSCNameRec() {} -func (s *DNSService) GetAllDNSCNameRec() {} -func (s *DNSService) GetDNSCNameRec() {} -func (s *DNSService) CountDNSCNameRec() {} +func (s *DNSService) AddDNSCNameRec(rec models.DNSCnameRec) error { + payload := map[string]any{"dnscnamerec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsCNameRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSCNameRec(aliasName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsCNameRecURL, url.QueryEscape(aliasName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSCNameRec() ([]models.DNSCnameRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsCNameRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSCnameRec `json:"dnscnamerec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSCNameRec(aliasName string) ([]models.DNSCnameRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsCNameRecURL, url.QueryEscape(aliasName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSCnameRec `json:"dnscnamerec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSCNameRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsCNameRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnscnamerec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsglobal_binding -func (s *DNSService) GetDNSGlobalBinding() {} +func (s *DNSService) GetDNSGlobalBinding() ([]models.DNSGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSGlobalBinding `json:"dnsglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnsglobal_dnspolicy_binding -func (s *DNSService) AddDNSGlobalDNSPolicyBinding() {} -func (s *DNSService) DeleteDNSGlobalDNSPolicyBinding() {} -func (s *DNSService) GetDNSGlobalDNSPolicyBinding() {} -func (s *DNSService) CountDNSGlobalDNSPolicyBinding() {} +func (s *DNSService) AddDNSGlobalDNSPolicyBinding(binding models.DNSGlobalDNSPolicyBinding) error { + payload := map[string]any{"dnsglobal_dnspolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsGlobalDNSPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSGlobalDNSPolicyBinding(policyname string, typefield string) error { + reqURL := fmt.Sprintf("%s/%s?args=type:%s", dnsGlobalDNSPolicyBindingURL, url.QueryEscape(policyname), url.QueryEscape(typefield)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetDNSGlobalDNSPolicyBinding() ([]models.DNSGlobalDNSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsGlobalDNSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSGlobalDNSPolicyBinding `json:"dnsglobal_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSGlobalDNSPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsGlobalDNSPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsglobal_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnskey -func (s *DNSService) AddDNSKey() {} -func (s *DNSService) DeleteDNSKey() {} -func (s *DNSService) UpdateDNSKey() {} -func (s *DNSService) UnsetDNSKey() {} -func (s *DNSService) GetAllDNSKey() {} -func (s *DNSService) GetDNSKey() {} -func (s *DNSService) CountDNSKey() {} -func (s *DNSService) CreateDNSKey() {} -func (s *DNSService) ImportDNSKey() {} +func (s *DNSService) AddDNSKey(key models.DNSKey) error { + payload := map[string]any{"dnskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsKeyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSKey(keyName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsKeyURL, url.QueryEscape(keyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSKey(key models.DNSKey) error { + payload := map[string]any{"dnskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsKeyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSKey(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnskey": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsKeyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSKey() ([]models.DNSKey, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsKeyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSKey `json:"dnskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSKey(keyName string) ([]models.DNSKey, error) { + reqURL := fmt.Sprintf("%s/%s", dnsKeyURL, url.QueryEscape(keyName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSKey `json:"dnskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSKey() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsKeyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +func (s *DNSService) CreateDNSKey(key models.DNSKey) error { + payload := map[string]any{"dnskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsKeyURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) ImportDNSKey(key models.DNSKey) error { + payload := map[string]any{"dnskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsKeyURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // dnsmxrec -func (s *DNSService) AddDNSMXRec() {} -func (s *DNSService) DeleteDNSMXRec() {} -func (s *DNSService) UpdateDNSMXRec() {} -func (s *DNSService) UnsetDNSMXRec() {} -func (s *DNSService) GetAllDNSMXRec() {} -func (s *DNSService) GetDNSMXRec() {} -func (s *DNSService) CountDNSMXRec() {} +func (s *DNSService) AddDNSMXRec(rec models.DNSMXRec) error { + payload := map[string]any{"dnsmxrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsMXRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSMXRec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsMXRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSMXRec(rec models.DNSMXRec) error { + payload := map[string]any{"dnsmxrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsMXRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSMXRec(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsmxrec": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsMXRecURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSMXRec() ([]models.DNSMXRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsMXRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSMXRec `json:"dnsmxrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSMXRec(domain string) ([]models.DNSMXRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsMXRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSMXRec `json:"dnsmxrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSMXRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsMXRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsmxrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsnameserver -func (s *DNSService) AddDNSNameServer() {} -func (s *DNSService) DeleteDNSNameServer() {} -func (s *DNSService) UpdateDNSNameServer() {} -func (s *DNSService) UnsetDNSNameServer() {} -func (s *DNSService) EnableDNSNameServer() {} -func (s *DNSService) DisableDNSNameServer() {} -func (s *DNSService) GetAllDNSNameServer() {} -func (s *DNSService) CountDNSNameServer() {} +func (s *DNSService) AddDNSNameServer(server models.DNSNameServer) error { + payload := map[string]any{"dnsnameserver": server} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNameServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSNameServer(ip string) error { + reqURL := fmt.Sprintf("%s/%s", dnsNameServerURL, url.QueryEscape(ip)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSNameServer(server models.DNSNameServer) error { + payload := map[string]any{"dnsnameserver": server} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsNameServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSNameServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsnameserver": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNameServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) EnableDNSNameServer(ip string) error { + payload := map[string]any{ + "dnsnameserver": map[string]string{"ip": ip}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNameServerURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DisableDNSNameServer(ip string) error { + payload := map[string]any{ + "dnsnameserver": map[string]string{"ip": ip}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNameServerURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSNameServer() ([]models.DNSNameServer, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNameServerURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNameServer `json:"dnsnameserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSNameServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNameServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsnameserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsnaptrrec -func (s *DNSService) AddDNSNAPTRRec() {} -func (s *DNSService) DeleteDNSNAPTRRec() {} -func (s *DNSService) GetAllDNSNAPTRRec() {} -func (s *DNSService) GetDNSNAPTRRec() {} -func (s *DNSService) CountDNSNAPTRRec() {} +func (s *DNSService) AddDNSNAPTRRec(rec models.DNSNaptrRec) error { + payload := map[string]any{"dnsnaptrrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNAPTRRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSNAPTRRec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsNAPTRRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSNAPTRRec() ([]models.DNSNaptrRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNAPTRRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNaptrRec `json:"dnsnaptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSNAPTRRec(domain string) ([]models.DNSNaptrRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsNAPTRRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNaptrRec `json:"dnsnaptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSNAPTRRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNAPTRRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsnaptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsnsecrec -func (s *DNSService) GetAllDNSNSECRec() {} -func (s *DNSService) GetDNSNSEcRec() {} -func (s *DNSService) CountDNSNSECRec() {} +func (s *DNSService) GetAllDNSNSECRec() ([]models.DNSNSECRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNSECRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNSECRec `json:"dnsnsecrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSNSEcRec(hostname string) ([]models.DNSNSECRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsNSECRecURL, url.QueryEscape(hostname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNSECRec `json:"dnsnsecrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSNSECRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNSECRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsnsecrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsnsrec -func (s *DNSService) AddDNSNSRec() {} -func (s *DNSService) DeleteDNSNSRec() {} -func (s *DNSService) GetAllDNSNSRec() {} -func (s *DNSService) GetDNSNSRec() {} -func (s *DNSService) CountDNSNSRec() {} +func (s *DNSService) AddDNSNSRec(rec models.DNSNSRec) error { + payload := map[string]any{"dnsnsrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsNSRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSNSRec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsNSRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSNSRec() ([]models.DNSNSRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNSRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNSRec `json:"dnsnsrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSNSRec(domain string) ([]models.DNSNSRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsNSRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSNSRec `json:"dnsnsrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSNSRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsNSRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsnsrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsparameter -func (s *DNSService) UpdateDNSParameter() {} -func (s *DNSService) UnsetDNSParameter() {} -func (s *DNSService) GetAllDNSParameter() {} +func (s *DNSService) UpdateDNSParameter(param models.DNSParameter) error { + payload := map[string]any{"dnsparameter": param} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsparameter": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSParameter() (models.DNSParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsParameterURL, nil) + if err != nil { + return models.DNSParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.DNSParameter{}, err + } + var result struct { + Items []models.DNSParameter `json:"dnsparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.DNSParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0], nil + } + return models.DNSParameter{}, nil +} // dnspolicy -func (s *DNSService) AddDNSPolicy() {} -func (s *DNSService) DeleteDNSPolicy() {} -func (s *DNSService) UpdateDNSPolicy() {} -func (s *DNSService) UnsetDNSPolicy() {} -func (s *DNSService) GetAllDNSPolicy() {} -func (s *DNSService) GetDNSPolicy() {} -func (s *DNSService) CountDNSPolicy() {} +func (s *DNSService) AddDNSPolicy(policy models.DNSPolicy) error { + payload := map[string]any{"dnspolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSPolicy(policy models.DNSPolicy) error { + payload := map[string]any{"dnspolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnspolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSPolicy() ([]models.DNSPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy `json:"dnspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicy(name string) ([]models.DNSPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy `json:"dnspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicy64 -func (s *DNSService) AddDNSPolicy64() {} -func (s *DNSService) DeleteDNSPolicy64() {} -func (s *DNSService) UpdateDNSPolicy64() {} -func (s *DNSService) GetAllDNSPolicy64() {} -func (s *DNSService) GetDNSPolicy64() {} -func (s *DNSService) CountDNSPolicy64() {} +func (s *DNSService) AddDNSPolicy64(policy models.DNSPolicy64) error { + payload := map[string]any{"dnspolicy64": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPolicy64URL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSPolicy64(name string) error { + reqURL := fmt.Sprintf("%s/%s", dnsPolicy64URL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSPolicy64(policy models.DNSPolicy64) error { + payload := map[string]any{"dnspolicy64": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsPolicy64URL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSPolicy64() ([]models.DNSPolicy64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicy64URL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64 `json:"dnspolicy64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicy64(name string) ([]models.DNSPolicy64, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicy64URL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64 `json:"dnspolicy64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicy64() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicy64URL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicy64"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicy64_binding -func (s *DNSService) GetAllDNSPolicy64Binding() {} -func (s *DNSService) GetDNSPolicy64Binding() {} +func (s *DNSService) GetAllDNSPolicy64Binding() ([]models.DNSPolicy64Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicy64BindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64Binding `json:"dnspolicy64_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicy64Binding(name string) ([]models.DNSPolicy64Binding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicy64BindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64Binding `json:"dnspolicy64_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnspolicy64_lbvserver_binding -func (s *DNSService) GetAllDNSPolicy64LBVServerBinding() {} -func (s *DNSService) GetDNSPolicy64LBVServerBinding() {} -func (s *DNSService) CountDNSPolicy64LBVServerBinding() {} +func (s *DNSService) GetAllDNSPolicy64LBVServerBinding() ([]models.DNSPolicy64LBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicy64LBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64LBVServerBinding `json:"dnspolicy64_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicy64LBVServerBinding(name string) ([]models.DNSPolicy64LBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicy64LBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicy64LBVServerBinding `json:"dnspolicy64_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicy64LBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsPolicy64LBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicy64_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicylabel -func (s *DNSService) AddDNSPolicyLabel() {} -func (s *DNSService) DeleteDNSPolicyLabel() {} -func (s *DNSService) GetAllDNSPolicyLabel() {} -func (s *DNSService) GetDNSPolicyLabel() {} -func (s *DNSService) CountDNSPolicyLabel() {} -func (s *DNSService) RenameDNSPolicyLabel() {} +func (s *DNSService) AddDNSPolicyLabel(label models.DNSPolicyLabel) error { + payload := map[string]any{"dnspolicylabel": label} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSPolicyLabel(labelName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyLabelURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSPolicyLabel() ([]models.DNSPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabel `json:"dnspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyLabel(labelName string) ([]models.DNSPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyLabelURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabel `json:"dnspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +func (s *DNSService) RenameDNSPolicyLabel(name string, newName string) error { + payload := map[string]any{ + "dnspolicylabel": map[string]string{ + "labelname": name, + "newname": newName, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // dnspolicylabel_binding -func (s *DNSService) GetAllDNSPolicyLabelBinding() {} -func (s *DNSService) GetDNSPolicyLabelBinding() {} +func (s *DNSService) GetAllDNSPolicyLabelBinding() ([]models.DNSPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelBinding `json:"dnspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyLabelBinding(labelName string) ([]models.DNSPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyLabelBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelBinding `json:"dnspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnspolicylabel_dnspolicy_binding -func (s *DNSService) AddDNSPolicyLabelDNSPolicyBinding() {} -func (s *DNSService) DeleteDNSPolicyLabelDNSPolicyBinding() {} -func (s *DNSService) GetAllDNSPolicyLabelDNSPolicyBinding() {} -func (s *DNSService) GetDNSPolicyLabelDNSPolicyBinding() {} -func (s *DNSService) CountDNSPolicyLabelDNSPolicyBinding() {} +func (s *DNSService) AddDNSPolicyLabelDNSPolicyBinding(binding models.DNSPolicyLabelDNSPolicyBinding) error { + payload := map[string]any{"dnspolicylabel_dnspolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsPolicyLabelDNSPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSPolicyLabelDNSPolicyBinding(labelName string, policyName string) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s", dnsPolicyLabelDNSPolicyBindingURL, url.QueryEscape(labelName), url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSPolicyLabelDNSPolicyBinding() ([]models.DNSPolicyLabelDNSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyLabelDNSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelDNSPolicyBinding `json:"dnspolicylabel_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyLabelDNSPolicyBinding(labelName string) ([]models.DNSPolicyLabelDNSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyLabelDNSPolicyBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelDNSPolicyBinding `json:"dnspolicylabel_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicyLabelDNSPolicyBinding(labelName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsPolicyLabelDNSPolicyBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicylabel_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicylabel_policybinding_binding -func (s *DNSService) GetAllDNSPolicyLabelPolicyBindingBinding() {} -func (s *DNSService) GetDNSPolicyLabelPolicyBindingBinding() {} -func (s *DNSService) CountDNSPolicyLabelPolicyBindingBinding() {} +func (s *DNSService) GetAllDNSPolicyLabelPolicyBindingBinding() ([]models.DNSPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelPolicyBindingBinding `json:"dnspolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyLabelPolicyBindingBinding(labelName string) ([]models.DNSPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyLabelPolicyBindingBinding `json:"dnspolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicyLabelPolicyBindingBinding(labelName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicy_binding -func (s *DNSService) GetAllDNSPolicyBinding() {} -func (s *DNSService) GetDNSPolicyBinding() {} +func (s *DNSService) GetAllDNSPolicyBinding() ([]models.DNSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyBinding `json:"dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyBinding(name string) ([]models.DNSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyBinding `json:"dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnspolicy_dnsglobal_binding -func (s *DNSService) GetAllDNSPolicyDNSGlobalBinding() {} -func (s *DNSService) GetDNSPolicyDNSGlobalBinding() {} -func (s *DNSService) CountDNSPolicyDNSGlobalBinding() {} +func (s *DNSService) GetAllDNSPolicyDNSGlobalBinding() ([]models.DNSPolicyDNSGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyDNSGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyDNSGlobalBinding `json:"dnspolicy_dnsglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyDNSGlobalBinding(name string) ([]models.DNSPolicyDNSGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyDNSGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyDNSGlobalBinding `json:"dnspolicy_dnsglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicyDNSGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsPolicyDNSGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicy_dnsglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnspolicy_dnspolicylabel_binding -func (s *DNSService) GetAllDNSPolicyDNSPolicyLabelBinding() {} -func (s *DNSService) GetDNSPolicyDNSPolicyLabelBinding() {} -func (s *DNSService) CountDNSPolicyDNSPolicyLabelBinding() {} +func (s *DNSService) GetAllDNSPolicyDNSPolicyLabelBinding() ([]models.DNSPolicyDNSPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPolicyDNSPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyDNSPolicyLabelBinding `json:"dnspolicy_dnspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPolicyDNSPolicyLabelBinding(name string) ([]models.DNSPolicyDNSPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPolicyDNSPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPolicyDNSPolicyLabelBinding `json:"dnspolicy_dnspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPolicyDNSPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsPolicyDNSPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnspolicy_dnspolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsprofile -func (s *DNSService) AddDNSProfile() {} -func (s *DNSService) DeleteDNSProfile() {} -func (s *DNSService) UpdateDNSProfile() {} -func (s *DNSService) UnsetDNSProfile() {} -func (s *DNSService) GetAllDNSProfile() {} -func (s *DNSService) GetDNSProfile() {} -func (s *DNSService) CountDNSProfile() {} +func (s *DNSService) AddDNSProfile(profile models.DNSProfile) error { + payload := map[string]any{"dnsprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", dnsProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSProfile(profile models.DNSProfile) error { + payload := map[string]any{"dnsprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnsprofile": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSProfile() ([]models.DNSProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSProfile `json:"dnsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSProfile(name string) ([]models.DNSProfile, error) { + reqURL := fmt.Sprintf("%s/%s", dnsProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSProfile `json:"dnsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsproxyrecords -func (s *DNSService) FlushDNSProxyRecords() {} +func (s *DNSService) FlushDNSProxyRecords() error { + req, err := s.client.NewRequest(http.MethodPost, dnsProxyRecordsURL+"?action=flush", nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // dnsptrrec -func (s *DNSService) AddDNSPTRRec() {} -func (s *DNSService) DeleteDNSPTRRec() {} -func (s *DNSService) GetAllDNSPTRRec() {} -func (s *DNSService) GetDNSPTRRec() {} -func (s *DNSService) CountDNSPTRRec() {} +func (s *DNSService) AddDNSPTRRec(rec models.DNSPtrRec) error { + payload := map[string]any{"dnsptrrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsPTRRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSPTRRec(reverseDomain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsPTRRecURL, url.QueryEscape(reverseDomain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSPTRRec() ([]models.DNSPtrRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPTRRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPtrRec `json:"dnsptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSPTRRec(reverseDomain string) ([]models.DNSPtrRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsPTRRecURL, url.QueryEscape(reverseDomain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSPtrRec `json:"dnsptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSPTRRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsPTRRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsptrrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnssoarec -func (s *DNSService) AddDNSSOARec() {} -func (s *DNSService) DeleteDNSSOARec() {} -func (s *DNSService) UpdateDNSSOARec() {} -func (s *DNSService) UnsetDNSSOARec() {} -func (s *DNSService) GetAllDNSSOARec() {} -func (s *DNSService) GetDNSSOARec() {} -func (s *DNSService) CountDNSSOARec() {} +func (s *DNSService) AddDNSSOARec(rec models.DNSSOARec) error { + payload := map[string]any{"dnssoarec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsSOARecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSSOARec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsSOARecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSSOARec(rec models.DNSSOARec) error { + payload := map[string]any{"dnssoarec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsSOARecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSSOARec(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnssoarec": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsSOARecURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSSOARec() ([]models.DNSSOARec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSOARecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSOARec `json:"dnssoarec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSSOARec(domain string) ([]models.DNSSOARec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsSOARecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSOARec `json:"dnssoarec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSSOARec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSOARecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnssoarec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnssrvrec -func (s *DNSService) AddDNSSRVRec() {} -func (s *DNSService) DeleteDNSSRVRec() {} -func (s *DNSService) UpdateDNSSRVRec() {} -func (s *DNSService) UnsetDNSSRVRec() {} -func (s *DNSService) GetAllDNSSRVRec() {} -func (s *DNSService) CountDNSSRVRec() {} +func (s *DNSService) AddDNSSRVRec(rec models.DNSSrvRec) error { + payload := map[string]any{"dnssrvrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsSRVRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSSRVRec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsSRVRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSSRVRec(rec models.DNSSrvRec) error { + payload := map[string]any{"dnssrvrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsSRVRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSSRVRec(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnssrvrec": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsSRVRecURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSSRVRec() ([]models.DNSSrvRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSRVRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSrvRec `json:"dnssrvrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSSRVRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSRVRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnssrvrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnssubnetcache -func (s *DNSService) FlushDNSSubnetCache() {} -func (s *DNSService) GetAllDNSSubnetCache() {} -func (s *DNSService) GetDNSSubnetCache() {} -func (s *DNSService) CountDNSSubnetCache() {} +func (s *DNSService) FlushDNSSubnetCache() error { + req, err := s.client.NewRequest(http.MethodPost, dnsSubnetCacheURL+"?action=flush", nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSSubnetCache() ([]models.DNSSubnetCache, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSubnetCacheURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSubnetCache `json:"dnssubnetcache"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSSubnetCache(hostname string) ([]models.DNSSubnetCache, error) { + reqURL := fmt.Sprintf("%s/%s", dnsSubnetCacheURL, url.QueryEscape(hostname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSubnetCache `json:"dnssubnetcache"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSSubnetCache() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSubnetCacheURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnssubnetcache"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnssuffix -func (s *DNSService) AddDNSSuffix() {} -func (s *DNSService) DeleteDNSSuffix() {} -func (s *DNSService) GetAllDNSSuffix() {} -func (s *DNSService) GetDNSSuffix() {} -func (s *DNSService) CountDNSSuffix() {} +func (s *DNSService) AddDNSSuffix(suffix models.DNSSuffix) error { + payload := map[string]any{"dnssuffix": suffix} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsSuffixURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSSuffix(suffix string) error { + reqURL := fmt.Sprintf("%s/%s", dnsSuffixURL, url.QueryEscape(suffix)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSSuffix() ([]models.DNSSuffix, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSuffixURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSuffix `json:"dnssuffix"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSSuffix(suffix string) ([]models.DNSSuffix, error) { + reqURL := fmt.Sprintf("%s/%s", dnsSuffixURL, url.QueryEscape(suffix)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSSuffix `json:"dnssuffix"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSSuffix() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsSuffixURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnssuffix"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnstxtrec -func (s *DNSService) AddDNSTXTRec() {} -func (s *DNSService) DeleteDNSTXTRec() {} -func (s *DNSService) GetAllDNSTXTRec() {} -func (s *DNSService) GetDNSTXTRec() {} -func (s *DNSService) CountDNSTXTRec() {} +func (s *DNSService) AddDNSTXTRec(rec models.DNSTxtRec) error { + payload := map[string]any{"dnstxtrec": rec} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsTXTRecURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSTXTRec(domain string) error { + reqURL := fmt.Sprintf("%s/%s", dnsTXTRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSTXTRec() ([]models.DNSTxtRec, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsTXTRecURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSTxtRec `json:"dnstxtrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSTXTRec(domain string) ([]models.DNSTxtRec, error) { + reqURL := fmt.Sprintf("%s/%s", dnsTXTRecURL, url.QueryEscape(domain)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSTxtRec `json:"dnstxtrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSTXTRec() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsTXTRecURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnstxtrec"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsview -func (s *DNSService) AddDNSView() {} -func (s *DNSService) DeleteDNSView() {} -func (s *DNSService) GetAllDNSView() {} -func (s *DNSService) GetDNSView() {} -func (s *DNSService) CountDNSView() {} +func (s *DNSService) AddDNSView(view models.DNSView) error { + payload := map[string]any{"dnsview": view} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsViewURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSView(viewName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsViewURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSView() ([]models.DNSView, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsViewURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSView `json:"dnsview"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSView(viewName string) ([]models.DNSView, error) { + reqURL := fmt.Sprintf("%s/%s", dnsViewURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSView `json:"dnsview"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSView() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsViewURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsview"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsview_binding -func (s *DNSService) GetAllDNSViewBinding() {} -func (s *DNSService) GetDNSViewBinding() {} +func (s *DNSService) GetAllDNSViewBinding() ([]models.DNSViewBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsViewBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewBinding `json:"dnsview_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSViewBinding(viewName string) ([]models.DNSViewBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsViewBindingURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewBinding `json:"dnsview_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnsview_dnspolicy_binding -func (s *DNSService) GetAllDNSViewDNSPolicyBinding() {} -func (s *DNSService) GetDNSViewDNSPolicyBinding() {} -func (s *DNSService) CountDNSViewDNSPolicyBinding() {} +func (s *DNSService) GetAllDNSViewDNSPolicyBinding() ([]models.DNSViewDNSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsViewDNSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewDNSPolicyBinding `json:"dnsview_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSViewDNSPolicyBinding(viewName string) ([]models.DNSViewDNSPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsViewDNSPolicyBindingURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewDNSPolicyBinding `json:"dnsview_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSViewDNSPolicyBinding(viewName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsViewDNSPolicyBindingURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsview_dnspolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnsview_gslbservice_binding -func (s *DNSService) GetAllDNSViewGSLBServiceBinding() {} -func (s *DNSService) GetDNSViewGSLBServiceBinding() {} -func (s *DNSService) CountDNSViewGSLBServiceBinding() {} +func (s *DNSService) GetAllDNSViewGSLBServiceBinding() ([]models.DNSViewGSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsViewGSLBServiceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewGSLBServiceBinding `json:"dnsview_gslbservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSViewGSLBServiceBinding(viewName string) ([]models.DNSViewGSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsViewGSLBServiceBindingURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSViewGSLBServiceBinding `json:"dnsview_gslbservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSViewGSLBServiceBinding(viewName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsViewGSLBServiceBindingURL, url.QueryEscape(viewName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnsview_gslbservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnszone -func (s *DNSService) AddDNSZone() {} -func (s *DNSService) DeleteDNSZone() {} -func (s *DNSService) UpdateDNSZone() {} -func (s *DNSService) UnsetDNSZone() {} -func (s *DNSService) SignDNSZone() {} -func (s *DNSService) UnsignDNSZone() {} -func (s *DNSService) GetAllDNSZone() {} -func (s *DNSService) GetDNSZone() {} -func (s *DNSService) CountDNSZone() {} +func (s *DNSService) AddDNSZone(zone models.DNSZone) error { + payload := map[string]any{"dnszone": zone} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsZoneURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) DeleteDNSZone(zoneName string) error { + reqURL := fmt.Sprintf("%s/%s", dnsZoneURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UpdateDNSZone(zone models.DNSZone) error { + payload := map[string]any{"dnszone": zone} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, dnsZoneURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsetDNSZone(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"dnszone": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsZoneURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) SignDNSZone(zone models.DNSZone) error { + payload := map[string]any{"dnszone": zone} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsZoneURL+"?action=sign", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) UnsignDNSZone(zone models.DNSZone) error { + payload := map[string]any{"dnszone": zone} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, dnsZoneURL+"?action=unsign", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *DNSService) GetAllDNSZone() ([]models.DNSZone, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsZoneURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZone `json:"dnszone"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSZone(zoneName string) ([]models.DNSZone, error) { + reqURL := fmt.Sprintf("%s/%s", dnsZoneURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZone `json:"dnszone"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSZone() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsZoneURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnszone"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnszone_binding -func (s *DNSService) GetAllDNSZoneBinding() {} -func (s *DNSService) GetDNSZoneBinding() {} +func (s *DNSService) GetAllDNSZoneBinding() ([]models.DNSZoneBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsZoneBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneBinding `json:"dnszone_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSZoneBinding(zoneName string) ([]models.DNSZoneBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsZoneBindingURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneBinding `json:"dnszone_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // dnszone_dnskey_binding -func (s *DNSService) GetAllDNSZoneDNSKeyBinding() {} -func (s *DNSService) GetDNSZoneDNSKeyBinding() {} -func (s *DNSService) CountDNSZoneDNSKeyBinding() {} +func (s *DNSService) GetAllDNSZoneDNSKeyBinding() ([]models.DNSZoneDNSKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsZoneDNSKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneDNSKeyBinding `json:"dnszone_dnskey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSZoneDNSKeyBinding(zoneName string) ([]models.DNSZoneDNSKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsZoneDNSKeyBindingURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneDNSKeyBinding `json:"dnszone_dnskey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSZoneDNSKeyBinding(zoneName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsZoneDNSKeyBindingURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnszone_dnskey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // dnszone_domain_binding -func (s *DNSService) GetAllDNSZoneDomainBinding() {} -func (s *DNSService) GetDNSZoneDomainBinding() {} -func (s *DNSService) CountDNSZoneDomainBinding() {} +func (s *DNSService) GetAllDNSZoneDomainBinding() ([]models.DNSZoneDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, dnsZoneDomainBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneDomainBinding `json:"dnszone_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) GetDNSZoneDomainBinding(zoneName string) ([]models.DNSZoneDomainBinding, error) { + reqURL := fmt.Sprintf("%s/%s", dnsZoneDomainBindingURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.DNSZoneDomainBinding `json:"dnszone_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *DNSService) CountDNSZoneDomainBinding(zoneName string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", dnsZoneDomainBindingURL, url.QueryEscape(zoneName)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"dnszone_domain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/feo.go b/nitrogo/feo.go index bac2346..06846cf 100644 --- a/nitrogo/feo.go +++ b/nitrogo/feo.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( feoActionURL = "/nitro/v1/config/feoaction" feoGlobalBindingURL = "/nitro/v1/config/feoglobal_binding" @@ -21,68 +31,777 @@ type FEOService struct { // feoaction // Configuration for Front end optimization action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feoaction -func (s *FEOService) AddFEOAction() {} -func (s *FEOService) DeleteFEOAction() {} -func (s *FEOService) UpdateFEOAction() {} -func (s *FEOService) UnsetFEOAction() {} -func (s *FEOService) GetAllFEOAction() {} -func (s *FEOService) GetFEOAction() {} -func (s *FEOService) CountFEOAction() {} + +func (s *FEOService) AddFEOAction(action models.FEOAction) error { + payload := map[string]any{ + "feoaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, feoActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) DeleteFEOAction(name string) error { + urlReq := fmt.Sprintf("%s/%s", feoActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) UpdateFEOAction(action models.FEOAction) error { + payload := map[string]any{ + "feoaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, feoActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) UnsetFEOAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "feoaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, feoActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) GetAllFEOAction() ([]models.FEOAction, error) { + req, err := s.client.NewRequest(http.MethodGet, feoActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.FEOAction `json:"feoaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *FEOService) GetFEOAction(name string) ([]models.FEOAction, error) { + urlReq := fmt.Sprintf("%s/%s", feoActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.FEOAction `json:"feoaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *FEOService) CountFEOAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, feoActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"feoaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} // feoglobal_binding // Binding object which returns the resources bound to feoglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feoglobal_binding -func (s *FEOService) GetFEOGlobalBinding() {} + +func (s *FEOService) GetFEOGlobalBinding() ([]models.FEOGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOGlobalBinding `json:"feoglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // feoglobal_feopolicy_binding // Binding object showing the feopolicy that can be bound to feoglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feoglobal_feopolicy_binding -func (s *FEOService) AddFEOGlobalFEOPolicyBinding() {} -func (s *FEOService) DeleteFEOGlobalFEOPolicyBinding() {} -func (s *FEOService) GetFEOGlobalFEOPolicyBinding() {} -func (s *FEOService) CountFEOGlobalFEOPolicyBinding() {} + +func (s *FEOService) AddFEOGlobalFEOPolicyBinding(binding models.FEOGlobalFEOPolicyBinding) error { + payload := map[string]any{ + "feoglobal_feopolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, feoGlobalFEOPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) DeleteFEOGlobalFEOPolicyBinding(policyname string) error { + urlReq := fmt.Sprintf("%s?args=policyname:%s", feoGlobalFEOPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) GetFEOGlobalFEOPolicyBinding() ([]models.FEOGlobalFEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoGlobalFEOPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOGlobalFEOPolicyBinding `json:"feoglobal_feopolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) CountFEOGlobalFEOPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, feoGlobalFEOPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"feoglobal_feopolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // feoparameter // Configuration for FEO parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feoparameter -func (s *FEOService) UpdateFEOParameter() {} -func (s *FEOService) UnsetFEOParameter() {} -func (s *FEOService) GetAllFEOParameter() {} + +func (s *FEOService) UpdateFEOParameter(param models.FEOParameter) error { + payload := map[string]any{ + "feoparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, feoParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) UnsetFEOParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "feoparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, feoParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) GetAllFEOParameter() (models.FEOParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, feoParameterURL, nil) + if err != nil { + return models.FEOParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.FEOParameter{}, err + } + + var result struct { + Parameters []models.FEOParameter `json:"feoparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.FEOParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0], nil + } + + return models.FEOParameter{}, nil +} // feopolicy // Configuration for Front end optimization policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feopolicy -func (s *FEOService) AddFEOPolicy() {} -func (s *FEOService) DeleteFEOPolicy() {} -func (s *FEOService) UpdateFEOPolicy() {} -func (s *FEOService) UnsetFEOPolicy() {} -func (s *FEOService) GetAllFEOPolicy() {} -func (s *FEOService) GetFEOPolicy() {} -func (s *FEOService) CountFEOPolicy() {} + +func (s *FEOService) AddFEOPolicy(policy models.FEOPolicy) error { + payload := map[string]any{ + "feopolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, feoPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) DeleteFEOPolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", feoPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) UpdateFEOPolicy(policy models.FEOPolicy) error { + payload := map[string]any{ + "feopolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, feoPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) UnsetFEOPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "feopolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, feoPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *FEOService) GetAllFEOPolicy() ([]models.FEOPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.FEOPolicy `json:"feopolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *FEOService) GetFEOPolicy(name string) ([]models.FEOPolicy, error) { + urlReq := fmt.Sprintf("%s/%s", feoPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.FEOPolicy `json:"feopolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *FEOService) CountFEOPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"feopolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} // feopolicy_binding // Binding object which returns the resources bound to feopolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feopolicy_binding -func (s *FEOService) GetAllFEOPolicyBinding() {} -func (s *FEOService) GetFEOPolicyBinding() {} + +func (s *FEOService) GetAllFEOPolicyBinding() ([]models.FEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyBinding `json:"feopolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) GetFEOPolicyBinding(name string) ([]models.FEOPolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", feoPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyBinding `json:"feopolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // feopolicy_csvserver_binding // Binding object showing the csvserver that can be bound to feopolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feopolicy_csvserver_binding -func (s *FEOService) GetAllFEOPolicyCSVServerBinding() {} -func (s *FEOService) GetFEOPolicyCSVServerBinding() {} -func (s *FEOService) CountFEOPolicyCSVServerBinding() {} + +func (s *FEOService) GetAllFEOPolicyCSVServerBinding() ([]models.FEOPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyCSVServerBinding `json:"feopolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) GetFEOPolicyCSVServerBinding(name string) ([]models.FEOPolicyCSVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", feoPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyCSVServerBinding `json:"feopolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) CountFEOPolicyCSVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", feoPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"feopolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // feopolicy_feoglobal_binding // Binding object showing the feoglobal that can be bound to feopolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feopolicy_feoglobal_binding -func (s *FEOService) GetAllFEOPolicyFEOGlobalBinding() {} -func (s *FEOService) GetFEOPolicyFEOGlobalBinding() {} -func (s *FEOService) CountFEOPolicyFEOGlobalBinding() {} + +func (s *FEOService) GetAllFEOPolicyFEOGlobalBinding() ([]models.FEOPolicyFEOGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyFEOGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyFEOGlobalBinding `json:"feopolicy_feoglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) GetFEOPolicyFEOGlobalBinding(name string) ([]models.FEOPolicyFEOGlobalBinding, error) { + urlReq := fmt.Sprintf("%s/%s", feoPolicyFEOGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyFEOGlobalBinding `json:"feopolicy_feoglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) CountFEOPolicyFEOGlobalBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", feoPolicyFEOGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"feopolicy_feoglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // feopolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to feopolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/feo/feopolicy_lbvserver_binding -func (s *FEOService) GetAllFEOPolicyLBVServerBinding() {} -func (s *FEOService) GetFEOPolicyLBVServerBinding() {} -func (s *FEOService) CountFEOPolicyLBVServerBinding() {} + +func (s *FEOService) GetAllFEOPolicyLBVServerBinding() ([]models.FEOPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, feoPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyLBVServerBinding `json:"feopolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) GetFEOPolicyLBVServerBinding(name string) ([]models.FEOPolicyLBVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", feoPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.FEOPolicyLBVServerBinding `json:"feopolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *FEOService) CountFEOPolicyLBVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", feoPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"feopolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/glsb.go b/nitrogo/glsb.go deleted file mode 100644 index 82b52fc..0000000 --- a/nitrogo/glsb.go +++ /dev/null @@ -1,242 +0,0 @@ -package nitrogo - -const ( - gslbConfigURL = "/nitro/v1/config/gslbconfig" - gslbDomainURL = "/nitro/v1/config/gslbdomain" - gslbDomainBindingURL = "/nitro/v1/config/gslbdomain_binding" - gslbDomainGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroupmember_binding" - gslbDomainGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroup_binding" - gslbDomainGSLBServiceBindingURL = "/nitro/v1/config/gslbdomain_gslbservice_binding" - gslbDomainGSLBVServerBindingURL = "/nitro/v1/config/gslbdomain_gslbvserver_binding" - gslbDomainLBMonitorBindingURL = "/nitro/v1/config/gslbdomain_lbmonitor_binding" - gslbDNSEntriesURL = "/nitro/v1/config/gslbdnsentries" - gslbDNSEntryURL = "/nitro/v1/config/gslbdnsentry" - gslbParameterURL = "/nitro/v1/config/gslbparameter" - gslbRunningConfigURL = "/nitro/v1/config/gslbrunningconfig" - gslbServiceURL = "/nitro/v1/config/gslbservice" - gslbServiceGroupURL = "/nitro/v1/config/gslbservicegroup" - gslbServiceGroupBindingURL = "/nitro/v1/config/gslbservicegroup_binding" - gslbServiceGroupGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbservicegroup_gslbservicegroupmember_binding" - gslbServiceGroupLBMonitorBindingURL = "/nitro/v1/config/gslbservicegroup_lbmonitor_binding" - gslbServiceGroupServiceGroupEntityMonBindingsBindingURL = "/nitro/v1/config/gslbservicegroup_servicegroupentitymonbindings_binding" - gslbServiceBindingURL = "/nitro/v1/config/gslbservice_binding" - gslbServiceDNSViewBindingURL = "/nitro/v1/config/gslbservice_dnsview_binding" - gslbServiceLBMonitorBindingURL = "/nitro/v1/config/gslbservice_lbmonitor_binding" - gslbSiteURL = "/nitro/v1/config/gslbsite" - gslbSiteBindingURL = "/nitro/v1/config/gslbsite_binding" - gslbSiteGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroupmember_binding" - gslbSiteGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroup_binding" - gslbSiteGSLBServiceBindingURL = "/nitro/v1/config/gslbsite_gslbservice_binding" - gslbSyncStatusURL = "/nitro/v1/config/gslbsyncstatus" - gslbVServerURL = "/nitro/v1/config/gslbvserver" - gslbVServerBindingURL = "/nitro/v1/config/gslbvserver_binding" - gslbVServerDomainBindingURL = "/nitro/v1/config/gslbvserver_domain_binding" - gslbVServerGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroupmember_binding" - gslbVServerGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroup_binding" - gslbVServerGSLBServiceBindingURL = "/nitro/v1/config/gslbvserver_gslbservice_binding" - gslbVServerSpilloverPolicyBindingURL = "/nitro/v1/config/gslbvserver_spilloverpolicy_binding" -) - -// Global Server Load Balancing (GSLB) configuration. GSLB feature ensures that client requests are -// directed to a best performing site available in a global enterprise and distributed Internet environment. -// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/gslb/gslb -type GSLBService struct { - client *Client -} - -// gslbconfig -func (s *GSLBService) SyncGSLBConfig() {} - -// gslbdomain -func (s *GSLBService) GetAllGSLBDomain() {} -func (s *GSLBService) GetGSLBDomain() {} -func (s *GSLBService) CountGSLBDomain() {} - -// gslbdomain_binding -func (s *GSLBService) GetAllGSLBDomainBinding() {} -func (s *GSLBService) GetGSLBDomainBinding() {} - -// dslbdomain_gslbservicegroupmember_binding -func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) GetGSLBDomainGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) CountGSLBDomainGSLBServiceGroupMemberBinding() {} - -// gslbdomain_gslbservicegroup_binding -func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupBinding() {} -func (s *GSLBService) GetGSLBDomainGSLBServiceGroupBinding() {} -func (s *GSLBService) CountGSLBDomainGSLBServiceGroupBinding() {} - -// dslbdomain_gslbservice_binding -func (s *GSLBService) GetAllGSLBDomainGSLBServiceBinding() {} -func (s *GSLBService) GetGSLBDomainGSLBServiceBinding() {} -func (s *GSLBService) CountGSLBDomainGSLBServiceBinding() {} - -// gslbdomain_gslbvserver_binding -func (s *GSLBService) GetAllGSLBDomainGSLBVServerBinding() {} -func (s *GSLBService) GetGSLBDomainGSLBVServerBinding() {} -func (s *GSLBService) CountGSLBDomainGSLBVServerBinding() {} - -// gslbdomain_lbmonitor_binding -func (s *GSLBService) GetAllGSLBDomainLBMonitorBinding() {} -func (s *GSLBService) GetGSLBDomainLBMonitorBinding() {} -func (s *GSLBService) CountGSLBDomainLBMonitorBinding() {} - -// gslbdnsentries -func (s *GSLBService) ClearGSLBDNSEntries() {} -func (s *GSLBService) GetAllGSLBDNSEntries() {} -func (s *GSLBService) CountGSLBDNSEntries() {} - -// gslbdnsentry -func (s *GSLBService) DeleteGSLBDNSEntry() {} - -// gslbparameter -func (s *GSLBService) UpdateGSLBParameter() {} -func (s *GSLBService) UnsetGSLBParameter() {} -func (s *GSLBService) GetAllGSLBParameter() {} - -// gslbrunningconfig -func (s *GSLBService) GetAllGSLBRunningConfig() {} - -// gslbservice -func (s *GSLBService) AddGSLBService() {} -func (s *GSLBService) DeleteGSLBService() {} -func (s *GSLBService) UpdateGSLBService() {} -func (s *GSLBService) UnsetGSLBService() {} -func (s *GSLBService) GetAllGSLBService() {} -func (s *GSLBService) GetGSLBService() {} -func (s *GSLBService) CountGSLBService() {} -func (s *GSLBService) RenameGSLBService() {} - -// gslbservicegroup -func (s *GSLBService) AddGSLBServiceGroup() {} -func (s *GSLBService) DeleteGSLBServiceGroup() {} -func (s *GSLBService) UpdateGSLBServiceGroup() {} -func (s *GSLBService) UnsetGSLBServiceGroup() {} -func (s *GSLBService) EnableGSLBServiceGroup() {} -func (s *GSLBService) DisableGSLBServiceGroup() {} -func (s *GSLBService) GetAllGSLBServiceGroup() {} -func (s *GSLBService) GetGSLBServiceGroup() {} -func (s *GSLBService) CountGSLBServiceGroup() {} -func (s *GSLBService) RenameGSLBServiceGroup() {} - -// gslbservicegroup_binding -func (s *GSLBService) GetAllGSLBServiceGroupBinding() {} -func (s *GSLBService) GetGSLBServiceGroupBinding() {} - -// gslbservicegroup_gslbservicegroupmember_binding -func (s *GSLBService) AddGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) DeleteGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) GetAllGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) GetGSLBServiceGroupGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) CountGSLBServiceGroupGSLBServiceGroupMemberBinding() {} - -// gslbservicegroup_lbmonitor_binding -func (s *GSLBService) AddGSLBServiceGroupLBMonitorBinding() {} -func (s *GSLBService) DeleteGSLBServiceGroupLBMonitorBinding() {} -func (s *GSLBService) GetAllGSLBServiceGroupLBMonitorBinding() {} -func (s *GSLBService) GetGSLBServiceGroupLBMonitorBinding() {} -func (s *GSLBService) CountGSLBServiceGroupLBMonitorBinding() {} - -// gslbservicegroup_servicegroupentitymonbindings_binding -func (s *GSLBService) GetAllGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *GSLBService) GetGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} -func (s *GSLBService) CountGSLBServiceGroupServiceGroupEntityMonBindingsBinding() {} - -// gslbservice_binding -func (s *GSLBService) GetAllGSLBServiceBinding() {} -func (s *GSLBService) GetGSLBServiceBinding() {} - -// gslbservice_dnsview_binding -func (s *GSLBService) AddGSLBServiceDNSViewBinding() {} -func (s *GSLBService) DeleteGSLBServiceDNSViewBinding() {} -func (s *GSLBService) GetAllGSLBServiceDNSViewBinding() {} -func (s *GSLBService) GetGSLBServiceDNSViewBinding() {} -func (s *GSLBService) CountGSLBServiceDNSViewBinding() {} - -// dslbservice_lbmonitor_binding -func (s *GSLBService) AddGSLBServiceLBMonitorBinding() {} -func (s *GSLBService) DeleteGSLBServiceLBMonitorBinding() {} -func (s *GSLBService) GetAllGSLBServiceLBMonitorBinding() {} -func (s *GSLBService) GetGSLBServiceLBMonitorBinding() {} -func (s *GSLBService) CountGSLBServiceLBMonitorBinding() {} - -// gslbsite -func (s *GSLBService) AddGSLBSite() {} -func (s *GSLBService) DeleteGSLBSite() {} -func (s *GSLBService) UpdateGSLBSite() {} -func (s *GSLBService) UnsetGSLBSite() {} -func (s *GSLBService) GetAllGSLBSite() {} -func (s *GSLBService) GetGSLBSite() {} -func (s *GSLBService) CountGSLBSite() {} -func (s *GSLBService) RenameGSLBSite() {} - -// gslbsite_binding -func (s *GSLBService) GetAllGSLBSiteBinding() {} -func (s *GSLBService) GetGSLBSiteBinding() {} - -// gslbsite_gslbservicegroupmember_binding -func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) GetGSLBSiteGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) CountGSLBSiteGSLBServiceGroupMemberBinding() {} - -// gslbsite_gslbservicegroup_binding -func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupBinding() {} -func (s *GSLBService) GetGSLBSiteGSLBServiceGroupBinding() {} -func (s *GSLBService) CountGSLBSiteGSLBServiceGroupBinding() {} - -// gslbsite_gslbservice_binding -func (s *GSLBService) GetAllGSLBSiteGSLBServiceBinding() {} -func (s *GSLBService) GetGSLBSiteGSLBServiceBinding() {} -func (s *GSLBService) CountGSLBSiteGSLBServiceBinding() {} - -// gslbsyncstatus -func (s *GSLBService) GetAllGSLBSyncStatus() {} - -// gslbvserver -func (s *GSLBService) AddGSLBVServer() {} -func (s *GSLBService) DeleteGSLBVServer() {} -func (s *GSLBService) UpdateGSLBVServer() {} -func (s *GSLBService) UnsetGSLBVServer() {} -func (s *GSLBService) EnableGSLBVServer() {} -func (s *GSLBService) DisableGSLBVServer() {} -func (s *GSLBService) GetAllGSLBVServer() {} -func (s *GSLBService) GetGSLBVServer() {} -func (s *GSLBService) CountGSLBVServer() {} -func (s *GSLBService) RenameGSLBVServer() {} - -// gslbvserver_binding -func (s *GSLBService) GetAllGSLBVServerBinding() {} -func (s *GSLBService) GetGSLBVServerBinding() {} - -// gslbvserver_domain_binding -func (s *GSLBService) AddGSLBVServerDomainBinding() {} -func (s *GSLBService) DeleteGSLBVServerDomainBinding() {} -func (s *GSLBService) GetAllGSLBVServerDomainBinding() {} -func (s *GSLBService) GetGSLBVServerDomainBinding() {} -func (s *GSLBService) CountGSLBVServerDomainBinding() {} - -// gslbvserver_gslbservicegroupmember_binding -func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) GetGSLBVServerGSLBServiceGroupMemberBinding() {} -func (s *GSLBService) CountGSLBVServerGSLBServiceGroupMemberBinding() {} - -// gslbvserver_gslbservicegroup_binding -func (s *GSLBService) AddGSLBVServerGSLBServiceGroupBinding() {} -func (s *GSLBService) DeleteGSLBVServerGSLBServiceGroupBinding() {} -func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupBinding() {} -func (s *GSLBService) GetGSLBVServerGSLBServiceGroupBinding() {} -func (s *GSLBService) CountGSLBVServerGSLBServiceGroupBinding() {} - -// gslbvserver_gslbservice_binding -func (s *GSLBService) AddGSLBVServerGSLBServiceBinding() {} -func (s *GSLBService) DeleteGSLBVServerGSLBServiceBinding() {} -func (s *GSLBService) GetAllGSLBVServerGSLBServiceBinding() {} -func (s *GSLBService) GetGSLBVServerGSLBServiceBinding() {} -func (s *GSLBService) CountGSLBVServerGSLBServiceBinding() {} - -// gslbvserver_spilloverpolicy_binding -func (s *GSLBService) AddGSLBVServerSpilloverPolicyBinding() {} -func (s *GSLBService) DeleteGSLBVServerSpilloverPolicyBinding() {} -func (s *GSLBService) GetAllGSLBVServerSpilloverPolicyBinding() {} -func (s *GSLBService) GetGSLBVServerSpilloverPolicyBinding() {} -func (s *GSLBService) CountGSLBVServerSpilloverPolicyBinding() {} diff --git a/nitrogo/gslb.go b/nitrogo/gslb.go new file mode 100644 index 0000000..76f9b71 --- /dev/null +++ b/nitrogo/gslb.go @@ -0,0 +1,2998 @@ +package nitrogo + +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + +const ( + gslbConfigURL = "/nitro/v1/config/gslbconfig" + gslbDomainURL = "/nitro/v1/config/gslbdomain" + gslbDomainBindingURL = "/nitro/v1/config/gslbdomain_binding" + gslbDomainGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroupmember_binding" + gslbDomainGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbdomain_gslbservicegroup_binding" + gslbDomainGSLBServiceBindingURL = "/nitro/v1/config/gslbdomain_gslbservice_binding" + gslbDomainGSLBVServerBindingURL = "/nitro/v1/config/gslbdomain_gslbvserver_binding" + gslbDomainLBMonitorBindingURL = "/nitro/v1/config/gslbdomain_lbmonitor_binding" + gslbDNSEntriesURL = "/nitro/v1/config/gslbdnsentries" + gslbDNSEntryURL = "/nitro/v1/config/gslbdnsentry" + gslbParameterURL = "/nitro/v1/config/gslbparameter" + gslbRunningConfigURL = "/nitro/v1/config/gslbrunningconfig" + gslbServiceURL = "/nitro/v1/config/gslbservice" + gslbServiceGroupURL = "/nitro/v1/config/gslbservicegroup" + gslbServiceGroupBindingURL = "/nitro/v1/config/gslbservicegroup_binding" + gslbServiceGroupGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbservicegroup_gslbservicegroupmember_binding" + gslbServiceGroupLBMonitorBindingURL = "/nitro/v1/config/gslbservicegroup_lbmonitor_binding" + gslbServiceGroupServiceGroupEntityMonBindingsBindingURL = "/nitro/v1/config/gslbservicegroup_servicegroupentitymonbindings_binding" + gslbServiceBindingURL = "/nitro/v1/config/gslbservice_binding" + gslbServiceDNSViewBindingURL = "/nitro/v1/config/gslbservice_dnsview_binding" + gslbServiceLBMonitorBindingURL = "/nitro/v1/config/gslbservice_lbmonitor_binding" + gslbSiteURL = "/nitro/v1/config/gslbsite" + gslbSiteBindingURL = "/nitro/v1/config/gslbsite_binding" + gslbSiteGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroupmember_binding" + gslbSiteGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbsite_gslbservicegroup_binding" + gslbSiteGSLBServiceBindingURL = "/nitro/v1/config/gslbsite_gslbservice_binding" + gslbSyncStatusURL = "/nitro/v1/config/gslbsyncstatus" + gslbVServerURL = "/nitro/v1/config/gslbvserver" + gslbVServerBindingURL = "/nitro/v1/config/gslbvserver_binding" + gslbVServerDomainBindingURL = "/nitro/v1/config/gslbvserver_domain_binding" + gslbVServerGSLBServiceGroupMemberBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroupmember_binding" + gslbVServerGSLBServiceGroupBindingURL = "/nitro/v1/config/gslbvserver_gslbservicegroup_binding" + gslbVServerGSLBServiceBindingURL = "/nitro/v1/config/gslbvserver_gslbservice_binding" + gslbVServerSpilloverPolicyBindingURL = "/nitro/v1/config/gslbvserver_spilloverpolicy_binding" +) + +// Global Server Load Balancing (GSLB) configuration. GSLB feature ensures that client requests are +// directed to a best performing site available in a global enterprise and distributed Internet environment. +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/gslb/gslb +type GSLBService struct { + client *Client +} + +// gslbconfig +func (s *GSLBService) SyncGSLBConfig(config models.GSLBConfig) error { + payload := map[string]any{ + "gslbconfig": config, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbConfigURL+"?action=sync", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbdomain +func (s *GSLBService) GetAllGSLBDomain() ([]models.GSLBDomain, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + GSLBDomains []models.GSLBDomain `json:"gslbdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.GSLBDomains, nil +} + +func (s *GSLBService) GetGSLBDomain(name string) (*models.GSLBDomain, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + GSLBDomains []models.GSLBDomain `json:"gslbdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.GSLBDomains) == 0 { + return nil, fmt.Errorf("gslbdomain not found") + } + + return &result.GSLBDomains[0], nil +} + +func (s *GSLBService) CountGSLBDomain() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + GSLBDomains []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.GSLBDomains) > 0 { + return result.GSLBDomains[0].Count, nil + } + + return 0, nil +} + +// gslbdomain_binding +func (s *GSLBService) GetAllGSLBDomainBinding() ([]models.GSLBDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainBinding `json:"gslbdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainBinding(name string) (*models.GSLBDomainBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainBinding `json:"gslbdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("gslbdomain_binding not found") + } + + return &result.Bindings[0], nil +} + +// gslbdomain_gslbservicegroupmember_binding +func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupMemberBinding() ([]models.GSLBDomainGSLBServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainGSLBServiceGroupMemberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceGroupMemberBinding `json:"gslbdomain_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainGSLBServiceGroupMemberBinding(name string) ([]models.GSLBDomainGSLBServiceGroupMemberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceGroupMemberBinding `json:"gslbdomain_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBDomainGSLBServiceGroupMemberBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbDomainGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbdomain_gslbservicegroup_binding +func (s *GSLBService) GetAllGSLBDomainGSLBServiceGroupBinding() ([]models.GSLBDomainGSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainGSLBServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceGroupBinding `json:"gslbdomain_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainGSLBServiceGroupBinding(name string) ([]models.GSLBDomainGSLBServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceGroupBinding `json:"gslbdomain_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBDomainGSLBServiceGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbDomainGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbdomain_gslbservice_binding +func (s *GSLBService) GetAllGSLBDomainGSLBServiceBinding() ([]models.GSLBDomainGSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainGSLBServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceBinding `json:"gslbdomain_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainGSLBServiceBinding(name string) ([]models.GSLBDomainGSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBServiceBinding `json:"gslbdomain_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBDomainGSLBServiceBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbDomainGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbdomain_gslbvserver_binding +func (s *GSLBService) GetAllGSLBDomainGSLBVServerBinding() ([]models.GSLBDomainGSLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainGSLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBVServerBinding `json:"gslbdomain_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainGSLBVServerBinding(name string) ([]models.GSLBDomainGSLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainGSLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainGSLBVServerBinding `json:"gslbdomain_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBDomainGSLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbDomainGSLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbdomain_lbmonitor_binding +func (s *GSLBService) GetAllGSLBDomainLBMonitorBinding() ([]models.GSLBDomainLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDomainLBMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainLBMonitorBinding `json:"gslbdomain_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBDomainLBMonitorBinding(name string) ([]models.GSLBDomainLBMonitorBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbDomainLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBDomainLBMonitorBinding `json:"gslbdomain_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBDomainLBMonitorBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbDomainLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbdomain_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbdnsentries +func (s *GSLBService) ClearGSLBDNSEntries(resource models.GSLBLDNSEntries) error { + payload := map[string]any{ + "gslbdnsentries": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbDNSEntriesURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBDNSEntries() ([]models.GSLBLDNSEntries, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDNSEntriesURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Entries []models.GSLBLDNSEntries `json:"gslbdnsentries"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Entries, nil +} + +func (s *GSLBService) CountGSLBDNSEntries() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbDNSEntriesURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Entries []struct { + Count float64 `json:"__count"` + } `json:"gslbdnsentries"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Entries) > 0 { + return result.Entries[0].Count, nil + } + + return 0, nil +} + +// gslbdnsentry +func (s *GSLBService) DeleteGSLBDNSEntry(name string) error { + reqURL := fmt.Sprintf("%s/%s", gslbDNSEntryURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbparameter +func (s *GSLBService) UpdateGSLBParameter(resource models.GSLBParameter) error { + payload := map[string]any{ + "gslbparameter": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, gslbParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UnsetGSLBParameter(resource models.GSLBParameter) error { + payload := map[string]any{ + "gslbparameter": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBParameter() (*models.GSLBParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbParameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Parameter []models.GSLBParameter `json:"gslbparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameter) == 0 { + return nil, fmt.Errorf("gslbparameter not found") + } + + return &result.Parameter[0], nil +} + +// gslbrunningconfig +func (s *GSLBService) GetAllGSLBRunningConfig() ([]models.GSLBRunningConfig, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbRunningConfigURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RunningConfig []models.GSLBRunningConfig `json:"gslbrunningconfig"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RunningConfig, nil +} + +// gslbservice +func (s *GSLBService) AddGSLBService(resource models.GSLBService) error { + payload := map[string]any{ + "gslbservice": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBService(name string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UpdateGSLBService(resource models.GSLBService) error { + payload := map[string]any{ + "gslbservice": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, gslbServiceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UnsetGSLBService(resource models.GSLBService) error { + payload := map[string]any{ + "gslbservice": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBService() ([]models.GSLBService, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Services []models.GSLBService `json:"gslbservice"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Services, nil +} + +func (s *GSLBService) GetGSLBService(name string) (*models.GSLBService, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Services []models.GSLBService `json:"gslbservice"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Services) == 0 { + return nil, fmt.Errorf("gslbservice not found") + } + + return &result.Services[0], nil +} + +func (s *GSLBService) CountGSLBService() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Services []struct { + Count float64 `json:"__count"` + } `json:"gslbservice"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Services) > 0 { + return result.Services[0].Count, nil + } + + return 0, nil +} + +func (s *GSLBService) RenameGSLBService(resource models.GSLBService) error { + payload := map[string]any{ + "gslbservice": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbservicegroup +func (s *GSLBService) AddGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBServiceGroup(name string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UpdateGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, gslbServiceGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UnsetGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) EnableGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DisableGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBServiceGroup() ([]models.GSLBServiceGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.GSLBServiceGroup `json:"gslbservicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Groups, nil +} + +func (s *GSLBService) GetGSLBServiceGroup(name string) (*models.GSLBServiceGroup, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.GSLBServiceGroup `json:"gslbservicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Groups) == 0 { + return nil, fmt.Errorf("gslbservicegroup not found") + } + + return &result.Groups[0], nil +} + +func (s *GSLBService) CountGSLBServiceGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Groups []struct { + Count float64 `json:"__count"` + } `json:"gslbservicegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Groups) > 0 { + return result.Groups[0].Count, nil + } + + return 0, nil +} + +func (s *GSLBService) RenameGSLBServiceGroup(resource models.GSLBServiceGroup) error { + payload := map[string]any{ + "gslbservicegroup": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbservicegroup_binding +func (s *GSLBService) GetAllGSLBServiceGroupBinding() ([]models.GSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupBinding `json:"gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceGroupBinding(name string) (*models.GSLBServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupBinding `json:"gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("gslbservicegroup_binding not found") + } + + return &result.Bindings[0], nil +} + +// gslbservicegroup_gslbservicegroupmember_binding +func (s *GSLBService) AddGSLBServiceGroupGSLBServiceGroupMemberBinding(resource models.GSLBServiceGroupGSLBServiceGroupMemberBinding) error { + payload := map[string]any{ + "gslbservicegroup_gslbservicegroupmember_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupGSLBServiceGroupMemberBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBServiceGroupGSLBServiceGroupMemberBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBServiceGroupGSLBServiceGroupMemberBinding() ([]models.GSLBServiceGroupGSLBServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupGSLBServiceGroupMemberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupGSLBServiceGroupMemberBinding `json:"gslbservicegroup_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceGroupGSLBServiceGroupMemberBinding(name string) ([]models.GSLBServiceGroupGSLBServiceGroupMemberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupGSLBServiceGroupMemberBinding `json:"gslbservicegroup_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBServiceGroupGSLBServiceGroupMemberBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbServiceGroupGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbservicegroup_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbservicegroup_lbmonitor_binding +func (s *GSLBService) AddGSLBServiceGroupLBMonitorBinding(resource models.GSLBServiceGroupLBMonitorBinding) error { + payload := map[string]any{ + "gslbservicegroup_lbmonitor_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceGroupLBMonitorBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBServiceGroupLBMonitorBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupLBMonitorBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBServiceGroupLBMonitorBinding() ([]models.GSLBServiceGroupLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupLBMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupLBMonitorBinding `json:"gslbservicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceGroupLBMonitorBinding(name string) ([]models.GSLBServiceGroupLBMonitorBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupLBMonitorBinding `json:"gslbservicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBServiceGroupLBMonitorBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbServiceGroupLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbservicegroup_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbservicegroup_servicegroupentitymonbindings_binding +func (s *GSLBService) GetAllGSLBServiceGroupServiceGroupEntityMonBindingsBinding() ([]models.GSLBServiceGroupServiceGroupEntityMonBindingsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceGroupServiceGroupEntityMonBindingsBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupServiceGroupEntityMonBindingsBinding `json:"gslbservicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceGroupServiceGroupEntityMonBindingsBinding(name string) ([]models.GSLBServiceGroupServiceGroupEntityMonBindingsBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceGroupServiceGroupEntityMonBindingsBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceGroupServiceGroupEntityMonBindingsBinding `json:"gslbservicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBServiceGroupServiceGroupEntityMonBindingsBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbServiceGroupServiceGroupEntityMonBindingsBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbservicegroup_servicegroupentitymonbindings_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbservice_binding +func (s *GSLBService) GetAllGSLBServiceBinding() ([]models.GSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceBinding `json:"gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceBinding(name string) (*models.GSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceBinding `json:"gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("gslbservice_binding not found") + } + + return &result.Bindings[0], nil +} + +// gslbservice_dnsview_binding +func (s *GSLBService) AddGSLBServiceDNSViewBinding(resource models.GSLBServiceDNSViewBinding) error { + payload := map[string]any{ + "gslbservice_dnsview_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceDNSViewBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBServiceDNSViewBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceDNSViewBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBServiceDNSViewBinding() ([]models.GSLBServiceDNSViewBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceDNSViewBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceDNSViewBinding `json:"gslbservice_dnsview_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceDNSViewBinding(name string) ([]models.GSLBServiceDNSViewBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceDNSViewBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceDNSViewBinding `json:"gslbservice_dnsview_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBServiceDNSViewBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbServiceDNSViewBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbservice_dnsview_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbservice_lbmonitor_binding +func (s *GSLBService) AddGSLBServiceLBMonitorBinding(resource models.GSLBServiceLBMonitorBinding) error { + payload := map[string]any{ + "gslbservice_lbmonitor_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbServiceLBMonitorBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBServiceLBMonitorBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbServiceLBMonitorBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBServiceLBMonitorBinding() ([]models.GSLBServiceLBMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbServiceLBMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceLBMonitorBinding `json:"gslbservice_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBServiceLBMonitorBinding(name string) ([]models.GSLBServiceLBMonitorBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbServiceLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBServiceLBMonitorBinding `json:"gslbservice_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBServiceLBMonitorBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbServiceLBMonitorBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbservice_lbmonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbsite +func (s *GSLBService) AddGSLBSite(resource models.GSLBSite) error { + payload := map[string]any{ + "gslbsite": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbSiteURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBSite(name string) error { + reqURL := fmt.Sprintf("%s/%s", gslbSiteURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UpdateGSLBSite(resource models.GSLBSite) error { + payload := map[string]any{ + "gslbsite": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, gslbSiteURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UnsetGSLBSite(resource models.GSLBSite) error { + payload := map[string]any{ + "gslbsite": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbSiteURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBSite() ([]models.GSLBSite, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Sites []models.GSLBSite `json:"gslbsite"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Sites, nil +} + +func (s *GSLBService) GetGSLBSite(name string) (*models.GSLBSite, error) { + reqURL := fmt.Sprintf("%s/%s", gslbSiteURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Sites []models.GSLBSite `json:"gslbsite"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Sites) == 0 { + return nil, fmt.Errorf("gslbsite not found") + } + + return &result.Sites[0], nil +} + +func (s *GSLBService) CountGSLBSite() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Sites []struct { + Count float64 `json:"__count"` + } `json:"gslbsite"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Sites) > 0 { + return result.Sites[0].Count, nil + } + + return 0, nil +} + +func (s *GSLBService) RenameGSLBSite(resource models.GSLBSite) error { + payload := map[string]any{ + "gslbsite": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbSiteURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbsite_binding +func (s *GSLBService) GetAllGSLBSiteBinding() ([]models.GSLBSiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteBinding `json:"gslbsite_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBSiteBinding(name string) (*models.GSLBSiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbSiteBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteBinding `json:"gslbsite_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("gslbsite_binding not found") + } + + return &result.Bindings[0], nil +} + +// gslbsite_gslbservicegroupmember_binding +func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupMemberBinding() ([]models.GSLBSiteGSLBServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteGSLBServiceGroupMemberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceGroupMemberBinding `json:"gslbsite_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBSiteGSLBServiceGroupMemberBinding(name string) ([]models.GSLBSiteGSLBServiceGroupMemberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbSiteGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceGroupMemberBinding `json:"gslbsite_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBSiteGSLBServiceGroupMemberBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbSiteGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbsite_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbsite_gslbservicegroup_binding +func (s *GSLBService) GetAllGSLBSiteGSLBServiceGroupBinding() ([]models.GSLBSiteGSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteGSLBServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceGroupBinding `json:"gslbsite_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBSiteGSLBServiceGroupBinding(name string) ([]models.GSLBSiteGSLBServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbSiteGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceGroupBinding `json:"gslbsite_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBSiteGSLBServiceGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbSiteGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbsite_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbsite_gslbservice_binding +func (s *GSLBService) GetAllGSLBSiteGSLBServiceBinding() ([]models.GSLBSiteGSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSiteGSLBServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceBinding `json:"gslbsite_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBSiteGSLBServiceBinding(name string) ([]models.GSLBSiteGSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbSiteGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBSiteGSLBServiceBinding `json:"gslbsite_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBSiteGSLBServiceBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbSiteGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbsite_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbsyncstatus +func (s *GSLBService) GetAllGSLBSyncStatus() ([]models.GSLBSyncStatus, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbSyncStatusURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Status []models.GSLBSyncStatus `json:"gslbsyncstatus"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Status, nil +} + +// gslbvserver +func (s *GSLBService) AddGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBVServer(name string) error { + reqURL := fmt.Sprintf("%s/%s", gslbVServerURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UpdateGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, gslbVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) UnsetGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) EnableGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DisableGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBVServer() ([]models.GSLBVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + VServers []models.GSLBVServer `json:"gslbvserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.VServers, nil +} + +func (s *GSLBService) GetGSLBVServer(name string) (*models.GSLBVServer, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + VServers []models.GSLBVServer `json:"gslbvserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.VServers) == 0 { + return nil, fmt.Errorf("gslbvserver not found") + } + + return &result.VServers[0], nil +} + +func (s *GSLBService) CountGSLBVServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + VServers []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.VServers) > 0 { + return result.VServers[0].Count, nil + } + + return 0, nil +} + +func (s *GSLBService) RenameGSLBVServer(resource models.GSLBVServer) error { + payload := map[string]any{ + "gslbvserver": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// gslbvserver_binding +func (s *GSLBService) GetAllGSLBVServerBinding() ([]models.GSLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerBinding `json:"gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerBinding(name string) (*models.GSLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerBinding `json:"gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("gslbvserver_binding not found") + } + + return &result.Bindings[0], nil +} + +// gslbvserver_domain_binding +func (s *GSLBService) AddGSLBVServerDomainBinding(resource models.GSLBVServerDomainBinding) error { + payload := map[string]any{ + "gslbvserver_domain_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerDomainBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBVServerDomainBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbVServerDomainBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBVServerDomainBinding() ([]models.GSLBVServerDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerDomainBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerDomainBinding `json:"gslbvserver_domain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerDomainBinding(name string) ([]models.GSLBVServerDomainBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerDomainBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerDomainBinding `json:"gslbvserver_domain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBVServerDomainBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbVServerDomainBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver_domain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbvserver_gslbservicegroupmember_binding +func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupMemberBinding() ([]models.GSLBVServerGSLBServiceGroupMemberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerGSLBServiceGroupMemberBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceGroupMemberBinding `json:"gslbvserver_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerGSLBServiceGroupMemberBinding(name string) ([]models.GSLBVServerGSLBServiceGroupMemberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceGroupMemberBinding `json:"gslbvserver_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBVServerGSLBServiceGroupMemberBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbVServerGSLBServiceGroupMemberBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver_gslbservicegroupmember_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbvserver_gslbservicegroup_binding +func (s *GSLBService) AddGSLBVServerGSLBServiceGroupBinding(resource models.GSLBVServerGSLBServiceGroupBinding) error { + payload := map[string]any{ + "gslbvserver_gslbservicegroup_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerGSLBServiceGroupBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBVServerGSLBServiceGroupBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbVServerGSLBServiceGroupBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBVServerGSLBServiceGroupBinding() ([]models.GSLBVServerGSLBServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerGSLBServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceGroupBinding `json:"gslbvserver_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerGSLBServiceGroupBinding(name string) ([]models.GSLBVServerGSLBServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceGroupBinding `json:"gslbvserver_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBVServerGSLBServiceGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbVServerGSLBServiceGroupBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver_gslbservicegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbvserver_gslbservice_binding +func (s *GSLBService) AddGSLBVServerGSLBServiceBinding(resource models.GSLBVServerGSLBServiceBinding) error { + payload := map[string]any{ + "gslbvserver_gslbservice_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerGSLBServiceBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBVServerGSLBServiceBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbVServerGSLBServiceBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBVServerGSLBServiceBinding() ([]models.GSLBVServerGSLBServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerGSLBServiceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceBinding `json:"gslbvserver_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerGSLBServiceBinding(name string) ([]models.GSLBVServerGSLBServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerGSLBServiceBinding `json:"gslbvserver_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBVServerGSLBServiceBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbVServerGSLBServiceBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver_gslbservice_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// gslbvserver_spilloverpolicy_binding +func (s *GSLBService) AddGSLBVServerSpilloverPolicyBinding(resource models.GSLBVServerSpilloverPolicyBinding) error { + payload := map[string]any{ + "gslbvserver_spilloverpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, gslbVServerSpilloverPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) DeleteGSLBVServerSpilloverPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", gslbVServerSpilloverPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *GSLBService) GetAllGSLBVServerSpilloverPolicyBinding() ([]models.GSLBVServerSpilloverPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, gslbVServerSpilloverPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerSpilloverPolicyBinding `json:"gslbvserver_spilloverpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) GetGSLBVServerSpilloverPolicyBinding(name string) ([]models.GSLBVServerSpilloverPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", gslbVServerSpilloverPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.GSLBVServerSpilloverPolicyBinding `json:"gslbvserver_spilloverpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *GSLBService) CountGSLBVServerSpilloverPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", gslbVServerSpilloverPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"gslbvserver_spilloverpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/ha.go b/nitrogo/ha.go index fd88e44..103afab 100644 --- a/nitrogo/ha.go +++ b/nitrogo/ha.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( haFilesURL = "/nitro/v1/config/hafiles" haNodeURL = "/nitro/v1/config/hanode" @@ -20,52 +29,716 @@ type HAService struct { } // hafiles -func (s *HAService) SyncHAFiles() {} + +func (s *HAService) SyncHAFiles(files models.HAFiles) error { + payload := map[string]any{ + "hafiles": files, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, haFilesURL+"?action=sync", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // hanode -func (s *HAService) AddHANode() {} -func (s *HAService) DeleteHANode() {} -func (s *HAService) UpdateHANode() {} -func (s *HAService) UnsetHANode() {} -func (s *HAService) GetAllHANode() {} -func (s *HAService) GetHANode() {} -func (s *HAService) CountHANode() {} + +func (s *HAService) AddHANode(node models.HANode) error { + payload := map[string]any{ + "hanode": node, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, haNodeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) DeleteHANode(id int) error { + url := fmt.Sprintf("%s/%d", haNodeURL, id) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) UpdateHANode(node models.HANode) error { + payload := map[string]any{ + "hanode": node, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, haNodeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) UnsetHANode(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "hanode": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, haNodeURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) GetAllHANode() ([]models.HANode, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + HANodes []models.HANode `json:"hanode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.HANodes, nil +} + +func (s *HAService) GetHANode(id int) ([]models.HANode, error) { + url := fmt.Sprintf("%s/%d", haNodeURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + HANodes []models.HANode `json:"hanode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.HANodes, nil +} + +func (s *HAService) CountHANode() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeURL+"?view=count", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + HANodes []struct { + Count float64 `json:"__count"` + } `json:"hanode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.HANodes) > 0 { + return result.HANodes[0].Count, nil + } + + return 0, nil +} // hanode_binding -func (s *HAService) GetAllHANodeBinding() {} -func (s *HAService) GetHANodeBinding() {} + +func (s *HAService) GetAllHANodeBinding() ([]models.HANodeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeBinding `json:"hanode_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodeBinding(id int) ([]models.HANodeBinding, error) { + url := fmt.Sprintf("%s/%d", haNodeBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeBinding `json:"hanode_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // hanode_ci_binding -func (s *HAService) GetAllHANodeCIBinding() {} -func (s *HAService) GetHANodeCIBinding() {} -func (s *HAService) CountHANodeCIBinding() {} + +func (s *HAService) GetAllHANodeCIBinding() ([]models.HANodeCIBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeCIBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeCIBinding `json:"hanode_ci_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodeCIBinding(id int) ([]models.HANodeCIBinding, error) { + url := fmt.Sprintf("%s/%d", haNodeCIBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeCIBinding `json:"hanode_ci_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) CountHANodeCIBinding(id int) (float64, error) { + url := fmt.Sprintf("%s/%d?count=yes", haNodeCIBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"hanode_ci_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // hanode_fis_binding -func (s *HAService) GetAllHANodeFISBinding() {} -func (s *HAService) GetHANodeFISBinding() {} -func (s *HAService) CountHANodeFISBinding() {} + +func (s *HAService) GetAllHANodeFISBinding() ([]models.HANodeFISBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeFISBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeFISBinding `json:"hanode_fis_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodeFISBinding(id int) ([]models.HANodeFISBinding, error) { + url := fmt.Sprintf("%s/%d", haNodeFISBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeFISBinding `json:"hanode_fis_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) CountHANodeFISBinding(id int) (float64, error) { + url := fmt.Sprintf("%s/%d?count=yes", haNodeFISBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"hanode_fis_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // hanode_partialfailureinterfaces_binding -func (s *HAService) GetAllHANodePartialFailureInterfacesBinding() {} -func (s *HAService) GetHANodePartialFailureInterfacesBinding() {} -func (s *HAService) CountHANodePartialFailureInterfacesBinding() {} + +func (s *HAService) GetAllHANodePartialFailureInterfacesBinding() ([]models.HANodePartialFailureInterfacesBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodePartialFailureInterfacesBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodePartialFailureInterfacesBinding `json:"hanode_partialfailureinterfaces_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodePartialFailureInterfacesBinding(id int) ([]models.HANodePartialFailureInterfacesBinding, error) { + url := fmt.Sprintf("%s/%d", haNodePartialFailureInterfacesBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodePartialFailureInterfacesBinding `json:"hanode_partialfailureinterfaces_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) CountHANodePartialFailureInterfacesBinding(id int) (float64, error) { + url := fmt.Sprintf("%s/%d?count=yes", haNodePartialFailureInterfacesBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"hanode_partialfailureinterfaces_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // hanode_routemonitor6_binding -func (s *HAService) AddHANodeRouteMonitor6Binding() {} -func (s *HAService) DeleteHANodeRouteMonitor6Binding() {} -func (s *HAService) GetAllHANodeRouteMonitor6Binding() {} -func (s *HAService) GetHANodeRouteMonitor6Binding() {} -func (s *HAService) CountHANodeRouteMonitor6Binding() {} + +func (s *HAService) AddHANodeRouteMonitor6Binding(binding models.HANodeRouteMonitor6Binding) error { + payload := map[string]any{ + "hanode_routemonitor6_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, haNodeRouteMonitor6BindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) DeleteHANodeRouteMonitor6Binding(id int, routemonitor string) error { + urlReq := fmt.Sprintf("%s/%d?args=routemonitor:%s", haNodeRouteMonitor6BindingURL, id, routemonitor) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) GetAllHANodeRouteMonitor6Binding() ([]models.HANodeRouteMonitor6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeRouteMonitor6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeRouteMonitor6Binding `json:"hanode_routemonitor6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodeRouteMonitor6Binding(id int) ([]models.HANodeRouteMonitor6Binding, error) { + url := fmt.Sprintf("%s/%d", haNodeRouteMonitor6BindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeRouteMonitor6Binding `json:"hanode_routemonitor6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) CountHANodeRouteMonitor6Binding(id int) (float64, error) { + url := fmt.Sprintf("%s/%d?count=yes", haNodeRouteMonitor6BindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"hanode_routemonitor6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // hanode_routemonitor_binding -func (s *HAService) AddHANodeRouteMonitorBinding() {} -func (s *HAService) DeleteHANodeRouteMonitorBinding() {} -func (s *HAService) GetAllHANodeRouteMonitorBinding() {} -func (s *HAService) GetHANodeRouteMonitorBinding() {} -func (s *HAService) CountHANodeRouteMonitorBinding() {} + +func (s *HAService) AddHANodeRouteMonitorBinding(binding models.HANodeRouteMonitorBinding) error { + payload := map[string]any{ + "hanode_routemonitor_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, haNodeRouteMonitorBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) DeleteHANodeRouteMonitorBinding(id int, routemonitor string) error { + urlReq := fmt.Sprintf("%s/%d?args=routemonitor:%s", haNodeRouteMonitorBindingURL, id, routemonitor) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *HAService) GetAllHANodeRouteMonitorBinding() ([]models.HANodeRouteMonitorBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, haNodeRouteMonitorBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeRouteMonitorBinding `json:"hanode_routemonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) GetHANodeRouteMonitorBinding(id int) ([]models.HANodeRouteMonitorBinding, error) { + url := fmt.Sprintf("%s/%d", haNodeRouteMonitorBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.HANodeRouteMonitorBinding `json:"hanode_routemonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *HAService) CountHANodeRouteMonitorBinding(id int) (float64, error) { + url := fmt.Sprintf("%s/%d?count=yes", haNodeRouteMonitorBindingURL, id) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"hanode_routemonitor_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // hasync -func (s *HAService) ForceHASync() {} + +func (s *HAService) ForceHASync(sync models.HASync) error { + payload := map[string]any{ + "hasync": sync, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, haSyncURL+"?action=Force", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // hasyncfailures -func (s *HAService) GetAllHASyncFailures() {} + +func (s *HAService) GetAllHASyncFailures() ([]models.HASyncFailures, error) { + req, err := s.client.NewRequest(http.MethodGet, haSyncFailuresURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + HASyncFailures []models.HASyncFailures `json:"hasyncfailures"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.HASyncFailures, nil +} diff --git a/nitrogo/ica.go b/nitrogo/ica.go index bad48e2..f071e81 100644 --- a/nitrogo/ica.go +++ b/nitrogo/ica.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( icaAccessProfileURL = "/nitro/v1/config/icaaccessprofile" icaActionURL = "/nitro/v1/config/icaaction" @@ -20,73 +30,1100 @@ type ICAService struct { client *Client } -// ucaaccessprofile -func (s *ICAService) AddICAAccessProfile() {} -func (s *ICAService) DeleteICAAccessProfile() {} -func (s *ICAService) UpdateICAAccessProfile() {} -func (s *ICAService) UnsetICAAccessProfile() {} -func (s *ICAService) GetAllICAAccessProfile() {} -func (s *ICAService) GetICAAccessProfile() {} -func (s *ICAService) CountICAAccessProfile() {} +// icaaccessprofile + +func (s *ICAService) AddICAAccessProfile(profile models.ICAAccessProfile) error { + payload := map[string]any{ + "icaaccessprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaAccessProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) DeleteICAAccessProfile(name string) error { + urlReq := fmt.Sprintf("%s/%s", icaAccessProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UpdateICAAccessProfile(profile models.ICAAccessProfile) error { + payload := map[string]any{ + "icaaccessprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaAccessProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UnsetICAAccessProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "icaaccessprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaAccessProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetAllICAAccessProfile() ([]models.ICAAccessProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, icaAccessProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.ICAAccessProfile `json:"icaaccessprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *ICAService) GetICAAccessProfile(name string) ([]models.ICAAccessProfile, error) { + urlReq := fmt.Sprintf("%s/%s", icaAccessProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.ICAAccessProfile `json:"icaaccessprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *ICAService) CountICAAccessProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, icaAccessProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"icaaccessprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} // icaaction -func (s *ICAService) AddICAAction() {} -func (s *ICAService) DeleteICAAction() {} -func (s *ICAService) UpdateICAAction() {} -func (s *ICAService) UnsetICAAction() {} -func (s *ICAService) GetAllICAAction() {} -func (s *ICAService) GetICAAction() {} -func (s *ICAService) CountICAAction() {} -func (s *ICAService) RenameICAAction() {} + +func (s *ICAService) AddICAAction(action models.ICAAction) error { + payload := map[string]any{ + "icaaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) DeleteICAAction(name string) error { + urlReq := fmt.Sprintf("%s/%s", icaActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UpdateICAAction(action models.ICAAction) error { + payload := map[string]any{ + "icaaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UnsetICAAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "icaaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetAllICAAction() ([]models.ICAAction, error) { + req, err := s.client.NewRequest(http.MethodGet, icaActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.ICAAction `json:"icaaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *ICAService) GetICAAction(name string) ([]models.ICAAction, error) { + urlReq := fmt.Sprintf("%s/%s", icaActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.ICAAction `json:"icaaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *ICAService) CountICAAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, icaActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"icaaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} + +func (s *ICAService) RenameICAAction(name string, newname string) error { + payload := map[string]any{ + "icaaction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // icaglobal_binding -func (s *ICAService) GetICAGlobalBinding() {} + +func (s *ICAService) GetICAGlobalBinding() ([]models.ICAGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAGlobalBinding `json:"icaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // icaglobal_icapolicy_binding -func (s *ICAService) AddICAGlobalICAPolicyBinding() {} -func (s *ICAService) DeleteICAGlobalICAPolicyBinding() {} -func (s *ICAService) GetICAGlobalICAPolicyBinding() {} -func (s *ICAService) CountICAGlobalICAPolicyBinding() {} + +func (s *ICAService) AddICAGlobalICAPolicyBinding(binding models.ICAGlobalICAPolicyBinding) error { + payload := map[string]any{ + "icaglobal_icapolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaGlobalICAPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) DeleteICAGlobalICAPolicyBinding(policyname string) error { + urlReq := fmt.Sprintf("%s?args=policyname:%s", icaGlobalICAPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetICAGlobalICAPolicyBinding() ([]models.ICAGlobalICAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaGlobalICAPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAGlobalICAPolicyBinding `json:"icaglobal_icapolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) CountICAGlobalICAPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, icaGlobalICAPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"icaglobal_icapolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // icalatencyprofile -func (s *ICAService) AddICALatencyProfile() {} -func (s *ICAService) DeleteICALatencyProfile() {} -func (s *ICAService) UpdateICALatencyProfile() {} -func (s *ICAService) UnsetICALatencyProfile() {} -func (s *ICAService) GetAllICALatencyProfile() {} -func (s *ICAService) GetICALatencyProfile() {} -func (s *ICAService) CountICALatencyProfile() {} + +func (s *ICAService) AddICALatencyProfile(profile models.ICALatencyProfile) error { + payload := map[string]any{ + "icalatencyprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaLatencyProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) DeleteICALatencyProfile(name string) error { + urlReq := fmt.Sprintf("%s/%s", icaLatencyProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UpdateICALatencyProfile(profile models.ICALatencyProfile) error { + payload := map[string]any{ + "icalatencyprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaLatencyProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UnsetICALatencyProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "icalatencyprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaLatencyProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetAllICALatencyProfile() ([]models.ICALatencyProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, icaLatencyProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.ICALatencyProfile `json:"icalatencyprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *ICAService) GetICALatencyProfile(name string) ([]models.ICALatencyProfile, error) { + urlReq := fmt.Sprintf("%s/%s", icaLatencyProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Profiles []models.ICALatencyProfile `json:"icalatencyprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Profiles, nil +} + +func (s *ICAService) CountICALatencyProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, icaLatencyProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"icalatencyprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + + return 0, nil +} // icaparameter -func (s *ICAService) UpdateICAParameter() {} -func (s *ICAService) UnsetICAParameter() {} -func (s *ICAService) GetAllICAParameter() {} + +func (s *ICAService) UpdateICAParameter(param models.ICAParameter) error { + payload := map[string]any{ + "icaparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UnsetICAParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "icaparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetAllICAParameter() (models.ICAParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, icaParameterURL, nil) + if err != nil { + return models.ICAParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ICAParameter{}, err + } + + var result struct { + Parameters []models.ICAParameter `json:"icaparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ICAParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) > 0 { + return result.Parameters[0], nil + } + + return models.ICAParameter{}, nil +} // icapolicy -func (s *ICAService) AddICAPolicy() {} -func (s *ICAService) DeleteICAPolicy() {} -func (s *ICAService) UpdateICAPolicy() {} -func (s *ICAService) UnsetICAPolicy() {} -func (s *ICAService) GetAllICAPolicy() {} -func (s *ICAService) GetICAPolicy() {} -func (s *ICAService) CountICAPolicy() {} -func (s *ICAService) RenameICAPolicy() {} + +func (s *ICAService) AddICAPolicy(policy models.ICAPolicy) error { + payload := map[string]any{ + "icapolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) DeleteICAPolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", icaPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UpdateICAPolicy(policy models.ICAPolicy) error { + payload := map[string]any{ + "icapolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, icaPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) UnsetICAPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "icapolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ICAService) GetAllICAPolicy() ([]models.ICAPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.ICAPolicy `json:"icapolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *ICAService) GetICAPolicy(name string) ([]models.ICAPolicy, error) { + urlReq := fmt.Sprintf("%s/%s", icaPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.ICAPolicy `json:"icapolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *ICAService) CountICAPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"icapolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} + +func (s *ICAService) RenameICAPolicy(name string, newname string) error { + payload := map[string]any{ + "icapolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, icaPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // icapolicy_binding -func (s *ICAService) GetAllICAPolicyBinding() {} -func (s *ICAService) GetICAPolicyBinding() {} + +func (s *ICAService) GetAllICAPolicyBinding() ([]models.ICAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyBinding `json:"icapolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) GetICAPolicyBinding(name string) ([]models.ICAPolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", icaPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyBinding `json:"icapolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // icapolicy_crvserver_binding -func (s *ICAService) GetAllICAPolicyCRVServerBinding() {} -func (s *ICAService) GetICAPolicyCRVServerBinding() {} -func (s *ICAService) CountICAPolicyCRVServerBinding() {} + +func (s *ICAService) GetAllICAPolicyCRVServerBinding() ([]models.ICAPolicyCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyCRVServerBinding `json:"icapolicy_crvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) GetICAPolicyCRVServerBinding(name string) ([]models.ICAPolicyCRVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", icaPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyCRVServerBinding `json:"icapolicy_crvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) CountICAPolicyCRVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", icaPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"icapolicy_crvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // icapolicy_icaglobal_binding -func (s *ICAService) GetAllICAPolicyICAGlobalBinding() {} -func (s *ICAService) GetICAPolicyICAGlobalBinding() {} -func (s *ICAService) CountICAPolicyICAGlobalBinding() {} + +func (s *ICAService) GetAllICAPolicyICAGlobalBinding() ([]models.ICAPolicyICAGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyICAGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyICAGlobalBinding `json:"icapolicy_icaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) GetICAPolicyICAGlobalBinding(name string) ([]models.ICAPolicyICAGlobalBinding, error) { + urlReq := fmt.Sprintf("%s/%s", icaPolicyICAGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyICAGlobalBinding `json:"icapolicy_icaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) CountICAPolicyICAGlobalBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", icaPolicyICAGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"icapolicy_icaglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // icapolicy_vpnvserver_binding -func (s *ICAService) GetAllICAPolicyVPNVServerBinding() {} -func (s *ICAService) GetICAPolicyVPNVServerBinding() {} -func (s *ICAService) CountICAPolicyVPNVServerBinding() {} + +func (s *ICAService) GetAllICAPolicyVPNVServerBinding() ([]models.ICAPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, icaPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyVPNVServerBinding `json:"icapolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) GetICAPolicyVPNVServerBinding(name string) ([]models.ICAPolicyVPNVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", icaPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.ICAPolicyVPNVServerBinding `json:"icapolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *ICAService) CountICAPolicyVPNVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", icaPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"icapolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/ipsec.go b/nitrogo/ipsec.go index da05a7f..00b263c 100644 --- a/nitrogo/ipsec.go +++ b/nitrogo/ipsec.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( ipsecParameterURL = "/nitro/v1/config/ipsecparameter" ipsecProfileURL = "/nitro/v1/config/ipsecprofile" @@ -14,15 +23,181 @@ type IPSECService struct { // ipsecparameter // Configuration for IPSEC paramter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsec/ipsecparameter -func (s *IPSECService) UpdateIPSECParamter() {} -func (s *IPSECService) UnsetIPSECParamter() {} -func (s *IPSECService) GetAllIPSECParamter() {} + +func (s *IPSECService) UpdateIPSECParamter(param models.IPSECParameter) error { + payload := map[string]any{ + "ipsecparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, ipsecParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECService) UnsetIPSECParamter(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "ipsecparameter": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ipsecParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECService) GetAllIPSECParamter() (models.IPSECParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecParameterURL, nil) + if err != nil { + return models.IPSECParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.IPSECParameter{}, err + } + + var result struct { + IPSECParameters []models.IPSECParameter `json:"ipsecparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.IPSECParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.IPSECParameters) > 0 { + return result.IPSECParameters[0], nil + } + + return models.IPSECParameter{}, nil +} // ipsecprofile // Configuration for IPSEC profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsec/ipsecprofile -func (s *IPSECService) AddIPSECProfile() {} -func (s *IPSECService) DeleteIPSECProfile() {} -func (s *IPSECService) GetAllIPSECProfile() {} -func (s *IPSECService) GetIPSECProfile() {} -func (s *IPSECService) CountIPSECProfile() {} + +func (s *IPSECService) AddIPSECProfile(profile models.IPSECProfile) error { + payload := map[string]any{ + "ipsecprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ipsecProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECService) DeleteIPSECProfile(name string) error { + url := fmt.Sprintf("%s/%s", ipsecProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECService) GetAllIPSECProfile() ([]models.IPSECProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + IPSECProfiles []models.IPSECProfile `json:"ipsecprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.IPSECProfiles, nil +} + +func (s *IPSECService) GetIPSECProfile(name string) ([]models.IPSECProfile, error) { + url := fmt.Sprintf("%s/%s", ipsecProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + IPSECProfiles []models.IPSECProfile `json:"ipsecprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.IPSECProfiles, nil +} + +func (s *IPSECService) CountIPSECProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + IPSECProfiles []struct { + Count float64 `json:"__count"` + } `json:"ipsecprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.IPSECProfiles) > 0 { + return result.IPSECProfiles[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/ipsecalg.go b/nitrogo/ipsecalg.go index 78e7405..b0ff1ff 100644 --- a/nitrogo/ipsecalg.go +++ b/nitrogo/ipsecalg.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( ipsecALGProfileURL = "/nitro/v1/config/ipsecalgprofile" ipsecALGSessionURL = "/nitro/v1/config/ipsecalgsession" @@ -14,17 +23,223 @@ type IPSECALGService struct { // ipsecalgprofile // Configuration for IPSEC ALG profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsecalg/ipsecalgprofile -func (s *IPSECALGService) AddIPSECALGProfile() {} -func (s *IPSECALGService) DeleteIPSECALGProfile() {} -func (s *IPSECALGService) UpdateIPSECALGProfile() {} -func (s *IPSECALGService) UnsetIPSECALGProfile() {} -func (s *IPSECALGService) GetAllIPSECALGProfile() {} -func (s *IPSECALGService) GetIPSECALGProfile() {} -func (s *IPSECALGService) CountIPSECALGProfile() {} + +func (s *IPSECALGService) AddIPSECALGProfile(profile models.IPSECALGProfile) error { + payload := map[string]any{ + "ipsecalgprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ipsecALGProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECALGService) DeleteIPSECALGProfile(name string) error { + url := fmt.Sprintf("%s/%s", ipsecALGProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECALGService) UpdateIPSECALGProfile(profile models.IPSECALGProfile) error { + payload := map[string]any{ + "ipsecalgprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, ipsecALGProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECALGService) UnsetIPSECALGProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "ipsecalgprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ipsecALGProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *IPSECALGService) GetAllIPSECALGProfile() ([]models.IPSECALGProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecALGProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + IPSECALGProfiles []models.IPSECALGProfile `json:"ipsecalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.IPSECALGProfiles, nil +} + +func (s *IPSECALGService) GetIPSECALGProfile(name string) ([]models.IPSECALGProfile, error) { + url := fmt.Sprintf("%s/%s", ipsecALGProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + IPSECALGProfiles []models.IPSECALGProfile `json:"ipsecalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.IPSECALGProfiles, nil +} + +func (s *IPSECALGService) CountIPSECALGProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecALGProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + IPSECALGProfiles []struct { + Count float64 `json:"__count"` + } `json:"ipsecalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.IPSECALGProfiles) > 0 { + return result.IPSECALGProfiles[0].Count, nil + } + + return 0, nil +} // ipsecalgsession // Configuration for IPSEC ALG session resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ipsecalg/ipsecalgsession -func (s *IPSECALGService) GetAllIPSECALGSession() {} -func (s *IPSECALGService) CountIPSECALGSession() {} -func (s *IPSECALGService) FlushIPSECALGSession() {} + +func (s *IPSECALGService) GetAllIPSECALGSession() ([]models.IPSECALGSession, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecALGSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + IPSECALGSessions []models.IPSECALGSession `json:"ipsecalgsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.IPSECALGSessions, nil +} + +func (s *IPSECALGService) CountIPSECALGSession() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, ipsecALGSessionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + IPSECALGSessions []struct { + Count float64 `json:"__count"` + } `json:"ipsecalgsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.IPSECALGSessions) > 0 { + return result.IPSECALGSessions[0].Count, nil + } + + return 0, nil +} + +func (s *IPSECALGService) FlushIPSECALGSession(session models.IPSECALGSession) error { + payload := map[string]any{ + "ipsecalgsession": session, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ipsecALGSessionURL+"?action=flush", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/lldp.go b/nitrogo/lldp.go index 1c4013f..a59b217 100644 --- a/nitrogo/lldp.go +++ b/nitrogo/lldp.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( lldpNeighborsURL = "/nitro/v1/config/lldpneighbors" lldpParamURL = "/nitro/v1/config/lldpparam" @@ -14,14 +23,170 @@ type LLDPService struct { // lldpneighbors // Configuration for lldp neighbors resource // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/lldp/lldpneighbors -func (s *LLDPService) GetAllLLDPNeighbors() {} -func (s *LLDPService) GetLLDPNeighbors() {} -func (s *LLDPService) CountLLDPNeighbors() {} -func (s *LLDPService) ClearLLDPNeighbors() {} + +func (s *LLDPService) GetAllLLDPNeighbors() ([]models.LLDPNeighbors, error) { + req, err := s.client.NewRequest(http.MethodGet, lldpNeighborsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + LLDPNeighbors []models.LLDPNeighbors `json:"lldpneighbors"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.LLDPNeighbors, nil +} + +func (s *LLDPService) GetLLDPNeighbors(ifnum string) ([]models.LLDPNeighbors, error) { + url := lldpNeighborsURL + "/" + ifnum + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + LLDPNeighbors []models.LLDPNeighbors `json:"lldpneighbors"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.LLDPNeighbors, nil +} + +func (s *LLDPService) CountLLDPNeighbors() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, lldpNeighborsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + LLDPNeighbors []struct { + Count float64 `json:"__count"` + } `json:"lldpneighbors"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.LLDPNeighbors) > 0 { + return result.LLDPNeighbors[0].Count, nil + } + + return 0, nil +} + +func (s *LLDPService) ClearLLDPNeighbors(neighbor models.LLDPNeighbors) error { + payload := map[string]any{ + "lldpneighbors": neighbor, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, lldpNeighborsURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // lldpparam // Configuration for lldp params resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/lldp/lldpparam -func (s *LLDPService) UpdateLLDPParam() {} -func (s *LLDPService) UnsetLLDPParam() {} -func (s *LLDPService) GetAllLLDPParam() {} + +func (s *LLDPService) UpdateLLDPParam(param models.LLDPParam) error { + payload := map[string]any{ + "lldpparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, lldpParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LLDPService) UnsetLLDPParam(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "lldpparam": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, lldpParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LLDPService) GetAllLLDPParam() (models.LLDPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, lldpParamURL, nil) + if err != nil { + return models.LLDPParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LLDPParam{}, err + } + + var result struct { + LLDPParams []models.LLDPParam `json:"lldpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LLDPParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.LLDPParams) > 0 { + return result.LLDPParams[0], nil + } + + return models.LLDPParam{}, nil +} diff --git a/nitrogo/lsn.go b/nitrogo/lsn.go index 6b4625b..561149b 100644 --- a/nitrogo/lsn.go +++ b/nitrogo/lsn.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( lsnAppsAttributesURL = "/nitro/v1/config/lsnappsattributes" lsnAppsProfileURL = "/nitro/v1/config/lsnappsprofile" @@ -51,280 +61,4120 @@ type LSNService struct { } // lsnappsattributes -func (s *LSNService) AddLSNAppsAttributes() {} -func (s *LSNService) DeleteLSNAppsAttributes() {} -func (s *LSNService) UpdateLSNAppsAttributes() {} -func (s *LSNService) UnsetLSNAppsAttributes() {} -func (s *LSNService) GetAllLSNAppsAttributes() {} -func (s *LSNService) GetLSNAppsAttributes() {} -func (s *LSNService) CountLSNAppsAttributes() {} +func (s *LSNService) AddLSNAppsAttributes(resource models.LSNAppsAttributes) error { + payload := map[string]any{"lsnappsattributes": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnAppsAttributesURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNAppsAttributes(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnAppsAttributesURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNAppsAttributes(resource models.LSNAppsAttributes) error { + payload := map[string]any{"lsnappsattributes": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnAppsAttributesURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNAppsAttributes(resource models.LSNAppsAttributes) error { + payload := map[string]any{"lsnappsattributes": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnAppsAttributesURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNAppsAttributes() ([]models.LSNAppsAttributes, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnAppsAttributesURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsAttributes `json:"lsnappsattributes"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNAppsAttributes(name string) (models.LSNAppsAttributes, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnAppsAttributesURL, name), nil) + if err != nil { + return models.LSNAppsAttributes{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNAppsAttributes{}, err + } + + var result struct { + Data []models.LSNAppsAttributes `json:"lsnappsattributes"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNAppsAttributes{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNAppsAttributes{}, fmt.Errorf("lsnappsattributes %s not found", name) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNAppsAttributes() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnAppsAttributesURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNAppsAttributes `json:"lsnappsattributes"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnappsprofile -func (s *LSNService) AddLSNAppsProfile() {} -func (s *LSNService) DeleteLSNAppsProfile() {} -func (s *LSNService) UpdateLSNAppsProfile() {} -func (s *LSNService) UnsetLSNAppsProfile() {} -func (s *LSNService) GetAllLSNAppsProfile() {} -func (s *LSNService) GetLSNAppsProfile() {} -func (s *LSNService) CountLSNAppsProfile() {} +func (s *LSNService) AddLSNAppsProfile(resource models.LSNAppsProfile) error { + payload := map[string]any{"lsnappsprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnAppsProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNAppsProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnAppsProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNAppsProfile(resource models.LSNAppsProfile) error { + payload := map[string]any{"lsnappsprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnAppsProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNAppsProfile(resource models.LSNAppsProfile) error { + payload := map[string]any{"lsnappsprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnAppsProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNAppsProfile() ([]models.LSNAppsProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnAppsProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfile `json:"lsnappsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNAppsProfile(name string) (models.LSNAppsProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnAppsProfileURL, name), nil) + if err != nil { + return models.LSNAppsProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNAppsProfile{}, err + } + + var result struct { + Data []models.LSNAppsProfile `json:"lsnappsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNAppsProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNAppsProfile{}, fmt.Errorf("lsnappsprofile %s not found", name) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNAppsProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnAppsProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNAppsProfile `json:"lsnappsprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnappsprofile_binding -func (s *LSNService) GetAllLSNAppsProfileBinding() {} -func (s *LSNService) GetLSNAppsProfileBinding() {} +func (s *LSNService) GetAllLSNAppsProfileBinding() ([]models.LSNAppsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnAppsProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfileBinding `json:"lsnappsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNAppsProfileBinding(name string) (models.LSNAppsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnAppsProfileBindingURL, name), nil) + if err != nil { + return models.LSNAppsProfileBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNAppsProfileBinding{}, err + } + + var result struct { + Data []models.LSNAppsProfileBinding `json:"lsnappsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNAppsProfileBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNAppsProfileBinding{}, fmt.Errorf("lsnappsprofile_binding %s not found", name) + } + + return result.Data[0], nil +} // lsnappsprofile_lsnappsattributes_binding -func (s *LSNService) AddLSNAppsProfileLSNAppsAttributesBinding() {} -func (s *LSNService) DeleteLSNAppsProfileLSNAppsAttributesBinding() {} -func (s *LSNService) GetAllLSNAppsProfileLSNAppsAttributesBinding() {} -func (s *LSNService) GetLSNAppsProfileLSNAppsAttributesBinding() {} -func (s *LSNService) CountLSNAppsProfileLSNAppsAttributesBinding() {} +func (s *LSNService) AddLSNAppsProfileLSNAppsAttributesBinding(resource models.LSNAppsProfileLSNAppsAttributesBinding) error { + payload := map[string]any{"lsnappsprofile_lsnappsattributes_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnAppsProfileLSNAppsAttributesBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNAppsProfileLSNAppsAttributesBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnAppsProfileLSNAppsAttributesBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNAppsProfileLSNAppsAttributesBinding() ([]models.LSNAppsProfileLSNAppsAttributesBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnAppsProfileLSNAppsAttributesBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfileLSNAppsAttributesBinding `json:"lsnappsprofile_lsnappsattributes_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNAppsProfileLSNAppsAttributesBinding(name string) ([]models.LSNAppsProfileLSNAppsAttributesBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnAppsProfileLSNAppsAttributesBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfileLSNAppsAttributesBinding `json:"lsnappsprofile_lsnappsattributes_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNAppsProfileLSNAppsAttributesBinding(appsprofilename string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnAppsProfileLSNAppsAttributesBindingURL, appsprofilename), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNAppsProfileLSNAppsAttributesBinding `json:"lsnappsprofile_lsnappsattributes_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnappsprofile_port_binding -func (s *LSNService) AddLSNAppsProfilePortBinding() {} -func (s *LSNService) DeleteLSNAppsProfilePortBinding() {} -func (s *LSNService) GetAllLSNAppsProfilePortBinding() {} -func (s *LSNService) GetLSNAppsProfilePortBinding() {} -func (s *LSNService) CountLSNAppsProfilePortBinding() {} +func (s *LSNService) AddLSNAppsProfilePortBinding(resource models.LSNAppsProfilePortBinding) error { + payload := map[string]any{"lsnappsprofile_port_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnAppsProfilePortBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNAppsProfilePortBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnAppsProfilePortBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNAppsProfilePortBinding() ([]models.LSNAppsProfilePortBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnAppsProfilePortBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfilePortBinding `json:"lsnappsprofile_port_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNAppsProfilePortBinding(name string) ([]models.LSNAppsProfilePortBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnAppsProfilePortBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNAppsProfilePortBinding `json:"lsnappsprofile_port_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNAppsProfilePortBinding(appsprofilename string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnAppsProfilePortBindingURL, appsprofilename), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNAppsProfilePortBinding `json:"lsnappsprofile_port_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnclient -func (s *LSNService) AddLSNClient() {} -func (s *LSNService) DeleteLSNClient() {} -func (s *LSNService) GetAllLSNClient() {} -func (s *LSNService) GetLSNClient() {} -func (s *LSNService) CountLSNClient() {} +func (s *LSNService) AddLSNClient(resource models.LSNClient) error { + payload := map[string]any{"lsnclient": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnClientURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNClient(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnClientURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNClient() ([]models.LSNClient, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClient `json:"lsnclient"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNClient(name string) (models.LSNClient, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientURL, name), nil) + if err != nil { + return models.LSNClient{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNClient{}, err + } + + var result struct { + Data []models.LSNClient `json:"lsnclient"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNClient{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNClient{}, fmt.Errorf("lsnclient %s not found", name) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNClient() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnClientURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNClient `json:"lsnclient"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnclient_binding -func (s *LSNService) GetAllLSNClientBinding() {} -func (s *LSNService) GetLSNClientBinding() {} +func (s *LSNService) GetAllLSNClientBinding() ([]models.LSNClientBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClientBinding `json:"lsnclient_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNClientBinding(name string) (models.LSNClientBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientBindingURL, name), nil) + if err != nil { + return models.LSNClientBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNClientBinding{}, err + } + + var result struct { + Data []models.LSNClientBinding `json:"lsnclient_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNClientBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNClientBinding{}, fmt.Errorf("lsnclient_binding %s not found", name) + } + + return result.Data[0], nil +} // lsnclient_network6_binding -func (s *LSNService) AddLSNClientNetwork6Binding() {} -func (s *LSNService) DeleteLSNClientNetwork6Binding() {} -func (s *LSNService) GetAllLSNClientNetwork6Binding() {} -func (s *LSNService) GetLSNClientNetwork6Binding() {} -func (s *LSNService) CountLSNClientNetwork6Binding() {} +func (s *LSNService) AddLSNClientNetwork6Binding(resource models.LSNClientNetwork6Binding) error { + payload := map[string]any{"lsnclient_network6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnClientNetwork6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNClientNetwork6Binding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnClientNetwork6BindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNClientNetwork6Binding() ([]models.LSNClientNetwork6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientNetwork6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClientNetwork6Binding `json:"lsnclient_network6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNClientNetwork6Binding(name string) ([]models.LSNClientNetwork6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientNetwork6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClientNetwork6Binding `json:"lsnclient_network6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNClientNetwork6Binding(clientname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnClientNetwork6BindingURL, clientname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNClientNetwork6Binding `json:"lsnclient_network6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnclient_network_binding -func (s *LSNService) AddLSNClientNetworkBinding() {} -func (s *LSNService) DeleteLSNClientNetworkBinding() {} -func (s *LSNService) GetAllLSNClientNetworkBinding() {} -func (s *LSNService) GetLSNClientNetworkBinding() {} -func (s *LSNService) CountLSNClientNetworkBinding() {} +func (s *LSNService) AddLSNClientNetworkBinding(resource models.LSNClientNetworkBinding) error { + payload := map[string]any{"lsnclient_network_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnClientNetworkBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNClientNetworkBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnClientNetworkBindingURL, name, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNClientNetworkBinding() ([]models.LSNClientNetworkBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientNetworkBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClientNetworkBinding `json:"lsnclient_network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNClientNetworkBinding(name string) ([]models.LSNClientNetworkBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientNetworkBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNClientNetworkBinding `json:"lsnclient_network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNClientNetworkBinding(clientname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnClientNetworkBindingURL, clientname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNClientNetworkBinding `json:"lsnclient_network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // lsnclient_nsacl6_binding -func (s *LSNService) AddLSNClientNSACL6Binding() {} -func (s *LSNService) DeleteLSNClientNSACL6Binding() {} -func (s *LSNService) GetAllLSNClientNSACL6Binding() {} -func (s *LSNService) GetLSNClientNSACL6Binding() {} -func (s *LSNService) CountLSNClientNSACL6Binding() {} +func (s *LSNService) AddLSNClientNSACL6Binding(resource models.LSNClientNSACL6Binding) error { + payload := map[string]any{"lsnclient_nsacl6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lsnclient_nsacl_binding -func (s *LSNService) AddLSNClientNSACLBinding() {} -func (s *LSNService) DeleteLSNClientNSACLBinding() {} -func (s *LSNService) GetAllLSNClientNSACLBinding() {} -func (s *LSNService) GetLSNClientNSACLBinding() {} -func (s *LSNService) CountLSNClientNSACLBinding() {} + req, err := s.client.NewRequest(http.MethodPost, lsnClientNSACL6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lsndeterministicnat -func (s *LSNService) GetAllLSNDeterministicNAT() {} -func (s *LSNService) CountLSNDeterministicNAT() {} + _, err = s.client.Do(req) + return err +} -// lsngroup -func (s *LSNService) AddLSNGroup() {} -func (s *LSNService) DeleteLSNGroup() {} -func (s *LSNService) UpdateLSNGroup() {} -func (s *LSNService) UnsetLSNGroup() {} -func (s *LSNService) GetAllLSNGroup() {} -func (s *LSNService) GetLSNGroup() {} -func (s *LSNService) CountLSNGroup() {} +func (s *LSNService) DeleteLSNClientNSACL6Binding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnClientNSACL6BindingURL, name, argsStr), nil) + if err != nil { + return err + } -// lsngroup_binding -func (s *LSNService) GetAllLSNGroupBinding() {} -func (s *LSNService) GetLSNGroupBinding() {} + _, err = s.client.Do(req) + return err +} -// lsngroup_ipsecalgprofile_binding -func (s *LSNService) AddLSNGroupIPSecALGProfileBinding() {} -func (s *LSNService) DeleteLSNGroupIPSecALGProfileBinding() {} -func (s *LSNService) GetAllLSNGroupIPSecALGProfileBinding() {} -func (s *LSNService) GetLSNGroupIPSecALGProfileBinding() {} -func (s *LSNService) CountLSNGroupIPSecALGProfileBinding() {} +func (s *LSNService) GetAllLSNClientNSACL6Binding() ([]models.LSNClientNSACL6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientNSACL6BindingURL, nil) + if err != nil { + return nil, err + } -// lsngroup_lsnappsprofile_binding -func (s *LSNService) AddLSNGroupLSNAppsProfileBinding() {} -func (s *LSNService) DeleteLSNGroupLSNAppsProfileBinding() {} -func (s *LSNService) GetAllLSNGroupLSNAppsProfileBinding() {} -func (s *LSNService) GetLSNGroupLSNAppsProfileBinding() {} -func (s *LSNService) CountLSNGroupLSNAppsProfileBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lsngroup_lsnhttphdrlogprofile_binding -func (s *LSNService) AddLSNGroupLSNHTTPHDRLogProfileBinding() {} -func (s *LSNService) DeleteLSNGroupLSNHTTPHDRLogProfileBinding() {} -func (s *LSNService) GetAllLSNGroupLSNHTTPHDRLogProfileBinding() {} -func (s *LSNService) GetLSNGroupLSNHTTPHDRLogProfileBinding() {} -func (s *LSNService) CountLSNGroupLSNHTTPHDRLogProfileBinding() {} + var result struct { + Data []models.LSNClientNSACL6Binding `json:"lsnclient_nsacl6_binding"` + } -// lsngroup_lsnlogprofile_binding -func (s *LSNService) AddLSNGroupLSNLogProfileBinding() {} -func (s *LSNService) DeleteLSNGroupLSNLogProfileBinding() {} -func (s *LSNService) GetAllLSNGroupLSNLogProfileBinding() {} -func (s *LSNService) GetLSNGroupLSNLogProfileBinding() {} -func (s *LSNService) CountLSNGroupLSNLogProfileBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lsngroup_lsnpool_binding -func (s *LSNService) AddLSNGroupLSNPoolBinding() {} -func (s *LSNService) DeleteLSNGroupLSNPoolBinding() {} -func (s *LSNService) GetAllLSNGroupLSNPoolBinding() {} -func (s *LSNService) GetLSNGroupLSNPoolBinding() {} -func (s *LSNService) CountLSNGroupLSNPoolBinding() {} + return result.Data, nil +} -// lsngroup_lsnrtspalgprofile_binding -func (s *LSNService) AddLSNGroupLSNRTSPALGProfileBinding() {} -func (s *LSNService) DeleteLSNGroupLSNRTSPALGProfileBinding() {} -func (s *LSNService) GetAllLSNGroupLSNRTSPALGProfileBinding() {} -func (s *LSNService) GetLSNGroupLSNRTSPALGProfileBinding() {} -func (s *LSNService) CountLSNGroupLSNRTSPALGProfileBinding() {} +func (s *LSNService) GetLSNClientNSACL6Binding(name string) ([]models.LSNClientNSACL6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientNSACL6BindingURL, name), nil) + if err != nil { + return nil, err + } -// lsngroup_lsnsipalgprofile_binding -func (s *LSNService) AddKSBGroupLSNSIPALGProfileBinding() {} -func (s *LSNService) DeleteKSBGroupLSNSIPALGProfileBinding() {} -func (s *LSNService) GetAllKSBGroupLSNSIPALGProfileBinding() {} -func (s *LSNService) GetKSBGroupLSNSIPALGProfileBinding() {} -func (s *LSNService) CountKSBGroupLSNSIPALGProfileBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lsngroup_lsntransportprofile_binding -func (s *LSNService) AddLSNGroupLSNTransportProfileBinding() {} -func (s *LSNService) DeleteLSNGroupLSNTransportProfileBinding() {} -func (s *LSNService) GetAllLSNGroupLSNTransportProfileBinding() {} -func (s *LSNService) GetLSNGroupLSNTransportProfileBinding() {} -func (s *LSNService) CountLSNGroupLSNTransportProfileBinding() {} + var result struct { + Data []models.LSNClientNSACL6Binding `json:"lsnclient_nsacl6_binding"` + } -// lsngroup_pcpserver_binding -func (s *LSNService) AddLSNGroupPCPServerBinding() {} -func (s *LSNService) DeleteLSNGroupPCPServerBinding() {} -func (s *LSNService) GetAllLSNGroupPCPServerBinding() {} -func (s *LSNService) GetLSNGroupPCPServerBinding() {} -func (s *LSNService) CountLSNGroupPCPServerBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lsnhttphdrlogprofile -func (s *LSNService) AddLSNHTTPHDRLogProfile() {} -func (s *LSNService) DeleteLSNHTTPHDRLogProfile() {} -func (s *LSNService) UpdateLSNHTTPHDRLogProfile() {} -func (s *LSNService) UnsetLSNHTTPHDRLogProfile() {} -func (s *LSNService) GetAllLSNHTTPHDRLogProfile() {} -func (s *LSNService) GetLSNHTTPHDRLogProfile() {} -func (s *LSNService) CountLSNHTTPHDRLogProfile() {} + return result.Data, nil +} -// lsnip6profile -func (s *LSNService) AddLSNIP6Profile() {} -func (s *LSNService) DeleteLSNIP6Profile() {} -func (s *LSNService) GetAllLSNIP6Profile() {} -func (s *LSNService) GetLSNIP6Profile() {} -func (s *LSNService) CountLSNIP6Profile() {} +func (s *LSNService) CountLSNClientNSACL6Binding(clientname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnClientNSACL6BindingURL, clientname), nil) + if err != nil { + return 0, err + } -// lsnlogprofile -func (s *LSNService) AddLSNLogProfile() {} -func (s *LSNService) DeleteLSNLogProfile() {} -func (s *LSNService) UpdateLSNLogProfile() {} -func (s *LSNService) UnsetLSNLogProfile() {} -func (s *LSNService) GetAllLSNLogProfile() {} -func (s *LSNService) GetLSNLogProfile() {} -func (s *LSNService) CountLSNLogProfile() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// lsnparameter -func (s *LSNService) UpdateLSNParameter() {} -func (s *LSNService) UnsetLSNParameter() {} -func (s *LSNService) GetAllLSNParameter() {} + var result struct { + Data []models.LSNClientNSACL6Binding `json:"lsnclient_nsacl6_binding"` + } -// lsnpool -func (s *LSNService) AddLSNPool() {} -func (s *LSNService) DeleteLSNPool() {} -func (s *LSNService) UpdateLSNPool() {} -func (s *LSNService) UnsetLSNPool() {} -func (s *LSNService) GetAllLSNPool() {} -func (s *LSNService) GetLSNPool() {} -func (s *LSNService) CountLSNPool() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// lsnpool_binding -func (s *LSNService) GetAllLSNPoolBinding() {} -func (s *LSNService) GetLSNPoolBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// lsnpool_lsnip_binding -func (s *LSNService) AddLSNPoolLSNIPBinding() {} -func (s *LSNService) DeleteLSNPoolLSNIPBinding() {} -func (s *LSNService) GetAllLSNPoolLSNIPBinding() {} -func (s *LSNService) GetLSNPoolLSNIPBinding() {} -func (s *LSNService) CountLSNPoolLSNIPBinding() {} +// lsnclient_nsacl_binding +func (s *LSNService) AddLSNClientNSACLBinding(resource models.LSNClientNSACLBinding) error { + payload := map[string]any{"lsnclient_nsacl_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// lsnrtspalgprofile -func (s *LSNService) AddLSNRTSPALGProfile() {} -func (s *LSNService) DeleteLSNRTSPALGProfile() {} -func (s *LSNService) UpdateLSNRTSPALGProfile() {} -func (s *LSNService) UnsetLSNRTSPALGProfile() {} -func (s *LSNService) GetAllLSNRTSPALGProfile() {} -func (s *LSNService) GetLSNRTSPALGProfile() {} -func (s *LSNService) CountLSNRTSPALGProfile() {} + req, err := s.client.NewRequest(http.MethodPost, lsnClientNSACLBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// lsnrtspalgsession -func (s *LSNService) GetAllLSNRTSPALGSession() {} -func (s *LSNService) GetLSNRTSPALGSession() {} -func (s *LSNService) CountLSNRTSPALGSession() {} -func (s *LSNService) FlushLSNRTSPALGSession() {} + _, err = s.client.Do(req) + return err +} -// lsnrtspalgsession_binding -func (s *LSNService) GetAllLSNRTSPALGSessionBinding() {} -func (s *LSNService) GetLSNRTSPALGSessionBinding() {} +func (s *LSNService) DeleteLSNClientNSACLBinding(name string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnClientNSACLBindingURL, name, argsStr), nil) + if err != nil { + return err + } -// lsnrtspalgsession_datachannel_binding -func (s *LSNService) GetAllLSNRTSPALGSessionDataChannelBinding() {} -func (s *LSNService) GetLSNRTSPALGSessionDataChannelBinding() {} -func (s *LSNService) CountLSNRTSPALGSessionDataChannelBinding() {} + _, err = s.client.Do(req) + return err +} -// lsnsession -func (s *LSNService) GetAllLSNSession() {} -func (s *LSNService) CountLSNSession() {} -func (s *LSNService) FlushLSNSession() {} +func (s *LSNService) GetAllLSNClientNSACLBinding() ([]models.LSNClientNSACLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnClientNSACLBindingURL, nil) + if err != nil { + return nil, err + } -// lsnsipalgcall -func (s *LSNService) GetAllLSNSIPALGCall() {} -func (s *LSNService) GetLSNSIPALGCall() {} -func (s *LSNService) CountLSNSIPALGCall() {} -func (s *LSNService) FlushLSNSIPALGCall() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lsnsipalgcall_binding -func (s *LSNService) GetAllLSNSIPALGCallBinding() {} -func (s *LSNService) GetLSNSIPALGCallBinding() {} + var result struct { + Data []models.LSNClientNSACLBinding `json:"lsnclient_nsacl_binding"` + } -// lsnsipalgcall_controlchannel_binding -func (s *LSNService) GetAllLSNSIPALGCallControlChannelBinding() {} -func (s *LSNService) GetLSNSIPALGCallControlChannelBinding() {} -func (s *LSNService) CountLSNSIPALGCallControlChannelBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// lsnsipalgcall_datachannel_binding -func (s *LSNService) GetAllLSNSIPALGCallDataChannelBinding() {} -func (s *LSNService) GetLSNSIPALGCallDataChannelBinding() {} -func (s *LSNService) CountLSNSIPALGCallDataChannelBinding() {} + return result.Data, nil +} -// lsnsipalgprofile -func (s *LSNService) AddLSNSIPALGProfile() {} -func (s *LSNService) DeleteLSNSIPALGProfile() {} -func (s *LSNService) UpdateLSNSIPALGProfile() {} -func (s *LSNService) UnsetLSNSIPALGProfile() {} -func (s *LSNService) GetAllLSNSIPALGProfile() {} -func (s *LSNService) GetLSNSIPALGProfile() {} -func (s *LSNService) CountLSNSIPALGProfile() {} +func (s *LSNService) GetLSNClientNSACLBinding(name string) ([]models.LSNClientNSACLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnClientNSACLBindingURL, name), nil) + if err != nil { + return nil, err + } -// lsnstatic -func (s *LSNService) AddLSNStatic() {} -func (s *LSNService) DeleteLSNStatic() {} -func (s *LSNService) GetAllLSNStatic() {} -func (s *LSNService) GetLSNStatic() {} -func (s *LSNService) CountLSNStatic() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lsntransportprofile -func (s *LSNService) AddLSNTransportProfile() {} -func (s *LSNService) DeleteLSNTransportProfile() {} -func (s *LSNService) UpdateLSNTransportProfile() {} -func (s *LSNService) UnsetLSNTransportProfile() {} -func (s *LSNService) GetAllLSNTransportProfile() {} -func (s *LSNService) GetLSNTransportProfile() {} -func (s *LSNService) CountLSNTransportProfile() {} + var result struct { + Data []models.LSNClientNSACLBinding `json:"lsnclient_nsacl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNClientNSACLBinding(clientname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnClientNSACLBindingURL, clientname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNClientNSACLBinding `json:"lsnclient_nsacl_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsndeterministicnat +func (s *LSNService) GetAllLSNDeterministicNAT() ([]models.LSNDeterministicNAT, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnDeterministicNATURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNDeterministicNAT `json:"lsndeterministicnat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNDeterministicNAT() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnDeterministicNATURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNDeterministicNAT `json:"lsndeterministicnat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup +func (s *LSNService) AddLSNGroup(resource models.LSNGroup) error { + payload := map[string]any{"lsngroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroup(groupname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnGroupURL, groupname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNGroup(resource models.LSNGroup) error { + payload := map[string]any{"lsngroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNGroup(resource models.LSNGroup) error { + payload := map[string]any{"lsngroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroup() ([]models.LSNGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroup `json:"lsngroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroup(groupname string) (models.LSNGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupURL, groupname), nil) + if err != nil { + return models.LSNGroup{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNGroup{}, err + } + + var result struct { + Data []models.LSNGroup `json:"lsngroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNGroup{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNGroup{}, fmt.Errorf("lsngroup %s not found", groupname) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroup `json:"lsngroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_binding +func (s *LSNService) GetAllLSNGroupBinding() ([]models.LSNGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupBinding `json:"lsngroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupBinding(groupname string) (models.LSNGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupBindingURL, groupname), nil) + if err != nil { + return models.LSNGroupBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNGroupBinding{}, err + } + + var result struct { + Data []models.LSNGroupBinding `json:"lsngroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNGroupBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNGroupBinding{}, fmt.Errorf("lsngroup_binding %s not found", groupname) + } + + return result.Data[0], nil +} + +// lsngroup_ipsecalgprofile_binding +func (s *LSNService) AddLSNGroupIPSecALGProfileBinding(resource models.LSNGroupIPSECALGProfileBinding) error { + payload := map[string]any{"lsngroup_ipsecalgprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupIPSecALGProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupIPSecALGProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupIPSecALGProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupIPSecALGProfileBinding() ([]models.LSNGroupIPSECALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupIPSecALGProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupIPSECALGProfileBinding `json:"lsngroup_ipsecalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupIPSecALGProfileBinding(groupname string) ([]models.LSNGroupIPSECALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupIPSecALGProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupIPSECALGProfileBinding `json:"lsngroup_ipsecalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupIPSecALGProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupIPSecALGProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupIPSECALGProfileBinding `json:"lsngroup_ipsecalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnappsprofile_binding +func (s *LSNService) AddLSNGroupLSNAppsProfileBinding(resource models.LSNGroupLSNAppsProfileBinding) error { + payload := map[string]any{"lsngroup_lsnappsprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNAppsProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNAppsProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNAppsProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNAppsProfileBinding() ([]models.LSNGroupLSNAppsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNAppsProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNAppsProfileBinding `json:"lsngroup_lsnappsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNAppsProfileBinding(groupname string) ([]models.LSNGroupLSNAppsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNAppsProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNAppsProfileBinding `json:"lsngroup_lsnappsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNAppsProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNAppsProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNAppsProfileBinding `json:"lsngroup_lsnappsprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnhttphdrlogprofile_binding +func (s *LSNService) AddLSNGroupLSNHTTPHDRLogProfileBinding(resource models.LSNGroupLSNHTTPHdrLogProfileBinding) error { + payload := map[string]any{"lsngroup_lsnhttphdrlogprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNHTTPHDRLogProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNHTTPHDRLogProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNHTTPHDRLogProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNHTTPHDRLogProfileBinding() ([]models.LSNGroupLSNHTTPHdrLogProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNHTTPHDRLogProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNHTTPHdrLogProfileBinding `json:"lsngroup_lsnhttphdrlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNHTTPHDRLogProfileBinding(groupname string) ([]models.LSNGroupLSNHTTPHdrLogProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNHTTPHDRLogProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNHTTPHdrLogProfileBinding `json:"lsngroup_lsnhttphdrlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNHTTPHDRLogProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNHTTPHDRLogProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNHTTPHdrLogProfileBinding `json:"lsngroup_lsnhttphdrlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnlogprofile_binding +func (s *LSNService) AddLSNGroupLSNLogProfileBinding(resource models.LSNGroupLSNLogProfileBinding) error { + payload := map[string]any{"lsngroup_lsnlogprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNLogProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNLogProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNLogProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNLogProfileBinding() ([]models.LSNGroupLSNLogProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNLogProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNLogProfileBinding `json:"lsngroup_lsnlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNLogProfileBinding(groupname string) ([]models.LSNGroupLSNLogProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNLogProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNLogProfileBinding `json:"lsngroup_lsnlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNLogProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNLogProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNLogProfileBinding `json:"lsngroup_lsnlogprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnpool_binding +func (s *LSNService) AddLSNGroupLSNPoolBinding(resource models.LSNGroupLSNPoolBinding) error { + payload := map[string]any{"lsngroup_lsnpool_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNPoolBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNPoolBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNPoolBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNPoolBinding() ([]models.LSNGroupLSNPoolBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNPoolBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNPoolBinding `json:"lsngroup_lsnpool_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNPoolBinding(groupname string) ([]models.LSNGroupLSNPoolBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNPoolBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNPoolBinding `json:"lsngroup_lsnpool_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNPoolBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNPoolBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNPoolBinding `json:"lsngroup_lsnpool_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnrtspalgprofile_binding +func (s *LSNService) AddLSNGroupLSNRTSPALGProfileBinding(resource models.LSNGroupLSNRTSPALGProfileBinding) error { + payload := map[string]any{"lsngroup_lsnrtspalgprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNRTSPALGProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNRTSPALGProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNRTSPALGProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNRTSPALGProfileBinding() ([]models.LSNGroupLSNRTSPALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNRTSPALGProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNRTSPALGProfileBinding `json:"lsngroup_lsnrtspalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNRTSPALGProfileBinding(groupname string) ([]models.LSNGroupLSNRTSPALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNRTSPALGProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNRTSPALGProfileBinding `json:"lsngroup_lsnrtspalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNRTSPALGProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNRTSPALGProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNRTSPALGProfileBinding `json:"lsngroup_lsnrtspalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsnsipalgprofile_binding +func (s *LSNService) AddLSNGroupLSNSIPALGProfileBinding(resource models.LSNGroupLSNSIPALGProfileBinding) error { + payload := map[string]any{"lsngroup_lsnsipalgprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNSIPALGProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNSIPALGProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNSIPALGProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNSIPALGProfileBinding() ([]models.LSNGroupLSNSIPALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNSIPALGProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNSIPALGProfileBinding `json:"lsngroup_lsnsipalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNSIPALGProfileBinding(groupname string) ([]models.LSNGroupLSNSIPALGProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNSIPALGProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNSIPALGProfileBinding `json:"lsngroup_lsnsipalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNSIPALGProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNSIPALGProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNSIPALGProfileBinding `json:"lsngroup_lsnsipalgprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_lsntransportprofile_binding +func (s *LSNService) AddLSNGroupLSNTransportProfileBinding(resource models.LSNGroupLSNTransportProfileBinding) error { + payload := map[string]any{"lsngroup_lsntransportprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupLSNTransportProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupLSNTransportProfileBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupLSNTransportProfileBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupLSNTransportProfileBinding() ([]models.LSNGroupLSNTransportProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupLSNTransportProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNTransportProfileBinding `json:"lsngroup_lsntransportprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupLSNTransportProfileBinding(groupname string) ([]models.LSNGroupLSNTransportProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupLSNTransportProfileBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupLSNTransportProfileBinding `json:"lsngroup_lsntransportprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupLSNTransportProfileBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupLSNTransportProfileBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupLSNTransportProfileBinding `json:"lsngroup_lsntransportprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsngroup_pcpserver_binding +func (s *LSNService) AddLSNGroupPCPServerBinding(resource models.LSNGroupPCPServerBinding) error { + payload := map[string]any{"lsngroup_pcpserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnGroupPCPServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNGroupPCPServerBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnGroupPCPServerBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNGroupPCPServerBinding() ([]models.LSNGroupPCPServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnGroupPCPServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupPCPServerBinding `json:"lsngroup_pcpserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNGroupPCPServerBinding(groupname string) ([]models.LSNGroupPCPServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnGroupPCPServerBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNGroupPCPServerBinding `json:"lsngroup_pcpserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNGroupPCPServerBinding(groupname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnGroupPCPServerBindingURL, groupname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNGroupPCPServerBinding `json:"lsngroup_pcpserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnhttphdrlogprofile +func (s *LSNService) AddLSNHTTPHDRLogProfile(resource models.LSNHTTPHdrLogProfile) error { + payload := map[string]any{"lsnhttphdrlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnHTTPHDRLogProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNHTTPHDRLogProfile(httphdrlogprofilename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnHTTPHDRLogProfileURL, httphdrlogprofilename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNHTTPHDRLogProfile(resource models.LSNHTTPHdrLogProfile) error { + payload := map[string]any{"lsnhttphdrlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnHTTPHDRLogProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNHTTPHDRLogProfile(resource models.LSNHTTPHdrLogProfile) error { + payload := map[string]any{"lsnhttphdrlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnHTTPHDRLogProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNHTTPHDRLogProfile() ([]models.LSNHTTPHdrLogProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnHTTPHDRLogProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNHTTPHdrLogProfile `json:"lsnhttphdrlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNHTTPHDRLogProfile(httphdrlogprofilename string) (models.LSNHTTPHdrLogProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnHTTPHDRLogProfileURL, httphdrlogprofilename), nil) + if err != nil { + return models.LSNHTTPHdrLogProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNHTTPHdrLogProfile{}, err + } + + var result struct { + Data []models.LSNHTTPHdrLogProfile `json:"lsnhttphdrlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNHTTPHdrLogProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNHTTPHdrLogProfile{}, fmt.Errorf("lsnhttphdrlogprofile %s not found", httphdrlogprofilename) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNHTTPHDRLogProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnHTTPHDRLogProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNHTTPHdrLogProfile `json:"lsnhttphdrlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnip6profile +func (s *LSNService) AddLSNIP6Profile(resource models.LSNIP6Profile) error { + payload := map[string]any{"lsnip6profile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnIP6ProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNIP6Profile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnIP6ProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNIP6Profile() ([]models.LSNIP6Profile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnIP6ProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNIP6Profile `json:"lsnip6profile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNIP6Profile(name string) (models.LSNIP6Profile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnIP6ProfileURL, name), nil) + if err != nil { + return models.LSNIP6Profile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNIP6Profile{}, err + } + + var result struct { + Data []models.LSNIP6Profile `json:"lsnip6profile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNIP6Profile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNIP6Profile{}, fmt.Errorf("lsnip6profile %s not found", name) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNIP6Profile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnIP6ProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNIP6Profile `json:"lsnip6profile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnlogprofile +func (s *LSNService) AddLSNLogProfile(resource models.LSNLogProfile) error { + payload := map[string]any{"lsnlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnLogProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNLogProfile(logprofilename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnLogProfileURL, logprofilename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNLogProfile(resource models.LSNLogProfile) error { + payload := map[string]any{"lsnlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnLogProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNLogProfile(resource models.LSNLogProfile) error { + payload := map[string]any{"lsnlogprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnLogProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNLogProfile() ([]models.LSNLogProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnLogProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNLogProfile `json:"lsnlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNLogProfile(logprofilename string) (models.LSNLogProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnLogProfileURL, logprofilename), nil) + if err != nil { + return models.LSNLogProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNLogProfile{}, err + } + + var result struct { + Data []models.LSNLogProfile `json:"lsnlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNLogProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNLogProfile{}, fmt.Errorf("lsnlogprofile %s not found", logprofilename) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNLogProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnLogProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNLogProfile `json:"lsnlogprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnparameter +func (s *LSNService) UpdateLSNParameter(resource models.LSNParameter) error { + payload := map[string]any{"lsnparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNParameter(resource models.LSNParameter) error { + payload := map[string]any{"lsnparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNParameter() (models.LSNParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnParameterURL, nil) + if err != nil { + return models.LSNParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNParameter{}, err + } + + var result struct { + Data models.LSNParameter `json:"lsnparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// lsnpool +func (s *LSNService) AddLSNPool(resource models.LSNPool) error { + payload := map[string]any{"lsnpool": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnPoolURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNPool(poolname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnPoolURL, poolname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNPool(resource models.LSNPool) error { + payload := map[string]any{"lsnpool": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnPoolURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNPool(resource models.LSNPool) error { + payload := map[string]any{"lsnpool": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnPoolURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNPool() ([]models.LSNPool, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnPoolURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNPool `json:"lsnpool"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNPool(poolname string) (models.LSNPool, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnPoolURL, poolname), nil) + if err != nil { + return models.LSNPool{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNPool{}, err + } + + var result struct { + Data []models.LSNPool `json:"lsnpool"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNPool{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNPool{}, fmt.Errorf("lsnpool %s not found", poolname) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNPool() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnPoolURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNPool `json:"lsnpool"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnpool_binding +func (s *LSNService) GetAllLSNPoolBinding() ([]models.LSNPoolBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnPoolBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNPoolBinding `json:"lsnpool_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNPoolBinding(poolname string) (models.LSNPoolBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnPoolBindingURL, poolname), nil) + if err != nil { + return models.LSNPoolBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNPoolBinding{}, err + } + + var result struct { + Data []models.LSNPoolBinding `json:"lsnpool_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNPoolBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNPoolBinding{}, fmt.Errorf("lsnpool_binding %s not found", poolname) + } + + return result.Data[0], nil +} + +// lsnpool_lsnip_binding +func (s *LSNService) AddLSNPoolLSNIPBinding(resource models.LSNPoolLSNIPBinding) error { + payload := map[string]any{"lsnpool_lsnip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnPoolLSNIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNPoolLSNIPBinding(poolname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", lsnPoolLSNIPBindingURL, poolname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNPoolLSNIPBinding() ([]models.LSNPoolLSNIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnPoolLSNIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNPoolLSNIPBinding `json:"lsnpool_lsnip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNPoolLSNIPBinding(poolname string) ([]models.LSNPoolLSNIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnPoolLSNIPBindingURL, poolname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNPoolLSNIPBinding `json:"lsnpool_lsnip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNPoolLSNIPBinding(poolname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnPoolLSNIPBindingURL, poolname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNPoolLSNIPBinding `json:"lsnpool_lsnip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnrtspalgprofile +func (s *LSNService) AddLSNRTSPALGProfile(resource models.LSNRTSPALGProfile) error { + payload := map[string]any{"lsnrtspalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnRTSPALGProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNRTSPALGProfile(profilename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnRTSPALGProfileURL, profilename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNRTSPALGProfile(resource models.LSNRTSPALGProfile) error { + payload := map[string]any{"lsnrtspalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnRTSPALGProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNRTSPALGProfile(resource models.LSNRTSPALGProfile) error { + payload := map[string]any{"lsnrtspalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnRTSPALGProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNRTSPALGProfile() ([]models.LSNRTSPALGProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnRTSPALGProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNRTSPALGProfile `json:"lsnrtspalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNRTSPALGProfile(profilename string) (models.LSNRTSPALGProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnRTSPALGProfileURL, profilename), nil) + if err != nil { + return models.LSNRTSPALGProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNRTSPALGProfile{}, err + } + + var result struct { + Data []models.LSNRTSPALGProfile `json:"lsnrtspalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNRTSPALGProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNRTSPALGProfile{}, fmt.Errorf("lsnrtspalgprofile %s not found", profilename) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNRTSPALGProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnRTSPALGProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNRTSPALGProfile `json:"lsnrtspalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnrtspalgsession +func (s *LSNService) GetAllLSNRTSPALGSession() ([]models.LSNRTSPALGSession, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnRTSPALGSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNRTSPALGSession `json:"lsnrtspalgsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNRTSPALGSession(sessionid string) (models.LSNRTSPALGSession, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnRTSPALGSessionURL, sessionid), nil) + if err != nil { + return models.LSNRTSPALGSession{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNRTSPALGSession{}, err + } + + var result struct { + Data []models.LSNRTSPALGSession `json:"lsnrtspalgsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNRTSPALGSession{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNRTSPALGSession{}, fmt.Errorf("lsnrtspalgsession %s not found", sessionid) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNRTSPALGSession() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnRTSPALGSessionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNRTSPALGSession `json:"lsnrtspalgsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LSNService) FlushLSNRTSPALGSession(resource models.LSNRTSPALGSession) error { + payload := map[string]any{"lsnrtspalgsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", lsnRTSPALGSessionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lsnrtspalgsession_binding +func (s *LSNService) GetAllLSNRTSPALGSessionBinding() ([]models.LSNRTSPALGSessionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnRTSPALGSessionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNRTSPALGSessionBinding `json:"lsnrtspalgsession_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNRTSPALGSessionBinding(sessionid string) (models.LSNRTSPALGSessionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnRTSPALGSessionBindingURL, sessionid), nil) + if err != nil { + return models.LSNRTSPALGSessionBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNRTSPALGSessionBinding{}, err + } + + var result struct { + Data []models.LSNRTSPALGSessionBinding `json:"lsnrtspalgsession_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNRTSPALGSessionBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNRTSPALGSessionBinding{}, fmt.Errorf("lsnrtspalgsession_binding %s not found", sessionid) + } + + return result.Data[0], nil +} + +// lsnrtspalgsession_datachannel_binding +func (s *LSNService) GetAllLSNRTSPALGSessionDataChannelBinding() ([]models.LSNRTSPALGSessionDataChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnRTSPALGSessionDataChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNRTSPALGSessionDataChannelBinding `json:"lsnrtspalgsession_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNRTSPALGSessionDataChannelBinding(sessionid string) ([]models.LSNRTSPALGSessionDataChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnRTSPALGSessionDataChannelBindingURL, sessionid), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNRTSPALGSessionDataChannelBinding `json:"lsnrtspalgsession_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNRTSPALGSessionDataChannelBinding(sessionid string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnRTSPALGSessionDataChannelBindingURL, sessionid), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNRTSPALGSessionDataChannelBinding `json:"lsnrtspalgsession_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnsession +func (s *LSNService) GetAllLSNSession() ([]models.LSNSession, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSession `json:"lsnsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNSession() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnSessionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNSession `json:"lsnsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LSNService) FlushLSNSession(resource models.LSNSession) error { + payload := map[string]any{"lsnsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", lsnSessionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lsnsipalgcall +func (s *LSNService) GetAllLSNSIPALGCall() ([]models.LSNSIPALGCall, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSIPALGCallURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCall `json:"lsnsipalgcall"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNSIPALGCall(callid string) (models.LSNSIPALGCall, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnSIPALGCallURL, callid), nil) + if err != nil { + return models.LSNSIPALGCall{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNSIPALGCall{}, err + } + + var result struct { + Data []models.LSNSIPALGCall `json:"lsnsipalgcall"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNSIPALGCall{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNSIPALGCall{}, fmt.Errorf("lsnsipalgcall %s not found", callid) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNSIPALGCall() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnSIPALGCallURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNSIPALGCall `json:"lsnsipalgcall"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *LSNService) FlushLSNSIPALGCall(resource models.LSNSIPALGCall) error { + payload := map[string]any{"lsnsipalgcall": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", lsnSIPALGCallURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// lsnsipalgcall_binding +func (s *LSNService) GetAllLSNSIPALGCallBinding() ([]models.LSNSIPALGCallBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSIPALGCallBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCallBinding `json:"lsnsipalgcall_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNSIPALGCallBinding(callid string) (models.LSNSIPALGCallBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnSIPALGCallBindingURL, callid), nil) + if err != nil { + return models.LSNSIPALGCallBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNSIPALGCallBinding{}, err + } + + var result struct { + Data []models.LSNSIPALGCallBinding `json:"lsnsipalgcall_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNSIPALGCallBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNSIPALGCallBinding{}, fmt.Errorf("lsnsipalgcall_binding %s not found", callid) + } + + return result.Data[0], nil +} + +// lsnsipalgcall_controlchannel_binding +func (s *LSNService) GetAllLSNSIPALGCallControlChannelBinding() ([]models.LSNSIPALGCallControlChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSIPALGCallControlChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCallControlChannelBinding `json:"lsnsipalgcall_controlchannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNSIPALGCallControlChannelBinding(callid string) ([]models.LSNSIPALGCallControlChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnSIPALGCallControlChannelBindingURL, callid), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCallControlChannelBinding `json:"lsnsipalgcall_controlchannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNSIPALGCallControlChannelBinding(callid string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnSIPALGCallControlChannelBindingURL, callid), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNSIPALGCallControlChannelBinding `json:"lsnsipalgcall_controlchannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnsipalgcall_datachannel_binding +func (s *LSNService) GetAllLSNSIPALGCallDataChannelBinding() ([]models.LSNSIPALGCallDataChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSIPALGCallDataChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCallDataChannelBinding `json:"lsnsipalgcall_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNSIPALGCallDataChannelBinding(callid string) ([]models.LSNSIPALGCallDataChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnSIPALGCallDataChannelBindingURL, callid), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGCallDataChannelBinding `json:"lsnsipalgcall_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) CountLSNSIPALGCallDataChannelBinding(callid string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", lsnSIPALGCallDataChannelBindingURL, callid), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNSIPALGCallDataChannelBinding `json:"lsnsipalgcall_datachannel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnsipalgprofile +func (s *LSNService) AddLSNSIPALGProfile(resource models.LSNSIPALGProfile) error { + payload := map[string]any{"lsnsipalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnSIPALGProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNSIPALGProfile(sipalgprofilename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnSIPALGProfileURL, sipalgprofilename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNSIPALGProfile(resource models.LSNSIPALGProfile) error { + payload := map[string]any{"lsnsipalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnSIPALGProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNSIPALGProfile(resource models.LSNSIPALGProfile) error { + payload := map[string]any{"lsnsipalgprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnSIPALGProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNSIPALGProfile() ([]models.LSNSIPALGProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnSIPALGProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNSIPALGProfile `json:"lsnsipalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNSIPALGProfile(sipalgprofilename string) (models.LSNSIPALGProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnSIPALGProfileURL, sipalgprofilename), nil) + if err != nil { + return models.LSNSIPALGProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNSIPALGProfile{}, err + } + + var result struct { + Data []models.LSNSIPALGProfile `json:"lsnsipalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNSIPALGProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNSIPALGProfile{}, fmt.Errorf("lsnsipalgprofile %s not found", sipalgprofilename) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNSIPALGProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnSIPALGProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNSIPALGProfile `json:"lsnsipalgprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsnstatic +func (s *LSNService) AddLSNStatic(resource models.LSNStatic) error { + payload := map[string]any{"lsnstatic": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnStaticURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNStatic(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnStaticURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNStatic() ([]models.LSNStatic, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnStaticURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNStatic `json:"lsnstatic"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNStatic(name string) (models.LSNStatic, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnStaticURL, name), nil) + if err != nil { + return models.LSNStatic{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNStatic{}, err + } + + var result struct { + Data []models.LSNStatic `json:"lsnstatic"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNStatic{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNStatic{}, fmt.Errorf("lsnstatic %s not found", name) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNStatic() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnStaticURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNStatic `json:"lsnstatic"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// lsntransportprofile +func (s *LSNService) AddLSNTransportProfile(resource models.LSNTransportProfile) error { + payload := map[string]any{"lsntransportprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, lsnTransportProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) DeleteLSNTransportProfile(transportprofilename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", lsnTransportProfileURL, transportprofilename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UpdateLSNTransportProfile(resource models.LSNTransportProfile) error { + payload := map[string]any{"lsntransportprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lsnTransportProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) UnsetLSNTransportProfile(resource models.LSNTransportProfile) error { + payload := map[string]any{"lsntransportprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", lsnTransportProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *LSNService) GetAllLSNTransportProfile() ([]models.LSNTransportProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, lsnTransportProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LSNTransportProfile `json:"lsntransportprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *LSNService) GetLSNTransportProfile(transportprofilename string) (models.LSNTransportProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lsnTransportProfileURL, transportprofilename), nil) + if err != nil { + return models.LSNTransportProfile{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.LSNTransportProfile{}, err + } + + var result struct { + Data []models.LSNTransportProfile `json:"lsntransportprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.LSNTransportProfile{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return models.LSNTransportProfile{}, fmt.Errorf("lsntransportprofile %s not found", transportprofilename) + } + + return result.Data[0], nil +} + +func (s *LSNService) CountLSNTransportProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lsnTransportProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LSNTransportProfile `json:"lsntransportprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} diff --git a/nitrogo/models/aaa.go b/nitrogo/models/aaa.go index 01bbe1b..acec119 100644 --- a/nitrogo/models/aaa.go +++ b/nitrogo/models/aaa.go @@ -12,17 +12,19 @@ type AAACertParams struct { type AAAGlobalAAAPreAuthenticationPolicyBinding struct { BindPolicyType int `json:"bindpolicytype,omitempty"` Builtin []string `json:"builtin,omitempty"` + Count float64 `json:"__count,omitempty"` Policy string `json:"policy,omitempty"` Priority int `json:"priority,omitempty"` } type AAAGlobalAuthenticationNegotiateActionBinding struct { - WindowsProfile string `json:"windowsprofile,omitempty"` + Count float64 `json:"__count,omitempty"` + WindowsProfile string `json:"windowsprofile,omitempty"` } type AAAGlobalBinding struct { - AAAGlobalAAAPreAuthenticationPolicyBinding []interface{} `json:"aaaglobal_aaapreauthenticationpolicy_binding,omitempty"` - AAAGlobalAuthenticationNegotiateActionBinding []interface{} `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` + AAAGlobalAAAPreAuthenticationPolicyBinding []any `json:"aaaglobal_aaapreauthenticationpolicy_binding,omitempty"` + AAAGlobalAuthenticationNegotiateActionBinding []any `json:"aaaglobal_authenticationnegotiateaction_binding,omitempty"` } type AAAGroup struct { @@ -34,124 +36,137 @@ type AAAGroup struct { } type AAAGroupAAAUserBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` } type AAAGroupAuditNSLogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupAuditSyslogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupAuthorizationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupBinding struct { - AAAGroupAAAUserBinding []interface{} `json:"aaagroup_aaauser_binding,omitempty"` - AAAGroupAuditNSLogPolicyBinding []interface{} `json:"aaagroup_auditnslogpolicy_binding,omitempty"` - AAAGroupAuditSyslogPolicyBinding []interface{} `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` - AAAGroupAuthorizationPolicyBinding []interface{} `json:"aaagroup_authorizationpolicy_binding,omitempty"` - AAAGroupIntranetIP6Binding []interface{} `json:"aaagroup_intranetip6_binding,omitempty"` - AAAGroupIntranetIPBinding []interface{} `json:"aaagroup_intranetip_binding,omitempty"` - AAAGroupTMSessionPolicyBinding []interface{} `json:"aaagroup_tmsessionpolicy_binding,omitempty"` - AAAGroupVPNIntranetApplicationBinding []interface{} `json:"aaagroup_vpnintranetapplication_binding,omitempty"` - AAAGroupVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` - AAAGroupVPNSessionPolicyBinding []interface{} `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` - AAAGroupVPNTrafficPolicyBinding []interface{} `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` - AAAGroupVPNURLBinding []interface{} `json:"aaagroup_vpnurl_binding,omitempty"` - AAAGroupVPNURLPolicyBinding []interface{} `json:"aaagroup_vpnurlpolicy_binding,omitempty"` - GroupName string `json:"groupname,omitempty"` + AAAGroupAAAUserBinding []any `json:"aaagroup_aaauser_binding,omitempty"` + AAAGroupAuditNSLogPolicyBinding []any `json:"aaagroup_auditnslogpolicy_binding,omitempty"` + AAAGroupAuditSyslogPolicyBinding []any `json:"aaagroup_auditsyslogpolicy_binding,omitempty"` + AAAGroupAuthorizationPolicyBinding []any `json:"aaagroup_authorizationpolicy_binding,omitempty"` + AAAGroupIntranetIP6Binding []any `json:"aaagroup_intranetip6_binding,omitempty"` + AAAGroupIntranetIPBinding []any `json:"aaagroup_intranetip_binding,omitempty"` + AAAGroupTMSessionPolicyBinding []any `json:"aaagroup_tmsessionpolicy_binding,omitempty"` + AAAGroupVPNIntranetApplicationBinding []any `json:"aaagroup_vpnintranetapplication_binding,omitempty"` + AAAGroupVPNSecurePrivateAccessProfileBinding []any `json:"aaagroup_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAGroupVPNSessionPolicyBinding []any `json:"aaagroup_vpnsessionpolicy_binding,omitempty"` + AAAGroupVPNTrafficPolicyBinding []any `json:"aaagroup_vpntrafficpolicy_binding,omitempty"` + AAAGroupVPNURLBinding []any `json:"aaagroup_vpnurl_binding,omitempty"` + AAAGroupVPNURLPolicyBinding []any `json:"aaagroup_vpnurlpolicy_binding,omitempty"` + GroupName string `json:"groupname,omitempty"` } type AAAGroupIntranetIP6Binding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - IntranetIP6 string `json:"intranetip6,omitempty"` - NumAddr int `json:"numaddr,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } type AAAGroupIntranetIPBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - IntranetIP string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` } type AAAGroupTMSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupVPNIntranetApplicationBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` } type AAAGroupVPNSecurePrivateAccessProfileBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` } type AAAGroupVPNSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupVPNTrafficPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAGroupVPNURLBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - URLName string `json:"urlname,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + URLName string `json:"urlname,omitempty"` } type AAAGroupVPNURLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` } type AAAKCDAccount struct { @@ -273,23 +288,25 @@ type AAAPreAuthenticationPolicy struct { } type AAAPreAuthenticationPolicyAAAGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AAAPreAuthenticationPolicyBinding struct { - AAAPreAuthenticationPolicyAAAGlobalBinding []interface{} `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` - AAAPreAuthenticationPolicyVPNVServerBinding []interface{} `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AAAPreAuthenticationPolicyAAAGlobalBinding []any `json:"aaapreauthenticationpolicy_aaaglobal_binding,omitempty"` + AAAPreAuthenticationPolicyVPNVServerBinding []any `json:"aaapreauthenticationpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AAAPreAuthenticationPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AAARADIUSParams struct { @@ -377,122 +394,135 @@ type AAAUser struct { } type AAAUserAAAGroupBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupName string `json:"groupname,omitempty"` - Username string `json:"username,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupName string `json:"groupname,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserAuditNSLogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserAuditSyslogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserAuthorizationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserBinding struct { - AAAUserAAAGroupBinding []interface{} `json:"aaauser_aaagroup_binding,omitempty"` - AAAUserAuditNSLogPolicyBinding []interface{} `json:"aaauser_auditnslogpolicy_binding,omitempty"` - AAAUserAuditSyslogPolicyBinding []interface{} `json:"aaauser_auditsyslogpolicy_binding,omitempty"` - AAAUserAuthorizationPolicyBinding []interface{} `json:"aaauser_authorizationpolicy_binding,omitempty"` - AAAUserIntranetIP6Binding []interface{} `json:"aaauser_intranetip6_binding,omitempty"` - AAAUserIntranetIPBinding []interface{} `json:"aaauser_intranetip_binding,omitempty"` - AAAUserTMSessionPolicyBinding []interface{} `json:"aaauser_tmsessionpolicy_binding,omitempty"` - AAAUserVPNIntranetApplicationBinding []interface{} `json:"aaauser_vpnintranetapplication_binding,omitempty"` - AAAUserVPNSecurePrivateAccessProfileBinding []interface{} `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` - AAAUserVPNSessionPolicyBinding []interface{} `json:"aaauser_vpnsessionpolicy_binding,omitempty"` - AAAUserVPNTrafficPolicyBinding []interface{} `json:"aaauser_vpntrafficpolicy_binding,omitempty"` - AAAUserVPNURLBinding []interface{} `json:"aaauser_vpnurl_binding,omitempty"` - AAAUserVPNURLPolicyBinding []interface{} `json:"aaauser_vpnurlpolicy_binding,omitempty"` - Username string `json:"username,omitempty"` + AAAUserAAAGroupBinding []any `json:"aaauser_aaagroup_binding,omitempty"` + AAAUserAuditNSLogPolicyBinding []any `json:"aaauser_auditnslogpolicy_binding,omitempty"` + AAAUserAuditSyslogPolicyBinding []any `json:"aaauser_auditsyslogpolicy_binding,omitempty"` + AAAUserAuthorizationPolicyBinding []any `json:"aaauser_authorizationpolicy_binding,omitempty"` + AAAUserIntranetIP6Binding []any `json:"aaauser_intranetip6_binding,omitempty"` + AAAUserIntranetIPBinding []any `json:"aaauser_intranetip_binding,omitempty"` + AAAUserTMSessionPolicyBinding []any `json:"aaauser_tmsessionpolicy_binding,omitempty"` + AAAUserVPNIntranetApplicationBinding []any `json:"aaauser_vpnintranetapplication_binding,omitempty"` + AAAUserVPNSecurePrivateAccessProfileBinding []any `json:"aaauser_vpnsecureprivateaccessprofile_binding,omitempty"` + AAAUserVPNSessionPolicyBinding []any `json:"aaauser_vpnsessionpolicy_binding,omitempty"` + AAAUserVPNTrafficPolicyBinding []any `json:"aaauser_vpntrafficpolicy_binding,omitempty"` + AAAUserVPNURLBinding []any `json:"aaauser_vpnurl_binding,omitempty"` + AAAUserVPNURLPolicyBinding []any `json:"aaauser_vpnurlpolicy_binding,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserIntranetIP6Binding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetIP6 string `json:"intranetip6,omitempty"` - NumAddr int `json:"numaddr,omitempty"` - Username string `json:"username,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserIntranetIPBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetIP string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` - Username string `json:"username,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserTMSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNIntranetApplicationBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNSecurePrivateAccessProfileBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNTrafficPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNURLBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - URLName string `json:"urlname,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + URLName string `json:"urlname,omitempty"` + Username string `json:"username,omitempty"` } type AAAUserVPNURLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - TypeField string `json:"type,omitempty"` - Username string `json:"username,omitempty"` + ActType int `json:"acttype,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + TypeField string `json:"type,omitempty"` + Username string `json:"username,omitempty"` } diff --git a/nitrogo/models/analytics.go b/nitrogo/models/analytics.go index 072f5ee..0d0458a 100644 --- a/nitrogo/models/analytics.go +++ b/nitrogo/models/analytics.go @@ -6,7 +6,7 @@ type AnalyticsGlobalAnalyticsProfileBinding struct { } type AnalyticsGlobalBinding struct { - AnalyticsGlobalAnalyticsProfileBinding []interface{} `json:"analyticsglobal_analyticsprofile_binding,omitempty"` + AnalyticsGlobalAnalyticsProfileBinding []any `json:"analyticsglobal_analyticsprofile_binding,omitempty"` } type AnalyticsProfile struct { diff --git a/nitrogo/models/api.go b/nitrogo/models/api.go index a364cf0..e714aff 100644 --- a/nitrogo/models/api.go +++ b/nitrogo/models/api.go @@ -43,11 +43,11 @@ type APIProfile struct { } type APIProfileBinding struct { - APIProfileAPISpecBinding []interface{} `json:"apiprofile_apispec_binding,omitempty"` - Name string `json:"name,omitempty"` + APIProfileAPISpecBinding []any `json:"apiprofile_apispec_binding,omitempty"` + Name string `json:"name,omitempty"` } type APISpecBinding struct { - APISpecSpecEndpointBinding []interface{} `json:"apispec_specendpoint_binding,omitempty"` - Name string `json:"name,omitempty"` + APISpecSpecEndpointBinding []any `json:"apispec_specendpoint_binding,omitempty"` + Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/appflow.go b/nitrogo/models/appflow.go index 6875a76..5a82a59 100644 --- a/nitrogo/models/appflow.go +++ b/nitrogo/models/appflow.go @@ -61,7 +61,7 @@ type AppFlowParam struct { } type AppFlowGlobalBinding struct { - AppFlowGlobalAppFlowPolicyBinding []interface{} `json:"appflowglobal_appflowpolicy_binding,omitempty"` + AppFlowGlobalAppFlowPolicyBinding []any `json:"appflowglobal_appflowpolicy_binding,omitempty"` } type AppFlowPolicyAppFlowGlobalBinding struct { @@ -92,8 +92,8 @@ type AppFlowPolicyLabel struct { } type AppFlowPolicyLabelBinding struct { - AppFlowPolicyLabelAppFlowPolicyBinding []interface{} `json:"appflowpolicylabel_appflowpolicy_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + AppFlowPolicyLabelAppFlowPolicyBinding []any `json:"appflowpolicylabel_appflowpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type AppFlowPolicyVPNVServerBinding struct { @@ -130,8 +130,8 @@ type AppFlowPolicyAppFlowPolicyLabelBinding struct { } type AppFlowActionBinding struct { - AppFlowActionAnalyticsProfileBinding []interface{} `json:"appflowaction_analyticsprofile_binding,omitempty"` - Name string `json:"name,omitempty"` + AppFlowActionAnalyticsProfileBinding []any `json:"appflowaction_analyticsprofile_binding,omitempty"` + Name string `json:"name,omitempty"` } type AppFlowPolicyLabelAppFlowPolicyBinding struct { @@ -145,12 +145,12 @@ type AppFlowPolicyLabelAppFlowPolicyBinding struct { } type AppFlowPolicyBinding struct { - AppFlowPolicyAppFlowGlobalBinding []interface{} `json:"appflowpolicy_appflowglobal_binding,omitempty"` - AppFlowPolicyAppFlowPolicyLabelBinding []interface{} `json:"appflowpolicy_appflowpolicylabel_binding,omitempty"` - AppFlowPolicyCSVServerBinding []interface{} `json:"appflowpolicy_csvserver_binding,omitempty"` - AppFlowPolicyLBVServerBinding []interface{} `json:"appflowpolicy_lbvserver_binding,omitempty"` - AppFlowPolicyVPNVServerBinding []interface{} `json:"appflowpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AppFlowPolicyAppFlowGlobalBinding []any `json:"appflowpolicy_appflowglobal_binding,omitempty"` + AppFlowPolicyAppFlowPolicyLabelBinding []any `json:"appflowpolicy_appflowpolicylabel_binding,omitempty"` + AppFlowPolicyCSVServerBinding []any `json:"appflowpolicy_csvserver_binding,omitempty"` + AppFlowPolicyLBVServerBinding []any `json:"appflowpolicy_lbvserver_binding,omitempty"` + AppFlowPolicyVPNVServerBinding []any `json:"appflowpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AppFlowPolicyLBVServerBinding struct { diff --git a/nitrogo/models/appfw.go b/nitrogo/models/appfw.go index 072d744..9341a18 100644 --- a/nitrogo/models/appfw.go +++ b/nitrogo/models/appfw.go @@ -113,24 +113,24 @@ type AppFWProfileDenyURLBinding struct { } type AppFWSignatures struct { - Action []string `json:"action,omitempty"` - AutoEnableNewSignatures string `json:"autoenablenewsignatures,omitempty"` - Category string `json:"category,omitempty"` - Comment string `json:"comment,omitempty"` - Enabled string `json:"enabled,omitempty"` - EncryptedVersion int `json:"encryptedversion,omitempty"` - Merge bool `json:"merge,omitempty"` - MergeDefault bool `json:"mergedefault,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Overwrite bool `json:"overwrite,omitempty"` - PreserveDefActions bool `json:"preservedefactions,omitempty"` - Response string `json:"response,omitempty"` - RuleID []interface{} `json:"ruleid,omitempty"` - SHA1 string `json:"sha1,omitempty"` - Src string `json:"src,omitempty"` - VendorType string `json:"vendortype,omitempty"` - XSLT string `json:"xslt,omitempty"` + Action []string `json:"action,omitempty"` + AutoEnableNewSignatures string `json:"autoenablenewsignatures,omitempty"` + Category string `json:"category,omitempty"` + Comment string `json:"comment,omitempty"` + Enabled string `json:"enabled,omitempty"` + EncryptedVersion int `json:"encryptedversion,omitempty"` + Merge bool `json:"merge,omitempty"` + MergeDefault bool `json:"mergedefault,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Overwrite bool `json:"overwrite,omitempty"` + PreserveDefActions bool `json:"preservedefactions,omitempty"` + Response string `json:"response,omitempty"` + RuleID []any `json:"ruleid,omitempty"` + SHA1 string `json:"sha1,omitempty"` + Src string `json:"src,omitempty"` + VendorType string `json:"vendortype,omitempty"` + XSLT string `json:"xslt,omitempty"` } type AppFWProfileFieldFormatBinding struct { @@ -332,41 +332,41 @@ type AppFWTransactionRecords struct { } type AppFWProfileBinding struct { - AppFWProfileAppFWConfidFieldBinding []interface{} `json:"appfwprofile_appfwconfidfield_binding,omitempty"` - AppFWProfileBlockKeywordBinding []interface{} `json:"appfwprofile_blockkeyword_binding,omitempty"` - AppFWProfileBypassListBinding []interface{} `json:"appfwprofile_bypasslist_binding,omitempty"` - AppFWProfileCMDInjectionBinding []interface{} `json:"appfwprofile_cmdinjection_binding,omitempty"` - AppFWProfileContentTypeBinding []interface{} `json:"appfwprofile_contenttype_binding,omitempty"` - AppFWProfileCookieConsistencyBinding []interface{} `json:"appfwprofile_cookieconsistency_binding,omitempty"` - AppFWProfileCreditCardNumberBinding []interface{} `json:"appfwprofile_creditcardnumber_binding,omitempty"` - AppFWProfileCrossSiteScriptingBinding []interface{} `json:"appfwprofile_crosssitescripting_binding,omitempty"` - AppFWProfileCSRFTagBinding []interface{} `json:"appfwprofile_csrftag_binding,omitempty"` - AppFWProfileDenyListBinding []interface{} `json:"appfwprofile_denylist_binding,omitempty"` - AppFWProfileDenyURLBinding []interface{} `json:"appfwprofile_denyurl_binding,omitempty"` - AppFWProfileExcludeRESContentTypeBinding []interface{} `json:"appfwprofile_excluderescontenttype_binding,omitempty"` - AppFWProfileFakeAccountBinding []interface{} `json:"appfwprofile_fakeaccount_binding,omitempty"` - AppFWProfileFieldConsistencyBinding []interface{} `json:"appfwprofile_fieldconsistency_binding,omitempty"` - AppFWProfileFieldFormatBinding []interface{} `json:"appfwprofile_fieldformat_binding,omitempty"` - AppFWProfileFileUploadTypeBinding []interface{} `json:"appfwprofile_fileuploadtype_binding,omitempty"` - AppFWProfileGRPCValidationBinding []interface{} `json:"appfwprofile_grpcvalidation_binding,omitempty"` - AppFWProfileJSONBlockKeywordBinding []interface{} `json:"appfwprofile_jsonblockkeyword_binding,omitempty"` - AppFWProfileJSONCMDURLBinding []interface{} `json:"appfwprofile_jsoncmdurl_binding,omitempty"` - AppFWProfileJSONDOSURLBinding []interface{} `json:"appfwprofile_jsondosurl_binding,omitempty"` - AppFWProfileJSONSQLURLBinding []interface{} `json:"appfwprofile_jsonsqlurl_binding,omitempty"` - AppFWProfileJSONXSSURLBinding []interface{} `json:"appfwprofile_jsonxssurl_binding,omitempty"` - AppFWProfileLogExpressionBinding []interface{} `json:"appfwprofile_logexpression_binding,omitempty"` - AppFWProfileRESTValidationBinding []interface{} `json:"appfwprofile_restvalidation_binding,omitempty"` - AppFWProfileSafeObjectBinding []interface{} `json:"appfwprofile_safeobject_binding,omitempty"` - AppFWProfileSQLInjectionBinding []interface{} `json:"appfwprofile_sqlinjection_binding,omitempty"` - AppFWProfileStartURLBinding []interface{} `json:"appfwprofile_starturl_binding,omitempty"` - AppFWProfileTrustedLearningClientsBinding []interface{} `json:"appfwprofile_trustedlearningclients_binding,omitempty"` - AppFWProfileXMLAttachmentURLBinding []interface{} `json:"appfwprofile_xmlattachmenturl_binding,omitempty"` - AppFWProfileXMLDOSURLBinding []interface{} `json:"appfwprofile_xmldosurl_binding,omitempty"` - AppFWProfileXMLSQLInjectionBinding []interface{} `json:"appfwprofile_xmlsqlinjection_binding,omitempty"` - AppFWProfileXMLValidationURLBinding []interface{} `json:"appfwprofile_xmlvalidationurl_binding,omitempty"` - AppFWProfileXMLWSIURLBinding []interface{} `json:"appfwprofile_xmlwsiurl_binding,omitempty"` - AppFWProfileXMLXSSBinding []interface{} `json:"appfwprofile_xmlxss_binding,omitempty"` - Name string `json:"name,omitempty"` + AppFWProfileAppFWConfidFieldBinding []any `json:"appfwprofile_appfwconfidfield_binding,omitempty"` + AppFWProfileBlockKeywordBinding []any `json:"appfwprofile_blockkeyword_binding,omitempty"` + AppFWProfileBypassListBinding []any `json:"appfwprofile_bypasslist_binding,omitempty"` + AppFWProfileCMDInjectionBinding []any `json:"appfwprofile_cmdinjection_binding,omitempty"` + AppFWProfileContentTypeBinding []any `json:"appfwprofile_contenttype_binding,omitempty"` + AppFWProfileCookieConsistencyBinding []any `json:"appfwprofile_cookieconsistency_binding,omitempty"` + AppFWProfileCreditCardNumberBinding []any `json:"appfwprofile_creditcardnumber_binding,omitempty"` + AppFWProfileCrossSiteScriptingBinding []any `json:"appfwprofile_crosssitescripting_binding,omitempty"` + AppFWProfileCSRFTagBinding []any `json:"appfwprofile_csrftag_binding,omitempty"` + AppFWProfileDenyListBinding []any `json:"appfwprofile_denylist_binding,omitempty"` + AppFWProfileDenyURLBinding []any `json:"appfwprofile_denyurl_binding,omitempty"` + AppFWProfileExcludeRESContentTypeBinding []any `json:"appfwprofile_excluderescontenttype_binding,omitempty"` + AppFWProfileFakeAccountBinding []any `json:"appfwprofile_fakeaccount_binding,omitempty"` + AppFWProfileFieldConsistencyBinding []any `json:"appfwprofile_fieldconsistency_binding,omitempty"` + AppFWProfileFieldFormatBinding []any `json:"appfwprofile_fieldformat_binding,omitempty"` + AppFWProfileFileUploadTypeBinding []any `json:"appfwprofile_fileuploadtype_binding,omitempty"` + AppFWProfileGRPCValidationBinding []any `json:"appfwprofile_grpcvalidation_binding,omitempty"` + AppFWProfileJSONBlockKeywordBinding []any `json:"appfwprofile_jsonblockkeyword_binding,omitempty"` + AppFWProfileJSONCMDURLBinding []any `json:"appfwprofile_jsoncmdurl_binding,omitempty"` + AppFWProfileJSONDOSURLBinding []any `json:"appfwprofile_jsondosurl_binding,omitempty"` + AppFWProfileJSONSQLURLBinding []any `json:"appfwprofile_jsonsqlurl_binding,omitempty"` + AppFWProfileJSONXSSURLBinding []any `json:"appfwprofile_jsonxssurl_binding,omitempty"` + AppFWProfileLogExpressionBinding []any `json:"appfwprofile_logexpression_binding,omitempty"` + AppFWProfileRESTValidationBinding []any `json:"appfwprofile_restvalidation_binding,omitempty"` + AppFWProfileSafeObjectBinding []any `json:"appfwprofile_safeobject_binding,omitempty"` + AppFWProfileSQLInjectionBinding []any `json:"appfwprofile_sqlinjection_binding,omitempty"` + AppFWProfileStartURLBinding []any `json:"appfwprofile_starturl_binding,omitempty"` + AppFWProfileTrustedLearningClientsBinding []any `json:"appfwprofile_trustedlearningclients_binding,omitempty"` + AppFWProfileXMLAttachmentURLBinding []any `json:"appfwprofile_xmlattachmenturl_binding,omitempty"` + AppFWProfileXMLDOSURLBinding []any `json:"appfwprofile_xmldosurl_binding,omitempty"` + AppFWProfileXMLSQLInjectionBinding []any `json:"appfwprofile_xmlsqlinjection_binding,omitempty"` + AppFWProfileXMLValidationURLBinding []any `json:"appfwprofile_xmlvalidationurl_binding,omitempty"` + AppFWProfileXMLWSIURLBinding []any `json:"appfwprofile_xmlwsiurl_binding,omitempty"` + AppFWProfileXMLXSSBinding []any `json:"appfwprofile_xmlxss_binding,omitempty"` + Name string `json:"name,omitempty"` } type AppFWProfileCSRFTagBinding struct { @@ -428,9 +428,9 @@ type AppFWGlobalAuditSyslogPolicyBinding struct { } type AppFWGlobalBinding struct { - AppFWGlobalAppFWPolicyBinding []interface{} `json:"appfwglobal_appfwpolicy_binding,omitempty"` - AppFWGlobalAuditNSLogPolicyBinding []interface{} `json:"appfwglobal_auditnslogpolicy_binding,omitempty"` - AppFWGlobalAuditSyslogPolicyBinding []interface{} `json:"appfwglobal_auditsyslogpolicy_binding,omitempty"` + AppFWGlobalAppFWPolicyBinding []any `json:"appfwglobal_appfwpolicy_binding,omitempty"` + AppFWGlobalAuditNSLogPolicyBinding []any `json:"appfwglobal_auditnslogpolicy_binding,omitempty"` + AppFWGlobalAuditSyslogPolicyBinding []any `json:"appfwglobal_auditsyslogpolicy_binding,omitempty"` } type AppFWProfileJSONXSSURLBinding struct { @@ -489,12 +489,12 @@ type AppFWURLEncodedFormContentType struct { } type AppFWPolicyBinding struct { - AppFWPolicyAppFWGlobalBinding []interface{} `json:"appfwpolicy_appfwglobal_binding,omitempty"` - AppFWPolicyAppFWPolicyLabelBinding []interface{} `json:"appfwpolicy_appfwpolicylabel_binding,omitempty"` - AppFWPolicyCSVServerBinding []interface{} `json:"appfwpolicy_csvserver_binding,omitempty"` - AppFWPolicyLBVServerBinding []interface{} `json:"appfwpolicy_lbvserver_binding,omitempty"` - AppFWPolicyVPNVServerBinding []interface{} `json:"appfwpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AppFWPolicyAppFWGlobalBinding []any `json:"appfwpolicy_appfwglobal_binding,omitempty"` + AppFWPolicyAppFWPolicyLabelBinding []any `json:"appfwpolicy_appfwpolicylabel_binding,omitempty"` + AppFWPolicyCSVServerBinding []any `json:"appfwpolicy_csvserver_binding,omitempty"` + AppFWPolicyLBVServerBinding []any `json:"appfwpolicy_lbvserver_binding,omitempty"` + AppFWPolicyVPNVServerBinding []any `json:"appfwpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AppFWProfileFieldConsistencyBinding struct { @@ -909,9 +909,9 @@ type AppFWProfileDenyListBinding struct { } type AppFWPolicyLabelBinding struct { - AppFWPolicyLabelAppFWPolicyBinding []interface{} `json:"appfwpolicylabel_appfwpolicy_binding,omitempty"` - AppFWPolicyLabelPolicyBindingBinding []interface{} `json:"appfwpolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + AppFWPolicyLabelAppFWPolicyBinding []any `json:"appfwpolicylabel_appfwpolicy_binding,omitempty"` + AppFWPolicyLabelPolicyBindingBinding []any `json:"appfwpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type AppFWProfile struct { diff --git a/nitrogo/models/appqoe.go b/nitrogo/models/appqoe.go index e1b9477..b44f3f8 100644 --- a/nitrogo/models/appqoe.go +++ b/nitrogo/models/appqoe.go @@ -47,8 +47,8 @@ type AppQOEAction struct { } type AppQOEPolicyBinding struct { - AppQOEPolicyLBVServerBinding []interface{} `json:"appqoepolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AppQOEPolicyLBVServerBinding []any `json:"appqoepolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AppQOEPolicy struct { diff --git a/nitrogo/models/audit.go b/nitrogo/models/audit.go index 4d731c6..0569b93 100644 --- a/nitrogo/models/audit.go +++ b/nitrogo/models/audit.go @@ -247,33 +247,33 @@ type AuditSyslogPolicyTMGlobalBinding struct { } type AuditNSLogPolicyBinding struct { - AuditNSLogPolicyAAAGroupBinding []interface{} `json:"auditnslogpolicy_aaagroup_binding,omitempty"` - AuditNSLogPolicyAAAUserBinding []interface{} `json:"auditnslogpolicy_aaauser_binding,omitempty"` - AuditNSLogPolicyAppFWGlobalBinding []interface{} `json:"auditnslogpolicy_appfwglobal_binding,omitempty"` - AuditNSLogPolicyAuditNSLogGlobalBinding []interface{} `json:"auditnslogpolicy_auditnslogglobal_binding,omitempty"` - AuditNSLogPolicyAuthenticationVServerBinding []interface{} `json:"auditnslogpolicy_authenticationvserver_binding,omitempty"` - AuditNSLogPolicyCSVServerBinding []interface{} `json:"auditnslogpolicy_csvserver_binding,omitempty"` - AuditNSLogPolicyLBVServerBinding []interface{} `json:"auditnslogpolicy_lbvserver_binding,omitempty"` - AuditNSLogPolicySystemGlobalBinding []interface{} `json:"auditnslogpolicy_systemglobal_binding,omitempty"` - AuditNSLogPolicyTMGlobalBinding []interface{} `json:"auditnslogpolicy_tmglobal_binding,omitempty"` - AuditNSLogPolicyVPNGlobalBinding []interface{} `json:"auditnslogpolicy_vpnglobal_binding,omitempty"` - AuditNSLogPolicyVPNVServerBinding []interface{} `json:"auditnslogpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuditNSLogPolicyAAAGroupBinding []any `json:"auditnslogpolicy_aaagroup_binding,omitempty"` + AuditNSLogPolicyAAAUserBinding []any `json:"auditnslogpolicy_aaauser_binding,omitempty"` + AuditNSLogPolicyAppFWGlobalBinding []any `json:"auditnslogpolicy_appfwglobal_binding,omitempty"` + AuditNSLogPolicyAuditNSLogGlobalBinding []any `json:"auditnslogpolicy_auditnslogglobal_binding,omitempty"` + AuditNSLogPolicyAuthenticationVServerBinding []any `json:"auditnslogpolicy_authenticationvserver_binding,omitempty"` + AuditNSLogPolicyCSVServerBinding []any `json:"auditnslogpolicy_csvserver_binding,omitempty"` + AuditNSLogPolicyLBVServerBinding []any `json:"auditnslogpolicy_lbvserver_binding,omitempty"` + AuditNSLogPolicySystemGlobalBinding []any `json:"auditnslogpolicy_systemglobal_binding,omitempty"` + AuditNSLogPolicyTMGlobalBinding []any `json:"auditnslogpolicy_tmglobal_binding,omitempty"` + AuditNSLogPolicyVPNGlobalBinding []any `json:"auditnslogpolicy_vpnglobal_binding,omitempty"` + AuditNSLogPolicyVPNVServerBinding []any `json:"auditnslogpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuditSyslogPolicyBinding struct { - AuditSyslogPolicyAAAGroupBinding []interface{} `json:"auditsyslogpolicy_aaagroup_binding,omitempty"` - AuditSyslogPolicyAAAUserBinding []interface{} `json:"auditsyslogpolicy_aaauser_binding,omitempty"` - AuditSyslogPolicyAuditSyslogGlobalBinding []interface{} `json:"auditsyslogpolicy_auditsyslogglobal_binding,omitempty"` - AuditSyslogPolicyAuthenticationVServerBinding []interface{} `json:"auditsyslogpolicy_authenticationvserver_binding,omitempty"` - AuditSyslogPolicyCSVServerBinding []interface{} `json:"auditsyslogpolicy_csvserver_binding,omitempty"` - AuditSyslogPolicyLBVServerBinding []interface{} `json:"auditsyslogpolicy_lbvserver_binding,omitempty"` - AuditSyslogPolicyRNATGlobalBinding []interface{} `json:"auditsyslogpolicy_rnatglobal_binding,omitempty"` - AuditSyslogPolicySystemGlobalBinding []interface{} `json:"auditsyslogpolicy_systemglobal_binding,omitempty"` - AuditSyslogPolicyTMGlobalBinding []interface{} `json:"auditsyslogpolicy_tmglobal_binding,omitempty"` - AuditSyslogPolicyVPNGlobalBinding []interface{} `json:"auditsyslogpolicy_vpnglobal_binding,omitempty"` - AuditSyslogPolicyVPNVServerBinding []interface{} `json:"auditsyslogpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuditSyslogPolicyAAAGroupBinding []any `json:"auditsyslogpolicy_aaagroup_binding,omitempty"` + AuditSyslogPolicyAAAUserBinding []any `json:"auditsyslogpolicy_aaauser_binding,omitempty"` + AuditSyslogPolicyAuditSyslogGlobalBinding []any `json:"auditsyslogpolicy_auditsyslogglobal_binding,omitempty"` + AuditSyslogPolicyAuthenticationVServerBinding []any `json:"auditsyslogpolicy_authenticationvserver_binding,omitempty"` + AuditSyslogPolicyCSVServerBinding []any `json:"auditsyslogpolicy_csvserver_binding,omitempty"` + AuditSyslogPolicyLBVServerBinding []any `json:"auditsyslogpolicy_lbvserver_binding,omitempty"` + AuditSyslogPolicyRNATGlobalBinding []any `json:"auditsyslogpolicy_rnatglobal_binding,omitempty"` + AuditSyslogPolicySystemGlobalBinding []any `json:"auditsyslogpolicy_systemglobal_binding,omitempty"` + AuditSyslogPolicyTMGlobalBinding []any `json:"auditsyslogpolicy_tmglobal_binding,omitempty"` + AuditSyslogPolicyVPNGlobalBinding []any `json:"auditsyslogpolicy_vpnglobal_binding,omitempty"` + AuditSyslogPolicyVPNVServerBinding []any `json:"auditsyslogpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuditSyslogGlobalAuditSyslogPolicyBinding struct { @@ -286,7 +286,7 @@ type AuditSyslogGlobalAuditSyslogPolicyBinding struct { } type AuditSyslogGlobalBinding struct { - AuditSyslogGlobalAuditSyslogPolicyBinding []interface{} `json:"auditsyslogglobal_auditsyslogpolicy_binding,omitempty"` + AuditSyslogGlobalAuditSyslogPolicyBinding []any `json:"auditsyslogglobal_auditsyslogpolicy_binding,omitempty"` } type AuditSyslogPolicyCSVServerBinding struct { @@ -362,7 +362,7 @@ type AuditSyslogPolicyAAAUserBinding struct { } type AuditNSLogGlobalBinding struct { - AuditNSLogGlobalAuditNSLogPolicyBinding []interface{} `json:"auditnslogglobal_auditnslogpolicy_binding,omitempty"` + AuditNSLogGlobalAuditNSLogPolicyBinding []any `json:"auditnslogglobal_auditnslogpolicy_binding,omitempty"` } type AuditSyslogPolicyAuthenticationVServerBinding struct { diff --git a/nitrogo/models/authentication.go b/nitrogo/models/authentication.go index 2e0a5f0..789550d 100644 --- a/nitrogo/models/authentication.go +++ b/nitrogo/models/authentication.go @@ -2,8 +2,8 @@ package models // authentication configuration structs type AuthenticationDFAPolicyBinding struct { - AuthenticationDFAPolicyVPNVServerBinding []interface{} `json:"authenticationdfapolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationDFAPolicyVPNVServerBinding []any `json:"authenticationdfapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationWebAuthPolicy struct { @@ -15,27 +15,29 @@ type AuthenticationWebAuthPolicy struct { } type AuthenticationLDAPPolicyBinding struct { - AuthenticationLDAPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationldappolicy_authenticationvserver_binding,omitempty"` - AuthenticationLDAPPolicySystemGlobalBinding []interface{} `json:"authenticationldappolicy_systemglobal_binding,omitempty"` - AuthenticationLDAPPolicyVPNGlobalBinding []interface{} `json:"authenticationldappolicy_vpnglobal_binding,omitempty"` - AuthenticationLDAPPolicyVPNVServerBinding []interface{} `json:"authenticationldappolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationLDAPPolicyAuthenticationVServerBinding []any `json:"authenticationldappolicy_authenticationvserver_binding,omitempty"` + AuthenticationLDAPPolicySystemGlobalBinding []any `json:"authenticationldappolicy_systemglobal_binding,omitempty"` + AuthenticationLDAPPolicyVPNGlobalBinding []any `json:"authenticationldappolicy_vpnglobal_binding,omitempty"` + AuthenticationLDAPPolicyVPNVServerBinding []any `json:"authenticationldappolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationWebAuthPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationNegotiatePolicy struct { @@ -47,10 +49,11 @@ type AuthenticationNegotiatePolicy struct { } type AuthenticationCertPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationLDAPPolicy struct { @@ -70,17 +73,18 @@ type AuthenticationSmartAccessProfile struct { } type AuthenticationLocalPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationPushService struct { + Count float64 `json:"__count,omitempty"` CertEndpoint string `json:"certendpoint,omitempty"` ClientID string `json:"clientid,omitempty"` ClientSecret string `json:"clientsecret,omitempty"` - Count float64 `json:"__count,omitempty"` CustomerID string `json:"customerid,omitempty"` HubName string `json:"hubname,omitempty"` Name string `json:"name,omitempty"` @@ -108,25 +112,27 @@ type AuthenticationStoreFrontAuthAction struct { } type AuthenticationWebAuthPolicyBinding struct { - AuthenticationWebAuthPolicyAuthenticationVServerBinding []interface{} `json:"authenticationwebauthpolicy_authenticationvserver_binding,omitempty"` - AuthenticationWebAuthPolicySystemGlobalBinding []interface{} `json:"authenticationwebauthpolicy_systemglobal_binding,omitempty"` - AuthenticationWebAuthPolicyVPNGlobalBinding []interface{} `json:"authenticationwebauthpolicy_vpnglobal_binding,omitempty"` - AuthenticationWebAuthPolicyVPNVServerBinding []interface{} `json:"authenticationwebauthpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationWebAuthPolicyAuthenticationVServerBinding []any `json:"authenticationwebauthpolicy_authenticationvserver_binding,omitempty"` + AuthenticationWebAuthPolicySystemGlobalBinding []any `json:"authenticationwebauthpolicy_systemglobal_binding,omitempty"` + AuthenticationWebAuthPolicyVPNGlobalBinding []any `json:"authenticationwebauthpolicy_vpnglobal_binding,omitempty"` + AuthenticationWebAuthPolicyVPNVServerBinding []any `json:"authenticationwebauthpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationLocalPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationWebAuthPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSmartAccessPolicy struct { @@ -140,9 +146,9 @@ type AuthenticationSmartAccessPolicy struct { } type AuthenticationSAMLIDPPolicyBinding struct { - AuthenticationSAMLIDPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsamlidppolicy_authenticationvserver_binding,omitempty"` - AuthenticationSAMLIDPPolicyVPNVServerBinding []interface{} `json:"authenticationsamlidppolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationSAMLIDPPolicyAuthenticationVServerBinding []any `json:"authenticationsamlidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationSAMLIDPPolicyVPNVServerBinding []any `json:"authenticationsamlidppolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationOAuthIDPPolicy struct { @@ -160,71 +166,74 @@ type AuthenticationOAuthIDPPolicy struct { } type AuthenticationVServerBinding struct { - AuthenticationVServerAuditNSLogPolicyBinding []interface{} `json:"authenticationvserver_auditnslogpolicy_binding,omitempty"` - AuthenticationVServerAuditSyslogPolicyBinding []interface{} `json:"authenticationvserver_auditsyslogpolicy_binding,omitempty"` - AuthenticationVServerAuthenticationCertPolicyBinding []interface{} `json:"authenticationvserver_authenticationcertpolicy_binding,omitempty"` - AuthenticationVServerAuthenticationLDAPPolicyBinding []interface{} `json:"authenticationvserver_authenticationldappolicy_binding,omitempty"` - AuthenticationVServerAuthenticationLocalPolicyBinding []interface{} `json:"authenticationvserver_authenticationlocalpolicy_binding,omitempty"` - AuthenticationVServerAuthenticationLoginSchemaPolicyBinding []interface{} `json:"authenticationvserver_authenticationloginschemapolicy_binding,omitempty"` - AuthenticationVServerAuthenticationNegotiatePolicyBinding []interface{} `json:"authenticationvserver_authenticationnegotiatepolicy_binding,omitempty"` - AuthenticationVServerAuthenticationOAuthIDPPolicyBinding []interface{} `json:"authenticationvserver_authenticationoauthidppolicy_binding,omitempty"` - AuthenticationVServerAuthenticationPolicyBinding []interface{} `json:"authenticationvserver_authenticationpolicy_binding,omitempty"` - AuthenticationVServerAuthenticationRADIUSPolicyBinding []interface{} `json:"authenticationvserver_authenticationradiuspolicy_binding,omitempty"` - AuthenticationVServerAuthenticationSAMLIDPPolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlidppolicy_binding,omitempty"` - AuthenticationVServerAuthenticationSAMLPolicyBinding []interface{} `json:"authenticationvserver_authenticationsamlpolicy_binding,omitempty"` - AuthenticationVServerAuthenticationSmartAccessPolicyBinding []interface{} `json:"authenticationvserver_authenticationsmartaccesspolicy_binding,omitempty"` - AuthenticationVServerAuthenticationTACACSPolicyBinding []interface{} `json:"authenticationvserver_authenticationtacacspolicy_binding,omitempty"` - AuthenticationVServerAuthenticationWebAuthPolicyBinding []interface{} `json:"authenticationvserver_authenticationwebauthpolicy_binding,omitempty"` - AuthenticationVServerCachePolicyBinding []interface{} `json:"authenticationvserver_cachepolicy_binding,omitempty"` - AuthenticationVServerCSPolicyBinding []interface{} `json:"authenticationvserver_cspolicy_binding,omitempty"` - AuthenticationVServerResponderPolicyBinding []interface{} `json:"authenticationvserver_responderpolicy_binding,omitempty"` - AuthenticationVServerRewritePolicyBinding []interface{} `json:"authenticationvserver_rewritepolicy_binding,omitempty"` - AuthenticationVServerTMSessionPolicyBinding []interface{} `json:"authenticationvserver_tmsessionpolicy_binding,omitempty"` - AuthenticationVServerVPNPortalThemeBinding []interface{} `json:"authenticationvserver_vpnportaltheme_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationVServerAuditNSLogPolicyBinding []any `json:"authenticationvserver_auditnslogpolicy_binding,omitempty"` + AuthenticationVServerAuditSyslogPolicyBinding []any `json:"authenticationvserver_auditsyslogpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationCertPolicyBinding []any `json:"authenticationvserver_authenticationcertpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLDAPPolicyBinding []any `json:"authenticationvserver_authenticationldappolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLocalPolicyBinding []any `json:"authenticationvserver_authenticationlocalpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationLoginSchemaPolicyBinding []any `json:"authenticationvserver_authenticationloginschemapolicy_binding,omitempty"` + AuthenticationVServerAuthenticationNegotiatePolicyBinding []any `json:"authenticationvserver_authenticationnegotiatepolicy_binding,omitempty"` + AuthenticationVServerAuthenticationOAuthIDPPolicyBinding []any `json:"authenticationvserver_authenticationoauthidppolicy_binding,omitempty"` + AuthenticationVServerAuthenticationPolicyBinding []any `json:"authenticationvserver_authenticationpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationRADIUSPolicyBinding []any `json:"authenticationvserver_authenticationradiuspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSAMLIDPPolicyBinding []any `json:"authenticationvserver_authenticationsamlidppolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSAMLPolicyBinding []any `json:"authenticationvserver_authenticationsamlpolicy_binding,omitempty"` + AuthenticationVServerAuthenticationSmartAccessPolicyBinding []any `json:"authenticationvserver_authenticationsmartaccesspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationTACACSPolicyBinding []any `json:"authenticationvserver_authenticationtacacspolicy_binding,omitempty"` + AuthenticationVServerAuthenticationWebAuthPolicyBinding []any `json:"authenticationvserver_authenticationwebauthpolicy_binding,omitempty"` + AuthenticationVServerCachePolicyBinding []any `json:"authenticationvserver_cachepolicy_binding,omitempty"` + AuthenticationVServerCSPolicyBinding []any `json:"authenticationvserver_cspolicy_binding,omitempty"` + AuthenticationVServerResponderPolicyBinding []any `json:"authenticationvserver_responderpolicy_binding,omitempty"` + AuthenticationVServerRewritePolicyBinding []any `json:"authenticationvserver_rewritepolicy_binding,omitempty"` + AuthenticationVServerTMSessionPolicyBinding []any `json:"authenticationvserver_tmsessionpolicy_binding,omitempty"` + AuthenticationVServerVPNPortalThemeBinding []any `json:"authenticationvserver_vpnportaltheme_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationLocalPolicyBinding struct { - AuthenticationLocalPolicyAuthenticationVServerBinding []interface{} `json:"authenticationlocalpolicy_authenticationvserver_binding,omitempty"` - AuthenticationLocalPolicySystemGlobalBinding []interface{} `json:"authenticationlocalpolicy_systemglobal_binding,omitempty"` - AuthenticationLocalPolicyVPNGlobalBinding []interface{} `json:"authenticationlocalpolicy_vpnglobal_binding,omitempty"` - AuthenticationLocalPolicyVPNVServerBinding []interface{} `json:"authenticationlocalpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationLocalPolicyAuthenticationVServerBinding []any `json:"authenticationlocalpolicy_authenticationvserver_binding,omitempty"` + AuthenticationLocalPolicySystemGlobalBinding []any `json:"authenticationlocalpolicy_systemglobal_binding,omitempty"` + AuthenticationLocalPolicyVPNGlobalBinding []any `json:"authenticationlocalpolicy_vpnglobal_binding,omitempty"` + AuthenticationLocalPolicyVPNVServerBinding []any `json:"authenticationlocalpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationSmartAccessPolicyBinding struct { - AuthenticationSmartAccessPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsmartaccesspolicy_authenticationvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationSmartAccessPolicyAuthenticationVServerBinding []any `json:"authenticationsmartaccesspolicy_authenticationvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationVServerAuthenticationWebAuthPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationVServerAuditSyslogPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationRADIUSPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSAMLIDPPolicy struct { @@ -242,12 +251,12 @@ type AuthenticationSAMLIDPPolicy struct { } type AuthenticationRADIUSAction struct { + Count float64 `json:"__count,omitempty"` Accounting string `json:"accounting,omitempty"` Authentication string `json:"authentication,omitempty"` AuthServRetry int `json:"authservretry,omitempty"` AuthTimeout int `json:"authtimeout,omitempty"` CallingStationID string `json:"callingstationid,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Failure int `json:"failure,omitempty"` IPAddress string `json:"ipaddress,omitempty"` @@ -276,10 +285,10 @@ type AuthenticationRADIUSAction struct { } type AuthenticationAzureKeyVault struct { + Count float64 `json:"__count,omitempty"` Authentication string `json:"authentication,omitempty"` ClientID string `json:"clientid,omitempty"` ClientSecret string `json:"clientsecret,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Name string `json:"name,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` @@ -307,14 +316,15 @@ type AuthenticationEmailAction struct { } type AuthenticationVServerTMSessionPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationTACACSPolicy struct { @@ -326,17 +336,18 @@ type AuthenticationTACACSPolicy struct { } type AuthenticationLDAPPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationNegotiatePolicyBinding struct { - AuthenticationNegotiatePolicyAuthenticationVServerBinding []interface{} `json:"authenticationnegotiatepolicy_authenticationvserver_binding,omitempty"` - AuthenticationNegotiatePolicyVPNGlobalBinding []interface{} `json:"authenticationnegotiatepolicy_vpnglobal_binding,omitempty"` - AuthenticationNegotiatePolicyVPNVServerBinding []interface{} `json:"authenticationnegotiatepolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationNegotiatePolicyAuthenticationVServerBinding []any `json:"authenticationnegotiatepolicy_authenticationvserver_binding,omitempty"` + AuthenticationNegotiatePolicyVPNGlobalBinding []any `json:"authenticationnegotiatepolicy_vpnglobal_binding,omitempty"` + AuthenticationNegotiatePolicyVPNVServerBinding []any `json:"authenticationnegotiatepolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationSmartAccessPolicyAuthenticationVServerBinding struct { @@ -347,23 +358,26 @@ type AuthenticationSmartAccessPolicyAuthenticationVServerBinding struct { } type AuthenticationLoginSchemaPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - LabelName string `json:"labelname,omitempty"` - LabelType string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationNegotiatePolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSAMLAction struct { + Count float64 `json:"__count,omitempty"` ArtifactResolutionServiceURL string `json:"artifactresolutionserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` @@ -385,7 +399,6 @@ type AuthenticationSAMLAction struct { Attributes string `json:"attributes,omitempty"` Audience string `json:"audience,omitempty"` AuthnCtxClassRef []string `json:"authnctxclassref,omitempty"` - Count float64 `json:"__count,omitempty"` CustomAuthnCtxClassRef string `json:"customauthnctxclassref,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` DigestMethod string `json:"digestmethod,omitempty"` @@ -419,23 +432,25 @@ type AuthenticationSAMLAction struct { } type AuthenticationVServerVPNPortalThemeBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - PortalTheme string `json:"portaltheme,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } type AuthenticationLocalPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationLoginSchemaPolicy struct { + Count float64 `json:"__count,omitempty"` Action string `json:"action,omitempty"` Builtin []string `json:"builtin,omitempty"` Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Hits int `json:"hits,omitempty"` LogAction string `json:"logaction,omitempty"` @@ -448,9 +463,9 @@ type AuthenticationLoginSchemaPolicy struct { } type AuthenticationLoginSchemaPolicyBinding struct { - AuthenticationLoginSchemaPolicyAuthenticationVServerBinding []interface{} `json:"authenticationloginschemapolicy_authenticationvserver_binding,omitempty"` - AuthenticationLoginSchemaPolicyVPNVServerBinding []interface{} `json:"authenticationloginschemapolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationLoginSchemaPolicyAuthenticationVServerBinding []any `json:"authenticationloginschemapolicy_authenticationvserver_binding,omitempty"` + AuthenticationLoginSchemaPolicyVPNVServerBinding []any `json:"authenticationloginschemapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationProtectedUserAction struct { @@ -462,22 +477,25 @@ type AuthenticationProtectedUserAction struct { } type AuthenticationPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSAMLPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationTACACSAction struct { + Count float64 `json:"__count,omitempty"` Accounting string `json:"accounting,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` @@ -499,7 +517,6 @@ type AuthenticationTACACSAction struct { AuditFailedCmds string `json:"auditfailedcmds,omitempty"` Authorization string `json:"authorization,omitempty"` AuthTimeout int `json:"authtimeout,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Failure int `json:"failure,omitempty"` GroupAttrName string `json:"groupattrname,omitempty"` @@ -512,65 +529,72 @@ type AuthenticationTACACSAction struct { } type AuthenticationCertPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuthenticationLoginSchemaPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationSAMLIDPPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationNegotiatePolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSAMLPolicyBinding struct { - AuthenticationSAMLPolicyAuthenticationVServerBinding []interface{} `json:"authenticationsamlpolicy_authenticationvserver_binding,omitempty"` - AuthenticationSAMLPolicyVPNGlobalBinding []interface{} `json:"authenticationsamlpolicy_vpnglobal_binding,omitempty"` - AuthenticationSAMLPolicyVPNVServerBinding []interface{} `json:"authenticationsamlpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationSAMLPolicyAuthenticationVServerBinding []any `json:"authenticationsamlpolicy_authenticationvserver_binding,omitempty"` + AuthenticationSAMLPolicyVPNGlobalBinding []any `json:"authenticationsamlpolicy_vpnglobal_binding,omitempty"` + AuthenticationSAMLPolicyVPNVServerBinding []any `json:"authenticationsamlpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationVServerAuthenticationLocalPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationRADIUSPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServer struct { + Count float64 `json:"__count,omitempty"` AppFlowLog string `json:"appflowlog,omitempty"` Authentication string `json:"authentication,omitempty"` AuthenticationDomain string `json:"authenticationdomain,omitempty"` @@ -581,7 +605,6 @@ type AuthenticationVServer struct { CertKeyNames string `json:"certkeynames,omitempty"` CltTimeout int `json:"clttimeout,omitempty"` Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` CurAAAUsers int `json:"curaaausers,omitempty"` CurState string `json:"curstate,omitempty"` DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` @@ -633,25 +656,27 @@ type AuthenticationNoAuthAction struct { } type AuthenticationNegotiatePolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationSAMLPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationAuthNProfile struct { + Count float64 `json:"__count,omitempty"` AuthenticationDomain string `json:"authenticationdomain,omitempty"` AuthenticationHost string `json:"authenticationhost,omitempty"` AuthenticationLevel int `json:"authenticationlevel,omitempty"` AuthNVSName string `json:"authnvsname,omitempty"` - Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } @@ -668,19 +693,19 @@ type AuthenticationCaptchaAction struct { } type AuthenticationRADIUSPolicyBinding struct { - AuthenticationRADIUSPolicyAuthenticationVServerBinding []interface{} `json:"authenticationradiuspolicy_authenticationvserver_binding,omitempty"` - AuthenticationRADIUSPolicySystemGlobalBinding []interface{} `json:"authenticationradiuspolicy_systemglobal_binding,omitempty"` - AuthenticationRADIUSPolicyVPNGlobalBinding []interface{} `json:"authenticationradiuspolicy_vpnglobal_binding,omitempty"` - AuthenticationRADIUSPolicyVPNVServerBinding []interface{} `json:"authenticationradiuspolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationRADIUSPolicyAuthenticationVServerBinding []any `json:"authenticationradiuspolicy_authenticationvserver_binding,omitempty"` + AuthenticationRADIUSPolicySystemGlobalBinding []any `json:"authenticationradiuspolicy_systemglobal_binding,omitempty"` + AuthenticationRADIUSPolicyVPNGlobalBinding []any `json:"authenticationradiuspolicy_vpnglobal_binding,omitempty"` + AuthenticationRADIUSPolicyVPNVServerBinding []any `json:"authenticationradiuspolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationTACACSPolicyBinding struct { - AuthenticationTACACSPolicyAuthenticationVServerBinding []interface{} `json:"authenticationtacacspolicy_authenticationvserver_binding,omitempty"` - AuthenticationTACACSPolicySystemGlobalBinding []interface{} `json:"authenticationtacacspolicy_systemglobal_binding,omitempty"` - AuthenticationTACACSPolicyVPNGlobalBinding []interface{} `json:"authenticationtacacspolicy_vpnglobal_binding,omitempty"` - AuthenticationTACACSPolicyVPNVServerBinding []interface{} `json:"authenticationtacacspolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationTACACSPolicyAuthenticationVServerBinding []any `json:"authenticationtacacspolicy_authenticationvserver_binding,omitempty"` + AuthenticationTACACSPolicySystemGlobalBinding []any `json:"authenticationtacacspolicy_systemglobal_binding,omitempty"` + AuthenticationTACACSPolicyVPNGlobalBinding []any `json:"authenticationtacacspolicy_vpnglobal_binding,omitempty"` + AuthenticationTACACSPolicyVPNVServerBinding []any `json:"authenticationtacacspolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationSAMLPolicy struct { @@ -692,17 +717,19 @@ type AuthenticationSAMLPolicy struct { } type AuthenticationLDAPPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationWebAuthPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationLocalPolicy struct { @@ -714,58 +741,64 @@ type AuthenticationLocalPolicy struct { } type AuthenticationVServerAuthenticationRADIUSPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationLoginSchemaPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - LabelName string `json:"labelname,omitempty"` - LabelType string `json:"labeltype,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + LabelType string `json:"labeltype,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationLocalPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuthenticationSAMLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationSAMLIDPPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationOAuthIDPPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationCitrixAuthAction struct { @@ -777,20 +810,21 @@ type AuthenticationCitrixAuthAction struct { } type AuthenticationVServerAuthenticationCertPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationPolicyLabelBinding struct { - AuthenticationPolicyLabelAuthenticationPolicyBinding []interface{} `json:"authenticationpolicylabel_authenticationpolicy_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + AuthenticationPolicyLabelAuthenticationPolicyBinding []any `json:"authenticationpolicylabel_authenticationpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type AuthenticationDFAPolicy struct { @@ -802,38 +836,41 @@ type AuthenticationDFAPolicy struct { } type AuthenticationTACACSPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationRADIUSPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuthenticationLDAPPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationOAuthIDPProfile struct { + Count float64 `json:"__count,omitempty"` Attributes string `json:"attributes,omitempty"` Audience string `json:"audience,omitempty"` ClientID string `json:"clientid,omitempty"` ClientSecret string `json:"clientsecret,omitempty"` ConfigService string `json:"configservice,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` EncryptToken string `json:"encrypttoken,omitempty"` Issuer string `json:"issuer,omitempty"` @@ -850,10 +887,11 @@ type AuthenticationOAuthIDPProfile struct { } type AuthenticationTACACSPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationEPAAction struct { @@ -869,24 +907,26 @@ type AuthenticationEPAAction struct { } type AuthenticationPolicyBinding struct { - AuthenticationPolicyAuthenticationPolicyLabelBinding []interface{} `json:"authenticationpolicy_authenticationpolicylabel_binding,omitempty"` - AuthenticationPolicyAuthenticationVServerBinding []interface{} `json:"authenticationpolicy_authenticationvserver_binding,omitempty"` - AuthenticationPolicySystemGlobalBinding []interface{} `json:"authenticationpolicy_systemglobal_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationPolicyAuthenticationPolicyLabelBinding []any `json:"authenticationpolicy_authenticationpolicylabel_binding,omitempty"` + AuthenticationPolicyAuthenticationVServerBinding []any `json:"authenticationpolicy_authenticationvserver_binding,omitempty"` + AuthenticationPolicySystemGlobalBinding []any `json:"authenticationpolicy_systemglobal_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationCertPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationDFAPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationWebAuthAction struct { @@ -943,15 +983,16 @@ type AuthenticationRADIUSPolicy struct { } type AuthenticationVServerAuthenticationOAuthIDPPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationVServerRewritePolicyBinding struct { @@ -978,73 +1019,80 @@ type AuthenticationDFAAction struct { } type AuthenticationOAuthIDPPolicyBinding struct { - AuthenticationOAuthIDPPolicyAuthenticationVServerBinding []interface{} `json:"authenticationoauthidppolicy_authenticationvserver_binding,omitempty"` - AuthenticationOAuthIDPPolicyVPNVServerBinding []interface{} `json:"authenticationoauthidppolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationOAuthIDPPolicyAuthenticationVServerBinding []any `json:"authenticationoauthidppolicy_authenticationvserver_binding,omitempty"` + AuthenticationOAuthIDPPolicyVPNVServerBinding []any `json:"authenticationoauthidppolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationVServerCachePolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationVServerAuthenticationNegotiatePolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationTACACSPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationTACACSPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuthenticationSAMLIDPPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationVServerAuthenticationTACACSPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationLDAPAction struct { + Count float64 `json:"__count,omitempty"` AlternateEmailAttr string `json:"alternateemailattr,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` @@ -1066,7 +1114,6 @@ type AuthenticationLDAPAction struct { Authentication string `json:"authentication,omitempty"` AuthTimeout int `json:"authtimeout,omitempty"` CloudAttributes string `json:"cloudattributes,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` Email string `json:"email,omitempty"` Failure int `json:"failure,omitempty"` @@ -1107,50 +1154,55 @@ type AuthenticationLDAPAction struct { } type AuthenticationVServerAuthenticationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationCertPolicyBinding struct { - AuthenticationCertPolicyAuthenticationVServerBinding []interface{} `json:"authenticationcertpolicy_authenticationvserver_binding,omitempty"` - AuthenticationCertPolicyVPNGlobalBinding []interface{} `json:"authenticationcertpolicy_vpnglobal_binding,omitempty"` - AuthenticationCertPolicyVPNVServerBinding []interface{} `json:"authenticationcertpolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthenticationCertPolicyAuthenticationVServerBinding []any `json:"authenticationcertpolicy_authenticationvserver_binding,omitempty"` + AuthenticationCertPolicyVPNGlobalBinding []any `json:"authenticationcertpolicy_vpnglobal_binding,omitempty"` + AuthenticationCertPolicyVPNVServerBinding []any `json:"authenticationcertpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthenticationWebAuthPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuditNSLogPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationSAMLPolicyAuthenticationVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationOAuthAction struct { + Count float64 `json:"__count,omitempty"` AllowedAlgorithms []string `json:"allowedalgorithms,omitempty"` Attribute1 string `json:"attribute1,omitempty"` Attribute10 string `json:"attribute10,omitempty"` @@ -1176,7 +1228,6 @@ type AuthenticationOAuthAction struct { CertFilePath string `json:"certfilepath,omitempty"` ClientID string `json:"clientid,omitempty"` ClientSecret string `json:"clientsecret,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` GrantType string `json:"granttype,omitempty"` GraphEndpoint string `json:"graphendpoint,omitempty"` @@ -1217,17 +1268,18 @@ type AuthenticationNegotiateAction struct { } type AuthenticationLDAPPolicySystemGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationLoginSchema struct { + Count float64 `json:"__count,omitempty"` AuthenticationSchema string `json:"authenticationschema,omitempty"` AuthenticationStrength int `json:"authenticationstrength,omitempty"` Builtin []string `json:"builtin,omitempty"` - Count float64 `json:"__count,omitempty"` Feature string `json:"feature,omitempty"` Name string `json:"name,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` @@ -1239,18 +1291,20 @@ type AuthenticationLoginSchema struct { } type AuthenticationPolicyLabelAuthenticationPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - LabelName string `json:"labelname,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + LabelName string `json:"labelname,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationRADIUSPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationCertAction struct { @@ -1275,41 +1329,45 @@ type AuthenticationADFSProxyProfile struct { } type AuthenticationVServerResponderPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationVServerCSPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type AuthenticationPolicyAuthenticationPolicyLabelBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - NextFactor string `json:"nextfactor,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + NextFactor string `json:"nextfactor,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationOAuthIDPPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationPolicy struct { @@ -1328,6 +1386,7 @@ type AuthenticationPolicy struct { } type AuthenticationSAMLIDPProfile struct { + Count float64 `json:"__count,omitempty"` ACSURLRule string `json:"acsurlrule,omitempty"` AssertionConsumerServiceURL string `json:"assertionconsumerserviceurl,omitempty"` Attribute1 string `json:"attribute1,omitempty"` @@ -1395,7 +1454,6 @@ type AuthenticationSAMLIDPProfile struct { Attribute9Format string `json:"attribute9format,omitempty"` Attribute9FriendlyName string `json:"attribute9friendlyname,omitempty"` Audience string `json:"audience,omitempty"` - Count float64 `json:"__count,omitempty"` DefaultAuthenticationGroup string `json:"defaultauthenticationgroup,omitempty"` DigestMethod string `json:"digestmethod,omitempty"` EncryptAssertion string `json:"encryptassertion,omitempty"` @@ -1426,10 +1484,11 @@ type AuthenticationSAMLIDPProfile struct { } type AuthenticationLDAPPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type AuthenticationVServerAuthenticationSmartAccessPolicyBinding struct { diff --git a/nitrogo/models/authorization.go b/nitrogo/models/authorization.go index f672f36..dedf2bc 100644 --- a/nitrogo/models/authorization.go +++ b/nitrogo/models/authorization.go @@ -24,12 +24,12 @@ type AuthorizationPolicyCSVServerBinding struct { } type AuthorizationPolicyBinding struct { - AuthorizationPolicyAAAGroupBinding []interface{} `json:"authorizationpolicy_aaagroup_binding,omitempty"` - AuthorizationPolicyAAAUserBinding []interface{} `json:"authorizationpolicy_aaauser_binding,omitempty"` - AuthorizationPolicyAuthorizationPolicyLabelBinding []interface{} `json:"authorizationpolicy_authorizationpolicylabel_binding,omitempty"` - AuthorizationPolicyCSVServerBinding []interface{} `json:"authorizationpolicy_csvserver_binding,omitempty"` - AuthorizationPolicyLBVServerBinding []interface{} `json:"authorizationpolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + AuthorizationPolicyAAAGroupBinding []any `json:"authorizationpolicy_aaagroup_binding,omitempty"` + AuthorizationPolicyAAAUserBinding []any `json:"authorizationpolicy_aaauser_binding,omitempty"` + AuthorizationPolicyAuthorizationPolicyLabelBinding []any `json:"authorizationpolicy_authorizationpolicylabel_binding,omitempty"` + AuthorizationPolicyCSVServerBinding []any `json:"authorizationpolicy_csvserver_binding,omitempty"` + AuthorizationPolicyLBVServerBinding []any `json:"authorizationpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type AuthorizationPolicyLBVServerBinding struct { @@ -79,8 +79,8 @@ type AuthorizationAction struct { } type AuthorizationPolicyLabelBinding struct { - AuthorizationPolicyLabelAuthorizationPolicyBinding []interface{} `json:"authorizationpolicylabel_authorizationpolicy_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + AuthorizationPolicyLabelAuthorizationPolicyBinding []any `json:"authorizationpolicylabel_authorizationpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type AuthorizationPolicyAAAUserBinding struct { diff --git a/nitrogo/models/autoscale.go b/nitrogo/models/autoscale.go index 2bddd5d..c7eb4a7 100644 --- a/nitrogo/models/autoscale.go +++ b/nitrogo/models/autoscale.go @@ -31,8 +31,8 @@ type AutoscalePolicyNSTimerBinding struct { } type AutoscalePolicyBinding struct { - AutoscalePolicyNSTimerBinding []interface{} `json:"autoscalepolicy_nstimer_binding,omitempty"` - Name string `json:"name,omitempty"` + AutoscalePolicyNSTimerBinding []any `json:"autoscalepolicy_nstimer_binding,omitempty"` + Name string `json:"name,omitempty"` } type AutoscalePolicy struct { diff --git a/nitrogo/models/basic.go b/nitrogo/models/basic.go index 87ca68f..291b12e 100644 --- a/nitrogo/models/basic.go +++ b/nitrogo/models/basic.go @@ -108,10 +108,10 @@ type ServiceGroupServiceGroupEntityMonBindingsBinding struct { } type ServiceGroupBinding struct { - ServiceGroupLBMonitorBinding []interface{} `json:"servicegroup_lbmonitor_binding,omitempty"` - ServiceGroupServiceGroupEntityMonBindingsBinding []interface{} `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` - ServiceGroupServiceGroupMemberBinding []interface{} `json:"servicegroup_servicegroupmember_binding,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceGroupLBMonitorBinding []any `json:"servicegroup_lbmonitor_binding,omitempty"` + ServiceGroupServiceGroupEntityMonBindingsBinding []any `json:"servicegroup_servicegroupentitymonbindings_binding,omitempty"` + ServiceGroupServiceGroupMemberBinding []any `json:"servicegroup_servicegroupmember_binding,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } type ServiceGroupLBMonitorBinding struct { @@ -132,8 +132,8 @@ type ServiceGroupLBMonitorBinding struct { } type ServiceBinding struct { - Name string `json:"name,omitempty"` - ServiceLBMonitorBinding []interface{} `json:"service_lbmonitor_binding,omitempty"` + Name string `json:"name,omitempty"` + ServiceLBMonitorBinding []any `json:"service_lbmonitor_binding,omitempty"` } type RADIUSNode struct { @@ -191,31 +191,31 @@ type VServer struct { } type NSTrace struct { - CapDropPkt string `json:"capdroppkt,omitempty"` - CapSSLKeys string `json:"capsslkeys,omitempty"` - DoRuntimeCleanup string `json:"doruntimecleanup,omitempty"` - FileID string `json:"fileid,omitempty"` - FileName string `json:"filename,omitempty"` - FileSize int `json:"filesize,omitempty"` - Filter string `json:"filter,omitempty"` - InMemoryTrace string `json:"inmemorytrace,omitempty"` - Link string `json:"link,omitempty"` - Merge string `json:"merge,omitempty"` - Mode []string `json:"mode,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NF int `json:"nf,omitempty"` - NodeID int `json:"nodeid,omitempty"` - Nodes []interface{} `json:"nodes,omitempty"` - PerNIC string `json:"pernic,omitempty"` - Scope string `json:"scope,omitempty"` - Size int `json:"size,omitempty"` - SkipLocalSSH string `json:"skiplocalssh,omitempty"` - SkipRPC string `json:"skiprpc,omitempty"` - State string `json:"state,omitempty"` - Time int `json:"time,omitempty"` - TraceBuffers int `json:"tracebuffers,omitempty"` - TraceFormat string `json:"traceformat,omitempty"` - TraceLocation string `json:"tracelocation,omitempty"` + CapDropPkt string `json:"capdroppkt,omitempty"` + CapSSLKeys string `json:"capsslkeys,omitempty"` + DoRuntimeCleanup string `json:"doruntimecleanup,omitempty"` + FileID string `json:"fileid,omitempty"` + FileName string `json:"filename,omitempty"` + FileSize int `json:"filesize,omitempty"` + Filter string `json:"filter,omitempty"` + InMemoryTrace string `json:"inmemorytrace,omitempty"` + Link string `json:"link,omitempty"` + Merge string `json:"merge,omitempty"` + Mode []string `json:"mode,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NF int `json:"nf,omitempty"` + NodeID int `json:"nodeid,omitempty"` + Nodes []any `json:"nodes,omitempty"` + PerNIC string `json:"pernic,omitempty"` + Scope string `json:"scope,omitempty"` + Size int `json:"size,omitempty"` + SkipLocalSSH string `json:"skiplocalssh,omitempty"` + SkipRPC string `json:"skiprpc,omitempty"` + State string `json:"state,omitempty"` + Time int `json:"time,omitempty"` + TraceBuffers int `json:"tracebuffers,omitempty"` + TraceFormat string `json:"traceformat,omitempty"` + TraceLocation string `json:"tracelocation,omitempty"` } type LocationFile struct { @@ -465,11 +465,11 @@ type ServiceGroup struct { } type ServerBinding struct { - Name string `json:"name,omitempty"` - ServerGSLBServiceBinding []interface{} `json:"server_gslbservice_binding,omitempty"` - ServerGSLBServiceGroupBinding []interface{} `json:"server_gslbservicegroup_binding,omitempty"` - ServerServiceBinding []interface{} `json:"server_service_binding,omitempty"` - ServerServiceGroupBinding []interface{} `json:"server_servicegroup_binding,omitempty"` + Name string `json:"name,omitempty"` + ServerGSLBServiceBinding []any `json:"server_gslbservice_binding,omitempty"` + ServerGSLBServiceGroupBinding []any `json:"server_gslbservicegroup_binding,omitempty"` + ServerServiceBinding []any `json:"server_service_binding,omitempty"` + ServerServiceGroupBinding []any `json:"server_servicegroup_binding,omitempty"` } type ServiceLBMonitorBinding struct { @@ -496,9 +496,9 @@ type ServiceLBMonitorBinding struct { } type ServiceGroupServiceGroupMemberListBinding struct { - FailedMembers []interface{} `json:"failedmembers,omitempty"` - Members []interface{} `json:"members,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` + FailedMembers []any `json:"failedmembers,omitempty"` + Members []any `json:"members,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } type Server struct { @@ -546,3 +546,7 @@ type Location struct { Q5Label string `json:"q5label,omitempty"` Q6Label string `json:"q6label,omitempty"` } + +type Reporting struct { + State string `json:"state,omitempty"` +} diff --git a/nitrogo/models/bot.go b/nitrogo/models/bot.go index 7248313..d4ac51f 100644 --- a/nitrogo/models/bot.go +++ b/nitrogo/models/bot.go @@ -107,9 +107,9 @@ type BotSettings struct { } type BotPolicyLabelBinding struct { - BotPolicyLabelBotPolicyBinding []interface{} `json:"botpolicylabel_botpolicy_binding,omitempty"` - BotPolicyLabelPolicyBindingBinding []interface{} `json:"botpolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + BotPolicyLabelBotPolicyBinding []any `json:"botpolicylabel_botpolicy_binding,omitempty"` + BotPolicyLabelPolicyBindingBinding []any `json:"botpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type BotGlobalBotPolicyBinding struct { @@ -126,11 +126,11 @@ type BotGlobalBotPolicyBinding struct { } type BotPolicyBinding struct { - BotPolicyBotGlobalBinding []interface{} `json:"botpolicy_botglobal_binding,omitempty"` - BotPolicyBotPolicyLabelBinding []interface{} `json:"botpolicy_botpolicylabel_binding,omitempty"` - BotPolicyCSVServerBinding []interface{} `json:"botpolicy_csvserver_binding,omitempty"` - BotPolicyLBVServerBinding []interface{} `json:"botpolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + BotPolicyBotGlobalBinding []any `json:"botpolicy_botglobal_binding,omitempty"` + BotPolicyBotPolicyLabelBinding []any `json:"botpolicy_botpolicylabel_binding,omitempty"` + BotPolicyCSVServerBinding []any `json:"botpolicy_csvserver_binding,omitempty"` + BotPolicyLBVServerBinding []any `json:"botpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type BotProfileTrapInsertionURLBinding struct { @@ -143,16 +143,16 @@ type BotProfileTrapInsertionURLBinding struct { } type BotProfileBinding struct { - BotProfileBlacklistBinding []interface{} `json:"botprofile_blacklist_binding,omitempty"` - BotProfileCaptchaBinding []interface{} `json:"botprofile_captcha_binding,omitempty"` - BotProfileIPReputationBinding []interface{} `json:"botprofile_ipreputation_binding,omitempty"` - BotProfileKMDetectionExprBinding []interface{} `json:"botprofile_kmdetectionexpr_binding,omitempty"` - BotProfileLogExpressionBinding []interface{} `json:"botprofile_logexpression_binding,omitempty"` - BotProfileRateLimitBinding []interface{} `json:"botprofile_ratelimit_binding,omitempty"` - BotProfileTPSBinding []interface{} `json:"botprofile_tps_binding,omitempty"` - BotProfileTrapInsertionURLBinding []interface{} `json:"botprofile_trapinsertionurl_binding,omitempty"` - BotProfileWhitelistBinding []interface{} `json:"botprofile_whitelist_binding,omitempty"` - Name string `json:"name,omitempty"` + BotProfileBlacklistBinding []any `json:"botprofile_blacklist_binding,omitempty"` + BotProfileCaptchaBinding []any `json:"botprofile_captcha_binding,omitempty"` + BotProfileIPReputationBinding []any `json:"botprofile_ipreputation_binding,omitempty"` + BotProfileKMDetectionExprBinding []any `json:"botprofile_kmdetectionexpr_binding,omitempty"` + BotProfileLogExpressionBinding []any `json:"botprofile_logexpression_binding,omitempty"` + BotProfileRateLimitBinding []any `json:"botprofile_ratelimit_binding,omitempty"` + BotProfileTPSBinding []any `json:"botprofile_tps_binding,omitempty"` + BotProfileTrapInsertionURLBinding []any `json:"botprofile_trapinsertionurl_binding,omitempty"` + BotProfileWhitelistBinding []any `json:"botprofile_whitelist_binding,omitempty"` + Name string `json:"name,omitempty"` } type BotPolicy struct { @@ -193,7 +193,7 @@ type BotProfileWhitelistBinding struct { } type BotGlobalBinding struct { - BotGlobalBotPolicyBinding []interface{} `json:"botglobal_botpolicy_binding,omitempty"` + BotGlobalBotPolicyBinding []any `json:"botglobal_botpolicy_binding,omitempty"` } type BotProfileLogExpressionBinding struct { diff --git a/nitrogo/models/cache.go b/nitrogo/models/cache.go index a7bf0fa..9ad9227 100644 --- a/nitrogo/models/cache.go +++ b/nitrogo/models/cache.go @@ -12,7 +12,7 @@ type CachePolicyCSVServerBinding struct { } type CacheGlobalBinding struct { - CacheGlobalCachePolicyBinding []interface{} `json:"cacheglobal_cachepolicy_binding,omitempty"` + CacheGlobalCachePolicyBinding []any `json:"cacheglobal_cachepolicy_binding,omitempty"` } type CachePolicyCachePolicyLabelBinding struct { @@ -92,11 +92,11 @@ type CachePolicyLabelPolicyBindingBinding struct { } type CachePolicyBinding struct { - CachePolicyCacheGlobalBinding []interface{} `json:"cachepolicy_cacheglobal_binding,omitempty"` - CachePolicyCachePolicyLabelBinding []interface{} `json:"cachepolicy_cachepolicylabel_binding,omitempty"` - CachePolicyCSVServerBinding []interface{} `json:"cachepolicy_csvserver_binding,omitempty"` - CachePolicyLBVServerBinding []interface{} `json:"cachepolicy_lbvserver_binding,omitempty"` - PolicyName string `json:"policyname,omitempty"` + CachePolicyCacheGlobalBinding []any `json:"cachepolicy_cacheglobal_binding,omitempty"` + CachePolicyCachePolicyLabelBinding []any `json:"cachepolicy_cachepolicylabel_binding,omitempty"` + CachePolicyCSVServerBinding []any `json:"cachepolicy_csvserver_binding,omitempty"` + CachePolicyLBVServerBinding []any `json:"cachepolicy_lbvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } type CacheSelector struct { @@ -218,9 +218,9 @@ type CacheObject struct { } type CachePolicyLabelBinding struct { - CachePolicyLabelCachePolicyBinding []interface{} `json:"cachepolicylabel_cachepolicy_binding,omitempty"` - CachePolicyLabelPolicyBindingBinding []interface{} `json:"cachepolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + CachePolicyLabelCachePolicyBinding []any `json:"cachepolicylabel_cachepolicy_binding,omitempty"` + CachePolicyLabelPolicyBindingBinding []any `json:"cachepolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type CachePolicyLabelCachePolicyBinding struct { diff --git a/nitrogo/models/cluster.go b/nitrogo/models/cluster.go index e51a1e8..8f9d343 100644 --- a/nitrogo/models/cluster.go +++ b/nitrogo/models/cluster.go @@ -2,45 +2,45 @@ package models // cluster configuration structs type ClusterNodeBinding struct { - ClusterNodeRouteMonitorBinding []interface{} `json:"clusternode_routemonitor_binding,omitempty"` - NodeID int `json:"nodeid,omitempty"` + ClusterNodeRouteMonitorBinding []any `json:"clusternode_routemonitor_binding,omitempty"` + NodeID int `json:"nodeid,omitempty"` } type ClusterNode struct { - Backplane string `json:"backplane,omitempty"` - CfgFlags int `json:"cfgflags,omitempty"` - ClearNodeGroupConfig string `json:"clearnodegroupconfig,omitempty"` - ClusterHealth string `json:"clusterhealth,omitempty"` - Count float64 `json:"__count,omitempty"` - Delay int `json:"delay,omitempty"` - DisabledIfaces string `json:"disabledifaces,omitempty"` - EffectiveState string `json:"effectivestate,omitempty"` - EnabledIfaces string `json:"enabledifaces,omitempty"` - Force bool `json:"force,omitempty"` - HAMonIfaces string `json:"hamonifaces,omitempty"` - Health string `json:"health,omitempty"` - IfacesList []string `json:"ifaceslist,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - IsConfigurationCoordinator bool `json:"isconfigurationcoordinator,omitempty"` - IsLocalNode bool `json:"islocalnode,omitempty"` - MasterState string `json:"masterstate,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NodeGroup string `json:"nodegroup,omitempty"` - NodeID int `json:"nodeid,omitempty"` - NodeJumboNotSupported bool `json:"nodejumbonotsupported,omitempty"` - NodeLicenseMismatch bool `json:"nodelicensemismatch,omitempty"` - NodeList []interface{} `json:"nodelist,omitempty"` - NodeRSSKeyMismatch bool `json:"nodersskeymismatch,omitempty"` - OperationalSyncState string `json:"operationalsyncstate,omitempty"` - PartialFailIfaces string `json:"partialfailifaces,omitempty"` - Priority int `json:"priority,omitempty"` - RouteMonitor string `json:"routemonitor,omitempty"` - State string `json:"state,omitempty"` - SyncFailureReason string `json:"syncfailurereason,omitempty"` - SyncState string `json:"syncstate,omitempty"` - TunnelMode string `json:"tunnelmode,omitempty"` + Backplane string `json:"backplane,omitempty"` + CfgFlags int `json:"cfgflags,omitempty"` + ClearNodeGroupConfig string `json:"clearnodegroupconfig,omitempty"` + ClusterHealth string `json:"clusterhealth,omitempty"` + Count float64 `json:"__count,omitempty"` + Delay int `json:"delay,omitempty"` + DisabledIfaces string `json:"disabledifaces,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + EnabledIfaces string `json:"enabledifaces,omitempty"` + Force bool `json:"force,omitempty"` + HAMonIfaces string `json:"hamonifaces,omitempty"` + Health string `json:"health,omitempty"` + IfacesList []string `json:"ifaceslist,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + IsConfigurationCoordinator bool `json:"isconfigurationcoordinator,omitempty"` + IsLocalNode bool `json:"islocalnode,omitempty"` + MasterState string `json:"masterstate,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeGroup string `json:"nodegroup,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NodeJumboNotSupported bool `json:"nodejumbonotsupported,omitempty"` + NodeLicenseMismatch bool `json:"nodelicensemismatch,omitempty"` + NodeList []any `json:"nodelist,omitempty"` + NodeRSSKeyMismatch bool `json:"nodersskeymismatch,omitempty"` + OperationalSyncState string `json:"operationalsyncstate,omitempty"` + PartialFailIfaces string `json:"partialfailifaces,omitempty"` + Priority int `json:"priority,omitempty"` + RouteMonitor string `json:"routemonitor,omitempty"` + State string `json:"state,omitempty"` + SyncFailureReason string `json:"syncfailurereason,omitempty"` + SyncState string `json:"syncstate,omitempty"` + TunnelMode string `json:"tunnelmode,omitempty"` } type ClusterNodeGroupStreamIdentifierBinding struct { @@ -104,18 +104,18 @@ type ClusterNodeGroupGSLBVServerBinding struct { } type ClusterNodeGroupBinding struct { - ClusterNodeGroupAuthenticationVServerBinding []interface{} `json:"clusternodegroup_authenticationvserver_binding,omitempty"` - ClusterNodeGroupClusterNodeBinding []interface{} `json:"clusternodegroup_clusternode_binding,omitempty"` - ClusterNodeGroupCRVServerBinding []interface{} `json:"clusternodegroup_crvserver_binding,omitempty"` - ClusterNodeGroupCSVServerBinding []interface{} `json:"clusternodegroup_csvserver_binding,omitempty"` - ClusterNodeGroupGSLBSiteBinding []interface{} `json:"clusternodegroup_gslbsite_binding,omitempty"` - ClusterNodeGroupGSLBVServerBinding []interface{} `json:"clusternodegroup_gslbvserver_binding,omitempty"` - ClusterNodeGroupLBVServerBinding []interface{} `json:"clusternodegroup_lbvserver_binding,omitempty"` - ClusterNodeGroupNSLimitIdentifierBinding []interface{} `json:"clusternodegroup_nslimitidentifier_binding,omitempty"` - ClusterNodeGroupServiceBinding []interface{} `json:"clusternodegroup_service_binding,omitempty"` - ClusterNodeGroupStreamIdentifierBinding []interface{} `json:"clusternodegroup_streamidentifier_binding,omitempty"` - ClusterNodeGroupVPNVServerBinding []interface{} `json:"clusternodegroup_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + ClusterNodeGroupAuthenticationVServerBinding []any `json:"clusternodegroup_authenticationvserver_binding,omitempty"` + ClusterNodeGroupClusterNodeBinding []any `json:"clusternodegroup_clusternode_binding,omitempty"` + ClusterNodeGroupCRVServerBinding []any `json:"clusternodegroup_crvserver_binding,omitempty"` + ClusterNodeGroupCSVServerBinding []any `json:"clusternodegroup_csvserver_binding,omitempty"` + ClusterNodeGroupGSLBSiteBinding []any `json:"clusternodegroup_gslbsite_binding,omitempty"` + ClusterNodeGroupGSLBVServerBinding []any `json:"clusternodegroup_gslbvserver_binding,omitempty"` + ClusterNodeGroupLBVServerBinding []any `json:"clusternodegroup_lbvserver_binding,omitempty"` + ClusterNodeGroupNSLimitIdentifierBinding []any `json:"clusternodegroup_nslimitidentifier_binding,omitempty"` + ClusterNodeGroupServiceBinding []any `json:"clusternodegroup_service_binding,omitempty"` + ClusterNodeGroupStreamIdentifierBinding []any `json:"clusternodegroup_streamidentifier_binding,omitempty"` + ClusterNodeGroupVPNVServerBinding []any `json:"clusternodegroup_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type ClusterNodeGroupAuthenticationVServerBinding struct { @@ -152,18 +152,18 @@ type ClusterNodeGroupServiceBinding struct { } type ClusterNodeGroup struct { - ActiveList []interface{} `json:"activelist,omitempty"` - BackupList []interface{} `json:"backuplist,omitempty"` - BackupNodeMask int `json:"backupnodemask,omitempty"` - BoundedEntitiesCntFromPE int `json:"boundedentitiescntfrompe,omitempty"` - Count float64 `json:"__count,omitempty"` - CurrentNodeMask int `json:"currentnodemask,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Priority int `json:"priority,omitempty"` - State string `json:"state,omitempty"` - Sticky string `json:"sticky,omitempty"` - Strict string `json:"strict,omitempty"` + ActiveList []any `json:"activelist,omitempty"` + BackupList []any `json:"backuplist,omitempty"` + BackupNodeMask int `json:"backupnodemask,omitempty"` + BoundedEntitiesCntFromPE int `json:"boundedentitiescntfrompe,omitempty"` + Count float64 `json:"__count,omitempty"` + CurrentNodeMask int `json:"currentnodemask,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Priority int `json:"priority,omitempty"` + State string `json:"state,omitempty"` + Sticky string `json:"sticky,omitempty"` + Strict string `json:"strict,omitempty"` } type ClusterNodeGroupClusterNodeBinding struct { @@ -184,8 +184,8 @@ type ClusterPropStatus struct { } type ClusterInstanceBinding struct { - CLID int `json:"clid,omitempty"` - ClusterInstanceClusterNodeBinding []interface{} `json:"clusterinstance_clusternode_binding,omitempty"` + CLID int `json:"clid,omitempty"` + ClusterInstanceClusterNodeBinding []any `json:"clusterinstance_clusternode_binding,omitempty"` } type ClusterFiles struct { diff --git a/nitrogo/models/cmp.go b/nitrogo/models/cmp.go index 7b04155..9b18d9d 100644 --- a/nitrogo/models/cmp.go +++ b/nitrogo/models/cmp.go @@ -24,16 +24,16 @@ type CMPParameter struct { } type CMPGlobalBinding struct { - CMPGlobalCMPPolicyBinding []interface{} `json:"cmpglobal_cmppolicy_binding,omitempty"` + CMPGlobalCMPPolicyBinding []any `json:"cmpglobal_cmppolicy_binding,omitempty"` } type CMPPolicyBinding struct { - CMPPolicyCMPGlobalBinding []interface{} `json:"cmppolicy_cmpglobal_binding,omitempty"` - CMPPolicyCMPPolicyLabelBinding []interface{} `json:"cmppolicy_cmppolicylabel_binding,omitempty"` - CMPPolicyCRVServerBinding []interface{} `json:"cmppolicy_crvserver_binding,omitempty"` - CMPPolicyCSVServerBinding []interface{} `json:"cmppolicy_csvserver_binding,omitempty"` - CMPPolicyLBVServerBinding []interface{} `json:"cmppolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + CMPPolicyCMPGlobalBinding []any `json:"cmppolicy_cmpglobal_binding,omitempty"` + CMPPolicyCMPPolicyLabelBinding []any `json:"cmppolicy_cmppolicylabel_binding,omitempty"` + CMPPolicyCRVServerBinding []any `json:"cmppolicy_crvserver_binding,omitempty"` + CMPPolicyCSVServerBinding []any `json:"cmppolicy_csvserver_binding,omitempty"` + CMPPolicyLBVServerBinding []any `json:"cmppolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type CMPPolicyLabelPolicyBindingBinding struct { @@ -167,7 +167,7 @@ type CMPPolicyCSVServerBinding struct { } type CMPPolicyLabelBinding struct { - CMPPolicyLabelCMPPolicyBinding []interface{} `json:"cmppolicylabel_cmppolicy_binding,omitempty"` - CMPPolicyLabelPolicyBindingBinding []interface{} `json:"cmppolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + CMPPolicyLabelCMPPolicyBinding []any `json:"cmppolicylabel_cmppolicy_binding,omitempty"` + CMPPolicyLabelPolicyBindingBinding []any `json:"cmppolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } diff --git a/nitrogo/models/contentinspection.go b/nitrogo/models/contentinspection.go index 916032a..a75fb09 100644 --- a/nitrogo/models/contentinspection.go +++ b/nitrogo/models/contentinspection.go @@ -108,9 +108,9 @@ type ContentInspectionParameter struct { } type ContentInspectionPolicyLabelBinding struct { - ContentInspectionPolicyLabelContentInspectionPolicyBinding []interface{} `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding,omitempty"` - ContentInspectionPolicyLabelPolicyBindingBinding []interface{} `json:"contentinspectionpolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + ContentInspectionPolicyLabelContentInspectionPolicyBinding []any `json:"contentinspectionpolicylabel_contentinspectionpolicy_binding,omitempty"` + ContentInspectionPolicyLabelPolicyBindingBinding []any `json:"contentinspectionpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type ContentInspectionAction struct { @@ -144,7 +144,7 @@ type ContentInspectionPolicyLBVServerBinding struct { } type ContentInspectionGlobalBinding struct { - ContentInspectionGlobalContentInspectionPolicyBinding []interface{} `json:"contentinspectionglobal_contentinspectionpolicy_binding,omitempty"` + ContentInspectionGlobalContentInspectionPolicyBinding []any `json:"contentinspectionglobal_contentinspectionpolicy_binding,omitempty"` } type ContentInspectionPolicyContentInspectionPolicyLabelBinding struct { @@ -158,11 +158,11 @@ type ContentInspectionPolicyContentInspectionPolicyLabelBinding struct { } type ContentInspectionPolicyBinding struct { - ContentInspectionPolicyContentInspectionGlobalBinding []interface{} `json:"contentinspectionpolicy_contentinspectionglobal_binding,omitempty"` - ContentInspectionPolicyContentInspectionPolicyLabelBinding []interface{} `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding,omitempty"` - ContentInspectionPolicyCSVServerBinding []interface{} `json:"contentinspectionpolicy_csvserver_binding,omitempty"` - ContentInspectionPolicyLBVServerBinding []interface{} `json:"contentinspectionpolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + ContentInspectionPolicyContentInspectionGlobalBinding []any `json:"contentinspectionpolicy_contentinspectionglobal_binding,omitempty"` + ContentInspectionPolicyContentInspectionPolicyLabelBinding []any `json:"contentinspectionpolicy_contentinspectionpolicylabel_binding,omitempty"` + ContentInspectionPolicyCSVServerBinding []any `json:"contentinspectionpolicy_csvserver_binding,omitempty"` + ContentInspectionPolicyLBVServerBinding []any `json:"contentinspectionpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type ContentInspectionPolicyLabelContentInspectionPolicyBinding struct { diff --git a/nitrogo/models/cr.go b/nitrogo/models/cr.go index d85d73b..4ac68c6 100644 --- a/nitrogo/models/cr.go +++ b/nitrogo/models/cr.go @@ -40,8 +40,8 @@ type CRVServerCachePolicyBinding struct { } type CRPolicyBinding struct { - CRPolicyCRVServerBinding []interface{} `json:"crpolicy_crvserver_binding,omitempty"` - PolicyName string `json:"policyname,omitempty"` + CRPolicyCRVServerBinding []any `json:"crpolicy_crvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } type CRVServerCMPPolicyBinding struct { @@ -199,22 +199,22 @@ type CRPolicy struct { } type CRVServerBinding struct { - CRVServerAnalyticsProfileBinding []interface{} `json:"crvserver_analyticsprofile_binding,omitempty"` - CRVServerAppFlowPolicyBinding []interface{} `json:"crvserver_appflowpolicy_binding,omitempty"` - CRVServerAppFWPolicyBinding []interface{} `json:"crvserver_appfwpolicy_binding,omitempty"` - CRVServerAppQOEPolicyBinding []interface{} `json:"crvserver_appqoepolicy_binding,omitempty"` - CRVServerCachePolicyBinding []interface{} `json:"crvserver_cachepolicy_binding,omitempty"` - CRVServerCMPPolicyBinding []interface{} `json:"crvserver_cmppolicy_binding,omitempty"` - CRVServerCRPolicyBinding []interface{} `json:"crvserver_crpolicy_binding,omitempty"` - CRVServerCSPolicyBinding []interface{} `json:"crvserver_cspolicy_binding,omitempty"` - CRVServerFEOPolicyBinding []interface{} `json:"crvserver_feopolicy_binding,omitempty"` - CRVServerICAPolicyBinding []interface{} `json:"crvserver_icapolicy_binding,omitempty"` - CRVServerLBVServerBinding []interface{} `json:"crvserver_lbvserver_binding,omitempty"` - CRVServerPolicyMapBinding []interface{} `json:"crvserver_policymap_binding,omitempty"` - CRVServerResponderPolicyBinding []interface{} `json:"crvserver_responderpolicy_binding,omitempty"` - CRVServerRewritePolicyBinding []interface{} `json:"crvserver_rewritepolicy_binding,omitempty"` - CRVServerSpilloverPolicyBinding []interface{} `json:"crvserver_spilloverpolicy_binding,omitempty"` - Name string `json:"name,omitempty"` + CRVServerAnalyticsProfileBinding []any `json:"crvserver_analyticsprofile_binding,omitempty"` + CRVServerAppFlowPolicyBinding []any `json:"crvserver_appflowpolicy_binding,omitempty"` + CRVServerAppFWPolicyBinding []any `json:"crvserver_appfwpolicy_binding,omitempty"` + CRVServerAppQOEPolicyBinding []any `json:"crvserver_appqoepolicy_binding,omitempty"` + CRVServerCachePolicyBinding []any `json:"crvserver_cachepolicy_binding,omitempty"` + CRVServerCMPPolicyBinding []any `json:"crvserver_cmppolicy_binding,omitempty"` + CRVServerCRPolicyBinding []any `json:"crvserver_crpolicy_binding,omitempty"` + CRVServerCSPolicyBinding []any `json:"crvserver_cspolicy_binding,omitempty"` + CRVServerFEOPolicyBinding []any `json:"crvserver_feopolicy_binding,omitempty"` + CRVServerICAPolicyBinding []any `json:"crvserver_icapolicy_binding,omitempty"` + CRVServerLBVServerBinding []any `json:"crvserver_lbvserver_binding,omitempty"` + CRVServerPolicyMapBinding []any `json:"crvserver_policymap_binding,omitempty"` + CRVServerResponderPolicyBinding []any `json:"crvserver_responderpolicy_binding,omitempty"` + CRVServerRewritePolicyBinding []any `json:"crvserver_rewritepolicy_binding,omitempty"` + CRVServerSpilloverPolicyBinding []any `json:"crvserver_spilloverpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` } type CRVServer struct { diff --git a/nitrogo/models/cs.go b/nitrogo/models/cs.go index 0daa9f4..cf9561b 100644 --- a/nitrogo/models/cs.go +++ b/nitrogo/models/cs.go @@ -79,29 +79,29 @@ type CSPolicy struct { } type CSVServerBinding struct { - CSVServerAnalyticsProfileBinding []interface{} `json:"csvserver_analyticsprofile_binding,omitempty"` - CSVServerAppFlowPolicyBinding []interface{} `json:"csvserver_appflowpolicy_binding,omitempty"` - CSVServerAppFWPolicyBinding []interface{} `json:"csvserver_appfwpolicy_binding,omitempty"` - CSVServerAppQOEPolicyBinding []interface{} `json:"csvserver_appqoepolicy_binding,omitempty"` - CSVServerAuditNSLogPolicyBinding []interface{} `json:"csvserver_auditnslogpolicy_binding,omitempty"` - CSVServerAuditSyslogPolicyBinding []interface{} `json:"csvserver_auditsyslogpolicy_binding,omitempty"` - CSVServerAuthorizationPolicyBinding []interface{} `json:"csvserver_authorizationpolicy_binding,omitempty"` - CSVServerBotPolicyBinding []interface{} `json:"csvserver_botpolicy_binding,omitempty"` - CSVServerCachePolicyBinding []interface{} `json:"csvserver_cachepolicy_binding,omitempty"` - CSVServerCMPPolicyBinding []interface{} `json:"csvserver_cmppolicy_binding,omitempty"` - CSVServerContentInspectionPolicyBinding []interface{} `json:"csvserver_contentinspectionpolicy_binding,omitempty"` - CSVServerCSPolicyBinding []interface{} `json:"csvserver_cspolicy_binding,omitempty"` - CSVServerFEOPolicyBinding []interface{} `json:"csvserver_feopolicy_binding,omitempty"` - CSVServerGSLBDomainBinding []interface{} `json:"csvserver_gslbdomain_binding,omitempty"` - CSVServerGSLBVServerBinding []interface{} `json:"csvserver_gslbvserver_binding,omitempty"` - CSVServerLBVServerBinding []interface{} `json:"csvserver_lbvserver_binding,omitempty"` - CSVServerResponderPolicyBinding []interface{} `json:"csvserver_responderpolicy_binding,omitempty"` - CSVServerRewritePolicyBinding []interface{} `json:"csvserver_rewritepolicy_binding,omitempty"` - CSVServerSpilloverPolicyBinding []interface{} `json:"csvserver_spilloverpolicy_binding,omitempty"` - CSVServerTMTrafficPolicyBinding []interface{} `json:"csvserver_tmtrafficpolicy_binding,omitempty"` - CSVServerTransformPolicyBinding []interface{} `json:"csvserver_transformpolicy_binding,omitempty"` - CSVServerVPNVServerBinding []interface{} `json:"csvserver_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + CSVServerAnalyticsProfileBinding []any `json:"csvserver_analyticsprofile_binding,omitempty"` + CSVServerAppFlowPolicyBinding []any `json:"csvserver_appflowpolicy_binding,omitempty"` + CSVServerAppFWPolicyBinding []any `json:"csvserver_appfwpolicy_binding,omitempty"` + CSVServerAppQOEPolicyBinding []any `json:"csvserver_appqoepolicy_binding,omitempty"` + CSVServerAuditNSLogPolicyBinding []any `json:"csvserver_auditnslogpolicy_binding,omitempty"` + CSVServerAuditSyslogPolicyBinding []any `json:"csvserver_auditsyslogpolicy_binding,omitempty"` + CSVServerAuthorizationPolicyBinding []any `json:"csvserver_authorizationpolicy_binding,omitempty"` + CSVServerBotPolicyBinding []any `json:"csvserver_botpolicy_binding,omitempty"` + CSVServerCachePolicyBinding []any `json:"csvserver_cachepolicy_binding,omitempty"` + CSVServerCMPPolicyBinding []any `json:"csvserver_cmppolicy_binding,omitempty"` + CSVServerContentInspectionPolicyBinding []any `json:"csvserver_contentinspectionpolicy_binding,omitempty"` + CSVServerCSPolicyBinding []any `json:"csvserver_cspolicy_binding,omitempty"` + CSVServerFEOPolicyBinding []any `json:"csvserver_feopolicy_binding,omitempty"` + CSVServerGSLBDomainBinding []any `json:"csvserver_gslbdomain_binding,omitempty"` + CSVServerGSLBVServerBinding []any `json:"csvserver_gslbvserver_binding,omitempty"` + CSVServerLBVServerBinding []any `json:"csvserver_lbvserver_binding,omitempty"` + CSVServerResponderPolicyBinding []any `json:"csvserver_responderpolicy_binding,omitempty"` + CSVServerRewritePolicyBinding []any `json:"csvserver_rewritepolicy_binding,omitempty"` + CSVServerSpilloverPolicyBinding []any `json:"csvserver_spilloverpolicy_binding,omitempty"` + CSVServerTMTrafficPolicyBinding []any `json:"csvserver_tmtrafficpolicy_binding,omitempty"` + CSVServerTransformPolicyBinding []any `json:"csvserver_transformpolicy_binding,omitempty"` + CSVServerVPNVServerBinding []any `json:"csvserver_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type CSPolicyCSVServerBinding struct { @@ -267,8 +267,8 @@ type CSPolicyCRVServerBinding struct { } type CSPolicyLabelBinding struct { - CSPolicyLabelCSPolicyBinding []interface{} `json:"cspolicylabel_cspolicy_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + CSPolicyLabelCSPolicyBinding []any `json:"cspolicylabel_cspolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type CSVServerContentInspectionPolicyBinding struct { @@ -482,10 +482,10 @@ type CSVServer struct { } type CSPolicyBinding struct { - CSPolicyCRVServerBinding []interface{} `json:"cspolicy_crvserver_binding,omitempty"` - CSPolicyCSPolicyLabelBinding []interface{} `json:"cspolicy_cspolicylabel_binding,omitempty"` - CSPolicyCSVServerBinding []interface{} `json:"cspolicy_csvserver_binding,omitempty"` - PolicyName string `json:"policyname,omitempty"` + CSPolicyCRVServerBinding []any `json:"cspolicy_crvserver_binding,omitempty"` + CSPolicyCSPolicyLabelBinding []any `json:"cspolicy_cspolicylabel_binding,omitempty"` + CSPolicyCSVServerBinding []any `json:"cspolicy_csvserver_binding,omitempty"` + PolicyName string `json:"policyname,omitempty"` } type CSVServerLBVServerBinding struct { diff --git a/nitrogo/models/dns.go b/nitrogo/models/dns.go index 36c8cc1..50612d4 100644 --- a/nitrogo/models/dns.go +++ b/nitrogo/models/dns.go @@ -38,9 +38,9 @@ type DNSZone struct { } type DNSPolicyLabelBinding struct { - DNSPolicyLabelDNSPolicyBinding []interface{} `json:"dnspolicylabel_dnspolicy_binding,omitempty"` - DNSPolicyLabelPolicyBindingBinding []interface{} `json:"dnspolicylabel_policybinding_binding,omitempty"` - LabelName string `json:"labelname,omitempty"` + DNSPolicyLabelDNSPolicyBinding []any `json:"dnspolicylabel_dnspolicy_binding,omitempty"` + DNSPolicyLabelPolicyBindingBinding []any `json:"dnspolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` } type DNSDSFile struct { @@ -90,9 +90,9 @@ type DNSZoneDomainBinding struct { } type DNSZoneBinding struct { - DNSZoneDNSKeyBinding []interface{} `json:"dnszone_dnskey_binding,omitempty"` - DNSZoneGSLBDomainBinding []interface{} `json:"dnszone_gslbdomain_binding,omitempty"` - ZoneName string `json:"zonename,omitempty"` + DNSZoneDNSKeyBinding []any `json:"dnszone_dnskey_binding,omitempty"` + DNSZoneGSLBDomainBinding []any `json:"dnszone_gslbdomain_binding,omitempty"` + ZoneName string `json:"zonename,omitempty"` } type DNSGlobalDNSPolicyBinding struct { @@ -150,9 +150,9 @@ type DNSSrvRec struct { } type DNSViewBinding struct { - DNSViewDNSPolicyBinding []interface{} `json:"dnsview_dnspolicy_binding,omitempty"` - DNSViewGSLBServiceBinding []interface{} `json:"dnsview_gslbservice_binding,omitempty"` - ViewName string `json:"viewname,omitempty"` + DNSViewDNSPolicyBinding []any `json:"dnsview_dnspolicy_binding,omitempty"` + DNSViewGSLBServiceBinding []any `json:"dnsview_gslbservice_binding,omitempty"` + ViewName string `json:"viewname,omitempty"` } type DNSPolicyLabel struct { @@ -235,7 +235,7 @@ type DNSAction struct { } type DNSGlobalBinding struct { - DNSGlobalDNSPolicyBinding []interface{} `json:"dnsglobal_dnspolicy_binding,omitempty"` + DNSGlobalDNSPolicyBinding []any `json:"dnsglobal_dnspolicy_binding,omitempty"` } type DNSSOARec struct { @@ -257,22 +257,22 @@ type DNSSOARec struct { } type DNSPolicy64Binding struct { - DNSPolicy64LBVServerBinding []interface{} `json:"dnspolicy64_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + DNSPolicy64LBVServerBinding []any `json:"dnspolicy64_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type DNSPolicyBinding struct { - DNSPolicyDNSGlobalBinding []interface{} `json:"dnspolicy_dnsglobal_binding,omitempty"` - DNSPolicyDNSPolicyLabelBinding []interface{} `json:"dnspolicy_dnspolicylabel_binding,omitempty"` - Name string `json:"name,omitempty"` + DNSPolicyDNSGlobalBinding []any `json:"dnspolicy_dnsglobal_binding,omitempty"` + DNSPolicyDNSPolicyLabelBinding []any `json:"dnspolicy_dnspolicylabel_binding,omitempty"` + Name string `json:"name,omitempty"` } type DNSZoneDNSKeyBinding struct { - Expires int `json:"expires,omitempty"` - KeyName []string `json:"keyname,omitempty"` - SigInceptionTime []interface{} `json:"siginceptiontime,omitempty"` - Signed int `json:"signed,omitempty"` - ZoneName string `json:"zonename,omitempty"` + Expires int `json:"expires,omitempty"` + KeyName []string `json:"keyname,omitempty"` + SigInceptionTime []any `json:"siginceptiontime,omitempty"` + Signed int `json:"signed,omitempty"` + ZoneName string `json:"zonename,omitempty"` } type DNSPolicy64LBVServerBinding struct { diff --git a/nitrogo/models/feo.go b/nitrogo/models/feo.go index c3e2a7e..cbbe73a 100644 --- a/nitrogo/models/feo.go +++ b/nitrogo/models/feo.go @@ -10,7 +10,7 @@ type FEOPolicyCSVServerBinding struct { } type FEOGlobalBinding struct { - FEOGlobalFEOPolicyBinding []interface{} `json:"feoglobal_feopolicy_binding,omitempty"` + FEOGlobalFEOPolicyBinding []any `json:"feoglobal_feopolicy_binding,omitempty"` } type FEOPolicyFEOGlobalBinding struct { @@ -83,10 +83,10 @@ type FEOAction struct { } type FEOPolicyBinding struct { - FEOPolicyCSVServerBinding []interface{} `json:"feopolicy_csvserver_binding,omitempty"` - FEOPolicyFEOGlobalBinding []interface{} `json:"feopolicy_feoglobal_binding,omitempty"` - FEOPolicyLBVServerBinding []interface{} `json:"feopolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + FEOPolicyCSVServerBinding []any `json:"feopolicy_csvserver_binding,omitempty"` + FEOPolicyFEOGlobalBinding []any `json:"feopolicy_feoglobal_binding,omitempty"` + FEOPolicyLBVServerBinding []any `json:"feopolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type FEOParameter struct { diff --git a/nitrogo/models/gslb.go b/nitrogo/models/gslb.go index d6aab68..41aae49 100644 --- a/nitrogo/models/gslb.go +++ b/nitrogo/models/gslb.go @@ -2,10 +2,10 @@ package models // gslb configuration structs type GSLBServiceGroupBinding struct { - GSLBServiceGroupGSLBServiceGroupMemberBinding []interface{} `json:"gslbservicegroup_gslbservicegroupmember_binding,omitempty"` - GSLBServiceGroupLBMonitorBinding []interface{} `json:"gslbservicegroup_lbmonitor_binding,omitempty"` - GSLBServiceGroupServiceGroupEntityMonBindingsBinding []interface{} `json:"gslbservicegroup_servicegroupentitymonbindings_binding,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` + GSLBServiceGroupGSLBServiceGroupMemberBinding []any `json:"gslbservicegroup_gslbservicegroupmember_binding,omitempty"` + GSLBServiceGroupLBMonitorBinding []any `json:"gslbservicegroup_lbmonitor_binding,omitempty"` + GSLBServiceGroupServiceGroupEntityMonBindingsBinding []any `json:"gslbservicegroup_servicegroupentitymonbindings_binding,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` } type GSLBServiceGroup struct { @@ -65,15 +65,15 @@ type GSLBServiceGroup struct { } type GSLBLDNSEntries struct { - Count float64 `json:"__count,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NodeID int `json:"nodeid,omitempty"` - NumSites int `json:"numsites,omitempty"` - RTT []interface{} `json:"rtt,omitempty"` - SiteName string `json:"sitename,omitempty"` - TTL int `json:"ttl,omitempty"` + Count float64 `json:"__count,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NumSites int `json:"numsites,omitempty"` + RTT []any `json:"rtt,omitempty"` + SiteName string `json:"sitename,omitempty"` + TTL int `json:"ttl,omitempty"` } type GSLBServiceGroupServiceGroupEntityMonBindingsBinding struct { @@ -231,13 +231,13 @@ type GSLBVServerSpilloverPolicyBinding struct { } type GSLBVServerBinding struct { - GSLBVServerGSLBDomainBinding []interface{} `json:"gslbvserver_gslbdomain_binding,omitempty"` - GSLBVServerGSLBServiceBinding []interface{} `json:"gslbvserver_gslbservice_binding,omitempty"` - GSLBVServerGSLBServiceGroupBinding []interface{} `json:"gslbvserver_gslbservicegroup_binding,omitempty"` - GSLBVServerGSLBServiceGroupMemberBinding []interface{} `json:"gslbvserver_gslbservicegroupmember_binding,omitempty"` - GSLBVServerLBPolicyBinding []interface{} `json:"gslbvserver_lbpolicy_binding,omitempty"` - GSLBVServerSpilloverPolicyBinding []interface{} `json:"gslbvserver_spilloverpolicy_binding,omitempty"` - Name string `json:"name,omitempty"` + GSLBVServerGSLBDomainBinding []any `json:"gslbvserver_gslbdomain_binding,omitempty"` + GSLBVServerGSLBServiceBinding []any `json:"gslbvserver_gslbservice_binding,omitempty"` + GSLBVServerGSLBServiceGroupBinding []any `json:"gslbvserver_gslbservicegroup_binding,omitempty"` + GSLBVServerGSLBServiceGroupMemberBinding []any `json:"gslbvserver_gslbservicegroupmember_binding,omitempty"` + GSLBVServerLBPolicyBinding []any `json:"gslbvserver_lbpolicy_binding,omitempty"` + GSLBVServerSpilloverPolicyBinding []any `json:"gslbvserver_spilloverpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` } type GSLBServiceDNSViewBinding struct { @@ -321,10 +321,10 @@ type GSLBSiteGSLBServiceGroupMemberBinding struct { } type GSLBSiteBinding struct { - GSLBSiteGSLBServiceBinding []interface{} `json:"gslbsite_gslbservice_binding,omitempty"` - GSLBSiteGSLBServiceGroupBinding []interface{} `json:"gslbsite_gslbservicegroup_binding,omitempty"` - GSLBSiteGSLBServiceGroupMemberBinding []interface{} `json:"gslbsite_gslbservicegroupmember_binding,omitempty"` - SiteName string `json:"sitename,omitempty"` + GSLBSiteGSLBServiceBinding []any `json:"gslbsite_gslbservice_binding,omitempty"` + GSLBSiteGSLBServiceGroupBinding []any `json:"gslbsite_gslbservicegroup_binding,omitempty"` + GSLBSiteGSLBServiceGroupMemberBinding []any `json:"gslbsite_gslbservicegroupmember_binding,omitempty"` + SiteName string `json:"sitename,omitempty"` } type GSLBDomainGSLBServiceBinding struct { @@ -386,18 +386,18 @@ type GSLBVServerDomainBinding struct { } type GSLBDomainBinding struct { - GSLBDomainGSLBServiceBinding []interface{} `json:"gslbdomain_gslbservice_binding,omitempty"` - GSLBDomainGSLBServiceGroupBinding []interface{} `json:"gslbdomain_gslbservicegroup_binding,omitempty"` - GSLBDomainGSLBServiceGroupMemberBinding []interface{} `json:"gslbdomain_gslbservicegroupmember_binding,omitempty"` - GSLBDomainGSLBVServerBinding []interface{} `json:"gslbdomain_gslbvserver_binding,omitempty"` - GSLBDomainLBMonitorBinding []interface{} `json:"gslbdomain_lbmonitor_binding,omitempty"` - Name string `json:"name,omitempty"` + GSLBDomainGSLBServiceBinding []any `json:"gslbdomain_gslbservice_binding,omitempty"` + GSLBDomainGSLBServiceGroupBinding []any `json:"gslbdomain_gslbservicegroup_binding,omitempty"` + GSLBDomainGSLBServiceGroupMemberBinding []any `json:"gslbdomain_gslbservicegroupmember_binding,omitempty"` + GSLBDomainGSLBVServerBinding []any `json:"gslbdomain_gslbvserver_binding,omitempty"` + GSLBDomainLBMonitorBinding []any `json:"gslbdomain_lbmonitor_binding,omitempty"` + Name string `json:"name,omitempty"` } type GSLBServiceBinding struct { - GSLBServiceDNSViewBinding []interface{} `json:"gslbservice_dnsview_binding,omitempty"` - GSLBServiceLBMonitorBinding []interface{} `json:"gslbservice_lbmonitor_binding,omitempty"` - ServiceName string `json:"servicename,omitempty"` + GSLBServiceDNSViewBinding []any `json:"gslbservice_dnsview_binding,omitempty"` + GSLBServiceLBMonitorBinding []any `json:"gslbservice_lbmonitor_binding,omitempty"` + ServiceName string `json:"servicename,omitempty"` } type GSLBServiceLBMonitorBinding struct { diff --git a/nitrogo/models/ha.go b/nitrogo/models/ha.go index 05457f0..d0aed69 100644 --- a/nitrogo/models/ha.go +++ b/nitrogo/models/ha.go @@ -80,12 +80,12 @@ type HANodeFISBinding struct { } type HANodeBinding struct { - HANodeCIBinding []interface{} `json:"hanode_ci_binding,omitempty"` - HANodeFISBinding []interface{} `json:"hanode_fis_binding,omitempty"` - HANodePartialFailureInterfacesBinding []interface{} `json:"hanode_partialfailureinterfaces_binding,omitempty"` - HANodeRouteMonitor6Binding []interface{} `json:"hanode_routemonitor6_binding,omitempty"` - HANodeRouteMonitorBinding []interface{} `json:"hanode_routemonitor_binding,omitempty"` - ID int `json:"id,omitempty"` + HANodeCIBinding []any `json:"hanode_ci_binding,omitempty"` + HANodeFISBinding []any `json:"hanode_fis_binding,omitempty"` + HANodePartialFailureInterfacesBinding []any `json:"hanode_partialfailureinterfaces_binding,omitempty"` + HANodeRouteMonitor6Binding []any `json:"hanode_routemonitor6_binding,omitempty"` + HANodeRouteMonitorBinding []any `json:"hanode_routemonitor_binding,omitempty"` + ID int `json:"id,omitempty"` } type HANodePartialFailureInterfacesBinding struct { diff --git a/nitrogo/models/ica.go b/nitrogo/models/ica.go index 9016fc7..7dd0b5b 100644 --- a/nitrogo/models/ica.go +++ b/nitrogo/models/ica.go @@ -58,7 +58,7 @@ type ICAPolicyVPNVServerBinding struct { } type ICAGlobalBinding struct { - ICAGlobalICAPolicyBinding []interface{} `json:"icaglobal_icapolicy_binding,omitempty"` + ICAGlobalICAPolicyBinding []any `json:"icaglobal_icapolicy_binding,omitempty"` } type ICAParameter struct { @@ -99,10 +99,10 @@ type ICAPolicy struct { } type ICAPolicyBinding struct { - ICAPolicyCRVServerBinding []interface{} `json:"icapolicy_crvserver_binding,omitempty"` - ICAPolicyICAGlobalBinding []interface{} `json:"icapolicy_icaglobal_binding,omitempty"` - ICAPolicyVPNVServerBinding []interface{} `json:"icapolicy_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + ICAPolicyCRVServerBinding []any `json:"icapolicy_crvserver_binding,omitempty"` + ICAPolicyICAGlobalBinding []any `json:"icapolicy_icaglobal_binding,omitempty"` + ICAPolicyVPNVServerBinding []any `json:"icapolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type ICAAccessProfile struct { diff --git a/nitrogo/models/kafka.go b/nitrogo/models/kafka.go index 9df8c7d..0b49be6 100644 --- a/nitrogo/models/kafka.go +++ b/nitrogo/models/kafka.go @@ -12,8 +12,8 @@ type KafkaCluster struct { } type KafkaClusterBinding struct { - KafkaClusterServiceGroupBinding []interface{} `json:"kafkacluster_servicegroup_binding,omitempty"` - Name string `json:"name,omitempty"` + KafkaClusterServiceGroupBinding []any `json:"kafkacluster_servicegroup_binding,omitempty"` + Name string `json:"name,omitempty"` } type KafkaClusterServiceGroupBinding struct { diff --git a/nitrogo/models/lb.go b/nitrogo/models/lb.go index 2bb4cc5..caa8bd3 100644 --- a/nitrogo/models/lb.go +++ b/nitrogo/models/lb.go @@ -47,16 +47,16 @@ type LBVServerCSVServerBinding struct { } type LBMonitorBinding struct { - LBMonitorMetricBinding []interface{} `json:"lbmonitor_metric_binding,omitempty"` - LBMonitorSSLCertKeyBinding []interface{} `json:"lbmonitor_sslcertkey_binding,omitempty"` - MonitorName string `json:"monitorname,omitempty"` + LBMonitorMetricBinding []any `json:"lbmonitor_metric_binding,omitempty"` + LBMonitorSSLCertKeyBinding []any `json:"lbmonitor_sslcertkey_binding,omitempty"` + MonitorName string `json:"monitorname,omitempty"` } type LBMonBindingsBinding struct { - LBMonBindingsGSLBServiceGroupBinding []interface{} `json:"lbmonbindings_gslbservicegroup_binding,omitempty"` - LBMonBindingsServiceBinding []interface{} `json:"lbmonbindings_service_binding,omitempty"` - LBMonBindingsServiceGroupBinding []interface{} `json:"lbmonbindings_servicegroup_binding,omitempty"` - MonitorName string `json:"monitorname,omitempty"` + LBMonBindingsGSLBServiceGroupBinding []any `json:"lbmonbindings_gslbservicegroup_binding,omitempty"` + LBMonBindingsServiceBinding []any `json:"lbmonbindings_service_binding,omitempty"` + LBMonBindingsServiceGroupBinding []any `json:"lbmonbindings_servicegroup_binding,omitempty"` + MonitorName string `json:"monitorname,omitempty"` } type LBVServerBotPolicyBinding struct { @@ -123,18 +123,18 @@ type LBVServerTransformPolicyBinding struct { } type LBAction struct { - Builtin []string `json:"builtin,omitempty"` - Comment string `json:"comment,omitempty"` - Count float64 `json:"__count,omitempty"` - Feature string `json:"feature,omitempty"` - Hits int `json:"hits,omitempty"` - Name string `json:"name,omitempty"` - NewName string `json:"newname,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - ReferenceCount int `json:"referencecount,omitempty"` - TypeField string `json:"type,omitempty"` - UndefHits int `json:"undefhits,omitempty"` - Value []interface{} `json:"value,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Comment string `json:"comment,omitempty"` + Count float64 `json:"__count,omitempty"` + Feature string `json:"feature,omitempty"` + Hits int `json:"hits,omitempty"` + Name string `json:"name,omitempty"` + NewName string `json:"newname,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + TypeField string `json:"type,omitempty"` + UndefHits int `json:"undefhits,omitempty"` + Value []any `json:"value,omitempty"` } type LBVServerAuditSyslogPolicyBinding struct { @@ -150,7 +150,7 @@ type LBVServerAuditSyslogPolicyBinding struct { } type LBGlobalBinding struct { - LBGlobalLBPolicyBinding []interface{} `json:"lbglobal_lbpolicy_binding,omitempty"` + LBGlobalLBPolicyBinding []any `json:"lbglobal_lbpolicy_binding,omitempty"` } type LBVServerAppFlowPolicyBinding struct { @@ -210,32 +210,32 @@ type LBVServerCachePolicyBinding struct { } type LBVServerBinding struct { - LBVServerAnalyticsProfileBinding []interface{} `json:"lbvserver_analyticsprofile_binding,omitempty"` - LBVServerAppFlowPolicyBinding []interface{} `json:"lbvserver_appflowpolicy_binding,omitempty"` - LBVServerAppFWPolicyBinding []interface{} `json:"lbvserver_appfwpolicy_binding,omitempty"` - LBVServerAppQOEPolicyBinding []interface{} `json:"lbvserver_appqoepolicy_binding,omitempty"` - LBVServerAuditNSLogPolicyBinding []interface{} `json:"lbvserver_auditnslogpolicy_binding,omitempty"` - LBVServerAuditSyslogPolicyBinding []interface{} `json:"lbvserver_auditsyslogpolicy_binding,omitempty"` - LBVServerAuthorizationPolicyBinding []interface{} `json:"lbvserver_authorizationpolicy_binding,omitempty"` - LBVServerBotPolicyBinding []interface{} `json:"lbvserver_botpolicy_binding,omitempty"` - LBVServerCachePolicyBinding []interface{} `json:"lbvserver_cachepolicy_binding,omitempty"` - LBVServerCMPPolicyBinding []interface{} `json:"lbvserver_cmppolicy_binding,omitempty"` - LBVServerContentInspectionPolicyBinding []interface{} `json:"lbvserver_contentinspectionpolicy_binding,omitempty"` - LBVServerCSVServerBinding []interface{} `json:"lbvserver_csvserver_binding,omitempty"` - LBVServerDNSPolicy64Binding []interface{} `json:"lbvserver_dnspolicy64_binding,omitempty"` - LBVServerFEOPolicyBinding []interface{} `json:"lbvserver_feopolicy_binding,omitempty"` - LBVServerLBPolicyBinding []interface{} `json:"lbvserver_lbpolicy_binding,omitempty"` - LBVServerResponderPolicyBinding []interface{} `json:"lbvserver_responderpolicy_binding,omitempty"` - LBVServerRewritePolicyBinding []interface{} `json:"lbvserver_rewritepolicy_binding,omitempty"` - LBVServerServiceBinding []interface{} `json:"lbvserver_service_binding,omitempty"` - LBVServerServiceGroupBinding []interface{} `json:"lbvserver_servicegroup_binding,omitempty"` - LBVServerServiceGroupMemberBinding []interface{} `json:"lbvserver_servicegroupmember_binding,omitempty"` - LBVServerSpilloverPolicyBinding []interface{} `json:"lbvserver_spilloverpolicy_binding,omitempty"` - LBVServerTMTrafficPolicyBinding []interface{} `json:"lbvserver_tmtrafficpolicy_binding,omitempty"` - LBVServerTransformPolicyBinding []interface{} `json:"lbvserver_transformpolicy_binding,omitempty"` - LBVServerVideoOptimizationDetectionPolicyBinding []interface{} `json:"lbvserver_videooptimizationdetectionpolicy_binding,omitempty"` - LBVServerVideoOptimizationPacingPolicyBinding []interface{} `json:"lbvserver_videooptimizationpacingpolicy_binding,omitempty"` - Name string `json:"name,omitempty"` + LBVServerAnalyticsProfileBinding []any `json:"lbvserver_analyticsprofile_binding,omitempty"` + LBVServerAppFlowPolicyBinding []any `json:"lbvserver_appflowpolicy_binding,omitempty"` + LBVServerAppFWPolicyBinding []any `json:"lbvserver_appfwpolicy_binding,omitempty"` + LBVServerAppQOEPolicyBinding []any `json:"lbvserver_appqoepolicy_binding,omitempty"` + LBVServerAuditNSLogPolicyBinding []any `json:"lbvserver_auditnslogpolicy_binding,omitempty"` + LBVServerAuditSyslogPolicyBinding []any `json:"lbvserver_auditsyslogpolicy_binding,omitempty"` + LBVServerAuthorizationPolicyBinding []any `json:"lbvserver_authorizationpolicy_binding,omitempty"` + LBVServerBotPolicyBinding []any `json:"lbvserver_botpolicy_binding,omitempty"` + LBVServerCachePolicyBinding []any `json:"lbvserver_cachepolicy_binding,omitempty"` + LBVServerCMPPolicyBinding []any `json:"lbvserver_cmppolicy_binding,omitempty"` + LBVServerContentInspectionPolicyBinding []any `json:"lbvserver_contentinspectionpolicy_binding,omitempty"` + LBVServerCSVServerBinding []any `json:"lbvserver_csvserver_binding,omitempty"` + LBVServerDNSPolicy64Binding []any `json:"lbvserver_dnspolicy64_binding,omitempty"` + LBVServerFEOPolicyBinding []any `json:"lbvserver_feopolicy_binding,omitempty"` + LBVServerLBPolicyBinding []any `json:"lbvserver_lbpolicy_binding,omitempty"` + LBVServerResponderPolicyBinding []any `json:"lbvserver_responderpolicy_binding,omitempty"` + LBVServerRewritePolicyBinding []any `json:"lbvserver_rewritepolicy_binding,omitempty"` + LBVServerServiceBinding []any `json:"lbvserver_service_binding,omitempty"` + LBVServerServiceGroupBinding []any `json:"lbvserver_servicegroup_binding,omitempty"` + LBVServerServiceGroupMemberBinding []any `json:"lbvserver_servicegroupmember_binding,omitempty"` + LBVServerSpilloverPolicyBinding []any `json:"lbvserver_spilloverpolicy_binding,omitempty"` + LBVServerTMTrafficPolicyBinding []any `json:"lbvserver_tmtrafficpolicy_binding,omitempty"` + LBVServerTransformPolicyBinding []any `json:"lbvserver_transformpolicy_binding,omitempty"` + LBVServerVideoOptimizationDetectionPolicyBinding []any `json:"lbvserver_videooptimizationdetectionpolicy_binding,omitempty"` + LBVServerVideoOptimizationPacingPolicyBinding []any `json:"lbvserver_videooptimizationpacingpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` } type LBPolicyLabelPolicyBindingBinding struct { @@ -381,151 +381,151 @@ type LBVServerCMPPolicyBinding struct { } type LBVServer struct { - ActiveServices int `json:"activeservices,omitempty"` - ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` - APIProfile string `json:"apiprofile,omitempty"` - AppFlowLog string `json:"appflowlog,omitempty"` - Authentication string `json:"authentication,omitempty"` - AuthenticationHost string `json:"authenticationhost,omitempty"` - Authn401 string `json:"authn401,omitempty"` - AuthnProfile string `json:"authnprofile,omitempty"` - AuthnVSName string `json:"authnvsname,omitempty"` - BackupLBMethod string `json:"backuplbmethod,omitempty"` - BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` - BackupVServer string `json:"backupvserver,omitempty"` - BackupVServerStatus string `json:"backupvserverstatus,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - BypassAAAA string `json:"bypassaaaa,omitempty"` - Cacheable string `json:"cacheable,omitempty"` - CacheVServer string `json:"cachevserver,omitempty"` - CltTimeout int `json:"clttimeout,omitempty"` - Comment string `json:"comment,omitempty"` - ConnFailover string `json:"connfailover,omitempty"` - ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` - ConsolidatedLConnGbl string `json:"consolidatedlconngbl,omitempty"` - CookieDomain string `json:"cookiedomain,omitempty"` - CookieName string `json:"cookiename,omitempty"` - Count float64 `json:"__count,omitempty"` - CurrentActiveOrder string `json:"currentactiveorder,omitempty"` - CurState string `json:"curstate,omitempty"` - DataLength int `json:"datalength,omitempty"` - DataOffset int `json:"dataoffset,omitempty"` - DBProfileName string `json:"dbprofilename,omitempty"` - DBSLB string `json:"dbslb,omitempty"` - DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` - DNS64 string `json:"dns64,omitempty"` - DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` - DNSProfileName string `json:"dnsprofilename,omitempty"` - DNSVServerName string `json:"dnsvservername,omitempty"` - Domain string `json:"domain,omitempty"` - DownStateFlush string `json:"downstateflush,omitempty"` - EffectiveState string `json:"effectivestate,omitempty"` - GroupName string `json:"groupname,omitempty"` - Gt2gb string `json:"gt2gb,omitempty"` - HashLength int `json:"hashlength,omitempty"` - Health int `json:"health,omitempty"` - HealthThreshold int `json:"healththreshold,omitempty"` - HomePage string `json:"homepage,omitempty"` - HTTPProfileName string `json:"httpprofilename,omitempty"` - HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` - ICMPVsrResponse string `json:"icmpvsrresponse,omitempty"` - InsertVServerIPPort string `json:"insertvserveripport,omitempty"` - IPMapping string `json:"ipmapping,omitempty"` - IPMask string `json:"ipmask,omitempty"` - IPPattern string `json:"ippattern,omitempty"` - IPSet string `json:"ipset,omitempty"` - IPv46 string `json:"ipv46,omitempty"` - IsGSLB bool `json:"isgslb,omitempty"` - L2Conn string `json:"l2conn,omitempty"` - LBMethod string `json:"lbmethod,omitempty"` - LBProfileName string `json:"lbprofilename,omitempty"` - LBRRReason int `json:"lbrrreason,omitempty"` - ListenPolicy string `json:"listenpolicy,omitempty"` - ListenPriority int `json:"listenpriority,omitempty"` - M string `json:"m,omitempty"` - MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` - MapField string `json:"map,omitempty"` - MaxAutoscaleMembers int `json:"maxautoscalemembers,omitempty"` - MinAutoscaleMembers int `json:"minautoscalemembers,omitempty"` - MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` - MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` - MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` - MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` - MySQLServerVersion string `json:"mysqlserverversion,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NetProfile string `json:"netprofile,omitempty"` - NewName string `json:"newname,omitempty"` - NewServiceRequest int `json:"newservicerequest,omitempty"` - NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` - NewServiceRequestUnit string `json:"newservicerequestunit,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NgName string `json:"ngname,omitempty"` - NoDefaultBindings string `json:"nodefaultbindings,omitempty"` - OracleServerVersion string `json:"oracleserverversion,omitempty"` - Order int `json:"order,omitempty"` - OrderThreshold int `json:"orderthreshold,omitempty"` - PersistAVPNo []interface{} `json:"persistavpno,omitempty"` - PersistenceBackup string `json:"persistencebackup,omitempty"` - PersistenceType string `json:"persistencetype,omitempty"` - PersistMask string `json:"persistmask,omitempty"` - Port int `json:"port,omitempty"` - Precedence string `json:"precedence,omitempty"` - ProbePort int `json:"probeport,omitempty"` - ProbeProtocol string `json:"probeprotocol,omitempty"` - ProbeSuccessResponseCode string `json:"probesuccessresponsecode,omitempty"` - ProcessLocal string `json:"processlocal,omitempty"` - Push string `json:"push,omitempty"` - PushLabel string `json:"pushlabel,omitempty"` - PushMultiClients string `json:"pushmulticlients,omitempty"` - PushVServer string `json:"pushvserver,omitempty"` - QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` - QUICProfileName string `json:"quicprofilename,omitempty"` - Range int `json:"range,omitempty"` - RecursionAvailable string `json:"recursionavailable,omitempty"` - Redirect string `json:"redirect,omitempty"` - RedirectFromPort int `json:"redirectfromport,omitempty"` - RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` - RedirURL string `json:"redirurl,omitempty"` - RedirURLFlags bool `json:"redirurlflags,omitempty"` - ResRule string `json:"resrule,omitempty"` - RetainConnectionsOnCluster string `json:"retainconnectionsoncluster,omitempty"` - RHIState string `json:"rhistate,omitempty"` - RTSPNAT string `json:"rtspnat,omitempty"` - Rule string `json:"rule,omitempty"` - RuleType int `json:"ruletype,omitempty"` - ServiceName string `json:"servicename,omitempty"` - ServiceType string `json:"servicetype,omitempty"` - Sessionless string `json:"sessionless,omitempty"` - SkipPersistency string `json:"skippersistency,omitempty"` - SOBackupAction string `json:"sobackupaction,omitempty"` - SOMethod string `json:"somethod,omitempty"` - SOPersistence string `json:"sopersistence,omitempty"` - SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` - SOThreshold int `json:"sothreshold,omitempty"` - State string `json:"state,omitempty"` - StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` - StateChangeTimeSec string `json:"statechangetimesec,omitempty"` - StateChangeTimeSeconds int `json:"statechangetimeseconds,omitempty"` - Status int `json:"status,omitempty"` - TCPProbePort int `json:"tcpprobeport,omitempty"` - TCPProfileName string `json:"tcpprofilename,omitempty"` - TD int `json:"td,omitempty"` - ThresholdValue int `json:"thresholdvalue,omitempty"` - TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` - Timeout int `json:"timeout,omitempty"` - ToggleOrder string `json:"toggleorder,omitempty"` - TOSID int `json:"tosid,omitempty"` - TotalServices int `json:"totalservices,omitempty"` - TROFSPersistence string `json:"trofspersistence,omitempty"` - TypeField string `json:"type,omitempty"` - V6NetmaskLen int `json:"v6netmasklen,omitempty"` - V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` - Value string `json:"value,omitempty"` - Version int `json:"version,omitempty"` - VIPHeader string `json:"vipheader,omitempty"` - VSvrDynConnSOThreshold int `json:"vsvrdynconnsothreshold,omitempty"` - Weight int `json:"weight,omitempty"` + ActiveServices int `json:"activeservices,omitempty"` + ADFSProxyProfile string `json:"adfsproxyprofile,omitempty"` + APIProfile string `json:"apiprofile,omitempty"` + AppFlowLog string `json:"appflowlog,omitempty"` + Authentication string `json:"authentication,omitempty"` + AuthenticationHost string `json:"authenticationhost,omitempty"` + Authn401 string `json:"authn401,omitempty"` + AuthnProfile string `json:"authnprofile,omitempty"` + AuthnVSName string `json:"authnvsname,omitempty"` + BackupLBMethod string `json:"backuplbmethod,omitempty"` + BackupPersistenceTimeout int `json:"backuppersistencetimeout,omitempty"` + BackupVServer string `json:"backupvserver,omitempty"` + BackupVServerStatus string `json:"backupvserverstatus,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + BypassAAAA string `json:"bypassaaaa,omitempty"` + Cacheable string `json:"cacheable,omitempty"` + CacheVServer string `json:"cachevserver,omitempty"` + CltTimeout int `json:"clttimeout,omitempty"` + Comment string `json:"comment,omitempty"` + ConnFailover string `json:"connfailover,omitempty"` + ConsolidatedLConn string `json:"consolidatedlconn,omitempty"` + ConsolidatedLConnGbl string `json:"consolidatedlconngbl,omitempty"` + CookieDomain string `json:"cookiedomain,omitempty"` + CookieName string `json:"cookiename,omitempty"` + Count float64 `json:"__count,omitempty"` + CurrentActiveOrder string `json:"currentactiveorder,omitempty"` + CurState string `json:"curstate,omitempty"` + DataLength int `json:"datalength,omitempty"` + DataOffset int `json:"dataoffset,omitempty"` + DBProfileName string `json:"dbprofilename,omitempty"` + DBSLB string `json:"dbslb,omitempty"` + DisablePrimaryOnDown string `json:"disableprimaryondown,omitempty"` + DNS64 string `json:"dns64,omitempty"` + DNSOverHTTPS string `json:"dnsoverhttps,omitempty"` + DNSProfileName string `json:"dnsprofilename,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + Domain string `json:"domain,omitempty"` + DownStateFlush string `json:"downstateflush,omitempty"` + EffectiveState string `json:"effectivestate,omitempty"` + GroupName string `json:"groupname,omitempty"` + Gt2gb string `json:"gt2gb,omitempty"` + HashLength int `json:"hashlength,omitempty"` + Health int `json:"health,omitempty"` + HealthThreshold int `json:"healththreshold,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPProfileName string `json:"httpprofilename,omitempty"` + HTTPSRedirectURL string `json:"httpsredirecturl,omitempty"` + ICMPVsrResponse string `json:"icmpvsrresponse,omitempty"` + InsertVServerIPPort string `json:"insertvserveripport,omitempty"` + IPMapping string `json:"ipmapping,omitempty"` + IPMask string `json:"ipmask,omitempty"` + IPPattern string `json:"ippattern,omitempty"` + IPSet string `json:"ipset,omitempty"` + IPv46 string `json:"ipv46,omitempty"` + IsGSLB bool `json:"isgslb,omitempty"` + L2Conn string `json:"l2conn,omitempty"` + LBMethod string `json:"lbmethod,omitempty"` + LBProfileName string `json:"lbprofilename,omitempty"` + LBRRReason int `json:"lbrrreason,omitempty"` + ListenPolicy string `json:"listenpolicy,omitempty"` + ListenPriority int `json:"listenpriority,omitempty"` + M string `json:"m,omitempty"` + MACModeRetainVLAN string `json:"macmoderetainvlan,omitempty"` + MapField string `json:"map,omitempty"` + MaxAutoscaleMembers int `json:"maxautoscalemembers,omitempty"` + MinAutoscaleMembers int `json:"minautoscalemembers,omitempty"` + MSSQLServerVersion string `json:"mssqlserverversion,omitempty"` + MySQLCharacterSet int `json:"mysqlcharacterset,omitempty"` + MySQLProtocolVersion int `json:"mysqlprotocolversion,omitempty"` + MySQLServerCapabilities int `json:"mysqlservercapabilities,omitempty"` + MySQLServerVersion string `json:"mysqlserverversion,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NewName string `json:"newname,omitempty"` + NewServiceRequest int `json:"newservicerequest,omitempty"` + NewServiceRequestIncrementInterval int `json:"newservicerequestincrementinterval,omitempty"` + NewServiceRequestUnit string `json:"newservicerequestunit,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NgName string `json:"ngname,omitempty"` + NoDefaultBindings string `json:"nodefaultbindings,omitempty"` + OracleServerVersion string `json:"oracleserverversion,omitempty"` + Order int `json:"order,omitempty"` + OrderThreshold int `json:"orderthreshold,omitempty"` + PersistAVPNo []any `json:"persistavpno,omitempty"` + PersistenceBackup string `json:"persistencebackup,omitempty"` + PersistenceType string `json:"persistencetype,omitempty"` + PersistMask string `json:"persistmask,omitempty"` + Port int `json:"port,omitempty"` + Precedence string `json:"precedence,omitempty"` + ProbePort int `json:"probeport,omitempty"` + ProbeProtocol string `json:"probeprotocol,omitempty"` + ProbeSuccessResponseCode string `json:"probesuccessresponsecode,omitempty"` + ProcessLocal string `json:"processlocal,omitempty"` + Push string `json:"push,omitempty"` + PushLabel string `json:"pushlabel,omitempty"` + PushMultiClients string `json:"pushmulticlients,omitempty"` + PushVServer string `json:"pushvserver,omitempty"` + QUICBridgeProfileName string `json:"quicbridgeprofilename,omitempty"` + QUICProfileName string `json:"quicprofilename,omitempty"` + Range int `json:"range,omitempty"` + RecursionAvailable string `json:"recursionavailable,omitempty"` + Redirect string `json:"redirect,omitempty"` + RedirectFromPort int `json:"redirectfromport,omitempty"` + RedirectPortRewrite string `json:"redirectportrewrite,omitempty"` + RedirURL string `json:"redirurl,omitempty"` + RedirURLFlags bool `json:"redirurlflags,omitempty"` + ResRule string `json:"resrule,omitempty"` + RetainConnectionsOnCluster string `json:"retainconnectionsoncluster,omitempty"` + RHIState string `json:"rhistate,omitempty"` + RTSPNAT string `json:"rtspnat,omitempty"` + Rule string `json:"rule,omitempty"` + RuleType int `json:"ruletype,omitempty"` + ServiceName string `json:"servicename,omitempty"` + ServiceType string `json:"servicetype,omitempty"` + Sessionless string `json:"sessionless,omitempty"` + SkipPersistency string `json:"skippersistency,omitempty"` + SOBackupAction string `json:"sobackupaction,omitempty"` + SOMethod string `json:"somethod,omitempty"` + SOPersistence string `json:"sopersistence,omitempty"` + SOPersistenceTimeout int `json:"sopersistencetimeout,omitempty"` + SOThreshold int `json:"sothreshold,omitempty"` + State string `json:"state,omitempty"` + StateChangeTimeMsec int `json:"statechangetimemsec,omitempty"` + StateChangeTimeSec string `json:"statechangetimesec,omitempty"` + StateChangeTimeSeconds int `json:"statechangetimeseconds,omitempty"` + Status int `json:"status,omitempty"` + TCPProbePort int `json:"tcpprobeport,omitempty"` + TCPProfileName string `json:"tcpprofilename,omitempty"` + TD int `json:"td,omitempty"` + ThresholdValue int `json:"thresholdvalue,omitempty"` + TicksSinceLastStateChange int `json:"tickssincelaststatechange,omitempty"` + Timeout int `json:"timeout,omitempty"` + ToggleOrder string `json:"toggleorder,omitempty"` + TOSID int `json:"tosid,omitempty"` + TotalServices int `json:"totalservices,omitempty"` + TROFSPersistence string `json:"trofspersistence,omitempty"` + TypeField string `json:"type,omitempty"` + V6NetmaskLen int `json:"v6netmasklen,omitempty"` + V6PersistMaskLen int `json:"v6persistmasklen,omitempty"` + Value string `json:"value,omitempty"` + Version int `json:"version,omitempty"` + VIPHeader string `json:"vipheader,omitempty"` + VSvrDynConnSOThreshold int `json:"vsvrdynconnsothreshold,omitempty"` + Weight int `json:"weight,omitempty"` } type LBVServerTMTrafficPolicyBinding struct { @@ -541,126 +541,126 @@ type LBVServerTMTrafficPolicyBinding struct { } type LBMonitor struct { - AcctApplicationID []interface{} `json:"acctapplicationid,omitempty"` - Action string `json:"action,omitempty"` - AlertRetries int `json:"alertretries,omitempty"` - Application string `json:"application,omitempty"` - Attribute string `json:"attribute,omitempty"` - AuthApplicationID []interface{} `json:"authapplicationid,omitempty"` - BaseDN string `json:"basedn,omitempty"` - BindDN string `json:"binddn,omitempty"` - Count float64 `json:"__count,omitempty"` - CustomHeaders string `json:"customheaders,omitempty"` - Database string `json:"database,omitempty"` - DestIP string `json:"destip,omitempty"` - DestPort int `json:"destport,omitempty"` - Deviation int `json:"deviation,omitempty"` - DispatcherIP string `json:"dispatcherip,omitempty"` - DispatcherPort int `json:"dispatcherport,omitempty"` - Domain string `json:"domain,omitempty"` - Downtime int `json:"downtime,omitempty"` - DupState string `json:"dup_state,omitempty"` - DupWeight int `json:"dup_weight,omitempty"` - DynamicInterval int `json:"dynamicinterval,omitempty"` - DynamicResponseTimeout int `json:"dynamicresponsetimeout,omitempty"` - EvalRule string `json:"evalrule,omitempty"` - FailureRetries int `json:"failureretries,omitempty"` - FileName string `json:"filename,omitempty"` - Filter string `json:"filter,omitempty"` - FirmwareRevision int `json:"firmwarerevision,omitempty"` - Group string `json:"group,omitempty"` - GRPCHealthCheck string `json:"grpchealthcheck,omitempty"` - GRPCServiceName string `json:"grpcservicename,omitempty"` - GRPCStatusCode []interface{} `json:"grpcstatuscode,omitempty"` - HostIPAddress string `json:"hostipaddress,omitempty"` - HostName string `json:"hostname,omitempty"` - HTTPRequest string `json:"httprequest,omitempty"` - InBandSecurityID string `json:"inbandsecurityid,omitempty"` - Interval int `json:"interval,omitempty"` - IPAddress []string `json:"ipaddress,omitempty"` - IPTunnel string `json:"iptunnel,omitempty"` - KCDAccount string `json:"kcdaccount,omitempty"` - LASVersion string `json:"lasversion,omitempty"` - LogonPointName string `json:"logonpointname,omitempty"` - LRTM string `json:"lrtm,omitempty"` - LRTMConf int `json:"lrtmconf,omitempty"` - LRTMConfStr string `json:"lrtmconfstr,omitempty"` - MaxForwards int `json:"maxforwards,omitempty"` - Metric string `json:"metric,omitempty"` - MetricTable string `json:"metrictable,omitempty"` - MetricThreshold int `json:"metricthreshold,omitempty"` - MetricWeight int `json:"metricweight,omitempty"` - MonitorName string `json:"monitorname,omitempty"` - MQTTClientIdentifier string `json:"mqttclientidentifier,omitempty"` - MQTTVersion int `json:"mqttversion,omitempty"` - MSSQLProtocolVersion string `json:"mssqlprotocolversion,omitempty"` - MultiMetricTable []string `json:"multimetrictable,omitempty"` - NetProfile string `json:"netprofile,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - OracleSID string `json:"oraclesid,omitempty"` - OriginHost string `json:"originhost,omitempty"` - OriginRealm string `json:"originrealm,omitempty"` - Password string `json:"password,omitempty"` - ProductName string `json:"productname,omitempty"` - Query string `json:"query,omitempty"` - QueryType string `json:"querytype,omitempty"` - RADAccountSession string `json:"radaccountsession,omitempty"` - RADAccountType int `json:"radaccounttype,omitempty"` - RADAPN string `json:"radapn,omitempty"` - RADFramedIP string `json:"radframedip,omitempty"` - RADKey string `json:"radkey,omitempty"` - RADMSISDN string `json:"radmsisdn,omitempty"` - RADNASID string `json:"radnasid,omitempty"` - RADNASIP string `json:"radnasip,omitempty"` - Recv string `json:"recv,omitempty"` - RespCode []string `json:"respcode,omitempty"` - RespTimeout int `json:"resptimeout,omitempty"` - RespTimeoutThresh int `json:"resptimeoutthresh,omitempty"` - Retries int `json:"retries,omitempty"` - Reverse string `json:"reverse,omitempty"` - RTSPRequest string `json:"rtsprequest,omitempty"` - ScriptArgs string `json:"scriptargs,omitempty"` - ScriptName string `json:"scriptname,omitempty"` - SecondaryPassword string `json:"secondarypassword,omitempty"` - Secure string `json:"secure,omitempty"` - SecureArgs string `json:"secureargs,omitempty"` - Send string `json:"send,omitempty"` - ServiceGroupName string `json:"servicegroupname,omitempty"` - ServiceName string `json:"servicename,omitempty"` - SIPMethod string `json:"sipmethod,omitempty"` - SIPRegURI string `json:"sipreguri,omitempty"` - SIPURI string `json:"sipuri,omitempty"` - SitePath string `json:"sitepath,omitempty"` - SNMPCommunity string `json:"snmpcommunity,omitempty"` - SNMPOID string `json:"Snmpoid,omitempty"` - SNMPThreshold string `json:"snmpthreshold,omitempty"` - SNMPVersion string `json:"snmpversion,omitempty"` - SQLQuery string `json:"sqlquery,omitempty"` - SSLProfile string `json:"sslprofile,omitempty"` - State string `json:"state,omitempty"` - StoreDB string `json:"storedb,omitempty"` - StoreFrontAcctService string `json:"storefrontacctservice,omitempty"` - StoreFrontCheckBackendServices string `json:"storefrontcheckbackendservices,omitempty"` - StoreName string `json:"storename,omitempty"` - SuccessRetries int `json:"successretries,omitempty"` - SupportedVendorIDs []interface{} `json:"supportedvendorids,omitempty"` - TOS string `json:"tos,omitempty"` - TOSID int `json:"tosid,omitempty"` - Transparent string `json:"transparent,omitempty"` - TROFSCode int `json:"trofscode,omitempty"` - TROFSString string `json:"trofsstring,omitempty"` - TypeField string `json:"type,omitempty"` - Units1 string `json:"units1,omitempty"` - Units2 string `json:"units2,omitempty"` - Units3 string `json:"units3,omitempty"` - Units4 string `json:"units4,omitempty"` - Username string `json:"username,omitempty"` - ValidateCred string `json:"validatecred,omitempty"` - VendorID int `json:"vendorid,omitempty"` - VendorSpecificAcctApplicationIDs []interface{} `json:"vendorspecificacctapplicationids,omitempty"` - VendorSpecificAuthApplicationIDs []interface{} `json:"vendorspecificauthapplicationids,omitempty"` - VendorSpecificVendorID int `json:"vendorspecificvendorid,omitempty"` - Weight int `json:"weight,omitempty"` + AcctApplicationID []any `json:"acctapplicationid,omitempty"` + Action string `json:"action,omitempty"` + AlertRetries int `json:"alertretries,omitempty"` + Application string `json:"application,omitempty"` + Attribute string `json:"attribute,omitempty"` + AuthApplicationID []any `json:"authapplicationid,omitempty"` + BaseDN string `json:"basedn,omitempty"` + BindDN string `json:"binddn,omitempty"` + Count float64 `json:"__count,omitempty"` + CustomHeaders string `json:"customheaders,omitempty"` + Database string `json:"database,omitempty"` + DestIP string `json:"destip,omitempty"` + DestPort int `json:"destport,omitempty"` + Deviation int `json:"deviation,omitempty"` + DispatcherIP string `json:"dispatcherip,omitempty"` + DispatcherPort int `json:"dispatcherport,omitempty"` + Domain string `json:"domain,omitempty"` + Downtime int `json:"downtime,omitempty"` + DupState string `json:"dup_state,omitempty"` + DupWeight int `json:"dup_weight,omitempty"` + DynamicInterval int `json:"dynamicinterval,omitempty"` + DynamicResponseTimeout int `json:"dynamicresponsetimeout,omitempty"` + EvalRule string `json:"evalrule,omitempty"` + FailureRetries int `json:"failureretries,omitempty"` + FileName string `json:"filename,omitempty"` + Filter string `json:"filter,omitempty"` + FirmwareRevision int `json:"firmwarerevision,omitempty"` + Group string `json:"group,omitempty"` + GRPCHealthCheck string `json:"grpchealthcheck,omitempty"` + GRPCServiceName string `json:"grpcservicename,omitempty"` + GRPCStatusCode []any `json:"grpcstatuscode,omitempty"` + HostIPAddress string `json:"hostipaddress,omitempty"` + HostName string `json:"hostname,omitempty"` + HTTPRequest string `json:"httprequest,omitempty"` + InBandSecurityID string `json:"inbandsecurityid,omitempty"` + Interval int `json:"interval,omitempty"` + IPAddress []string `json:"ipaddress,omitempty"` + IPTunnel string `json:"iptunnel,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + LASVersion string `json:"lasversion,omitempty"` + LogonPointName string `json:"logonpointname,omitempty"` + LRTM string `json:"lrtm,omitempty"` + LRTMConf int `json:"lrtmconf,omitempty"` + LRTMConfStr string `json:"lrtmconfstr,omitempty"` + MaxForwards int `json:"maxforwards,omitempty"` + Metric string `json:"metric,omitempty"` + MetricTable string `json:"metrictable,omitempty"` + MetricThreshold int `json:"metricthreshold,omitempty"` + MetricWeight int `json:"metricweight,omitempty"` + MonitorName string `json:"monitorname,omitempty"` + MQTTClientIdentifier string `json:"mqttclientidentifier,omitempty"` + MQTTVersion int `json:"mqttversion,omitempty"` + MSSQLProtocolVersion string `json:"mssqlprotocolversion,omitempty"` + MultiMetricTable []string `json:"multimetrictable,omitempty"` + NetProfile string `json:"netprofile,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + OracleSID string `json:"oraclesid,omitempty"` + OriginHost string `json:"originhost,omitempty"` + OriginRealm string `json:"originrealm,omitempty"` + Password string `json:"password,omitempty"` + ProductName string `json:"productname,omitempty"` + Query string `json:"query,omitempty"` + QueryType string `json:"querytype,omitempty"` + RADAccountSession string `json:"radaccountsession,omitempty"` + RADAccountType int `json:"radaccounttype,omitempty"` + RADAPN string `json:"radapn,omitempty"` + RADFramedIP string `json:"radframedip,omitempty"` + RADKey string `json:"radkey,omitempty"` + RADMSISDN string `json:"radmsisdn,omitempty"` + RADNASID string `json:"radnasid,omitempty"` + RADNASIP string `json:"radnasip,omitempty"` + Recv string `json:"recv,omitempty"` + RespCode []string `json:"respcode,omitempty"` + RespTimeout int `json:"resptimeout,omitempty"` + RespTimeoutThresh int `json:"resptimeoutthresh,omitempty"` + Retries int `json:"retries,omitempty"` + Reverse string `json:"reverse,omitempty"` + RTSPRequest string `json:"rtsprequest,omitempty"` + ScriptArgs string `json:"scriptargs,omitempty"` + ScriptName string `json:"scriptname,omitempty"` + SecondaryPassword string `json:"secondarypassword,omitempty"` + Secure string `json:"secure,omitempty"` + SecureArgs string `json:"secureargs,omitempty"` + Send string `json:"send,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SIPMethod string `json:"sipmethod,omitempty"` + SIPRegURI string `json:"sipreguri,omitempty"` + SIPURI string `json:"sipuri,omitempty"` + SitePath string `json:"sitepath,omitempty"` + SNMPCommunity string `json:"snmpcommunity,omitempty"` + SNMPOID string `json:"Snmpoid,omitempty"` + SNMPThreshold string `json:"snmpthreshold,omitempty"` + SNMPVersion string `json:"snmpversion,omitempty"` + SQLQuery string `json:"sqlquery,omitempty"` + SSLProfile string `json:"sslprofile,omitempty"` + State string `json:"state,omitempty"` + StoreDB string `json:"storedb,omitempty"` + StoreFrontAcctService string `json:"storefrontacctservice,omitempty"` + StoreFrontCheckBackendServices string `json:"storefrontcheckbackendservices,omitempty"` + StoreName string `json:"storename,omitempty"` + SuccessRetries int `json:"successretries,omitempty"` + SupportedVendorIDs []any `json:"supportedvendorids,omitempty"` + TOS string `json:"tos,omitempty"` + TOSID int `json:"tosid,omitempty"` + Transparent string `json:"transparent,omitempty"` + TROFSCode int `json:"trofscode,omitempty"` + TROFSString string `json:"trofsstring,omitempty"` + TypeField string `json:"type,omitempty"` + Units1 string `json:"units1,omitempty"` + Units2 string `json:"units2,omitempty"` + Units3 string `json:"units3,omitempty"` + Units4 string `json:"units4,omitempty"` + Username string `json:"username,omitempty"` + ValidateCred string `json:"validatecred,omitempty"` + VendorID int `json:"vendorid,omitempty"` + VendorSpecificAcctApplicationIDs []any `json:"vendorspecificacctapplicationids,omitempty"` + VendorSpecificAuthApplicationIDs []any `json:"vendorspecificauthapplicationids,omitempty"` + VendorSpecificVendorID int `json:"vendorspecificvendorid,omitempty"` + Weight int `json:"weight,omitempty"` } type LBProfile struct { @@ -693,8 +693,8 @@ type LBVServerServiceGroupBinding struct { } type LBWLMBinding struct { - LBWLMLBVServerBinding []interface{} `json:"lbwlm_lbvserver_binding,omitempty"` - WLMName string `json:"wlmname,omitempty"` + LBWLMLBVServerBinding []any `json:"lbwlm_lbvserver_binding,omitempty"` + WLMName string `json:"wlmname,omitempty"` } type LBMonBindingsGSLBServiceGroupBinding struct { @@ -761,8 +761,8 @@ type LBGroupLBVServerBinding struct { } type LBMetricTableBinding struct { - LBMetricTableMetricBinding []interface{} `json:"lbmetrictable_metric_binding,omitempty"` - MetricTable string `json:"metrictable,omitempty"` + LBMetricTableMetricBinding []any `json:"lbmetrictable_metric_binding,omitempty"` + MetricTable string `json:"metrictable,omitempty"` } type LBPersistentSessions struct { @@ -809,9 +809,9 @@ type LBVServerAuditNSLogPolicyBinding struct { } type LBPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - LBPolicyLabelLBPolicyBinding []interface{} `json:"lbpolicylabel_lbpolicy_binding,omitempty"` - LBPolicyLabelPolicyBindingBinding []interface{} `json:"lbpolicylabel_policybinding_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + LBPolicyLabelLBPolicyBinding []any `json:"lbpolicylabel_lbpolicy_binding,omitempty"` + LBPolicyLabelPolicyBindingBinding []any `json:"lbpolicylabel_policybinding_binding,omitempty"` } type LBMetricTableMetricBinding struct { @@ -910,11 +910,11 @@ type LBPolicyLabel struct { } type LBPolicyBinding struct { - LBPolicyGSLBVServerBinding []interface{} `json:"lbpolicy_gslbvserver_binding,omitempty"` - LBPolicyLBGlobalBinding []interface{} `json:"lbpolicy_lbglobal_binding,omitempty"` - LBPolicyLBPolicyLabelBinding []interface{} `json:"lbpolicy_lbpolicylabel_binding,omitempty"` - LBPolicyLBVServerBinding []interface{} `json:"lbpolicy_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + LBPolicyGSLBVServerBinding []any `json:"lbpolicy_gslbvserver_binding,omitempty"` + LBPolicyLBGlobalBinding []any `json:"lbpolicy_lbglobal_binding,omitempty"` + LBPolicyLBPolicyLabelBinding []any `json:"lbpolicy_lbpolicylabel_binding,omitempty"` + LBPolicyLBVServerBinding []any `json:"lbpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type LBMonitorMetricBinding struct { @@ -939,8 +939,8 @@ type LBVServerLBPolicyBinding struct { } type LBGroupBinding struct { - LBGroupLBVServerBinding []interface{} `json:"lbgroup_lbvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + LBGroupLBVServerBinding []any `json:"lbgroup_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type LBParameter struct { diff --git a/nitrogo/models/lsn.go b/nitrogo/models/lsn.go index b174e8f..0d03023 100644 --- a/nitrogo/models/lsn.go +++ b/nitrogo/models/lsn.go @@ -2,14 +2,16 @@ package models // lsn configuration structs type LSNGroupLSNLogProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - LogProfileName string `json:"logprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + LogProfileName string `json:"logprofilename,omitempty"` } type LSNClientNSACLBinding struct { - ACLName string `json:"aclname,omitempty"` - ClientName string `json:"clientname,omitempty"` - TD int `json:"td,omitempty"` + ACLName string `json:"aclname,omitempty"` + ClientName string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + TD int `json:"td,omitempty"` } type LSNIP6Profile struct { @@ -22,13 +24,15 @@ type LSNIP6Profile struct { } type LSNGroupLSNHTTPHdrLogProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - HTTPHdrLogProfileName string `json:"httphdrlogprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + HTTPHdrLogProfileName string `json:"httphdrlogprofilename,omitempty"` } type LSNGroupLSNTransportProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - TransportProfileName string `json:"transportprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + TransportProfileName string `json:"transportprofilename,omitempty"` } type LSNAppsAttributes struct { @@ -41,8 +45,9 @@ type LSNAppsAttributes struct { } type LSNGroupLSNRTSPALGProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - RTSPALGProfileName string `json:"rtspalgprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + RTSPALGProfileName string `json:"rtspalgprofilename,omitempty"` } type LSNClient struct { @@ -52,9 +57,10 @@ type LSNClient struct { } type LSNClientNSACL6Binding struct { - ACL6Name string `json:"acl6name,omitempty"` - ClientName string `json:"clientname,omitempty"` - TD int `json:"td,omitempty"` + ACL6Name string `json:"acl6name,omitempty"` + ClientName string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + TD int `json:"td,omitempty"` } type LSNParameter struct { @@ -67,23 +73,26 @@ type LSNParameter struct { } type LSNClientNetworkBinding struct { - ClientName string `json:"clientname,omitempty"` - Netmask string `json:"netmask,omitempty"` - Network string `json:"network,omitempty"` - TD int `json:"td,omitempty"` + ClientName string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + TD int `json:"td,omitempty"` } type LSNClientNetwork6Binding struct { - ClientName string `json:"clientname,omitempty"` - Netmask string `json:"netmask,omitempty"` - Network string `json:"network,omitempty"` - Network6 string `json:"network6,omitempty"` - TD int `json:"td,omitempty"` + ClientName string `json:"clientname,omitempty"` + Count float64 `json:"__count,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` + Network6 string `json:"network6,omitempty"` + TD int `json:"td,omitempty"` } type LSNAppsProfilePortBinding struct { - AppsProfileName string `json:"appsprofilename,omitempty"` - LSNPort string `json:"lsnport,omitempty"` + AppsProfileName string `json:"appsprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + LSNPort string `json:"lsnport,omitempty"` } type LSNSession struct { @@ -130,8 +139,8 @@ type LSNSIPALGProfile struct { } type LSNRTSPALGSessionBinding struct { - LSNRTSPALGSessionDataChannelBinding []interface{} `json:"lsnrtspalgsession_datachannel_binding,omitempty"` - SessionID string `json:"sessionid,omitempty"` + LSNRTSPALGSessionDataChannelBinding []any `json:"lsnrtspalgsession_datachannel_binding,omitempty"` + SessionID string `json:"sessionid,omitempty"` } type LSNLogProfile struct { @@ -146,8 +155,9 @@ type LSNLogProfile struct { } type LSNGroupIPSECALGProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - IPSECALGProfile string `json:"ipsecalgprofile,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + IPSECALGProfile string `json:"ipsecalgprofile,omitempty"` } type LSNGroup struct { @@ -206,20 +216,21 @@ type LSNTransportProfile struct { } type LSNSIPALGCallDataChannelBinding struct { - CallID string `json:"callid,omitempty"` - ChannelFlags int `json:"channelflags,omitempty"` - ChannelIP string `json:"channelip,omitempty"` - ChannelNatIP string `json:"channelnatip,omitempty"` - ChannelNatPort int `json:"channelnatport,omitempty"` - ChannelPort int `json:"channelport,omitempty"` - ChannelProtocol string `json:"channelprotocol,omitempty"` - ChannelTimeout int `json:"channeltimeout,omitempty"` + CallID string `json:"callid,omitempty"` + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` + Count float64 `json:"__count,omitempty"` } type LSNAppsProfileBinding struct { - AppsProfileName string `json:"appsprofilename,omitempty"` - LSNAppsProfileLSNAppsAttributesBinding []interface{} `json:"lsnappsprofile_lsnappsattributes_binding,omitempty"` - LSNAppsProfilePortBinding []interface{} `json:"lsnappsprofile_port_binding,omitempty"` + AppsProfileName string `json:"appsprofilename,omitempty"` + LSNAppsProfileLSNAppsAttributesBinding []any `json:"lsnappsprofile_lsnappsattributes_binding,omitempty"` + LSNAppsProfilePortBinding []any `json:"lsnappsprofile_port_binding,omitempty"` } type LSNPool struct { @@ -233,26 +244,27 @@ type LSNPool struct { } type LSNAppsProfileLSNAppsAttributesBinding struct { - AppsAttributesName string `json:"appsattributesname,omitempty"` - AppsProfileName string `json:"appsprofilename,omitempty"` + AppsAttributesName string `json:"appsattributesname,omitempty"` + AppsProfileName string `json:"appsprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` } type LSNGroupBinding struct { - GroupName string `json:"groupname,omitempty"` - LSNGroupIPSECALGProfileBinding []interface{} `json:"lsngroup_ipsecalgprofile_binding,omitempty"` - LSNGroupLSNAppsProfileBinding []interface{} `json:"lsngroup_lsnappsprofile_binding,omitempty"` - LSNGroupLSNHTTPHdrLogProfileBinding []interface{} `json:"lsngroup_lsnhttphdrlogprofile_binding,omitempty"` - LSNGroupLSNLogProfileBinding []interface{} `json:"lsngroup_lsnlogprofile_binding,omitempty"` - LSNGroupLSNPoolBinding []interface{} `json:"lsngroup_lsnpool_binding,omitempty"` - LSNGroupLSNRTSPALGProfileBinding []interface{} `json:"lsngroup_lsnrtspalgprofile_binding,omitempty"` - LSNGroupLSNSIPALGProfileBinding []interface{} `json:"lsngroup_lsnsipalgprofile_binding,omitempty"` - LSNGroupLSNTransportProfileBinding []interface{} `json:"lsngroup_lsntransportprofile_binding,omitempty"` - LSNGroupPCPServerBinding []interface{} `json:"lsngroup_pcpserver_binding,omitempty"` + GroupName string `json:"groupname,omitempty"` + LSNGroupIPSECALGProfileBinding []any `json:"lsngroup_ipsecalgprofile_binding,omitempty"` + LSNGroupLSNAppsProfileBinding []any `json:"lsngroup_lsnappsprofile_binding,omitempty"` + LSNGroupLSNHTTPHdrLogProfileBinding []any `json:"lsngroup_lsnhttphdrlogprofile_binding,omitempty"` + LSNGroupLSNLogProfileBinding []any `json:"lsngroup_lsnlogprofile_binding,omitempty"` + LSNGroupLSNPoolBinding []any `json:"lsngroup_lsnpool_binding,omitempty"` + LSNGroupLSNRTSPALGProfileBinding []any `json:"lsngroup_lsnrtspalgprofile_binding,omitempty"` + LSNGroupLSNSIPALGProfileBinding []any `json:"lsngroup_lsnsipalgprofile_binding,omitempty"` + LSNGroupLSNTransportProfileBinding []any `json:"lsngroup_lsntransportprofile_binding,omitempty"` + LSNGroupPCPServerBinding []any `json:"lsngroup_pcpserver_binding,omitempty"` } type LSNPoolBinding struct { - LSNPoolLSNIPBinding []interface{} `json:"lsnpool_lsnip_binding,omitempty"` - PoolName string `json:"poolname,omitempty"` + LSNPoolLSNIPBinding []any `json:"lsnpool_lsnip_binding,omitempty"` + PoolName string `json:"poolname,omitempty"` } type LSNDeterministicNAT struct { @@ -273,14 +285,15 @@ type LSNDeterministicNAT struct { } type LSNGroupLSNAppsProfileBinding struct { - AppsProfileName string `json:"appsprofilename,omitempty"` - GroupName string `json:"groupname,omitempty"` + AppsProfileName string `json:"appsprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` } type LSNSIPALGCallBinding struct { - CallID string `json:"callid,omitempty"` - LSNSIPALGCallControlChannelBinding []interface{} `json:"lsnsipalgcall_controlchannel_binding,omitempty"` - LSNSIPALGCallDataChannelBinding []interface{} `json:"lsnsipalgcall_datachannel_binding,omitempty"` + CallID string `json:"callid,omitempty"` + LSNSIPALGCallControlChannelBinding []any `json:"lsnsipalgcall_controlchannel_binding,omitempty"` + LSNSIPALGCallDataChannelBinding []any `json:"lsnsipalgcall_datachannel_binding,omitempty"` } type LSNAppsProfile struct { @@ -307,19 +320,21 @@ type LSNHTTPHdrLogProfile struct { } type LSNSIPALGCallControlChannelBinding struct { - CallID string `json:"callid,omitempty"` - ChannelFlags int `json:"channelflags,omitempty"` - ChannelIP string `json:"channelip,omitempty"` - ChannelNatIP string `json:"channelnatip,omitempty"` - ChannelNatPort int `json:"channelnatport,omitempty"` - ChannelPort int `json:"channelport,omitempty"` - ChannelProtocol string `json:"channelprotocol,omitempty"` - ChannelTimeout int `json:"channeltimeout,omitempty"` + CallID string `json:"callid,omitempty"` + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` + Count float64 `json:"__count,omitempty"` } type LSNGroupLSNPoolBinding struct { - GroupName string `json:"groupname,omitempty"` - PoolName string `json:"poolname,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + PoolName string `json:"poolname,omitempty"` } type LSNSIPALGCall struct { @@ -334,9 +349,10 @@ type LSNSIPALGCall struct { } type LSNPoolLSNIPBinding struct { - LSNIP string `json:"lsnip,omitempty"` - OwnerNode int `json:"ownernode,omitempty"` - PoolName string `json:"poolname,omitempty"` + Count float64 `json:"__count,omitempty"` + LSNIP string `json:"lsnip,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` + PoolName string `json:"poolname,omitempty"` } type LSNRTSPALGSession struct { @@ -360,30 +376,33 @@ type LSNRTSPALGProfile struct { } type LSNGroupPCPServerBinding struct { - GroupName string `json:"groupname,omitempty"` - PCPServer string `json:"pcpserver,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + PCPServer string `json:"pcpserver,omitempty"` } type LSNClientBinding struct { - ClientName string `json:"clientname,omitempty"` - LSNClientNetwork6Binding []interface{} `json:"lsnclient_network6_binding,omitempty"` - LSNClientNetworkBinding []interface{} `json:"lsnclient_network_binding,omitempty"` - LSNClientNSACL6Binding []interface{} `json:"lsnclient_nsacl6_binding,omitempty"` - LSNClientNSACLBinding []interface{} `json:"lsnclient_nsacl_binding,omitempty"` + ClientName string `json:"clientname,omitempty"` + LSNClientNetwork6Binding []any `json:"lsnclient_network6_binding,omitempty"` + LSNClientNetworkBinding []any `json:"lsnclient_network_binding,omitempty"` + LSNClientNSACL6Binding []any `json:"lsnclient_nsacl6_binding,omitempty"` + LSNClientNSACLBinding []any `json:"lsnclient_nsacl_binding,omitempty"` } type LSNRTSPALGSessionDataChannelBinding struct { - ChannelFlags int `json:"channelflags,omitempty"` - ChannelIP string `json:"channelip,omitempty"` - ChannelNatIP string `json:"channelnatip,omitempty"` - ChannelNatPort int `json:"channelnatport,omitempty"` - ChannelPort int `json:"channelport,omitempty"` - ChannelProtocol string `json:"channelprotocol,omitempty"` - ChannelTimeout int `json:"channeltimeout,omitempty"` - SessionID string `json:"sessionid,omitempty"` + ChannelFlags int `json:"channelflags,omitempty"` + ChannelIP string `json:"channelip,omitempty"` + ChannelNatIP string `json:"channelnatip,omitempty"` + ChannelNatPort int `json:"channelnatport,omitempty"` + ChannelPort int `json:"channelport,omitempty"` + ChannelProtocol string `json:"channelprotocol,omitempty"` + ChannelTimeout int `json:"channeltimeout,omitempty"` + Count float64 `json:"__count,omitempty"` + SessionID string `json:"sessionid,omitempty"` } type LSNGroupLSNSIPALGProfileBinding struct { - GroupName string `json:"groupname,omitempty"` - SIPALGProfileName string `json:"sipalgprofilename,omitempty"` + Count float64 `json:"__count,omitempty"` + GroupName string `json:"groupname,omitempty"` + SIPALGProfileName string `json:"sipalgprofilename,omitempty"` } diff --git a/nitrogo/models/metrics.go b/nitrogo/models/metrics.go index f81e486..85c9c45 100644 --- a/nitrogo/models/metrics.go +++ b/nitrogo/models/metrics.go @@ -20,16 +20,16 @@ type MetricsProfileGSLBVServerBinding struct { } type MetricsProfileBinding struct { - MetricsProfileAuthenticationVServerBinding []interface{} `json:"metricsprofile_authenticationvserver_binding,omitempty"` - MetricsProfileCRVServerBinding []interface{} `json:"metricsprofile_crvserver_binding,omitempty"` - MetricsProfileCSVServerBinding []interface{} `json:"metricsprofile_csvserver_binding,omitempty"` - MetricsProfileGSLBVServerBinding []interface{} `json:"metricsprofile_gslbvserver_binding,omitempty"` - MetricsProfileLBVServerBinding []interface{} `json:"metricsprofile_lbvserver_binding,omitempty"` - MetricsProfileServiceBinding []interface{} `json:"metricsprofile_service_binding,omitempty"` - MetricsProfileServiceGroupBinding []interface{} `json:"metricsprofile_servicegroup_binding,omitempty"` - MetricsProfileUserVServerBinding []interface{} `json:"metricsprofile_uservserver_binding,omitempty"` - MetricsProfileVPNVServerBinding []interface{} `json:"metricsprofile_vpnvserver_binding,omitempty"` - Name string `json:"name,omitempty"` + MetricsProfileAuthenticationVServerBinding []any `json:"metricsprofile_authenticationvserver_binding,omitempty"` + MetricsProfileCRVServerBinding []any `json:"metricsprofile_crvserver_binding,omitempty"` + MetricsProfileCSVServerBinding []any `json:"metricsprofile_csvserver_binding,omitempty"` + MetricsProfileGSLBVServerBinding []any `json:"metricsprofile_gslbvserver_binding,omitempty"` + MetricsProfileLBVServerBinding []any `json:"metricsprofile_lbvserver_binding,omitempty"` + MetricsProfileServiceBinding []any `json:"metricsprofile_service_binding,omitempty"` + MetricsProfileServiceGroupBinding []any `json:"metricsprofile_servicegroup_binding,omitempty"` + MetricsProfileUserVServerBinding []any `json:"metricsprofile_uservserver_binding,omitempty"` + MetricsProfileVPNVServerBinding []any `json:"metricsprofile_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` } type MetricsProfile struct { diff --git a/nitrogo/models/network.go b/nitrogo/models/network.go index 9b88be2..778d71a 100644 --- a/nitrogo/models/network.go +++ b/nitrogo/models/network.go @@ -1,7 +1,7 @@ package models -// network configuration structs type ChannelInterfaceBinding struct { + Count float64 `json:"__count,omitempty"` ID string `json:"id,omitempty"` IFNum []string `json:"ifnum,omitempty"` LAMode string `json:"lamode,omitempty"` @@ -23,21 +23,23 @@ type MapDMR struct { } type RNAT6Binding struct { - Name string `json:"name,omitempty"` - RNAT6NSIP6Binding []interface{} `json:"rnat6_nsip6_binding,omitempty"` + Name string `json:"name,omitempty"` + RNAT6NSIP6Binding []any `json:"rnat6_nsip6_binding,omitempty"` } type VLANNSIP6Binding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } type ND6RAVariablesOnLinkIPv6PrefixBinding struct { - IPv6Prefix string `json:"ipv6prefix,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + IPv6Prefix string `json:"ipv6prefix,omitempty"` + VLAN int `json:"vlan,omitempty"` } type PTP struct { @@ -46,10 +48,11 @@ type PTP struct { } type RNATNSIPBinding struct { - Name string `json:"name,omitempty"` - NatIP string `json:"natip,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + NatIP string `json:"natip,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } type VRID6 struct { @@ -75,10 +78,11 @@ type VRID6 struct { } type NetProfileNATRuleBinding struct { - Name string `json:"name,omitempty"` - NATRule string `json:"natrule,omitempty"` - Netmask string `json:"netmask,omitempty"` - RewriteIP string `json:"rewriteip,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + NATRule string `json:"natrule,omitempty"` + Netmask string `json:"netmask,omitempty"` + RewriteIP string `json:"rewriteip,omitempty"` } type IPTunnel struct { @@ -107,8 +111,9 @@ type IPTunnel struct { } type NetProfileSrcPortSetBinding struct { - Name string `json:"name,omitempty"` - SrcPortRange string `json:"srcportrange,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + SrcPortRange string `json:"srcportrange,omitempty"` } type L2Param struct { @@ -132,8 +137,8 @@ type L2Param struct { } type ND6RAVariablesBinding struct { - ND6RAVariablesOnLinkIPv6PrefixBinding []interface{} `json:"nd6ravariables_onlinkipv6prefix_binding,omitempty"` - VLAN int `json:"vlan,omitempty"` + ND6RAVariablesOnLinkIPv6PrefixBinding []any `json:"nd6ravariables_onlinkipv6prefix_binding,omitempty"` + VLAN int `json:"vlan,omitempty"` } type BridgeGroup struct { @@ -152,20 +157,22 @@ type BridgeGroup struct { } type IPSetNSIP6Binding struct { - IPAddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` } type VRID6ChannelBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } type ChannelBinding struct { - ChannelInterfaceBinding []interface{} `json:"channel_interface_binding,omitempty"` - ID string `json:"id,omitempty"` + ChannelInterfaceBinding []any `json:"channel_interface_binding,omitempty"` + ID string `json:"id,omitempty"` } type RNAT6 struct { @@ -181,18 +188,20 @@ type RNAT6 struct { } type BridgeGroupNSIP6Binding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - RNAT bool `json:"rnat,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RNAT bool `json:"rnat,omitempty"` + TD int `json:"td,omitempty"` } type BridgeGroupVLANBinding struct { - ID int `json:"id,omitempty"` - RNAT bool `json:"rnat,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + RNAT bool `json:"rnat,omitempty"` + VLAN int `json:"vlan,omitempty"` } type ND6RAVariables struct { @@ -217,16 +226,18 @@ type ND6RAVariables struct { } type VRIDNSIPBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } type VLANInterfaceBinding struct { - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - Tagged bool `json:"tagged,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } type IP6TunnelParam struct { @@ -239,15 +250,17 @@ type IP6TunnelParam struct { } type VRID6TrackInterfaceBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - TrackIFNum string `json:"trackifnum,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + TrackIFNum string `json:"trackifnum,omitempty"` } type RNATGlobalAuditSyslogPolicyBinding struct { - All bool `json:"all,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + All bool `json:"all,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` } type ARPParam struct { @@ -372,9 +385,10 @@ type NetProfile struct { } type VXLANNSIPBinding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` } type RNAT struct { @@ -412,16 +426,17 @@ type IPTunnelParam struct { } type VRIDNSIP6Binding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } type BridgeGroupBinding struct { - BridgeGroupNSIP6Binding []interface{} `json:"bridgegroup_nsip6_binding,omitempty"` - BridgeGroupNSIPBinding []interface{} `json:"bridgegroup_nsip_binding,omitempty"` - BridgeGroupVLANBinding []interface{} `json:"bridgegroup_vlan_binding,omitempty"` - ID int `json:"id,omitempty"` + BridgeGroupNSIP6Binding []any `json:"bridgegroup_nsip6_binding,omitempty"` + BridgeGroupNSIPBinding []any `json:"bridgegroup_nsip_binding,omitempty"` + BridgeGroupVLANBinding []any `json:"bridgegroup_vlan_binding,omitempty"` + ID int `json:"id,omitempty"` } type IPSet struct { @@ -573,36 +588,40 @@ type Route6 struct { } type VLANLinkSetBinding struct { - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - Tagged bool `json:"tagged,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } type VLANChannelBinding struct { - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - Tagged bool `json:"tagged,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + Tagged bool `json:"tagged,omitempty"` } type FISBinding struct { - FISChannelBinding []interface{} `json:"fis_channel_binding,omitempty"` - Name string `json:"name,omitempty"` + FISChannelBinding []any `json:"fis_channel_binding,omitempty"` + Name string `json:"name,omitempty"` } type VXLANIPTunnelBinding struct { - ID int `json:"id,omitempty"` - Tunnel string `json:"tunnel,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + Tunnel string `json:"tunnel,omitempty"` } type NetProfileBinding struct { - Name string `json:"name,omitempty"` - NetProfileNATRuleBinding []interface{} `json:"netprofile_natrule_binding,omitempty"` - NetProfileSrcPortSetBinding []interface{} `json:"netprofile_srcportset_binding,omitempty"` + Name string `json:"name,omitempty"` + NetProfileNATRuleBinding []any `json:"netprofile_natrule_binding,omitempty"` + NetProfileSrcPortSetBinding []any `json:"netprofile_srcportset_binding,omitempty"` } type VXLANVLANMapVXLANBinding struct { + Count float64 `json:"__count,omitempty"` Name string `json:"name,omitempty"` VLAN []string `json:"vlan,omitempty"` VXLAN int `json:"vxlan,omitempty"` @@ -623,14 +642,15 @@ type VRIDParam struct { } type VXLANSrcIPBinding struct { - ID int `json:"id,omitempty"` - SrcIP string `json:"srcip,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + SrcIP string `json:"srcip,omitempty"` } type IPSetBinding struct { - IPSetNSIP6Binding []interface{} `json:"ipset_nsip6_binding,omitempty"` - IPSetNSIPBinding []interface{} `json:"ipset_nsip_binding,omitempty"` - Name string `json:"name,omitempty"` + IPSetNSIP6Binding []any `json:"ipset_nsip6_binding,omitempty"` + IPSetNSIPBinding []any `json:"ipset_nsip_binding,omitempty"` + Name string `json:"name,omitempty"` } type NAT64 struct { @@ -670,63 +690,70 @@ type FISInterfaceBinding struct { } type VRIDChannelBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } type VRIDBinding struct { - ID int `json:"id,omitempty"` - VRIDChannelBinding []interface{} `json:"vrid_channel_binding,omitempty"` - VRIDInterfaceBinding []interface{} `json:"vrid_interface_binding,omitempty"` - VRIDNSIP6Binding []interface{} `json:"vrid_nsip6_binding,omitempty"` - VRIDNSIPBinding []interface{} `json:"vrid_nsip_binding,omitempty"` - VRIDTrackInterfaceBinding []interface{} `json:"vrid_trackinterface_binding,omitempty"` + ID int `json:"id,omitempty"` + VRIDChannelBinding []any `json:"vrid_channel_binding,omitempty"` + VRIDInterfaceBinding []any `json:"vrid_interface_binding,omitempty"` + VRIDNSIP6Binding []any `json:"vrid_nsip6_binding,omitempty"` + VRIDNSIPBinding []any `json:"vrid_nsip_binding,omitempty"` + VRIDTrackInterfaceBinding []any `json:"vrid_trackinterface_binding,omitempty"` } type NetBridgeIPTunnelBinding struct { - Name string `json:"name,omitempty"` - Tunnel string `json:"tunnel,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Tunnel string `json:"tunnel,omitempty"` } type IPSetNSIPBinding struct { - IPAddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` } type VLANNSIPBinding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } type LinkSetInterfaceBinding struct { - ID string `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` + Count float64 `json:"__count,omitempty"` + ID string `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` } type VRIDTrackInterfaceBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - TrackIFNum string `json:"trackifnum,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + TrackIFNum string `json:"trackifnum,omitempty"` } type VRID6Binding struct { - ID int `json:"id,omitempty"` - VRID6ChannelBinding []interface{} `json:"vrid6_channel_binding,omitempty"` - VRID6InterfaceBinding []interface{} `json:"vrid6_interface_binding,omitempty"` - VRID6NSIP6Binding []interface{} `json:"vrid6_nsip6_binding,omitempty"` - VRID6NSIPBinding []interface{} `json:"vrid6_nsip_binding,omitempty"` - VRID6TrackInterfaceBinding []interface{} `json:"vrid6_trackinterface_binding,omitempty"` + ID int `json:"id,omitempty"` + VRID6ChannelBinding []any `json:"vrid6_channel_binding,omitempty"` + VRID6InterfaceBinding []any `json:"vrid6_interface_binding,omitempty"` + VRID6NSIP6Binding []any `json:"vrid6_nsip6_binding,omitempty"` + VRID6NSIPBinding []any `json:"vrid6_nsip_binding,omitempty"` + VRID6TrackInterfaceBinding []any `json:"vrid6_trackinterface_binding,omitempty"` } type NetBridgeNSIPBinding struct { - IPAddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` } type RSSKeyType struct { @@ -735,16 +762,18 @@ type RSSKeyType struct { } type MapBMRBMRV4NetworkBinding struct { - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - Network string `json:"network,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + Network string `json:"network,omitempty"` } type RNAT6NSIP6Binding struct { - Name string `json:"name,omitempty"` - NatIP6 string `json:"natip6,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + NatIP6 string `json:"natip6,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + TD int `json:"td,omitempty"` } type Route struct { @@ -802,16 +831,17 @@ type Route struct { } type NetBridgeBinding struct { - Name string `json:"name,omitempty"` - NetBridgeIPTunnelBinding []interface{} `json:"netbridge_iptunnel_binding,omitempty"` - NetBridgeNSIP6Binding []interface{} `json:"netbridge_nsip6_binding,omitempty"` - NetBridgeNSIPBinding []interface{} `json:"netbridge_nsip_binding,omitempty"` - NetBridgeVLANBinding []interface{} `json:"netbridge_vlan_binding,omitempty"` + Name string `json:"name,omitempty"` + NetBridgeIPTunnelBinding []any `json:"netbridge_iptunnel_binding,omitempty"` + NetBridgeNSIP6Binding []any `json:"netbridge_nsip6_binding,omitempty"` + NetBridgeNSIPBinding []any `json:"netbridge_nsip_binding,omitempty"` + NetBridgeVLANBinding []any `json:"netbridge_vlan_binding,omitempty"` } type LinkSetChannelBinding struct { - ID string `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` + Count float64 `json:"__count,omitempty"` + ID string `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` } type IP6Tunnel struct { @@ -839,15 +869,16 @@ type VXLANVLANMap struct { } type MapBMRBinding struct { - MapBMRBMRV4NetworkBinding []interface{} `json:"mapbmr_bmrv4network_binding,omitempty"` - Name string `json:"name,omitempty"` + MapBMRBMRV4NetworkBinding []any `json:"mapbmr_bmrv4network_binding,omitempty"` + Name string `json:"name,omitempty"` } type VRIDInterfaceBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } type BridgeTable struct { @@ -869,8 +900,8 @@ type BridgeTable struct { } type VXLANVLANMapBinding struct { - Name string `json:"name,omitempty"` - VXLANVLANMapVXLANBinding []interface{} `json:"vxlanvlanmap_vxlan_binding,omitempty"` + Name string `json:"name,omitempty"` + VXLANVLANMapVXLANBinding []any `json:"vxlanvlanmap_vxlan_binding,omitempty"` } type VRID struct { @@ -895,9 +926,10 @@ type VRID struct { } type NetBridgeNSIP6Binding struct { - IPAddress string `json:"ipaddress,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` } type INAT struct { @@ -920,8 +952,9 @@ type INAT struct { } type RNATRetainSourcePortSetBinding struct { - Name string `json:"name,omitempty"` - RetainSourcePortRange string `json:"retainsourceportrange,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + RetainSourcePortRange string `json:"retainsourceportrange,omitempty"` } type VLAN struct { @@ -967,35 +1000,38 @@ type RNATParam struct { } type VRID6NSIP6Binding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } type VXLANNSIP6Binding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` } type VLANBinding struct { - ID int `json:"id,omitempty"` - VLANChannelBinding []interface{} `json:"vlan_channel_binding,omitempty"` - VLANInterfaceBinding []interface{} `json:"vlan_interface_binding,omitempty"` - VLANLinkSetBinding []interface{} `json:"vlan_linkset_binding,omitempty"` - VLANNSIP6Binding []interface{} `json:"vlan_nsip6_binding,omitempty"` - VLANNSIPBinding []interface{} `json:"vlan_nsip_binding,omitempty"` + ID int `json:"id,omitempty"` + VLANChannelBinding []any `json:"vlan_channel_binding,omitempty"` + VLANInterfaceBinding []any `json:"vlan_interface_binding,omitempty"` + VLANLinkSetBinding []any `json:"vlan_linkset_binding,omitempty"` + VLANNSIP6Binding []any `json:"vlan_nsip6_binding,omitempty"` + VLANNSIPBinding []any `json:"vlan_nsip_binding,omitempty"` } type RNATBinding struct { - Name string `json:"name,omitempty"` - RNATNSIPBinding []interface{} `json:"rnat_nsip_binding,omitempty"` - RNATRetainSourcePortSetBinding []interface{} `json:"rnat_retainsourceportset_binding,omitempty"` + Name string `json:"name,omitempty"` + RNATNSIPBinding []any `json:"rnat_nsip_binding,omitempty"` + RNATRetainSourcePortSetBinding []any `json:"rnat_retainsourceportset_binding,omitempty"` } type NetBridgeVLANBinding struct { - Name string `json:"name,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + Name string `json:"name,omitempty"` + VLAN int `json:"vlan,omitempty"` } type Interface struct { @@ -1153,11 +1189,11 @@ type MapBMR struct { } type VxlanBinding struct { - ID int `json:"id,omitempty"` - VxlanIPTunnelBinding []interface{} `json:"vxlan_iptunnel_binding,omitempty"` - VxlanNSIP6Binding []interface{} `json:"vxlan_nsip6_binding,omitempty"` - VxlanNSIPBinding []interface{} `json:"vxlan_nsip_binding,omitempty"` - VxlanSrcIPBinding []interface{} `json:"vxlan_srcip_binding,omitempty"` + ID int `json:"id,omitempty"` + VxlanIPTunnelBinding []any `json:"vxlan_iptunnel_binding,omitempty"` + VxlanNSIP6Binding []any `json:"vxlan_nsip6_binding,omitempty"` + VxlanNSIPBinding []any `json:"vxlan_nsip_binding,omitempty"` + VxlanSrcIPBinding []any `json:"vxlan_srcip_binding,omitempty"` } type FIS struct { @@ -1176,12 +1212,13 @@ type LinkSet struct { } type BridgeGroupNSIPBinding struct { - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - Netmask string `json:"netmask,omitempty"` - OwnerGroup string `json:"ownergroup,omitempty"` - RNAT bool `json:"rnat,omitempty"` - TD int `json:"td,omitempty"` + Count float64 `json:"__count,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + Netmask string `json:"netmask,omitempty"` + OwnerGroup string `json:"ownergroup,omitempty"` + RNAT bool `json:"rnat,omitempty"` + TD int `json:"td,omitempty"` } type OnLinkIPv6Prefix struct { @@ -1199,9 +1236,10 @@ type OnLinkIPv6Prefix struct { } type VRID6NSIPBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` } type CI struct { @@ -1228,34 +1266,37 @@ type IPv6 struct { } type LinkSetBinding struct { - ID string `json:"id,omitempty"` - LinkSetChannelBinding []interface{} `json:"linkset_channel_binding,omitempty"` - LinkSetInterfaceBinding []interface{} `json:"linkset_interface_binding,omitempty"` + ID string `json:"id,omitempty"` + LinkSetChannelBinding []any `json:"linkset_channel_binding,omitempty"` + LinkSetInterfaceBinding []any `json:"linkset_interface_binding,omitempty"` } type VRID6InterfaceBinding struct { - Flags int `json:"flags,omitempty"` - ID int `json:"id,omitempty"` - IFNum string `json:"ifnum,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + Flags int `json:"flags,omitempty"` + ID int `json:"id,omitempty"` + IFNum string `json:"ifnum,omitempty"` + VLAN int `json:"vlan,omitempty"` } type RNATGlobalBinding struct { - RNATGlobalAuditSyslogPolicyBinding []interface{} `json:"rnatglobal_auditsyslogpolicy_binding,omitempty"` + RNATGlobalAuditSyslogPolicyBinding []any `json:"rnatglobal_auditsyslogpolicy_binding,omitempty"` } type FISChannelBinding struct { - IFNum string `json:"ifnum,omitempty"` - Name string `json:"name,omitempty"` - OwnerNode int `json:"ownernode,omitempty"` + Count float64 `json:"__count,omitempty"` + IFNum string `json:"ifnum,omitempty"` + Name string `json:"name,omitempty"` + OwnerNode int `json:"ownernode,omitempty"` } type MapDomainBinding struct { - MapDomainMapBMRBinding []interface{} `json:"mapdomain_mapbmr_binding,omitempty"` - Name string `json:"name,omitempty"` + MapDomainMapBMRBinding []any `json:"mapdomain_mapbmr_binding,omitempty"` + Name string `json:"name,omitempty"` } type MapDomainMapBMRBinding struct { - MapBMRName string `json:"mapbmrname,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + MapBMRName string `json:"mapbmrname,omitempty"` + Name string `json:"name,omitempty"` } diff --git a/nitrogo/models/ns.go b/nitrogo/models/ns.go index b564297..2c69794 100644 --- a/nitrogo/models/ns.go +++ b/nitrogo/models/ns.go @@ -52,8 +52,9 @@ type NSPBR struct { } type NSTrafficDomainVXLANBinding struct { - TD int `json:"td,omitempty"` - VXLAN int `json:"vxlan,omitempty"` + Count float64 `json:"__count,omitempty"` + TD int `json:"td,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } type NSPartition struct { @@ -73,8 +74,8 @@ type NSPartition struct { } type NSExtensionBinding struct { - Name string `json:"name,omitempty"` - NSExtensionExtensionFunctionBinding []interface{} `json:"nsextension_extensionfunction_binding,omitempty"` + Name string `json:"name,omitempty"` + NSExtensionExtensionFunctionBinding []any `json:"nsextension_extensionfunction_binding,omitempty"` } type NSLicense struct { @@ -333,8 +334,8 @@ type NSConfigView struct { } type NSTimerBinding struct { - Name string `json:"name,omitempty"` - NSTimerAutoScalePolicyBinding []interface{} `json:"nstimer_autoscalepolicy_binding,omitempty"` + Name string `json:"name,omitempty"` + NSTimerAutoScalePolicyBinding []any `json:"nstimer_autoscalepolicy_binding,omitempty"` } type NSDiameter struct { @@ -347,8 +348,9 @@ type NSDiameter struct { } type NSTrafficDomainBridgeGroupBinding struct { - BridgeGroup int `json:"bridgegroup,omitempty"` - TD int `json:"td,omitempty"` + BridgeGroup int `json:"bridgegroup,omitempty"` + Count float64 `json:"__count,omitempty"` + TD int `json:"td,omitempty"` } type NSRollbackCmd struct { @@ -380,7 +382,8 @@ type NSLicenseProxyServer struct { } type NSLimitIdentifierNSLimitSessionsBinding struct { - LimitIdentifier string `json:"limitidentifier,omitempty"` + Count float64 `json:"__count,omitempty"` + LimitIdentifier string `json:"limitidentifier,omitempty"` } type NSPartitionMac struct { @@ -397,15 +400,16 @@ type NSServicePath struct { } type NSPartitionBinding struct { - NSPartitionBridgeGroupBinding []interface{} `json:"nspartition_bridgegroup_binding,omitempty"` - NSPartitionVlanBinding []interface{} `json:"nspartition_vlan_binding,omitempty"` - NSPartitionVxlanBinding []interface{} `json:"nspartition_vxlan_binding,omitempty"` - PartitionName string `json:"partitionname,omitempty"` + NSPartitionBridgeGroupBinding []any `json:"nspartition_bridgegroup_binding,omitempty"` + NSPartitionVlanBinding []any `json:"nspartition_vlan_binding,omitempty"` + NSPartitionVxlanBinding []any `json:"nspartition_vxlan_binding,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } type NSPartitionBridgeGroupBinding struct { - BridgeGroup int `json:"bridgegroup,omitempty"` - PartitionName string `json:"partitionname,omitempty"` + BridgeGroup int `json:"bridgegroup,omitempty"` + Count float64 `json:"__count,omitempty"` + PartitionName string `json:"partitionname,omitempty"` } type NSConnectionTable struct { @@ -535,46 +539,48 @@ type NSConnectionTable struct { } type NSServicePathNSServiceFunctionBinding struct { - Index int `json:"index,omitempty"` - ServiceFunction string `json:"servicefunction,omitempty"` - ServicePathName string `json:"servicepathname,omitempty"` + Count float64 `json:"__count,omitempty"` + Index int `json:"index,omitempty"` + ServiceFunction string `json:"servicefunction,omitempty"` + ServicePathName string `json:"servicepathname,omitempty"` } type NSParam struct { - AdvancedAnalyticsStats string `json:"advancedanalyticsstats,omitempty"` - AFTPAllowRandomSourcePort string `json:"aftpallowrandomsourceport,omitempty"` - AutoScaleOption int `json:"autoscaleoption,omitempty"` - CIP string `json:"cip,omitempty"` - CIPHeader string `json:"cipheader,omitempty"` - CookieVersion string `json:"cookieversion,omitempty"` - CRPortRange string `json:"crportrange,omitempty"` - ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` - ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` - FTPPortRange string `json:"ftpportrange,omitempty"` - GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` - GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` - HTTPPort []interface{} `json:"httpport,omitempty"` - ICAPorts []interface{} `json:"icaports,omitempty"` - InternalUserLogin string `json:"internaluserlogin,omitempty"` - IPTTL int `json:"ipttl,omitempty"` - MaxConn int `json:"maxconn,omitempty"` - MaxReq int `json:"maxreq,omitempty"` - MgmtHTTPPort int `json:"mgmthttpport,omitempty"` - MgmtHTTPSPort int `json:"mgmthttpsport,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PMTUMin int `json:"pmtumin,omitempty"` - PMTUTimeout int `json:"pmtutimeout,omitempty"` - ProxyProtocol string `json:"proxyprotocol,omitempty"` - SecureCookie string `json:"securecookie,omitempty"` - SecureICAPorts []interface{} `json:"secureicaports,omitempty"` - ServicePathIngressVlan int `json:"servicepathingressvlan,omitempty"` - TCPCIP string `json:"tcpcip,omitempty"` - TimeZone string `json:"timezone,omitempty"` - UseProxyPort string `json:"useproxyport,omitempty"` + AdvancedAnalyticsStats string `json:"advancedanalyticsstats,omitempty"` + AFTPAllowRandomSourcePort string `json:"aftpallowrandomsourceport,omitempty"` + AutoScaleOption int `json:"autoscaleoption,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + CookieVersion string `json:"cookieversion,omitempty"` + CRPortRange string `json:"crportrange,omitempty"` + ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` + ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` + FTPPortRange string `json:"ftpportrange,omitempty"` + GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` + GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` + HTTPPort []any `json:"httpport,omitempty"` + ICAPorts []any `json:"icaports,omitempty"` + InternalUserLogin string `json:"internaluserlogin,omitempty"` + IPTTL int `json:"ipttl,omitempty"` + MaxConn int `json:"maxconn,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + MgmtHTTPPort int `json:"mgmthttpport,omitempty"` + MgmtHTTPSPort int `json:"mgmthttpsport,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PMTUMin int `json:"pmtumin,omitempty"` + PMTUTimeout int `json:"pmtutimeout,omitempty"` + ProxyProtocol string `json:"proxyprotocol,omitempty"` + SecureCookie string `json:"securecookie,omitempty"` + SecureICAPorts []any `json:"secureicaports,omitempty"` + ServicePathIngressVlan int `json:"servicepathingressvlan,omitempty"` + TCPCIP string `json:"tcpcip,omitempty"` + TimeZone string `json:"timezone,omitempty"` + UseProxyPort string `json:"useproxyport,omitempty"` } type NSExtensionExtensionFunctionBinding struct { ActiveExtensionFunction int `json:"activeextensionfunction,omitempty"` + Count float64 `json:"__count,omitempty"` ExtensionFuncDescription string `json:"extensionfuncdescription,omitempty"` ExtensionFunctionAllParams []string `json:"extensionfunctionallparams,omitempty"` ExtensionFunctionAllParamsCount int `json:"extensionfunctionallparamscount,omitempty"` @@ -599,6 +605,7 @@ type NSVersion struct { type NSHTTPParam struct { Builtin []string `json:"builtin,omitempty"` ConMultiplex string `json:"conmultiplex,omitempty"` + Count float64 `json:"__count,omitempty"` DropInvalReqs string `json:"dropinvalreqs,omitempty"` Feature string `json:"feature,omitempty"` HTTP2ServerSide string `json:"http2serverside,omitempty"` @@ -659,8 +666,9 @@ type NSIP6 struct { } type NSPartitionVXLANBinding struct { - PartitionName string `json:"partitionname,omitempty"` - VXLAN int `json:"vxlan,omitempty"` + Count float64 `json:"__count,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + VXLAN int `json:"vxlan,omitempty"` } type NSIP struct { @@ -803,36 +811,37 @@ type NSRateControl struct { } type NSLimitSessions struct { - Count float64 `json:"__count,omitempty"` - Detail bool `json:"detail,omitempty"` - Drop int `json:"drop,omitempty"` - Flag int `json:"flag,omitempty"` - Flags int `json:"flags,omitempty"` - Hits int `json:"hits,omitempty"` - LimitIdentifier string `json:"limitidentifier,omitempty"` - MaxBandwidth int `json:"maxbandwidth,omitempty"` - Name string `json:"name,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Number []interface{} `json:"number,omitempty"` - ReferenceCount int `json:"referencecount,omitempty"` - SelectorIPv61 string `json:"selectoripv61,omitempty"` - SelectorIPv62 string `json:"selectoripv62,omitempty"` - Timeout int `json:"timeout,omitempty"` - Unit int `json:"unit,omitempty"` + Count float64 `json:"__count,omitempty"` + Detail bool `json:"detail,omitempty"` + Drop int `json:"drop,omitempty"` + Flag int `json:"flag,omitempty"` + Flags int `json:"flags,omitempty"` + Hits int `json:"hits,omitempty"` + LimitIdentifier string `json:"limitidentifier,omitempty"` + MaxBandwidth int `json:"maxbandwidth,omitempty"` + Name string `json:"name,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Number []any `json:"number,omitempty"` + ReferenceCount int `json:"referencecount,omitempty"` + SelectorIPv61 string `json:"selectoripv61,omitempty"` + SelectorIPv62 string `json:"selectoripv62,omitempty"` + Timeout int `json:"timeout,omitempty"` + Unit int `json:"unit,omitempty"` } type NSTrafficDomainVLANBinding struct { - TD int `json:"td,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + TD int `json:"td,omitempty"` + VLAN int `json:"vlan,omitempty"` } type NSSPParams struct { - BaseThreshold int `json:"basethreshold,omitempty"` - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Table0 []interface{} `json:"table0,omitempty"` - Throttle string `json:"throttle,omitempty"` + BaseThreshold int `json:"basethreshold,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Table0 []any `json:"table0,omitempty"` + Throttle string `json:"throttle,omitempty"` } type NSACLs6 struct { @@ -1460,20 +1469,21 @@ type NSTCPProfile struct { } type NSTrafficDomainBinding struct { - NSTrafficDomainBridgeGroupBinding []interface{} `json:"nstrafficdomain_bridgegroup_binding,omitempty"` - NSTrafficDomainVlanBinding []interface{} `json:"nstrafficdomain_vlan_binding,omitempty"` - NSTrafficDomainVxlanBinding []interface{} `json:"nstrafficdomain_vxlan_binding,omitempty"` - TD int `json:"td,omitempty"` + NSTrafficDomainBridgeGroupBinding []any `json:"nstrafficdomain_bridgegroup_binding,omitempty"` + NSTrafficDomainVlanBinding []any `json:"nstrafficdomain_vlan_binding,omitempty"` + NSTrafficDomainVxlanBinding []any `json:"nstrafficdomain_vxlan_binding,omitempty"` + TD int `json:"td,omitempty"` } type NSTimerAutoScalePolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - Name string `json:"name,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - SampleSize int `json:"samplesize,omitempty"` - Threshold int `json:"threshold,omitempty"` - VServer string `json:"vserver,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Name string `json:"name,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + SampleSize int `json:"samplesize,omitempty"` + Threshold int `json:"threshold,omitempty"` + VServer string `json:"vserver,omitempty"` } type NSMode struct { @@ -1528,60 +1538,60 @@ type NSLASLicense struct { } type NSConfig struct { - All bool `json:"all,omitempty"` - Async bool `json:"Async,omitempty"` - ChangedPassword bool `json:"changedpassword,omitempty"` - CIP string `json:"cip,omitempty"` - CIPHeader string `json:"cipheader,omitempty"` - Config string `json:"config,omitempty"` - Config1 string `json:"config1,omitempty"` - Config2 string `json:"config2,omitempty"` - ConfigChanged bool `json:"configchanged,omitempty"` - ConfigFile string `json:"configfile,omitempty"` - CookieVersion string `json:"cookieversion,omitempty"` - CRPortRange string `json:"crportrange,omitempty"` - CurrentSystemTime string `json:"currentsytemtime,omitempty"` - ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` - ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` - Flags int `json:"flags,omitempty"` - Force bool `json:"force,omitempty"` - FTPPortRange string `json:"ftpportrange,omitempty"` - GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` - GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` - HTTPPort []interface{} `json:"httpport,omitempty"` - ID int `json:"id,omitempty"` - IFNum []string `json:"ifnum,omitempty"` - IgnoreDeviceSpecific bool `json:"ignoredevicespecific,omitempty"` - IPAddress string `json:"ipaddress,omitempty"` - LastConfigChangedTime string `json:"lastconfigchangedtime,omitempty"` - LastConfigSaveTime string `json:"lastconfigsavetime,omitempty"` - Level string `json:"level,omitempty"` - MappedIP string `json:"mappedip,omitempty"` - MaxConn int `json:"maxconn,omitempty"` - MaxReq int `json:"maxreq,omitempty"` - Message string `json:"message,omitempty"` - Netmask string `json:"netmask,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NSVLAN int `json:"nsvlan,omitempty"` - OutType string `json:"outtype,omitempty"` - PMTUMin int `json:"pmtumin,omitempty"` - PMTUTimeout int `json:"pmtutimeout,omitempty"` - PrimaryIP string `json:"primaryip,omitempty"` - PrimaryIP6 string `json:"primaryip6,omitempty"` - Range int `json:"range,omitempty"` - RBAConfig string `json:"rbaconfig,omitempty"` - Response string `json:"response,omitempty"` - ResponseFile string `json:"responsefile,omitempty"` - SecureCookie string `json:"securecookie,omitempty"` - SecureManagementTD int `json:"securemanagementtd,omitempty"` - SecureManagementTraffic string `json:"securemanagementtraffic,omitempty"` - SVMCmd int `json:"svmcmd,omitempty"` - SystemTime int `json:"systemtime,omitempty"` - SystemType string `json:"systemtype,omitempty"` - Tagged string `json:"tagged,omitempty"` - Template bool `json:"template,omitempty"` - TimeZone string `json:"timezone,omitempty"` - WeakPassword bool `json:"weakpassword,omitempty"` + All bool `json:"all,omitempty"` + Async bool `json:"Async,omitempty"` + ChangedPassword bool `json:"changedpassword,omitempty"` + CIP string `json:"cip,omitempty"` + CIPHeader string `json:"cipheader,omitempty"` + Config string `json:"config,omitempty"` + Config1 string `json:"config1,omitempty"` + Config2 string `json:"config2,omitempty"` + ConfigChanged bool `json:"configchanged,omitempty"` + ConfigFile string `json:"configfile,omitempty"` + CookieVersion string `json:"cookieversion,omitempty"` + CRPortRange string `json:"crportrange,omitempty"` + CurrentSystemTime string `json:"currentsytemtime,omitempty"` + ExclusiveQuotaMaxClient int `json:"exclusivequotamaxclient,omitempty"` + ExclusiveQuotaSpillover int `json:"exclusivequotaspillover,omitempty"` + Flags int `json:"flags,omitempty"` + Force bool `json:"force,omitempty"` + FTPPortRange string `json:"ftpportrange,omitempty"` + GrantQuotaMaxClient int `json:"grantquotamaxclient,omitempty"` + GrantQuotaSpillover int `json:"grantquotaspillover,omitempty"` + HTTPPort []any `json:"httpport,omitempty"` + ID int `json:"id,omitempty"` + IFNum []string `json:"ifnum,omitempty"` + IgnoreDeviceSpecific bool `json:"ignoredevicespecific,omitempty"` + IPAddress string `json:"ipaddress,omitempty"` + LastConfigChangedTime string `json:"lastconfigchangedtime,omitempty"` + LastConfigSaveTime string `json:"lastconfigsavetime,omitempty"` + Level string `json:"level,omitempty"` + MappedIP string `json:"mappedip,omitempty"` + MaxConn int `json:"maxconn,omitempty"` + MaxReq int `json:"maxreq,omitempty"` + Message string `json:"message,omitempty"` + Netmask string `json:"netmask,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NSVLAN int `json:"nsvlan,omitempty"` + OutType string `json:"outtype,omitempty"` + PMTUMin int `json:"pmtumin,omitempty"` + PMTUTimeout int `json:"pmtutimeout,omitempty"` + PrimaryIP string `json:"primaryip,omitempty"` + PrimaryIP6 string `json:"primaryip6,omitempty"` + Range int `json:"range,omitempty"` + RBAConfig string `json:"rbaconfig,omitempty"` + Response string `json:"response,omitempty"` + ResponseFile string `json:"responsefile,omitempty"` + SecureCookie string `json:"securecookie,omitempty"` + SecureManagementTD int `json:"securemanagementtd,omitempty"` + SecureManagementTraffic string `json:"securemanagementtraffic,omitempty"` + SVMCmd int `json:"svmcmd,omitempty"` + SystemTime int `json:"systemtime,omitempty"` + SystemType string `json:"systemtype,omitempty"` + Tagged string `json:"tagged,omitempty"` + Template bool `json:"template,omitempty"` + TimeZone string `json:"timezone,omitempty"` + WeakPassword bool `json:"weakpassword,omitempty"` } type NSAPTLicense struct { @@ -1718,8 +1728,8 @@ type NSFeature struct { } type NSServicePathBinding struct { - NSServicePathNSServiceFunctionBinding []interface{} `json:"nsservicepath_nsservicefunction_binding,omitempty"` - ServicePathName string `json:"servicepathname,omitempty"` + NSServicePathNSServiceFunctionBinding []any `json:"nsservicepath_nsservicefunction_binding,omitempty"` + ServicePathName string `json:"servicepathname,omitempty"` } type NSLicenseParameters struct { @@ -1779,8 +1789,9 @@ type NSTrafficDomain struct { } type NSPartitionVlanBinding struct { - PartitionName string `json:"partitionname,omitempty"` - VLAN int `json:"vlan,omitempty"` + Count float64 `json:"__count,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + VLAN int `json:"vlan,omitempty"` } type NSCQAParam struct { @@ -1812,6 +1823,6 @@ type NSStats struct { } type NSLimitIdentifierBinding struct { - LimitIdentifier string `json:"limitidentifier,omitempty"` - NSLimitIdentifierNSLimitSessionsBinding []interface{} `json:"nslimitidentifier_nslimitsessions_binding,omitempty"` + LimitIdentifier string `json:"limitidentifier,omitempty"` + NSLimitIdentifierNSLimitSessionsBinding []any `json:"nslimitidentifier_nslimitsessions_binding,omitempty"` } diff --git a/nitrogo/models/ntp.go b/nitrogo/models/ntp.go index a7e585f..1cf8bbb 100644 --- a/nitrogo/models/ntp.go +++ b/nitrogo/models/ntp.go @@ -14,11 +14,11 @@ type NTPServer struct { } type NTPParam struct { - Authentication string `json:"authentication,omitempty"` - AutoKeyLogSec int `json:"autokeylogsec,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - RevokeLogSec int `json:"revokelogsec,omitempty"` - TrustedKey []interface{} `json:"trustedkey,omitempty"` + Authentication string `json:"authentication,omitempty"` + AutoKeyLogSec int `json:"autokeylogsec,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + RevokeLogSec int `json:"revokelogsec,omitempty"` + TrustedKey []any `json:"trustedkey,omitempty"` } type NTPSync struct { diff --git a/nitrogo/models/policy.go b/nitrogo/models/policy.go index 8dc1789..6e531b3 100644 --- a/nitrogo/models/policy.go +++ b/nitrogo/models/policy.go @@ -12,13 +12,13 @@ type PolicyPatsetPatternBinding struct { } type PolicyStringMapBinding struct { - Name string `json:"name,omitempty"` - PolicyStringMapPatternBinding []interface{} `json:"policystringmap_pattern_binding,omitempty"` + Name string `json:"name,omitempty"` + PolicyStringMapPatternBinding []any `json:"policystringmap_pattern_binding,omitempty"` } type PolicyDatasetBinding struct { - Name string `json:"name,omitempty"` - PolicyDatasetValueBinding []interface{} `json:"policydataset_value_binding,omitempty"` + Name string `json:"name,omitempty"` + PolicyDatasetValueBinding []any `json:"policydataset_value_binding,omitempty"` } type PolicyStringMapPatternBinding struct { @@ -53,8 +53,8 @@ type PolicyStringMap struct { } type PolicyPatsetBinding struct { - Name string `json:"name,omitempty"` - PolicyPatsetPatternBinding []interface{} `json:"policypatset_pattern_binding,omitempty"` + Name string `json:"name,omitempty"` + PolicyPatsetPatternBinding []any `json:"policypatset_pattern_binding,omitempty"` } type PolicyDatasetValueBinding struct { @@ -107,40 +107,40 @@ type PolicyURLSet struct { } type PolicyEvaluation struct { - Action string `json:"action,omitempty"` - Count float64 `json:"__count,omitempty"` - Expression string `json:"expression,omitempty"` - Input string `json:"input,omitempty"` - IsTruncatedRefResult bool `json:"istruncatedrefresult,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - PitActionErrorResult string `json:"pitactionerrorresult,omitempty"` - PitActionEvalTime int `json:"pitactionevaltime,omitempty"` - PitBoolErrorResult string `json:"pitboolerrorresult,omitempty"` - PitBoolEvalTime int `json:"pitboolevaltime,omitempty"` - PitBoolResult bool `json:"pitboolresult,omitempty"` - PitDoubleErrorResult string `json:"pitdoubleerrorresult,omitempty"` - PitDoubleEvalTime int `json:"pitdoubleevaltime,omitempty"` - PitDoubleResult float64 `json:"pitdoubleresult,omitempty"` - PitModifiedInputData string `json:"pitmodifiedinputdata,omitempty"` - PitNewOffsetArray []interface{} `json:"pitnewoffsetarray,omitempty"` - PitNumErrorResult string `json:"pitnumerrorresult,omitempty"` - PitNumEvalTime int `json:"pitnumevaltime,omitempty"` - PitNumResult int `json:"pitnumresult,omitempty"` - PitOffsetErrorResult string `json:"pitoffseterrorresult,omitempty"` - PitOffsetEvalTime int `json:"pitoffsetevaltime,omitempty"` - PitOffsetLengthArray []interface{} `json:"pitoffsetlengtharray,omitempty"` - PitOffsetNewLengthArray []interface{} `json:"pitoffsetnewlengtharray,omitempty"` - PitOffsetResult int `json:"pitoffsetresult,omitempty"` - PitOffsetResultLen int `json:"pitoffsetresultlen,omitempty"` - PitOldOffsetArray []interface{} `json:"pitoldoffsetarray,omitempty"` - PitOperationPerformerArray []string `json:"pitoperationperformerarray,omitempty"` - PitRefErrorResult string `json:"pitreferrorresult,omitempty"` - PitRefEvalTime int `json:"pitrefevaltime,omitempty"` - PitRefResult string `json:"pitrefresult,omitempty"` - PitUlongErrorResult string `json:"pitulongerrorresult,omitempty"` - PitUlongEvalTime int `json:"pitulongevaltime,omitempty"` - PitUlongResult int `json:"pitulongresult,omitempty"` - TypeField string `json:"type,omitempty"` + Action string `json:"action,omitempty"` + Count float64 `json:"__count,omitempty"` + Expression string `json:"expression,omitempty"` + Input string `json:"input,omitempty"` + IsTruncatedRefResult bool `json:"istruncatedrefresult,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + PitActionErrorResult string `json:"pitactionerrorresult,omitempty"` + PitActionEvalTime int `json:"pitactionevaltime,omitempty"` + PitBoolErrorResult string `json:"pitboolerrorresult,omitempty"` + PitBoolEvalTime int `json:"pitboolevaltime,omitempty"` + PitBoolResult bool `json:"pitboolresult,omitempty"` + PitDoubleErrorResult string `json:"pitdoubleerrorresult,omitempty"` + PitDoubleEvalTime int `json:"pitdoubleevaltime,omitempty"` + PitDoubleResult float64 `json:"pitdoubleresult,omitempty"` + PitModifiedInputData string `json:"pitmodifiedinputdata,omitempty"` + PitNewOffsetArray []any `json:"pitnewoffsetarray,omitempty"` + PitNumErrorResult string `json:"pitnumerrorresult,omitempty"` + PitNumEvalTime int `json:"pitnumevaltime,omitempty"` + PitNumResult int `json:"pitnumresult,omitempty"` + PitOffsetErrorResult string `json:"pitoffseterrorresult,omitempty"` + PitOffsetEvalTime int `json:"pitoffsetevaltime,omitempty"` + PitOffsetLengthArray []any `json:"pitoffsetlengtharray,omitempty"` + PitOffsetNewLengthArray []any `json:"pitoffsetnewlengtharray,omitempty"` + PitOffsetResult int `json:"pitoffsetresult,omitempty"` + PitOffsetResultLen int `json:"pitoffsetresultlen,omitempty"` + PitOldOffsetArray []any `json:"pitoldoffsetarray,omitempty"` + PitOperationPerformerArray []string `json:"pitoperationperformerarray,omitempty"` + PitRefErrorResult string `json:"pitreferrorresult,omitempty"` + PitRefEvalTime int `json:"pitrefevaltime,omitempty"` + PitRefResult string `json:"pitrefresult,omitempty"` + PitUlongErrorResult string `json:"pitulongerrorresult,omitempty"` + PitUlongEvalTime int `json:"pitulongevaltime,omitempty"` + PitUlongResult int `json:"pitulongresult,omitempty"` + TypeField string `json:"type,omitempty"` } type PolicyHTTPCallout struct { diff --git a/nitrogo/models/protocol.go b/nitrogo/models/protocol.go index 38abffe..774a4f7 100644 --- a/nitrogo/models/protocol.go +++ b/nitrogo/models/protocol.go @@ -2,20 +2,20 @@ package models // protocol configuration structs type ProtocolHTTPBand struct { - AccessCount []interface{} `json:"accesscount,omitempty"` - AccessRatio []interface{} `json:"accessratio,omitempty"` - AccessRatioNew []interface{} `json:"accessrationew,omitempty"` - AvgBandSize []interface{} `json:"avgbandsize,omitempty"` - AvgBandSizeNew []interface{} `json:"avgbandsizenew,omitempty"` - BandData []interface{} `json:"banddata,omitempty"` - BandDataNew []interface{} `json:"banddatanew,omitempty"` - BandRange int `json:"bandrange,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NodeID int `json:"nodeid,omitempty"` - NumberOfBands int `json:"numberofbands,omitempty"` - ReqBandSize int `json:"reqbandsize,omitempty"` - RespBandSize int `json:"respbandsize,omitempty"` - TotalBandSize []interface{} `json:"totalbandsize,omitempty"` - Totals []interface{} `json:"totals,omitempty"` - TypeField string `json:"type,omitempty"` + AccessCount []any `json:"accesscount,omitempty"` + AccessRatio []any `json:"accessratio,omitempty"` + AccessRatioNew []any `json:"accessrationew,omitempty"` + AvgBandSize []any `json:"avgbandsize,omitempty"` + AvgBandSizeNew []any `json:"avgbandsizenew,omitempty"` + BandData []any `json:"banddata,omitempty"` + BandDataNew []any `json:"banddatanew,omitempty"` + BandRange int `json:"bandrange,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + NumberOfBands int `json:"numberofbands,omitempty"` + ReqBandSize int `json:"reqbandsize,omitempty"` + RespBandSize int `json:"respbandsize,omitempty"` + TotalBandSize []any `json:"totalbandsize,omitempty"` + Totals []any `json:"totals,omitempty"` + TypeField string `json:"type,omitempty"` } diff --git a/nitrogo/models/responder.go b/nitrogo/models/responder.go index d9813f9..cde457a 100644 --- a/nitrogo/models/responder.go +++ b/nitrogo/models/responder.go @@ -130,9 +130,9 @@ type ResponderPolicyLabelResponderPolicyBinding struct { } type ResponderPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - ResponderPolicyLabelPolicyBindingBinding []interface{} `json:"responderpolicylabel_policybinding_binding,omitempty"` - ResponderPolicyLabelResponderPolicyBinding []interface{} `json:"responderpolicylabel_responderpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + ResponderPolicyLabelPolicyBindingBinding []any `json:"responderpolicylabel_policybinding_binding,omitempty"` + ResponderPolicyLabelResponderPolicyBinding []any `json:"responderpolicylabel_responderpolicy_binding,omitempty"` } type ResponderPolicy struct { @@ -169,15 +169,15 @@ type ResponderParam struct { } type ResponderPolicyBinding struct { - Name string `json:"name,omitempty"` - ResponderPolicyCRVServerBinding []interface{} `json:"responderpolicy_crvserver_binding,omitempty"` - ResponderPolicyCSVServerBinding []interface{} `json:"responderpolicy_csvserver_binding,omitempty"` - ResponderPolicyLBVServerBinding []interface{} `json:"responderpolicy_lbvserver_binding,omitempty"` - ResponderPolicyResponderGlobalBinding []interface{} `json:"responderpolicy_responderglobal_binding,omitempty"` - ResponderPolicyResponderPolicyLabelBinding []interface{} `json:"responderpolicy_responderpolicylabel_binding,omitempty"` - ResponderPolicyVPNVServerBinding []interface{} `json:"responderpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + ResponderPolicyCRVServerBinding []any `json:"responderpolicy_crvserver_binding,omitempty"` + ResponderPolicyCSVServerBinding []any `json:"responderpolicy_csvserver_binding,omitempty"` + ResponderPolicyLBVServerBinding []any `json:"responderpolicy_lbvserver_binding,omitempty"` + ResponderPolicyResponderGlobalBinding []any `json:"responderpolicy_responderglobal_binding,omitempty"` + ResponderPolicyResponderPolicyLabelBinding []any `json:"responderpolicy_responderpolicylabel_binding,omitempty"` + ResponderPolicyVPNVServerBinding []any `json:"responderpolicy_vpnvserver_binding,omitempty"` } type ResponderGlobalBinding struct { - ResponderGlobalResponderPolicyBinding []interface{} `json:"responderglobal_responderpolicy_binding,omitempty"` + ResponderGlobalResponderPolicyBinding []any `json:"responderglobal_responderpolicy_binding,omitempty"` } diff --git a/nitrogo/models/rewrite.go b/nitrogo/models/rewrite.go index 19b46f5..8920bde 100644 --- a/nitrogo/models/rewrite.go +++ b/nitrogo/models/rewrite.go @@ -2,7 +2,7 @@ package models // rewrite configuration structs type RewriteGlobalBinding struct { - RewriteGlobalRewritePolicyBinding []interface{} `json:"rewriteglobal_rewritepolicy_binding,omitempty"` + RewriteGlobalRewritePolicyBinding []any `json:"rewriteglobal_rewritepolicy_binding,omitempty"` } type RewritePolicy struct { @@ -74,9 +74,9 @@ type RewritePolicyLabelRewritePolicyBinding struct { } type RewritePolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - RewritePolicyLabelPolicyBindingBinding []interface{} `json:"rewritepolicylabel_policybinding_binding,omitempty"` - RewritePolicyLabelRewritePolicyBinding []interface{} `json:"rewritepolicylabel_rewritepolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + RewritePolicyLabelPolicyBindingBinding []any `json:"rewritepolicylabel_policybinding_binding,omitempty"` + RewritePolicyLabelRewritePolicyBinding []any `json:"rewritepolicylabel_rewritepolicy_binding,omitempty"` } type RewritePolicyCSVServerBinding struct { @@ -100,12 +100,12 @@ type RewritePolicyRewriteGlobalBinding struct { } type RewritePolicyBinding struct { - Name string `json:"name,omitempty"` - RewritePolicyCSVServerBinding []interface{} `json:"rewritepolicy_csvserver_binding,omitempty"` - RewritePolicyLBVServerBinding []interface{} `json:"rewritepolicy_lbvserver_binding,omitempty"` - RewritePolicyRewriteGlobalBinding []interface{} `json:"rewritepolicy_rewriteglobal_binding,omitempty"` - RewritePolicyRewritePolicyLabelBinding []interface{} `json:"rewritepolicy_rewritepolicylabel_binding,omitempty"` - RewritePolicyVPNVServerBinding []interface{} `json:"rewritepolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + RewritePolicyCSVServerBinding []any `json:"rewritepolicy_csvserver_binding,omitempty"` + RewritePolicyLBVServerBinding []any `json:"rewritepolicy_lbvserver_binding,omitempty"` + RewritePolicyRewriteGlobalBinding []any `json:"rewritepolicy_rewriteglobal_binding,omitempty"` + RewritePolicyRewritePolicyLabelBinding []any `json:"rewritepolicy_rewritepolicylabel_binding,omitempty"` + RewritePolicyVPNVServerBinding []any `json:"rewritepolicy_vpnvserver_binding,omitempty"` } type RewriteParam struct { diff --git a/nitrogo/models/snmp.go b/nitrogo/models/snmp.go index 46943d3..91dea6e 100644 --- a/nitrogo/models/snmp.go +++ b/nitrogo/models/snmp.go @@ -64,11 +64,11 @@ type SNMPCommunity struct { } type SNMPTrapBinding struct { - SNMPTrapSNMPUserBinding []interface{} `json:"snmptrap_snmpuser_binding,omitempty"` - TD int `json:"td,omitempty"` - TrapClass string `json:"trapclass,omitempty"` - TrapDestination string `json:"trapdestination,omitempty"` - Version string `json:"version,omitempty"` + SNMPTrapSNMPUserBinding []any `json:"snmptrap_snmpuser_binding,omitempty"` + TD int `json:"td,omitempty"` + TrapClass string `json:"trapclass,omitempty"` + TrapDestination string `json:"trapdestination,omitempty"` + Version string `json:"version,omitempty"` } type SNMPUser struct { diff --git a/nitrogo/models/spillover.go b/nitrogo/models/spillover.go index a876a4b..f950c29 100644 --- a/nitrogo/models/spillover.go +++ b/nitrogo/models/spillover.go @@ -36,10 +36,10 @@ type SpilloverPolicyLBVServerBinding struct { } type SpilloverPolicyBinding struct { - Name string `json:"name,omitempty"` - SpilloverPolicyCSVServerBinding []interface{} `json:"spilloverpolicy_csvserver_binding,omitempty"` - SpilloverPolicyGSLBVServerBinding []interface{} `json:"spilloverpolicy_gslbvserver_binding,omitempty"` - SpilloverPolicyLBVServerBinding []interface{} `json:"spilloverpolicy_lbvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + SpilloverPolicyCSVServerBinding []any `json:"spilloverpolicy_csvserver_binding,omitempty"` + SpilloverPolicyGSLBVServerBinding []any `json:"spilloverpolicy_gslbvserver_binding,omitempty"` + SpilloverPolicyLBVServerBinding []any `json:"spilloverpolicy_lbvserver_binding,omitempty"` } type SpilloverAction struct { diff --git a/nitrogo/models/ssl.go b/nitrogo/models/ssl.go index 7d3b8cb..508efb0 100644 --- a/nitrogo/models/ssl.go +++ b/nitrogo/models/ssl.go @@ -36,10 +36,10 @@ type SSLPolicyCSVServerBinding struct { } type SSLCipherBinding struct { - CipherGroupName string `json:"ciphergroupname,omitempty"` - SSLCipherIndividualCipherBinding []interface{} `json:"sslcipher_individualcipher_binding,omitempty"` - SSLCipherSSLCipherSuiteBinding []interface{} `json:"sslcipher_sslciphersuite_binding,omitempty"` - SSLCipherSSLProfileBinding []interface{} `json:"sslcipher_sslprofile_binding,omitempty"` + CipherGroupName string `json:"ciphergroupname,omitempty"` + SSLCipherIndividualCipherBinding []any `json:"sslcipher_individualcipher_binding,omitempty"` + SSLCipherSSLCipherSuiteBinding []any `json:"sslcipher_sslciphersuite_binding,omitempty"` + SSLCipherSSLProfileBinding []any `json:"sslcipher_sslprofile_binding,omitempty"` } type SSLPolicySSLPolicyLabelBinding struct { @@ -130,15 +130,15 @@ type SSLPolicySSLServiceBinding struct { } type SSLVServerBinding struct { - SSLVServerECCCurveBinding []interface{} `json:"sslvserver_ecccurve_binding,omitempty"` - SSLVServerHashicorpBinding []interface{} `json:"sslvserver_hashicorp_binding,omitempty"` - SSLVServerSSLCACertBundleBinding []interface{} `json:"sslvserver_sslcacertbundle_binding,omitempty"` - SSLVServerSSLCertKeyBinding []interface{} `json:"sslvserver_sslcertkey_binding,omitempty"` - SSLVServerSSLCertKeyBundleBinding []interface{} `json:"sslvserver_sslcertkeybundle_binding,omitempty"` - SSLVServerSSLCipherBinding []interface{} `json:"sslvserver_sslcipher_binding,omitempty"` - SSLVServerSSLCipherSuiteBinding []interface{} `json:"sslvserver_sslciphersuite_binding,omitempty"` - SSLVServerSSLPolicyBinding []interface{} `json:"sslvserver_sslpolicy_binding,omitempty"` - VServerName string `json:"vservername,omitempty"` + SSLVServerECCCurveBinding []any `json:"sslvserver_ecccurve_binding,omitempty"` + SSLVServerHashicorpBinding []any `json:"sslvserver_hashicorp_binding,omitempty"` + SSLVServerSSLCACertBundleBinding []any `json:"sslvserver_sslcacertbundle_binding,omitempty"` + SSLVServerSSLCertKeyBinding []any `json:"sslvserver_sslcertkey_binding,omitempty"` + SSLVServerSSLCertKeyBundleBinding []any `json:"sslvserver_sslcertkeybundle_binding,omitempty"` + SSLVServerSSLCipherBinding []any `json:"sslvserver_sslcipher_binding,omitempty"` + SSLVServerSSLCipherSuiteBinding []any `json:"sslvserver_sslciphersuite_binding,omitempty"` + SSLVServerSSLPolicyBinding []any `json:"sslvserver_sslpolicy_binding,omitempty"` + VServerName string `json:"vservername,omitempty"` } type SSLECDSAKey struct { @@ -170,8 +170,8 @@ type SSLHSMKey struct { } type SSLCACertGroupBinding struct { - CACertGroupName string `json:"cacertgroupname,omitempty"` - SSLCACertGroupSSLCertKeyBinding []interface{} `json:"sslcacertgroup_sslcertkey_binding,omitempty"` + CACertGroupName string `json:"cacertgroupname,omitempty"` + SSLCACertGroupSSLCertKeyBinding []any `json:"sslcacertgroup_sslcertkey_binding,omitempty"` } type SSLCipherSuite struct { @@ -182,22 +182,22 @@ type SSLCipherSuite struct { } type SSLCRLBinding struct { - CRLName string `json:"crlname,omitempty"` - SSLCRLSerialNumberBinding []interface{} `json:"sslcrl_serialnumber_binding,omitempty"` + CRLName string `json:"crlname,omitempty"` + SSLCRLSerialNumberBinding []any `json:"sslcrl_serialnumber_binding,omitempty"` } type SSLPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - SSLPolicyLabelSSLPolicyBinding []interface{} `json:"sslpolicylabel_sslpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + SSLPolicyLabelSSLPolicyBinding []any `json:"sslpolicylabel_sslpolicy_binding,omitempty"` } type SSLServiceGroupBinding struct { - ServiceGroupName string `json:"servicegroupname,omitempty"` - SSLServiceGroupECCCurveBinding []interface{} `json:"sslservicegroup_ecccurve_binding,omitempty"` - SSLServiceGroupSSLCACertBundleBinding []interface{} `json:"sslservicegroup_sslcacertbundle_binding,omitempty"` - SSLServiceGroupSSLCertKeyBinding []interface{} `json:"sslservicegroup_sslcertkey_binding,omitempty"` - SSLServiceGroupSSLCipherBinding []interface{} `json:"sslservicegroup_sslcipher_binding,omitempty"` - SSLServiceGroupSSLCipherSuiteBinding []interface{} `json:"sslservicegroup_sslciphersuite_binding,omitempty"` + ServiceGroupName string `json:"servicegroupname,omitempty"` + SSLServiceGroupECCCurveBinding []any `json:"sslservicegroup_ecccurve_binding,omitempty"` + SSLServiceGroupSSLCACertBundleBinding []any `json:"sslservicegroup_sslcacertbundle_binding,omitempty"` + SSLServiceGroupSSLCertKeyBinding []any `json:"sslservicegroup_sslcertkey_binding,omitempty"` + SSLServiceGroupSSLCipherBinding []any `json:"sslservicegroup_sslcipher_binding,omitempty"` + SSLServiceGroupSSLCipherSuiteBinding []any `json:"sslservicegroup_sslciphersuite_binding,omitempty"` } type SSLWrapKey struct { @@ -267,9 +267,9 @@ type SSLCRL struct { } type SSLCertKeyBundleBinding struct { - CertKeyBundleName string `json:"certkeybundlename,omitempty"` - SSLCertKeyBundleIntermediateCertLinksBinding []interface{} `json:"sslcertkeybundle_intermediatecertlinks_binding,omitempty"` - SSLCertKeyBundleSSLVServerBinding []interface{} `json:"sslcertkeybundle_sslvserver_binding,omitempty"` + CertKeyBundleName string `json:"certkeybundlename,omitempty"` + SSLCertKeyBundleIntermediateCertLinksBinding []any `json:"sslcertkeybundle_intermediatecertlinks_binding,omitempty"` + SSLCertKeyBundleSSLVServerBinding []any `json:"sslcertkeybundle_sslvserver_binding,omitempty"` } type SSLProfileSSLCipherBinding struct { @@ -304,13 +304,13 @@ type SSLVServerSSLCACertBundleBinding struct { } type SSLProfileBinding struct { - Name string `json:"name,omitempty"` - SSLProfileECCCurveBinding []interface{} `json:"sslprofile_ecccurve_binding,omitempty"` - SSLProfileSSLCertKeyBinding []interface{} `json:"sslprofile_sslcertkey_binding,omitempty"` - SSLProfileSSLCipherBinding []interface{} `json:"sslprofile_sslcipher_binding,omitempty"` - SSLProfileSSLCipherSuiteBinding []interface{} `json:"sslprofile_sslciphersuite_binding,omitempty"` - SSLProfileSSLECHConfigBinding []interface{} `json:"sslprofile_sslechconfig_binding,omitempty"` - SSLProfileSSLVServerBinding []interface{} `json:"sslprofile_sslvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + SSLProfileECCCurveBinding []any `json:"sslprofile_ecccurve_binding,omitempty"` + SSLProfileSSLCertKeyBinding []any `json:"sslprofile_sslcertkey_binding,omitempty"` + SSLProfileSSLCipherBinding []any `json:"sslprofile_sslcipher_binding,omitempty"` + SSLProfileSSLCipherSuiteBinding []any `json:"sslprofile_sslciphersuite_binding,omitempty"` + SSLProfileSSLECHConfigBinding []any `json:"sslprofile_sslechconfig_binding,omitempty"` + SSLProfileSSLVServerBinding []any `json:"sslprofile_sslvserver_binding,omitempty"` } type SSLCertKeyServiceBinding struct { @@ -703,8 +703,8 @@ type SSLCertKeyBundle struct { } type SSLCertChainBinding struct { - CertKeyName string `json:"certkeyname,omitempty"` - SSLCertChainSSLCertKeyBinding []interface{} `json:"sslcertchain_sslcertkey_binding,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + SSLCertChainSSLCertKeyBinding []any `json:"sslcertchain_sslcertkey_binding,omitempty"` } type SSLCertificateChain struct { @@ -880,13 +880,13 @@ type SSLZeroTouchParam struct { } type SSLPolicyBinding struct { - Name string `json:"name,omitempty"` - SSLPolicyCSVServerBinding []interface{} `json:"sslpolicy_csvserver_binding,omitempty"` - SSLPolicyLBVServerBinding []interface{} `json:"sslpolicy_lbvserver_binding,omitempty"` - SSLPolicySSLGlobalBinding []interface{} `json:"sslpolicy_sslglobal_binding,omitempty"` - SSLPolicySSLPolicyLabelBinding []interface{} `json:"sslpolicy_sslpolicylabel_binding,omitempty"` - SSLPolicySSLServiceBinding []interface{} `json:"sslpolicy_sslservice_binding,omitempty"` - SSLPolicySSLVServerBinding []interface{} `json:"sslpolicy_sslvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + SSLPolicyCSVServerBinding []any `json:"sslpolicy_csvserver_binding,omitempty"` + SSLPolicyLBVServerBinding []any `json:"sslpolicy_lbvserver_binding,omitempty"` + SSLPolicySSLGlobalBinding []any `json:"sslpolicy_sslglobal_binding,omitempty"` + SSLPolicySSLPolicyLabelBinding []any `json:"sslpolicy_sslpolicylabel_binding,omitempty"` + SSLPolicySSLServiceBinding []any `json:"sslpolicy_sslservice_binding,omitempty"` + SSLPolicySSLVServerBinding []any `json:"sslpolicy_sslvserver_binding,omitempty"` } type SSLPKCS12 struct { @@ -944,7 +944,7 @@ type SSLDynamicClientCertCache struct { } type SSLGlobalBinding struct { - SSLGlobalSSLPolicyBinding []interface{} `json:"sslglobal_sslpolicy_binding,omitempty"` + SSLGlobalSSLPolicyBinding []any `json:"sslglobal_sslpolicy_binding,omitempty"` } type SSLServiceSSLCACertBundleBinding struct { @@ -1115,18 +1115,18 @@ type SSLCertReq struct { } type SSLCACertBundleBinding struct { - CACertBundleName string `json:"cacertbundlename,omitempty"` - SSLCACertBundleIntermediateCACertListBinding []interface{} `json:"sslcacertbundle_intermediatecacertlist_binding,omitempty"` + CACertBundleName string `json:"cacertbundlename,omitempty"` + SSLCACertBundleIntermediateCACertListBinding []any `json:"sslcacertbundle_intermediatecacertlist_binding,omitempty"` } type SSLServiceBinding struct { - ServiceName string `json:"servicename,omitempty"` - SSLServiceECCCurveBinding []interface{} `json:"sslservice_ecccurve_binding,omitempty"` - SSLServiceSSLCACertBundleBinding []interface{} `json:"sslservice_sslcacertbundle_binding,omitempty"` - SSLServiceSSLCertKeyBinding []interface{} `json:"sslservice_sslcertkey_binding,omitempty"` - SSLServiceSSLCipherBinding []interface{} `json:"sslservice_sslcipher_binding,omitempty"` - SSLServiceSSLCipherSuiteBinding []interface{} `json:"sslservice_sslciphersuite_binding,omitempty"` - SSLServiceSSLPolicyBinding []interface{} `json:"sslservice_sslpolicy_binding,omitempty"` + ServiceName string `json:"servicename,omitempty"` + SSLServiceECCCurveBinding []any `json:"sslservice_ecccurve_binding,omitempty"` + SSLServiceSSLCACertBundleBinding []any `json:"sslservice_sslcacertbundle_binding,omitempty"` + SSLServiceSSLCertKeyBinding []any `json:"sslservice_sslcertkey_binding,omitempty"` + SSLServiceSSLCipherBinding []any `json:"sslservice_sslcipher_binding,omitempty"` + SSLServiceSSLCipherSuiteBinding []any `json:"sslservice_sslciphersuite_binding,omitempty"` + SSLServiceSSLPolicyBinding []any `json:"sslservice_sslpolicy_binding,omitempty"` } type SSLCipher struct { @@ -1146,12 +1146,12 @@ type SSLCertChain struct { } type SSLCertKeyBinding struct { - CertKey string `json:"certkey,omitempty"` - SSLCertKeyCRLDistributionBinding []interface{} `json:"sslcertkey_crldistribution_binding,omitempty"` - SSLCertKeyServiceBinding []interface{} `json:"sslcertkey_service_binding,omitempty"` - SSLCertKeySSLOCSPResponderBinding []interface{} `json:"sslcertkey_sslocspresponder_binding,omitempty"` - SSLCertKeySSLProfileBinding []interface{} `json:"sslcertkey_sslprofile_binding,omitempty"` - SSLCertKeySSLVServerBinding []interface{} `json:"sslcertkey_sslvserver_binding,omitempty"` + CertKey string `json:"certkey,omitempty"` + SSLCertKeyCRLDistributionBinding []any `json:"sslcertkey_crldistribution_binding,omitempty"` + SSLCertKeyServiceBinding []any `json:"sslcertkey_service_binding,omitempty"` + SSLCertKeySSLOCSPResponderBinding []any `json:"sslcertkey_sslocspresponder_binding,omitempty"` + SSLCertKeySSLProfileBinding []any `json:"sslcertkey_sslprofile_binding,omitempty"` + SSLCertKeySSLVServerBinding []any `json:"sslcertkey_sslvserver_binding,omitempty"` } type SSLPolicyLabel struct { diff --git a/nitrogo/models/stream.go b/nitrogo/models/stream.go index ab8e2a4..7960c50 100644 --- a/nitrogo/models/stream.go +++ b/nitrogo/models/stream.go @@ -28,9 +28,9 @@ type StreamIdentifier struct { } type StreamIdentifierBinding struct { - Name string `json:"name,omitempty"` - StreamIdentifierAnalyticsProfileBinding []interface{} `json:"streamidentifier_analyticsprofile_binding,omitempty"` - StreamIdentifierStreamSessionBinding []interface{} `json:"streamidentifier_streamsession_binding,omitempty"` + Name string `json:"name,omitempty"` + StreamIdentifierAnalyticsProfileBinding []any `json:"streamidentifier_analyticsprofile_binding,omitempty"` + StreamIdentifierStreamSessionBinding []any `json:"streamidentifier_streamsession_binding,omitempty"` } type StreamIdentifierAnalyticsProfileBinding struct { diff --git a/nitrogo/models/subscriber.go b/nitrogo/models/subscriber.go index 2a593b4..15aa8b8 100644 --- a/nitrogo/models/subscriber.go +++ b/nitrogo/models/subscriber.go @@ -18,44 +18,44 @@ type SubscriberSessions struct { } type SubscriberGxInterface struct { - CerRequestTimeout int `json:"cerrequesttimeout,omitempty"` - GxReportingAVP1 []interface{} `json:"gxreportingavp1,omitempty"` - GxReportingAVP1Type string `json:"gxreportingavp1type,omitempty"` - GxReportingAVP1VendorID int `json:"gxreportingavp1vendorid,omitempty"` - GxReportingAVP2 []interface{} `json:"gxreportingavp2,omitempty"` - GxReportingAVP2Type string `json:"gxreportingavp2type,omitempty"` - GxReportingAVP2VendorID int `json:"gxreportingavp2vendorid,omitempty"` - GxReportingAVP3 []interface{} `json:"gxreportingavp3,omitempty"` - GxReportingAVP3Type string `json:"gxreportingavp3type,omitempty"` - GxReportingAVP3VendorID int `json:"gxreportingavp3vendorid,omitempty"` - GxReportingAVP4 []interface{} `json:"gxreportingavp4,omitempty"` - GxReportingAVP4Type string `json:"gxreportingavp4type,omitempty"` - GxReportingAVP4VendorID int `json:"gxreportingavp4vendorid,omitempty"` - GxReportingAVP5 []interface{} `json:"gxreportingavp5,omitempty"` - GxReportingAVP5Type string `json:"gxreportingavp5type,omitempty"` - GxReportingAVP5VendorID int `json:"gxreportingavp5vendorid,omitempty"` - HealthCheck string `json:"healthcheck,omitempty"` - HealthCheckTTL int `json:"healthcheckttl,omitempty"` - HoldOnSubscriberAbsence string `json:"holdonsubscriberabsence,omitempty"` - Identity string `json:"identity,omitempty"` - IdleTTL int `json:"idlettl,omitempty"` - NegativeTTL int `json:"negativettl,omitempty"` - NegativeTTLLimitedSuccess string `json:"negativettllimitedsuccess,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NodeID int `json:"nodeid,omitempty"` - PCRFRealm string `json:"pcrfrealm,omitempty"` - PurgeSDBOnGxFailure string `json:"purgesdbongxfailure,omitempty"` - Realm string `json:"realm,omitempty"` - RequestRetryAttempts int `json:"requestretryattempts,omitempty"` - RequestTimeout int `json:"requesttimeout,omitempty"` - RevalidationTimeout int `json:"revalidationtimeout,omitempty"` - Service string `json:"service,omitempty"` - ServicePathAVP []interface{} `json:"servicepathavp,omitempty"` - ServicePathInfoMode string `json:"servicepathinfomode,omitempty"` - ServicePathVendorID int `json:"servicepathvendorid,omitempty"` - Status string `json:"status,omitempty"` - SvrState string `json:"svrstate,omitempty"` - VServer string `json:"vserver,omitempty"` + CerRequestTimeout int `json:"cerrequesttimeout,omitempty"` + GxReportingAVP1 []any `json:"gxreportingavp1,omitempty"` + GxReportingAVP1Type string `json:"gxreportingavp1type,omitempty"` + GxReportingAVP1VendorID int `json:"gxreportingavp1vendorid,omitempty"` + GxReportingAVP2 []any `json:"gxreportingavp2,omitempty"` + GxReportingAVP2Type string `json:"gxreportingavp2type,omitempty"` + GxReportingAVP2VendorID int `json:"gxreportingavp2vendorid,omitempty"` + GxReportingAVP3 []any `json:"gxreportingavp3,omitempty"` + GxReportingAVP3Type string `json:"gxreportingavp3type,omitempty"` + GxReportingAVP3VendorID int `json:"gxreportingavp3vendorid,omitempty"` + GxReportingAVP4 []any `json:"gxreportingavp4,omitempty"` + GxReportingAVP4Type string `json:"gxreportingavp4type,omitempty"` + GxReportingAVP4VendorID int `json:"gxreportingavp4vendorid,omitempty"` + GxReportingAVP5 []any `json:"gxreportingavp5,omitempty"` + GxReportingAVP5Type string `json:"gxreportingavp5type,omitempty"` + GxReportingAVP5VendorID int `json:"gxreportingavp5vendorid,omitempty"` + HealthCheck string `json:"healthcheck,omitempty"` + HealthCheckTTL int `json:"healthcheckttl,omitempty"` + HoldOnSubscriberAbsence string `json:"holdonsubscriberabsence,omitempty"` + Identity string `json:"identity,omitempty"` + IdleTTL int `json:"idlettl,omitempty"` + NegativeTTL int `json:"negativettl,omitempty"` + NegativeTTLLimitedSuccess string `json:"negativettllimitedsuccess,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NodeID int `json:"nodeid,omitempty"` + PCRFRealm string `json:"pcrfrealm,omitempty"` + PurgeSDBOnGxFailure string `json:"purgesdbongxfailure,omitempty"` + Realm string `json:"realm,omitempty"` + RequestRetryAttempts int `json:"requestretryattempts,omitempty"` + RequestTimeout int `json:"requesttimeout,omitempty"` + RevalidationTimeout int `json:"revalidationtimeout,omitempty"` + Service string `json:"service,omitempty"` + ServicePathAVP []any `json:"servicepathavp,omitempty"` + ServicePathInfoMode string `json:"servicepathinfomode,omitempty"` + ServicePathVendorID int `json:"servicepathvendorid,omitempty"` + Status string `json:"status,omitempty"` + SvrState string `json:"svrstate,omitempty"` + VServer string `json:"vserver,omitempty"` } type SubscriberProfile struct { @@ -73,14 +73,14 @@ type SubscriberProfile struct { } type SubscriberParam struct { - Builtin []string `json:"builtin,omitempty"` - Feature string `json:"feature,omitempty"` - IdleAction string `json:"idleaction,omitempty"` - IdleTTL int `json:"idlettl,omitempty"` - InterfaceType string `json:"interfacetype,omitempty"` - IPv6PrefixLookupList []interface{} `json:"ipv6prefixlookuplist,omitempty"` - KeyType string `json:"keytype,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Builtin []string `json:"builtin,omitempty"` + Feature string `json:"feature,omitempty"` + IdleAction string `json:"idleaction,omitempty"` + IdleTTL int `json:"idlettl,omitempty"` + InterfaceType string `json:"interfacetype,omitempty"` + IPv6PrefixLookupList []any `json:"ipv6prefixlookuplist,omitempty"` + KeyType string `json:"keytype,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } type SubscriberRadiusInterface struct { diff --git a/nitrogo/models/system.go b/nitrogo/models/system.go index 60133a0..4465361 100644 --- a/nitrogo/models/system.go +++ b/nitrogo/models/system.go @@ -105,13 +105,13 @@ type SystemAutoRestoreFeature struct { } type SystemGlobalBinding struct { - SystemGlobalAuditNSLogPolicyBinding []interface{} `json:"systemglobal_auditnslogpolicy_binding,omitempty"` - SystemGlobalAuditSyslogPolicyBinding []interface{} `json:"systemglobal_auditsyslogpolicy_binding,omitempty"` - SystemGlobalAuthenticationLDAPPolicyBinding []interface{} `json:"systemglobal_authenticationldappolicy_binding,omitempty"` - SystemGlobalAuthenticationLocalPolicyBinding []interface{} `json:"systemglobal_authenticationlocalpolicy_binding,omitempty"` - SystemGlobalAuthenticationPolicyBinding []interface{} `json:"systemglobal_authenticationpolicy_binding,omitempty"` - SystemGlobalAuthenticationRADIUSPolicyBinding []interface{} `json:"systemglobal_authenticationradiuspolicy_binding,omitempty"` - SystemGlobalAuthenticationTACACSPolicyBinding []interface{} `json:"systemglobal_authenticationtacacspolicy_binding,omitempty"` + SystemGlobalAuditNSLogPolicyBinding []any `json:"systemglobal_auditnslogpolicy_binding,omitempty"` + SystemGlobalAuditSyslogPolicyBinding []any `json:"systemglobal_auditsyslogpolicy_binding,omitempty"` + SystemGlobalAuthenticationLDAPPolicyBinding []any `json:"systemglobal_authenticationldappolicy_binding,omitempty"` + SystemGlobalAuthenticationLocalPolicyBinding []any `json:"systemglobal_authenticationlocalpolicy_binding,omitempty"` + SystemGlobalAuthenticationPolicyBinding []any `json:"systemglobal_authenticationpolicy_binding,omitempty"` + SystemGlobalAuthenticationRADIUSPolicyBinding []any `json:"systemglobal_authenticationradiuspolicy_binding,omitempty"` + SystemGlobalAuthenticationTACACSPolicyBinding []any `json:"systemglobal_authenticationtacacspolicy_binding,omitempty"` } type SystemKEK struct { @@ -234,10 +234,10 @@ type SystemGlobalAuthenticationPolicyBinding struct { } type SystemGroupBinding struct { - GroupName string `json:"groupname,omitempty"` - SystemGroupNSPartitionBinding []interface{} `json:"systemgroup_nspartition_binding,omitempty"` - SystemGroupSystemCmdPolicyBinding []interface{} `json:"systemgroup_systemcmdpolicy_binding,omitempty"` - SystemGroupSystemUserBinding []interface{} `json:"systemgroup_systemuser_binding,omitempty"` + GroupName string `json:"groupname,omitempty"` + SystemGroupNSPartitionBinding []any `json:"systemgroup_nspartition_binding,omitempty"` + SystemGroupSystemCmdPolicyBinding []any `json:"systemgroup_systemcmdpolicy_binding,omitempty"` + SystemGroupSystemUserBinding []any `json:"systemgroup_systemuser_binding,omitempty"` } type SystemBackup struct { @@ -284,10 +284,10 @@ type SystemUser struct { } type SystemUserBinding struct { - SystemUserNSPartitionBinding []interface{} `json:"systemuser_nspartition_binding,omitempty"` - SystemUserSystemCmdPolicyBinding []interface{} `json:"systemuser_systemcmdpolicy_binding,omitempty"` - SystemUserSystemGroupBinding []interface{} `json:"systemuser_systemgroup_binding,omitempty"` - Username string `json:"username,omitempty"` + SystemUserNSPartitionBinding []any `json:"systemuser_nspartition_binding,omitempty"` + SystemUserSystemCmdPolicyBinding []any `json:"systemuser_systemcmdpolicy_binding,omitempty"` + SystemUserSystemGroupBinding []any `json:"systemuser_systemgroup_binding,omitempty"` + Username string `json:"username,omitempty"` } type SystemFile struct { @@ -383,3 +383,82 @@ type SystemExtraMgmtCPU struct { EffectiveState string `json:"effectivestate,omitempty"` NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` } + +type SystemCollectionParam struct { + CommunityName string `json:"communityname,omitempty"` + LogLevel string `json:"loglevel,omitempty"` + DataPath string `json:"datapath,omitempty"` +} + +type SystemCore struct { + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemCounterGroup struct { + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemCounters struct { + CounterGroup string `json:"countergroup,omitempty"` + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemDataSource struct { + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemEntity struct { + Type string `json:"type,omitempty"` + Datasource string `json:"datasource,omitempty"` + Core int `json:"core,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemEntityData struct { + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + AllDeleted string `json:"alldeleted,omitempty"` + AllInactive string `json:"allinactive,omitempty"` + Datasource string `json:"datasource,omitempty"` + Core int `json:"core,omitempty"` + Counters string `json:"counters,omitempty"` + StartTime string `json:"starttime,omitempty"` + EndTime string `json:"endtime,omitempty"` + Last int `json:"last,omitempty"` + Unit string `json:"unit,omitempty"` + Response string `json:"response,omitempty"` + StartUpdate string `json:"startupdate,omitempty"` + LastUpdate string `json:"lastupdate,omitempty"` +} + +type SystemEntityType struct { + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemEventHistory struct { + StartTime string `json:"starttime,omitempty"` + EndTime string `json:"endtime,omitempty"` + Last int `json:"last,omitempty"` + Unit string `json:"unit,omitempty"` + Datasource string `json:"datasource,omitempty"` + Response string `json:"response,omitempty"` +} + +type SystemGlobalData struct { + Counters string `json:"counters,omitempty"` + CounterGroup string `json:"countergroup,omitempty"` + StartTime string `json:"starttime,omitempty"` + EndTime string `json:"endtime,omitempty"` + Last int `json:"last,omitempty"` + Unit string `json:"unit,omitempty"` + Datasource string `json:"datasource,omitempty"` + Core int `json:"core,omitempty"` + Response string `json:"response,omitempty"` + StartUpdate float64 `json:"startupdate,omitempty"` + LastUpdate float64 `json:"lastupdate,omitempty"` +} diff --git a/nitrogo/models/tm.go b/nitrogo/models/tm.go index 1e657c9..92397e7 100644 --- a/nitrogo/models/tm.go +++ b/nitrogo/models/tm.go @@ -41,17 +41,17 @@ type TMGlobalTMTrafficPolicyBinding struct { } type TMGlobalBinding struct { - TMGlobalAuditNSLogPolicyBinding []interface{} `json:"tmglobal_auditnslogpolicy_binding,omitempty"` - TMGlobalAuditSyslogPolicyBinding []interface{} `json:"tmglobal_auditsyslogpolicy_binding,omitempty"` - TMGlobalTMSessionPolicyBinding []interface{} `json:"tmglobal_tmsessionpolicy_binding,omitempty"` - TMGlobalTMTrafficPolicyBinding []interface{} `json:"tmglobal_tmtrafficpolicy_binding,omitempty"` + TMGlobalAuditNSLogPolicyBinding []any `json:"tmglobal_auditnslogpolicy_binding,omitempty"` + TMGlobalAuditSyslogPolicyBinding []any `json:"tmglobal_auditsyslogpolicy_binding,omitempty"` + TMGlobalTMSessionPolicyBinding []any `json:"tmglobal_tmsessionpolicy_binding,omitempty"` + TMGlobalTMTrafficPolicyBinding []any `json:"tmglobal_tmtrafficpolicy_binding,omitempty"` } type TMTrafficPolicyBinding struct { - Name string `json:"name,omitempty"` - TMTrafficPolicyCSVServerBinding []interface{} `json:"tmtrafficpolicy_csvserver_binding,omitempty"` - TMTrafficPolicyLBVServerBinding []interface{} `json:"tmtrafficpolicy_lbvserver_binding,omitempty"` - TMTrafficPolicyTMGlobalBinding []interface{} `json:"tmtrafficpolicy_tmglobal_binding,omitempty"` + Name string `json:"name,omitempty"` + TMTrafficPolicyCSVServerBinding []any `json:"tmtrafficpolicy_csvserver_binding,omitempty"` + TMTrafficPolicyLBVServerBinding []any `json:"tmtrafficpolicy_lbvserver_binding,omitempty"` + TMTrafficPolicyTMGlobalBinding []any `json:"tmtrafficpolicy_tmglobal_binding,omitempty"` } type TMSessionPolicy struct { @@ -123,11 +123,11 @@ type TMTrafficAction struct { } type TMSessionPolicyBinding struct { - Name string `json:"name,omitempty"` - TMSessionPolicyAAAGroupBinding []interface{} `json:"tmsessionpolicy_aaagroup_binding,omitempty"` - TMSessionPolicyAAAUserBinding []interface{} `json:"tmsessionpolicy_aaauser_binding,omitempty"` - TMSessionPolicyAuthenticationVServerBinding []interface{} `json:"tmsessionpolicy_authenticationvserver_binding,omitempty"` - TMSessionPolicyTMGlobalBinding []interface{} `json:"tmsessionpolicy_tmglobal_binding,omitempty"` + Name string `json:"name,omitempty"` + TMSessionPolicyAAAGroupBinding []any `json:"tmsessionpolicy_aaagroup_binding,omitempty"` + TMSessionPolicyAAAUserBinding []any `json:"tmsessionpolicy_aaauser_binding,omitempty"` + TMSessionPolicyAuthenticationVServerBinding []any `json:"tmsessionpolicy_authenticationvserver_binding,omitempty"` + TMSessionPolicyTMGlobalBinding []any `json:"tmsessionpolicy_tmglobal_binding,omitempty"` } type TMSessionPolicyAAAGroupBinding struct { diff --git a/nitrogo/models/transform.go b/nitrogo/models/transform.go index 1423be0..f1ebcaa 100644 --- a/nitrogo/models/transform.go +++ b/nitrogo/models/transform.go @@ -12,16 +12,16 @@ type TransformPolicyCSVServerBinding struct { } type TransformProfileBinding struct { - Name string `json:"name,omitempty"` - TransformProfileTransformActionBinding []interface{} `json:"transformprofile_transformaction_binding,omitempty"` + Name string `json:"name,omitempty"` + TransformProfileTransformActionBinding []any `json:"transformprofile_transformaction_binding,omitempty"` } type TransformPolicyBinding struct { - Name string `json:"name,omitempty"` - TransformPolicyCSVServerBinding []interface{} `json:"transformpolicy_csvserver_binding,omitempty"` - TransformPolicyLBVServerBinding []interface{} `json:"transformpolicy_lbvserver_binding,omitempty"` - TransformPolicyTransformGlobalBinding []interface{} `json:"transformpolicy_transformglobal_binding,omitempty"` - TransformPolicyTransformPolicyLabelBinding []interface{} `json:"transformpolicy_transformpolicylabel_binding,omitempty"` + Name string `json:"name,omitempty"` + TransformPolicyCSVServerBinding []any `json:"transformpolicy_csvserver_binding,omitempty"` + TransformPolicyLBVServerBinding []any `json:"transformpolicy_lbvserver_binding,omitempty"` + TransformPolicyTransformGlobalBinding []any `json:"transformpolicy_transformglobal_binding,omitempty"` + TransformPolicyTransformPolicyLabelBinding []any `json:"transformpolicy_transformpolicylabel_binding,omitempty"` } type TransformPolicyLabel struct { @@ -130,13 +130,13 @@ type TransformAction struct { } type TransformPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - TransformPolicyLabelPolicyBindingBinding []interface{} `json:"transformpolicylabel_policybinding_binding,omitempty"` - TransformPolicyLabelTransformPolicyBinding []interface{} `json:"transformpolicylabel_transformpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + TransformPolicyLabelPolicyBindingBinding []any `json:"transformpolicylabel_policybinding_binding,omitempty"` + TransformPolicyLabelTransformPolicyBinding []any `json:"transformpolicylabel_transformpolicy_binding,omitempty"` } type TransformGlobalBinding struct { - TransformGlobalTransformPolicyBinding []interface{} `json:"transformglobal_transformpolicy_binding,omitempty"` + TransformGlobalTransformPolicyBinding []any `json:"transformglobal_transformpolicy_binding,omitempty"` } type TransformProfileTransformActionBinding struct { diff --git a/nitrogo/models/tunnel.go b/nitrogo/models/tunnel.go index 880eb1b..d38ed84 100644 --- a/nitrogo/models/tunnel.go +++ b/nitrogo/models/tunnel.go @@ -25,12 +25,12 @@ type TunnelTrafficPolicy struct { } type TunnelGlobalBinding struct { - TunnelGlobalTunnelTrafficPolicyBinding []interface{} `json:"tunnelglobal_tunneltrafficpolicy_binding,omitempty"` + TunnelGlobalTunnelTrafficPolicyBinding []any `json:"tunnelglobal_tunneltrafficpolicy_binding,omitempty"` } type TunnelTrafficPolicyBinding struct { - Name string `json:"name,omitempty"` - TunnelTrafficPolicyTunnelGlobalBinding []interface{} `json:"tunneltrafficpolicy_tunnelglobal_binding,omitempty"` + Name string `json:"name,omitempty"` + TunnelTrafficPolicyTunnelGlobalBinding []any `json:"tunneltrafficpolicy_tunnelglobal_binding,omitempty"` } type TunnelTrafficPolicyTunnelGlobalBinding struct { diff --git a/nitrogo/models/utility.go b/nitrogo/models/utility.go index b30146f..89924e4 100644 --- a/nitrogo/models/utility.go +++ b/nitrogo/models/utility.go @@ -48,20 +48,20 @@ type Ping struct { } type TechSupport struct { - ADSS bool `json:"adss,omitempty"` - AuthToken string `json:"authtoken,omitempty"` - CaseNumber string `json:"casenumber,omitempty"` - Description string `json:"description,omitempty"` - File string `json:"file,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - Nodes []interface{} `json:"nodes,omitempty"` - PartitionName string `json:"partitionname,omitempty"` - Proxy string `json:"proxy,omitempty"` - Response string `json:"response,omitempty"` - Scope string `json:"scope,omitempty"` - ServerName string `json:"servername,omitempty"` - Time string `json:"time,omitempty"` - Upload bool `json:"upload,omitempty"` + ADSS bool `json:"adss,omitempty"` + AuthToken string `json:"authtoken,omitempty"` + CaseNumber string `json:"casenumber,omitempty"` + Description string `json:"description,omitempty"` + File string `json:"file,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + Nodes []any `json:"nodes,omitempty"` + PartitionName string `json:"partitionname,omitempty"` + Proxy string `json:"proxy,omitempty"` + Response string `json:"response,omitempty"` + Scope string `json:"scope,omitempty"` + ServerName string `json:"servername,omitempty"` + Time string `json:"time,omitempty"` + Upload bool `json:"upload,omitempty"` } type Traceroute struct { diff --git a/nitrogo/models/videooptimization.go b/nitrogo/models/videooptimization.go index b8291c4..8fddd9a 100644 --- a/nitrogo/models/videooptimization.go +++ b/nitrogo/models/videooptimization.go @@ -2,7 +2,7 @@ package models // videooptimization configuration structs type VideoOptimizationGlobalPacingBinding struct { - VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding []interface{} `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding,omitempty"` + VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding []any `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding,omitempty"` } type VideoOptimizationParameter struct { @@ -12,9 +12,9 @@ type VideoOptimizationParameter struct { } type VideoOptimizationPacingPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - VideoOptimizationPacingPolicyLabelPolicyBindingBinding []interface{} `json:"videooptimizationpacingpolicylabel_policybinding_binding,omitempty"` - VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding []interface{} `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + VideoOptimizationPacingPolicyLabelPolicyBindingBinding []any `json:"videooptimizationpacingpolicylabel_policybinding_binding,omitempty"` + VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding []any `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding,omitempty"` } type VideoOptimizationPacingAction struct { @@ -105,9 +105,9 @@ type VideoOptimizationDetectionPolicyLabelPolicyBindingBinding struct { } type VideoOptimizationDetectionPolicyBinding struct { - Name string `json:"name,omitempty"` - VideoOptimizationDetectionPolicyLBVServerBinding []interface{} `json:"videooptimizationdetectionpolicy_lbvserver_binding,omitempty"` - VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding []interface{} `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding,omitempty"` + Name string `json:"name,omitempty"` + VideoOptimizationDetectionPolicyLBVServerBinding []any `json:"videooptimizationdetectionpolicy_lbvserver_binding,omitempty"` + VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding []any `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding,omitempty"` } type VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding struct { @@ -123,19 +123,19 @@ type VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding struct { } type VideoOptimizationPacingPolicyBinding struct { - Name string `json:"name,omitempty"` - VideoOptimizationPacingPolicyLBVServerBinding []interface{} `json:"videooptimizationpacingpolicy_lbvserver_binding,omitempty"` - VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding []interface{} `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding,omitempty"` + Name string `json:"name,omitempty"` + VideoOptimizationPacingPolicyLBVServerBinding []any `json:"videooptimizationpacingpolicy_lbvserver_binding,omitempty"` + VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding []any `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding,omitempty"` } type VideoOptimizationDetectionPolicyLabelBinding struct { - LabelName string `json:"labelname,omitempty"` - VideoOptimizationDetectionPolicyLabelPolicyBindingBinding []interface{} `json:"videooptimizationdetectionpolicylabel_policybinding_binding,omitempty"` - VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding []interface{} `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding,omitempty"` + LabelName string `json:"labelname,omitempty"` + VideoOptimizationDetectionPolicyLabelPolicyBindingBinding []any `json:"videooptimizationdetectionpolicylabel_policybinding_binding,omitempty"` + VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding []any `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding,omitempty"` } type VideoOptimizationGlobalDetectionBinding struct { - VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding []interface{} `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding,omitempty"` + VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding []any `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding,omitempty"` } type VideoOptimizationPacingPolicyLabelPolicyBindingBinding struct { diff --git a/nitrogo/models/vpn.go b/nitrogo/models/vpn.go index 28bb9db..67f1ad2 100644 --- a/nitrogo/models/vpn.go +++ b/nitrogo/models/vpn.go @@ -2,18 +2,20 @@ package models // vpn configuration structs type VPNClientlessAccessPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNGlobalAuditNSLogPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNICADTLSConnection struct { @@ -42,23 +44,26 @@ type VPNStoreInfo struct { } type VPNGlobalIntranetIPBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetIP string `json:"intranetip,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + Netmask string `json:"netmask,omitempty"` } type VPNURLPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNURLPolicyAAAUserBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNEULA struct { @@ -68,42 +73,46 @@ type VPNEULA struct { } type VPNSessionPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNSessionPolicyBinding struct { - Name string `json:"name,omitempty"` - VPNSessionPolicyAAAGroupBinding []interface{} `json:"vpnsessionpolicy_aaagroup_binding,omitempty"` - VPNSessionPolicyAAAUserBinding []interface{} `json:"vpnsessionpolicy_aaauser_binding,omitempty"` - VPNSessionPolicyVPNGlobalBinding []interface{} `json:"vpnsessionpolicy_vpnglobal_binding,omitempty"` - VPNSessionPolicyVPNVServerBinding []interface{} `json:"vpnsessionpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + VPNSessionPolicyAAAGroupBinding []any `json:"vpnsessionpolicy_aaagroup_binding,omitempty"` + VPNSessionPolicyAAAUserBinding []any `json:"vpnsessionpolicy_aaauser_binding,omitempty"` + VPNSessionPolicyVPNGlobalBinding []any `json:"vpnsessionpolicy_vpnglobal_binding,omitempty"` + VPNSessionPolicyVPNVServerBinding []any `json:"vpnsessionpolicy_vpnvserver_binding,omitempty"` } type VPNVServerCSPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuditSyslogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNClientlessAccessPolicyBinding struct { + Count float64 `json:"__count,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` GlobalBindType string `json:"globalbindtype,omitempty"` @@ -121,9 +130,10 @@ type VPNGlobalSecurePrivateAccessURLBinding struct { } type VPNVServerAppControllerBinding struct { - ActType int `json:"acttype,omitempty"` - AppController string `json:"appcontroller,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + AppController string `json:"appcontroller,omitempty"` + Name string `json:"name,omitempty"` } type VPNGlobalVPNSecurePrivateAccessProfileBinding struct { @@ -132,23 +142,26 @@ type VPNGlobalVPNSecurePrivateAccessProfileBinding struct { } type VPNURLPolicyAAAGroupBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNGlobalAuthenticationCertPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAnalyticsProfileBinding struct { - AnalyticsProfile string `json:"analyticsprofile,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + AnalyticsProfile string `json:"analyticsprofile,omitempty"` + Name string `json:"name,omitempty"` } type VPNIntranetApplication struct { @@ -170,11 +183,12 @@ type VPNIntranetApplication struct { } type VPNGlobalVPNTrafficPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNURLAction struct { @@ -207,20 +221,22 @@ type VPNPCoIPConnection struct { } type VPNVServerVPNEULABinding struct { - ActType int `json:"acttype,omitempty"` - EULA string `json:"eula,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + EULA string `json:"eula,omitempty"` + Name string `json:"name,omitempty"` } type VPNVServerAuthenticationNegotiatePolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNSFConfig struct { @@ -239,121 +255,124 @@ type VPNPortalTheme struct { } type VPNTrafficPolicyVPNVServerBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNGlobalAuthenticationLDAPPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNEULABinding struct { - EULA string `json:"eula,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Count float64 `json:"__count,omitempty"` + EULA string `json:"eula,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` } type VPNParameter struct { - AccessRestrictedPageRedirect string `json:"accessrestrictedpageredirect,omitempty"` - AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` - AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` - AllProtocolProxy string `json:"allprotocolproxy,omitempty"` - AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` - AppTokenTimeout int `json:"apptokentimeout,omitempty"` - AuthorizationGroup string `json:"authorizationgroup,omitempty"` - AutoProxyURL string `json:"autoproxyurl,omitempty"` - BackendCertValidation string `json:"backendcertvalidation,omitempty"` - BackendDTLS12 string `json:"backenddtls12,omitempty"` - BackendServerSNI string `json:"backendserversni,omitempty"` - CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` - ClientChoices string `json:"clientchoices,omitempty"` - ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` - ClientConfiguration []string `json:"clientconfiguration,omitempty"` - ClientDebug string `json:"clientdebug,omitempty"` - ClientIDleTimeout int `json:"clientidletimeout,omitempty"` - ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` - ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` - ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` - ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` - ClientOptions []string `json:"clientoptions,omitempty"` - ClientSecurity string `json:"clientsecurity,omitempty"` - ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` - ClientSecurityLog string `json:"clientsecuritylog,omitempty"` - ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` - ClientVersions string `json:"clientversions,omitempty"` - DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` - DevicePosture string `json:"deviceposture,omitempty"` - DNSVServerName string `json:"dnsvservername,omitempty"` - EmailHome string `json:"emailhome,omitempty"` - EncryptCSECExp string `json:"encryptcsecexp,omitempty"` - EPAClientType string `json:"epaclienttype,omitempty"` - ForceCleanup []string `json:"forcecleanup,omitempty"` - ForcedTimeout int `json:"forcedtimeout,omitempty"` - ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` - FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` - FTPProxy string `json:"ftpproxy,omitempty"` - GopherProxy string `json:"gopherproxy,omitempty"` - HomePage string `json:"homepage,omitempty"` - HTTPPort []interface{} `json:"httpport,omitempty"` - HTTPProxy string `json:"httpproxy,omitempty"` - HTTPTrackConnProxy string `json:"httptrackconnproxy,omitempty"` - ICAProxy string `json:"icaproxy,omitempty"` - ICASessionTimeout string `json:"icasessiontimeout,omitempty"` - ICAUserAccounting string `json:"icauseraccounting,omitempty"` - IconWithReceiver string `json:"iconwithreceiver,omitempty"` - IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` - KCDAccount string `json:"kcdaccount,omitempty"` - KillConnections string `json:"killconnections,omitempty"` - LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` - LocalLANAccess string `json:"locallanaccess,omitempty"` - LoginScript string `json:"loginscript,omitempty"` - LogoutScript string `json:"logoutscript,omitempty"` - MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` - MaxIIPPerUser int `json:"maxiipperuser,omitempty"` - MDXTokenTimeout int `json:"mdxtokentimeout,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NTDomain string `json:"ntdomain,omitempty"` - PCoIPProfileName string `json:"pcoipprofilename,omitempty"` - Proxy string `json:"proxy,omitempty"` - ProxyException string `json:"proxyexception,omitempty"` - ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` - RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` - RFC1918 string `json:"rfc1918,omitempty"` - SameSite string `json:"samesite,omitempty"` - SecureBrowse string `json:"securebrowse,omitempty"` - SecurePrivateAccess string `json:"secureprivateaccess,omitempty"` - SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` - SessTimeout int `json:"sesstimeout,omitempty"` - SmartGroup string `json:"smartgroup,omitempty"` - SocksProxy string `json:"socksproxy,omitempty"` - SplitDNS string `json:"splitdns,omitempty"` - SplitTunnel string `json:"splittunnel,omitempty"` - SpoofIIP string `json:"spoofiip,omitempty"` - SSLProxy string `json:"sslproxy,omitempty"` - SSO string `json:"sso,omitempty"` - SSOCredential string `json:"ssocredential,omitempty"` - StoreFrontURL string `json:"storefronturl,omitempty"` - TransparentInterception string `json:"transparentinterception,omitempty"` - UITheme string `json:"uitheme,omitempty"` - UseIIP string `json:"useiip,omitempty"` - UseMIP string `json:"usemip,omitempty"` - UserDomains string `json:"userdomains,omitempty"` - VPNSessionPolicyBindType string `json:"vpnsessionpolicybindtype,omitempty"` - VPNSessionPolicyCount int `json:"vpnsessionpolicycount,omitempty"` - WIHome string `json:"wihome,omitempty"` - WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` - WindowsAutoLogon string `json:"windowsautologon,omitempty"` - WindowsClientType string `json:"windowsclienttype,omitempty"` - WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` - Winsip string `json:"winsip,omitempty"` - WIPortalMode string `json:"wiportalmode,omitempty"` + AccessRestrictedPageRedirect string `json:"accessrestrictedpageredirect,omitempty"` + AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` + AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` + AllProtocolProxy string `json:"allprotocolproxy,omitempty"` + AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` + AppTokenTimeout int `json:"apptokentimeout,omitempty"` + AuthorizationGroup string `json:"authorizationgroup,omitempty"` + AutoProxyURL string `json:"autoproxyurl,omitempty"` + BackendCertValidation string `json:"backendcertvalidation,omitempty"` + BackendDTLS12 string `json:"backenddtls12,omitempty"` + BackendServerSNI string `json:"backendserversni,omitempty"` + CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` + ClientChoices string `json:"clientchoices,omitempty"` + ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` + ClientConfiguration []string `json:"clientconfiguration,omitempty"` + ClientDebug string `json:"clientdebug,omitempty"` + ClientIDleTimeout int `json:"clientidletimeout,omitempty"` + ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` + ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` + ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` + ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` + ClientOptions []string `json:"clientoptions,omitempty"` + ClientSecurity string `json:"clientsecurity,omitempty"` + ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` + ClientSecurityLog string `json:"clientsecuritylog,omitempty"` + ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` + ClientVersions string `json:"clientversions,omitempty"` + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` + DevicePosture string `json:"deviceposture,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + EmailHome string `json:"emailhome,omitempty"` + EncryptCSECExp string `json:"encryptcsecexp,omitempty"` + EPAClientType string `json:"epaclienttype,omitempty"` + ForceCleanup []string `json:"forcecleanup,omitempty"` + ForcedTimeout int `json:"forcedtimeout,omitempty"` + ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` + FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` + FTPProxy string `json:"ftpproxy,omitempty"` + GopherProxy string `json:"gopherproxy,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPPort []any `json:"httpport,omitempty"` + HTTPProxy string `json:"httpproxy,omitempty"` + HTTPTrackConnProxy string `json:"httptrackconnproxy,omitempty"` + ICAProxy string `json:"icaproxy,omitempty"` + ICASessionTimeout string `json:"icasessiontimeout,omitempty"` + ICAUserAccounting string `json:"icauseraccounting,omitempty"` + IconWithReceiver string `json:"iconwithreceiver,omitempty"` + IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KillConnections string `json:"killconnections,omitempty"` + LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` + LocalLANAccess string `json:"locallanaccess,omitempty"` + LoginScript string `json:"loginscript,omitempty"` + LogoutScript string `json:"logoutscript,omitempty"` + MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` + MaxIIPPerUser int `json:"maxiipperuser,omitempty"` + MDXTokenTimeout int `json:"mdxtokentimeout,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NTDomain string `json:"ntdomain,omitempty"` + PCoIPProfileName string `json:"pcoipprofilename,omitempty"` + Proxy string `json:"proxy,omitempty"` + ProxyException string `json:"proxyexception,omitempty"` + ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` + RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` + RFC1918 string `json:"rfc1918,omitempty"` + SameSite string `json:"samesite,omitempty"` + SecureBrowse string `json:"securebrowse,omitempty"` + SecurePrivateAccess string `json:"secureprivateaccess,omitempty"` + SecurePrivateAccessProfile string `json:"secureprivateaccessprofile,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SmartGroup string `json:"smartgroup,omitempty"` + SocksProxy string `json:"socksproxy,omitempty"` + SplitDNS string `json:"splitdns,omitempty"` + SplitTunnel string `json:"splittunnel,omitempty"` + SpoofIIP string `json:"spoofiip,omitempty"` + SSLProxy string `json:"sslproxy,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + StoreFrontURL string `json:"storefronturl,omitempty"` + TransparentInterception string `json:"transparentinterception,omitempty"` + UITheme string `json:"uitheme,omitempty"` + UseIIP string `json:"useiip,omitempty"` + UseMIP string `json:"usemip,omitempty"` + UserDomains string `json:"userdomains,omitempty"` + VPNSessionPolicyBindType string `json:"vpnsessionpolicybindtype,omitempty"` + VPNSessionPolicyCount int `json:"vpnsessionpolicycount,omitempty"` + WIHome string `json:"wihome,omitempty"` + WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` + WindowsAutoLogon string `json:"windowsautologon,omitempty"` + WindowsClientType string `json:"windowsclienttype,omitempty"` + WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` + Winsip string `json:"winsip,omitempty"` + WIPortalMode string `json:"wiportalmode,omitempty"` } type VPNClientlessAccessProfile struct { @@ -467,17 +486,19 @@ type VPNSAMLSSOProfile struct { } type VPNVServerAuditNSLogPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNSessionPolicyBinding struct { + Count float64 `json:"__count,omitempty"` Builtin []string `json:"builtin,omitempty"` Feature string `json:"feature,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` @@ -496,74 +517,82 @@ type VPNPCoIPVServerProfile struct { } type VPNSessionPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNVServerIntranetIP6Binding struct { - ActType int `json:"acttype,omitempty"` - IntranetIP6 string `json:"intranetip6,omitempty"` - Name string `json:"name,omitempty"` - NumAddr int `json:"numaddr,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + Name string `json:"name,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } type VPNVServerFEOPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalAuditSyslogPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerVPNSessionPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerVPNURLBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - URLName string `json:"urlname,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + URLName string `json:"urlname,omitempty"` } type VPNVServerVPNURLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationWebAuthPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNClientlessAccessPolicy struct { @@ -582,32 +611,34 @@ type VPNClientlessAccessPolicy struct { } type VPNVServerAAAPreauthenticationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNTrafficPolicyBinding struct { - Name string `json:"name,omitempty"` - VPNTrafficPolicyAAAGroupBinding []interface{} `json:"vpntrafficpolicy_aaagroup_binding,omitempty"` - VPNTrafficPolicyAAAUserBinding []interface{} `json:"vpntrafficpolicy_aaauser_binding,omitempty"` - VPNTrafficPolicyVPNGlobalBinding []interface{} `json:"vpntrafficpolicy_vpnglobal_binding,omitempty"` - VPNTrafficPolicyVPNVServerBinding []interface{} `json:"vpntrafficpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + VPNTrafficPolicyAAAGroupBinding []any `json:"vpntrafficpolicy_aaagroup_binding,omitempty"` + VPNTrafficPolicyAAAUserBinding []any `json:"vpntrafficpolicy_aaauser_binding,omitempty"` + VPNTrafficPolicyVPNGlobalBinding []any `json:"vpntrafficpolicy_vpnglobal_binding,omitempty"` + VPNTrafficPolicyVPNVServerBinding []any `json:"vpntrafficpolicy_vpnvserver_binding,omitempty"` } type VPNVServerAuthenticationSAMLIDPPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNNextHopServer struct { @@ -635,6 +666,7 @@ type VPNURLPolicy struct { } type VPNGlobalVPNURLPolicyBinding struct { + Count float64 `json:"__count,omitempty"` Builtin []string `json:"builtin,omitempty"` GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` GroupExtraction bool `json:"groupextraction,omitempty"` @@ -672,102 +704,114 @@ type VPNURL struct { } type VPNGlobalAuthenticationPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationTACACSPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNNextHopServerBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - NextHopServer string `json:"nexthopserver,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + NextHopServer string `json:"nexthopserver,omitempty"` } type VPNVServerICAPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationCertPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationSAMLPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNURLPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNTrafficPolicyAAAGroupBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNVServerCachePolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNPortalThemeBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - PortalTheme string `json:"portaltheme,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } type VPNVServerShareFileServerBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - ShareFile string `json:"sharefile,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + ShareFile string `json:"sharefile,omitempty"` } type VPNGlobalAuthenticationSAMLPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNTrafficPolicy struct { @@ -781,222 +825,233 @@ type VPNTrafficPolicy struct { } type VPNVServerAuthenticationLoginSchemaPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerVPNTrafficPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNSessionPolicyAAAUserBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNVServerVPNIntranetApplicationBinding struct { - ActType int `json:"acttype,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` + Name string `json:"name,omitempty"` } type VPNVServerAppFlowPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalAuthenticationRADIUSPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNClientlessAccessPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNGlobalAuthenticationLocalPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalVPNURLBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - URLName string `json:"urlname,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + URLName string `json:"urlname,omitempty"` } type VPNSessionPolicyAAAGroupBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNVServerBinding struct { - Name string `json:"name,omitempty"` - VPNVServerAAAPreauthenticationPolicyBinding []interface{} `json:"vpnvserver_aaapreauthenticationpolicy_binding,omitempty"` - VPNVServerAnalyticsProfileBinding []interface{} `json:"vpnvserver_analyticsprofile_binding,omitempty"` - VPNVServerAppControllerBinding []interface{} `json:"vpnvserver_appcontroller_binding,omitempty"` - VPNVServerAppFlowPolicyBinding []interface{} `json:"vpnvserver_appflowpolicy_binding,omitempty"` - VPNVServerAppFWPolicyBinding []interface{} `json:"vpnvserver_appfwpolicy_binding,omitempty"` - VPNVServerAuditNSLogPolicyBinding []interface{} `json:"vpnvserver_auditnslogpolicy_binding,omitempty"` - VPNVServerAuditSyslogPolicyBinding []interface{} `json:"vpnvserver_auditsyslogpolicy_binding,omitempty"` - VPNVServerAuthenticationCertPolicyBinding []interface{} `json:"vpnvserver_authenticationcertpolicy_binding,omitempty"` - VPNVServerAuthenticationDFAPolicyBinding []interface{} `json:"vpnvserver_authenticationdfapolicy_binding,omitempty"` - VPNVServerAuthenticationLDAPPolicyBinding []interface{} `json:"vpnvserver_authenticationldappolicy_binding,omitempty"` - VPNVServerAuthenticationLocalPolicyBinding []interface{} `json:"vpnvserver_authenticationlocalpolicy_binding,omitempty"` - VPNVServerAuthenticationLoginSchemaPolicyBinding []interface{} `json:"vpnvserver_authenticationloginschemapolicy_binding,omitempty"` - VPNVServerAuthenticationNegotiatePolicyBinding []interface{} `json:"vpnvserver_authenticationnegotiatepolicy_binding,omitempty"` - VPNVServerAuthenticationOAuthIDPPolicyBinding []interface{} `json:"vpnvserver_authenticationoauthidppolicy_binding,omitempty"` - VPNVServerAuthenticationPolicyBinding []interface{} `json:"vpnvserver_authenticationpolicy_binding,omitempty"` - VPNVServerAuthenticationRADIUSPolicyBinding []interface{} `json:"vpnvserver_authenticationradiuspolicy_binding,omitempty"` - VPNVServerAuthenticationSAMLIDPPolicyBinding []interface{} `json:"vpnvserver_authenticationsamlidppolicy_binding,omitempty"` - VPNVServerAuthenticationSAMLPolicyBinding []interface{} `json:"vpnvserver_authenticationsamlpolicy_binding,omitempty"` - VPNVServerAuthenticationTACACSPolicyBinding []interface{} `json:"vpnvserver_authenticationtacacspolicy_binding,omitempty"` - VPNVServerAuthenticationWebAuthPolicyBinding []interface{} `json:"vpnvserver_authenticationwebauthpolicy_binding,omitempty"` - VPNVServerCachePolicyBinding []interface{} `json:"vpnvserver_cachepolicy_binding,omitempty"` - VPNVServerCSPolicyBinding []interface{} `json:"vpnvserver_cspolicy_binding,omitempty"` - VPNVServerFEOPolicyBinding []interface{} `json:"vpnvserver_feopolicy_binding,omitempty"` - VPNVServerICAPolicyBinding []interface{} `json:"vpnvserver_icapolicy_binding,omitempty"` - VPNVServerIntranetIP6Binding []interface{} `json:"vpnvserver_intranetip6_binding,omitempty"` - VPNVServerIntranetIPBinding []interface{} `json:"vpnvserver_intranetip_binding,omitempty"` - VPNVServerResponderPolicyBinding []interface{} `json:"vpnvserver_responderpolicy_binding,omitempty"` - VPNVServerRewritePolicyBinding []interface{} `json:"vpnvserver_rewritepolicy_binding,omitempty"` - VPNVServerSecurePrivateAccessURLBinding []interface{} `json:"vpnvserver_secureprivateaccessurl_binding,omitempty"` - VPNVServerShareFileServerBinding []interface{} `json:"vpnvserver_sharefileserver_binding,omitempty"` - VPNVServerSTAServerBinding []interface{} `json:"vpnvserver_staserver_binding,omitempty"` - VPNVServerVPNClientlessAccessPolicyBinding []interface{} `json:"vpnvserver_vpnclientlessaccesspolicy_binding,omitempty"` - VPNVServerVPNEPAProfileBinding []interface{} `json:"vpnvserver_vpnepaprofile_binding,omitempty"` - VPNVServerVPNEULABinding []interface{} `json:"vpnvserver_vpneula_binding,omitempty"` - VPNVServerVPNIntranetApplicationBinding []interface{} `json:"vpnvserver_vpnintranetapplication_binding,omitempty"` - VPNVServerVPNNextHopServerBinding []interface{} `json:"vpnvserver_vpnnexthopserver_binding,omitempty"` - VPNVServerVPNPortalThemeBinding []interface{} `json:"vpnvserver_vpnportaltheme_binding,omitempty"` - VPNVServerVPNSecurePrivateAccessProfileBinding []interface{} `json:"vpnvserver_vpnsecureprivateaccessprofile_binding,omitempty"` - VPNVServerVPNSessionPolicyBinding []interface{} `json:"vpnvserver_vpnsessionpolicy_binding,omitempty"` - VPNVServerVPNTrafficPolicyBinding []interface{} `json:"vpnvserver_vpntrafficpolicy_binding,omitempty"` - VPNVServerVPNURLBinding []interface{} `json:"vpnvserver_vpnurl_binding,omitempty"` - VPNVServerVPNURLPolicyBinding []interface{} `json:"vpnvserver_vpnurlpolicy_binding,omitempty"` + Name string `json:"name,omitempty"` + VPNVServerAAAPreauthenticationPolicyBinding []any `json:"vpnvserver_aaapreauthenticationpolicy_binding,omitempty"` + VPNVServerAnalyticsProfileBinding []any `json:"vpnvserver_analyticsprofile_binding,omitempty"` + VPNVServerAppControllerBinding []any `json:"vpnvserver_appcontroller_binding,omitempty"` + VPNVServerAppFlowPolicyBinding []any `json:"vpnvserver_appflowpolicy_binding,omitempty"` + VPNVServerAppFWPolicyBinding []any `json:"vpnvserver_appfwpolicy_binding,omitempty"` + VPNVServerAuditNSLogPolicyBinding []any `json:"vpnvserver_auditnslogpolicy_binding,omitempty"` + VPNVServerAuditSyslogPolicyBinding []any `json:"vpnvserver_auditsyslogpolicy_binding,omitempty"` + VPNVServerAuthenticationCertPolicyBinding []any `json:"vpnvserver_authenticationcertpolicy_binding,omitempty"` + VPNVServerAuthenticationDFAPolicyBinding []any `json:"vpnvserver_authenticationdfapolicy_binding,omitempty"` + VPNVServerAuthenticationLDAPPolicyBinding []any `json:"vpnvserver_authenticationldappolicy_binding,omitempty"` + VPNVServerAuthenticationLocalPolicyBinding []any `json:"vpnvserver_authenticationlocalpolicy_binding,omitempty"` + VPNVServerAuthenticationLoginSchemaPolicyBinding []any `json:"vpnvserver_authenticationloginschemapolicy_binding,omitempty"` + VPNVServerAuthenticationNegotiatePolicyBinding []any `json:"vpnvserver_authenticationnegotiatepolicy_binding,omitempty"` + VPNVServerAuthenticationOAuthIDPPolicyBinding []any `json:"vpnvserver_authenticationoauthidppolicy_binding,omitempty"` + VPNVServerAuthenticationPolicyBinding []any `json:"vpnvserver_authenticationpolicy_binding,omitempty"` + VPNVServerAuthenticationRADIUSPolicyBinding []any `json:"vpnvserver_authenticationradiuspolicy_binding,omitempty"` + VPNVServerAuthenticationSAMLIDPPolicyBinding []any `json:"vpnvserver_authenticationsamlidppolicy_binding,omitempty"` + VPNVServerAuthenticationSAMLPolicyBinding []any `json:"vpnvserver_authenticationsamlpolicy_binding,omitempty"` + VPNVServerAuthenticationTACACSPolicyBinding []any `json:"vpnvserver_authenticationtacacspolicy_binding,omitempty"` + VPNVServerAuthenticationWebAuthPolicyBinding []any `json:"vpnvserver_authenticationwebauthpolicy_binding,omitempty"` + VPNVServerCachePolicyBinding []any `json:"vpnvserver_cachepolicy_binding,omitempty"` + VPNVServerCSPolicyBinding []any `json:"vpnvserver_cspolicy_binding,omitempty"` + VPNVServerFEOPolicyBinding []any `json:"vpnvserver_feopolicy_binding,omitempty"` + VPNVServerICAPolicyBinding []any `json:"vpnvserver_icapolicy_binding,omitempty"` + VPNVServerIntranetIP6Binding []any `json:"vpnvserver_intranetip6_binding,omitempty"` + VPNVServerIntranetIPBinding []any `json:"vpnvserver_intranetip_binding,omitempty"` + VPNVServerResponderPolicyBinding []any `json:"vpnvserver_responderpolicy_binding,omitempty"` + VPNVServerRewritePolicyBinding []any `json:"vpnvserver_rewritepolicy_binding,omitempty"` + VPNVServerSecurePrivateAccessURLBinding []any `json:"vpnvserver_secureprivateaccessurl_binding,omitempty"` + VPNVServerShareFileServerBinding []any `json:"vpnvserver_sharefileserver_binding,omitempty"` + VPNVServerSTAServerBinding []any `json:"vpnvserver_staserver_binding,omitempty"` + VPNVServerVPNClientlessAccessPolicyBinding []any `json:"vpnvserver_vpnclientlessaccesspolicy_binding,omitempty"` + VPNVServerVPNEPAProfileBinding []any `json:"vpnvserver_vpnepaprofile_binding,omitempty"` + VPNVServerVPNEULABinding []any `json:"vpnvserver_vpneula_binding,omitempty"` + VPNVServerVPNIntranetApplicationBinding []any `json:"vpnvserver_vpnintranetapplication_binding,omitempty"` + VPNVServerVPNNextHopServerBinding []any `json:"vpnvserver_vpnnexthopserver_binding,omitempty"` + VPNVServerVPNPortalThemeBinding []any `json:"vpnvserver_vpnportaltheme_binding,omitempty"` + VPNVServerVPNSecurePrivateAccessProfileBinding []any `json:"vpnvserver_vpnsecureprivateaccessprofile_binding,omitempty"` + VPNVServerVPNSessionPolicyBinding []any `json:"vpnvserver_vpnsessionpolicy_binding,omitempty"` + VPNVServerVPNTrafficPolicyBinding []any `json:"vpnvserver_vpntrafficpolicy_binding,omitempty"` + VPNVServerVPNURLBinding []any `json:"vpnvserver_vpnurl_binding,omitempty"` + VPNVServerVPNURLPolicyBinding []any `json:"vpnvserver_vpnurlpolicy_binding,omitempty"` } type VPNSessionAction struct { - AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` - AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` - AllProtocolProxy string `json:"allprotocolproxy,omitempty"` - AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` - AuthorizationGroup string `json:"authorizationgroup,omitempty"` - AutoProxyURL string `json:"autoproxyurl,omitempty"` - Builtin []string `json:"builtin,omitempty"` - CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` - ClientChoices string `json:"clientchoices,omitempty"` - ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` - ClientConfiguration []string `json:"clientconfiguration,omitempty"` - ClientDebug string `json:"clientdebug,omitempty"` - ClientIDleTimeout int `json:"clientidletimeout,omitempty"` - ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` - ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` - ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` - ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` - ClientOptions string `json:"clientoptions,omitempty"` - ClientSecurity string `json:"clientsecurity,omitempty"` - ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` - ClientSecurityLog string `json:"clientsecuritylog,omitempty"` - ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` - Count float64 `json:"__count,omitempty"` - DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` - DNSVServerName string `json:"dnsvservername,omitempty"` - EmailHome string `json:"emailhome,omitempty"` - EPAClientType string `json:"epaclienttype,omitempty"` - Feature string `json:"feature,omitempty"` - ForceCleanup []string `json:"forcecleanup,omitempty"` - ForcedTimeout int `json:"forcedtimeout,omitempty"` - ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` - FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` - FTPProxy string `json:"ftpproxy,omitempty"` - GopherProxy string `json:"gopherproxy,omitempty"` - HomePage string `json:"homepage,omitempty"` - HTTPPort []interface{} `json:"httpport,omitempty"` - HTTPProxy string `json:"httpproxy,omitempty"` - ICAProxy string `json:"icaproxy,omitempty"` - IconWithReceiver string `json:"iconwithreceiver,omitempty"` - IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` - KCDAccount string `json:"kcdaccount,omitempty"` - KillConnections string `json:"killconnections,omitempty"` - LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` - LocalLANAccess string `json:"locallanaccess,omitempty"` - LoginScript string `json:"loginscript,omitempty"` - LogoutScript string `json:"logoutscript,omitempty"` - MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` - NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` - NTDomain string `json:"ntdomain,omitempty"` - PCoIPProfileName string `json:"pcoipprofilename,omitempty"` - Proxy string `json:"proxy,omitempty"` - ProxyException string `json:"proxyexception,omitempty"` - ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` - RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` - RFC1918 string `json:"rfc1918,omitempty"` - SecureBrowse string `json:"securebrowse,omitempty"` - SessTimeout int `json:"sesstimeout,omitempty"` - SFGatewayAuthType string `json:"sfgatewayauthtype,omitempty"` - SmartGroup string `json:"smartgroup,omitempty"` - SocksProxy string `json:"socksproxy,omitempty"` - SplitDNS string `json:"splitdns,omitempty"` - SplitTunnel string `json:"splittunnel,omitempty"` - SpoofIIP string `json:"spoofiip,omitempty"` - SSLProxy string `json:"sslproxy,omitempty"` - SSO string `json:"sso,omitempty"` - SSOCredential string `json:"ssocredential,omitempty"` - StoreFrontURL string `json:"storefronturl,omitempty"` - TransparentInterception string `json:"transparentinterception,omitempty"` - UseIIP string `json:"useiip,omitempty"` - UseMIP string `json:"usemip,omitempty"` - UserAccounting string `json:"useraccounting,omitempty"` - WIHome string `json:"wihome,omitempty"` - WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` - WindowsAutoLogon string `json:"windowsautologon,omitempty"` - WindowsClientType string `json:"windowsclienttype,omitempty"` - WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` - Winsip string `json:"winsip,omitempty"` - WIPortalMode string `json:"wiportalmode,omitempty"` + AdvancedClientlessVPNMode string `json:"advancedclientlessvpnmode,omitempty"` + AllowedLoginGroups string `json:"allowedlogingroups,omitempty"` + AllProtocolProxy string `json:"allprotocolproxy,omitempty"` + AlwaysOnProfileName string `json:"alwaysonprofilename,omitempty"` + AuthorizationGroup string `json:"authorizationgroup,omitempty"` + AutoProxyURL string `json:"autoproxyurl,omitempty"` + Builtin []string `json:"builtin,omitempty"` + CitrixReceiverHome string `json:"citrixreceiverhome,omitempty"` + ClientChoices string `json:"clientchoices,omitempty"` + ClientCleanupPrompt string `json:"clientcleanupprompt,omitempty"` + ClientConfiguration []string `json:"clientconfiguration,omitempty"` + ClientDebug string `json:"clientdebug,omitempty"` + ClientIDleTimeout int `json:"clientidletimeout,omitempty"` + ClientIDleTimeoutWarning int `json:"clientidletimeoutwarning,omitempty"` + ClientlessModeURLEncoding string `json:"clientlessmodeurlencoding,omitempty"` + ClientlessPersistentCookie string `json:"clientlesspersistentcookie,omitempty"` + ClientlessVPNMode string `json:"clientlessvpnmode,omitempty"` + ClientOptions string `json:"clientoptions,omitempty"` + ClientSecurity string `json:"clientsecurity,omitempty"` + ClientSecurityGroup string `json:"clientsecuritygroup,omitempty"` + ClientSecurityLog string `json:"clientsecuritylog,omitempty"` + ClientSecurityMessage string `json:"clientsecuritymessage,omitempty"` + Count float64 `json:"__count,omitempty"` + DefaultAuthorizationAction string `json:"defaultauthorizationaction,omitempty"` + DNSVServerName string `json:"dnsvservername,omitempty"` + EmailHome string `json:"emailhome,omitempty"` + EPAClientType string `json:"epaclienttype,omitempty"` + Feature string `json:"feature,omitempty"` + ForceCleanup []string `json:"forcecleanup,omitempty"` + ForcedTimeout int `json:"forcedtimeout,omitempty"` + ForcedTimeoutWarning int `json:"forcedtimeoutwarning,omitempty"` + FQDNSpoofedIP string `json:"fqdnspoofedip,omitempty"` + FTPProxy string `json:"ftpproxy,omitempty"` + GopherProxy string `json:"gopherproxy,omitempty"` + HomePage string `json:"homepage,omitempty"` + HTTPPort []any `json:"httpport,omitempty"` + HTTPProxy string `json:"httpproxy,omitempty"` + ICAProxy string `json:"icaproxy,omitempty"` + IconWithReceiver string `json:"iconwithreceiver,omitempty"` + IIPDNSSuffix string `json:"iipdnssuffix,omitempty"` + KCDAccount string `json:"kcdaccount,omitempty"` + KillConnections string `json:"killconnections,omitempty"` + LinuxPluginUpgrade string `json:"linuxpluginupgrade,omitempty"` + LocalLANAccess string `json:"locallanaccess,omitempty"` + LoginScript string `json:"loginscript,omitempty"` + LogoutScript string `json:"logoutscript,omitempty"` + MacPluginUpgrade string `json:"macpluginupgrade,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` + NextGenAPIResource string `json:"_nextgenapiresource,omitempty"` + NTDomain string `json:"ntdomain,omitempty"` + PCoIPProfileName string `json:"pcoipprofilename,omitempty"` + Proxy string `json:"proxy,omitempty"` + ProxyException string `json:"proxyexception,omitempty"` + ProxyLocalBypass string `json:"proxylocalbypass,omitempty"` + RDPClientProfileName string `json:"rdpclientprofilename,omitempty"` + RFC1918 string `json:"rfc1918,omitempty"` + SecureBrowse string `json:"securebrowse,omitempty"` + SessTimeout int `json:"sesstimeout,omitempty"` + SFGatewayAuthType string `json:"sfgatewayauthtype,omitempty"` + SmartGroup string `json:"smartgroup,omitempty"` + SocksProxy string `json:"socksproxy,omitempty"` + SplitDNS string `json:"splitdns,omitempty"` + SplitTunnel string `json:"splittunnel,omitempty"` + SpoofIIP string `json:"spoofiip,omitempty"` + SSLProxy string `json:"sslproxy,omitempty"` + SSO string `json:"sso,omitempty"` + SSOCredential string `json:"ssocredential,omitempty"` + StoreFrontURL string `json:"storefronturl,omitempty"` + TransparentInterception string `json:"transparentinterception,omitempty"` + UseIIP string `json:"useiip,omitempty"` + UseMIP string `json:"usemip,omitempty"` + UserAccounting string `json:"useraccounting,omitempty"` + WIHome string `json:"wihome,omitempty"` + WIHomeAddressType string `json:"wihomeaddresstype,omitempty"` + WindowsAutoLogon string `json:"windowsautologon,omitempty"` + WindowsClientType string `json:"windowsclienttype,omitempty"` + WindowsPluginUpgrade string `json:"windowspluginupgrade,omitempty"` + Winsip string `json:"winsip,omitempty"` + WIPortalMode string `json:"wiportalmode,omitempty"` } type VPNVServerAuthenticationLDAPPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNTrafficAction struct { @@ -1024,10 +1079,11 @@ type VPNVServerVPNSecurePrivateAccessProfileBinding struct { } type VPNVServerVPNEPAProfileBinding struct { - ActType int `json:"acttype,omitempty"` - EPAProfile string `json:"epaprofile,omitempty"` - EPAProfileOptional bool `json:"epaprofileoptional,omitempty"` - Name string `json:"name,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + EPAProfile string `json:"epaprofile,omitempty"` + EPAProfileOptional bool `json:"epaprofileoptional,omitempty"` + Name string `json:"name,omitempty"` } type VPNFormSSOAction struct { @@ -1045,50 +1101,54 @@ type VPNFormSSOAction struct { } type VPNVServerAuthenticationRADIUSPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationLocalPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNTrafficPolicyVPNGlobalBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNURLPolicyBinding struct { - Name string `json:"name,omitempty"` - VPNURLPolicyAAAGroupBinding []interface{} `json:"vpnurlpolicy_aaagroup_binding,omitempty"` - VPNURLPolicyAAAUserBinding []interface{} `json:"vpnurlpolicy_aaauser_binding,omitempty"` - VPNURLPolicyVPNGlobalBinding []interface{} `json:"vpnurlpolicy_vpnglobal_binding,omitempty"` - VPNURLPolicyVPNVServerBinding []interface{} `json:"vpnurlpolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + VPNURLPolicyAAAGroupBinding []any `json:"vpnurlpolicy_aaagroup_binding,omitempty"` + VPNURLPolicyAAAUserBinding []any `json:"vpnurlpolicy_aaauser_binding,omitempty"` + VPNURLPolicyVPNGlobalBinding []any `json:"vpnurlpolicy_vpnglobal_binding,omitempty"` + VPNURLPolicyVPNVServerBinding []any `json:"vpnurlpolicy_vpnvserver_binding,omitempty"` } type VPNVServerResponderPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerSecurePrivateAccessURLBinding struct { @@ -1098,62 +1158,65 @@ type VPNVServerSecurePrivateAccessURLBinding struct { } type VPNVServerAuthenticationPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalBinding struct { - VPNGlobalAppControllerBinding []interface{} `json:"vpnglobal_appcontroller_binding,omitempty"` - VPNGlobalAppFWPolicyBinding []interface{} `json:"vpnglobal_appfwpolicy_binding,omitempty"` - VPNGlobalAuditNSLogPolicyBinding []interface{} `json:"vpnglobal_auditnslogpolicy_binding,omitempty"` - VPNGlobalAuditSyslogPolicyBinding []interface{} `json:"vpnglobal_auditsyslogpolicy_binding,omitempty"` - VPNGlobalAuthenticationCertPolicyBinding []interface{} `json:"vpnglobal_authenticationcertpolicy_binding,omitempty"` - VPNGlobalAuthenticationLDAPPolicyBinding []interface{} `json:"vpnglobal_authenticationldappolicy_binding,omitempty"` - VPNGlobalAuthenticationLocalPolicyBinding []interface{} `json:"vpnglobal_authenticationlocalpolicy_binding,omitempty"` - VPNGlobalAuthenticationNegotiatePolicyBinding []interface{} `json:"vpnglobal_authenticationnegotiatepolicy_binding,omitempty"` - VPNGlobalAuthenticationPolicyBinding []interface{} `json:"vpnglobal_authenticationpolicy_binding,omitempty"` - VPNGlobalAuthenticationRADIUSPolicyBinding []interface{} `json:"vpnglobal_authenticationradiuspolicy_binding,omitempty"` - VPNGlobalAuthenticationSAMLPolicyBinding []interface{} `json:"vpnglobal_authenticationsamlpolicy_binding,omitempty"` - VPNGlobalAuthenticationTACACSPolicyBinding []interface{} `json:"vpnglobal_authenticationtacacspolicy_binding,omitempty"` - VPNGlobalGSLBDomainBinding []interface{} `json:"vpnglobal_gslbdomain_binding,omitempty"` - VPNGlobalIntranetIP6Binding []interface{} `json:"vpnglobal_intranetip6_binding,omitempty"` - VPNGlobalIntranetIPBinding []interface{} `json:"vpnglobal_intranetip_binding,omitempty"` - VPNGlobalSecurePrivateAccessURLBinding []interface{} `json:"vpnglobal_secureprivateaccessurl_binding,omitempty"` - VPNGlobalShareFileServerBinding []interface{} `json:"vpnglobal_sharefileserver_binding,omitempty"` - VPNGlobalSSLCertKeyBinding []interface{} `json:"vpnglobal_sslcertkey_binding,omitempty"` - VPNGlobalSTAServerBinding []interface{} `json:"vpnglobal_staserver_binding,omitempty"` - VPNGlobalVPNClientlessAccessPolicyBinding []interface{} `json:"vpnglobal_vpnclientlessaccesspolicy_binding,omitempty"` - VPNGlobalVPNEULABinding []interface{} `json:"vpnglobal_vpneula_binding,omitempty"` - VPNGlobalVPNIntranetApplicationBinding []interface{} `json:"vpnglobal_vpnintranetapplication_binding,omitempty"` - VPNGlobalVPNNextHopServerBinding []interface{} `json:"vpnglobal_vpnnexthopserver_binding,omitempty"` - VPNGlobalVPNPortalThemeBinding []interface{} `json:"vpnglobal_vpnportaltheme_binding,omitempty"` - VPNGlobalVPNSecurePrivateAccessProfileBinding []interface{} `json:"vpnglobal_vpnsecureprivateaccessprofile_binding,omitempty"` - VPNGlobalVPNSessionPolicyBinding []interface{} `json:"vpnglobal_vpnsessionpolicy_binding,omitempty"` - VPNGlobalVPNTrafficPolicyBinding []interface{} `json:"vpnglobal_vpntrafficpolicy_binding,omitempty"` - VPNGlobalVPNURLBinding []interface{} `json:"vpnglobal_vpnurl_binding,omitempty"` - VPNGlobalVPNURLPolicyBinding []interface{} `json:"vpnglobal_vpnurlpolicy_binding,omitempty"` + VPNGlobalAppControllerBinding []any `json:"vpnglobal_appcontroller_binding,omitempty"` + VPNGlobalAppFWPolicyBinding []any `json:"vpnglobal_appfwpolicy_binding,omitempty"` + VPNGlobalAuditNSLogPolicyBinding []any `json:"vpnglobal_auditnslogpolicy_binding,omitempty"` + VPNGlobalAuditSyslogPolicyBinding []any `json:"vpnglobal_auditsyslogpolicy_binding,omitempty"` + VPNGlobalAuthenticationCertPolicyBinding []any `json:"vpnglobal_authenticationcertpolicy_binding,omitempty"` + VPNGlobalAuthenticationLDAPPolicyBinding []any `json:"vpnglobal_authenticationldappolicy_binding,omitempty"` + VPNGlobalAuthenticationLocalPolicyBinding []any `json:"vpnglobal_authenticationlocalpolicy_binding,omitempty"` + VPNGlobalAuthenticationNegotiatePolicyBinding []any `json:"vpnglobal_authenticationnegotiatepolicy_binding,omitempty"` + VPNGlobalAuthenticationPolicyBinding []any `json:"vpnglobal_authenticationpolicy_binding,omitempty"` + VPNGlobalAuthenticationRADIUSPolicyBinding []any `json:"vpnglobal_authenticationradiuspolicy_binding,omitempty"` + VPNGlobalAuthenticationSAMLPolicyBinding []any `json:"vpnglobal_authenticationsamlpolicy_binding,omitempty"` + VPNGlobalAuthenticationTACACSPolicyBinding []any `json:"vpnglobal_authenticationtacacspolicy_binding,omitempty"` + VPNGlobalGSLBDomainBinding []any `json:"vpnglobal_gslbdomain_binding,omitempty"` + VPNGlobalIntranetIP6Binding []any `json:"vpnglobal_intranetip6_binding,omitempty"` + VPNGlobalIntranetIPBinding []any `json:"vpnglobal_intranetip_binding,omitempty"` + VPNGlobalSecurePrivateAccessURLBinding []any `json:"vpnglobal_secureprivateaccessurl_binding,omitempty"` + VPNGlobalShareFileServerBinding []any `json:"vpnglobal_sharefileserver_binding,omitempty"` + VPNGlobalSSLCertKeyBinding []any `json:"vpnglobal_sslcertkey_binding,omitempty"` + VPNGlobalSTAServerBinding []any `json:"vpnglobal_staserver_binding,omitempty"` + VPNGlobalVPNClientlessAccessPolicyBinding []any `json:"vpnglobal_vpnclientlessaccesspolicy_binding,omitempty"` + VPNGlobalVPNEULABinding []any `json:"vpnglobal_vpneula_binding,omitempty"` + VPNGlobalVPNIntranetApplicationBinding []any `json:"vpnglobal_vpnintranetapplication_binding,omitempty"` + VPNGlobalVPNNextHopServerBinding []any `json:"vpnglobal_vpnnexthopserver_binding,omitempty"` + VPNGlobalVPNPortalThemeBinding []any `json:"vpnglobal_vpnportaltheme_binding,omitempty"` + VPNGlobalVPNSecurePrivateAccessProfileBinding []any `json:"vpnglobal_vpnsecureprivateaccessprofile_binding,omitempty"` + VPNGlobalVPNSessionPolicyBinding []any `json:"vpnglobal_vpnsessionpolicy_binding,omitempty"` + VPNGlobalVPNTrafficPolicyBinding []any `json:"vpnglobal_vpntrafficpolicy_binding,omitempty"` + VPNGlobalVPNURLBinding []any `json:"vpnglobal_vpnurl_binding,omitempty"` + VPNGlobalVPNURLPolicyBinding []any `json:"vpnglobal_vpnurlpolicy_binding,omitempty"` } type VPNGlobalAppControllerBinding struct { - AppController string `json:"appcontroller,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + Count float64 `json:"__count,omitempty"` + AppController string `json:"appcontroller,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` } type VPNVServerAuthenticationDFAPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNPCoIPProfile struct { @@ -1166,15 +1229,17 @@ type VPNPCoIPProfile struct { } type VPNGlobalShareFileServerBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - ShareFile string `json:"sharefile,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + ShareFile string `json:"sharefile,omitempty"` } type VPNTrafficPolicyAAAUserBinding struct { - ActivePolicy int `json:"activepolicy,omitempty"` - BoundTo string `json:"boundto,omitempty"` - Name string `json:"name,omitempty"` - Priority int `json:"priority,omitempty"` + Count float64 `json:"__count,omitempty"` + ActivePolicy int `json:"activepolicy,omitempty"` + BoundTo string `json:"boundto,omitempty"` + Name string `json:"name,omitempty"` + Priority int `json:"priority,omitempty"` } type VPNAlwaysOnProfile struct { @@ -1187,9 +1252,10 @@ type VPNAlwaysOnProfile struct { } type VPNVServerVPNNextHopServerBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - NextHopServer string `json:"nexthopserver,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + NextHopServer string `json:"nexthopserver,omitempty"` } type VPNGlobalAppFWPolicyBinding struct { @@ -1201,53 +1267,59 @@ type VPNGlobalAppFWPolicyBinding struct { } type VPNVServerSTAServerBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - STAAddressType string `json:"staaddresstype,omitempty"` - STAAuthID string `json:"staauthid,omitempty"` - STAServer string `json:"staserver,omitempty"` - STAState string `json:"stastate,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + STAAddressType string `json:"staaddresstype,omitempty"` + STAAuthID string `json:"staauthid,omitempty"` + STAServer string `json:"staserver,omitempty"` + STAState string `json:"stastate,omitempty"` } type VPNGlobalVPNIntranetApplicationBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetApplication string `json:"intranetapplication,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetApplication string `json:"intranetapplication,omitempty"` } type VPNVServerIntranetIPBinding struct { - ActType int `json:"acttype,omitempty"` - IntranetIP string `json:"intranetip,omitempty"` - MapField string `json:"map,omitempty"` - Name string `json:"name,omitempty"` - Netmask string `json:"netmask,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + IntranetIP string `json:"intranetip,omitempty"` + MapField string `json:"map,omitempty"` + Name string `json:"name,omitempty"` + Netmask string `json:"netmask,omitempty"` } type VPNClientlessAccessPolicyBinding struct { - Name string `json:"name,omitempty"` - VPNClientlessAccessPolicyVPNGlobalBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnglobal_binding,omitempty"` - VPNClientlessAccessPolicyVPNVServerBinding []interface{} `json:"vpnclientlessaccesspolicy_vpnvserver_binding,omitempty"` + Name string `json:"name,omitempty"` + VPNClientlessAccessPolicyVPNGlobalBinding []any `json:"vpnclientlessaccesspolicy_vpnglobal_binding,omitempty"` + VPNClientlessAccessPolicyVPNVServerBinding []any `json:"vpnclientlessaccesspolicy_vpnvserver_binding,omitempty"` } type VPNGlobalAuthenticationNegotiatePolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalAuthenticationTACACSPolicyBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - PolicyName string `json:"policyname,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + PolicyName string `json:"policyname,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalIntranetIP6Binding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetIP6 string `json:"intranetip6,omitempty"` - NumAddr int `json:"numaddr,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetIP6 string `json:"intranetip6,omitempty"` + NumAddr int `json:"numaddr,omitempty"` } type VPNVServer struct { @@ -1336,12 +1408,13 @@ type VPNVServer struct { } type VPNGlobalSSLCertKeyBinding struct { - CACert string `json:"cacert,omitempty"` - CertKeyName string `json:"certkeyname,omitempty"` - CRLCheck string `json:"crlcheck,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - OCSPCheck string `json:"ocspcheck,omitempty"` - UserDataEncryptionKey string `json:"userdataencryptionkey,omitempty"` + Count float64 `json:"__count,omitempty"` + CACert string `json:"cacert,omitempty"` + CertKeyName string `json:"certkeyname,omitempty"` + CRLCheck string `json:"crlcheck,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + OCSPCheck string `json:"ocspcheck,omitempty"` + UserDataEncryptionKey string `json:"userdataencryptionkey,omitempty"` } type VPNVServerAppFWPolicyBinding struct { @@ -1372,31 +1445,34 @@ type VPNICAConnection struct { } type VPNVServerRewritePolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNVServerAuthenticationOAuthIDPPolicyBinding struct { - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } type VPNGlobalSTAServerBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - STAAddressType string `json:"staaddresstype,omitempty"` - STAAuthID string `json:"staauthid,omitempty"` - STAServer string `json:"staserver,omitempty"` - STAState string `json:"stastate,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + STAAddressType string `json:"staaddresstype,omitempty"` + STAAuthID string `json:"staauthid,omitempty"` + STAServer string `json:"staserver,omitempty"` + STAState string `json:"stastate,omitempty"` } type VPNSecurePrivateAccessProfile struct { @@ -1419,23 +1495,26 @@ type VPNEPAProfile struct { } type VPNVServerVPNPortalThemeBinding struct { - ActType int `json:"acttype,omitempty"` - Name string `json:"name,omitempty"` - PortalTheme string `json:"portaltheme,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + Name string `json:"name,omitempty"` + PortalTheme string `json:"portaltheme,omitempty"` } type VPNGlobalDomainBinding struct { - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - IntranetDomain string `json:"intranetdomain,omitempty"` + Count float64 `json:"__count,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + IntranetDomain string `json:"intranetdomain,omitempty"` } type VPNVServerVPNClientlessAccessPolicyBinding struct { - ActType int `json:"acttype,omitempty"` - BindPoint string `json:"bindpoint,omitempty"` - GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` - GroupExtraction bool `json:"groupextraction,omitempty"` - Name string `json:"name,omitempty"` - Policy string `json:"policy,omitempty"` - Priority int `json:"priority,omitempty"` - Secondary bool `json:"secondary,omitempty"` + Count float64 `json:"__count,omitempty"` + ActType int `json:"acttype,omitempty"` + BindPoint string `json:"bindpoint,omitempty"` + GotoPriorityExpression string `json:"gotopriorityexpression,omitempty"` + GroupExtraction bool `json:"groupextraction,omitempty"` + Name string `json:"name,omitempty"` + Policy string `json:"policy,omitempty"` + Priority int `json:"priority,omitempty"` + Secondary bool `json:"secondary,omitempty"` } diff --git a/nitrogo/network.go b/nitrogo/network.go index 7ce1eb5..c03d829 100644 --- a/nitrogo/network.go +++ b/nitrogo/network.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( appAlgParamURL = "/nitro/v1/config/appalgparam" arpURL = "/nitro/v1/config/arp" @@ -88,21 +97,21 @@ const ( vlanLinkSetBindingURL = "/nitro/v1/config/vlan_linkset_binding" vlanNSIP6BindingURL = "/nitro/v1/config/vlan_nsip6_binding" vlanNSIPBindingURL = "/nitro/v1/config/vlan_nsip_binding" - vrIDURL = "/nitro/v1/config/vrid" - vrIDBindingURL = "/nitro/v1/config/vrid_binding" - vrIDChannelBindingURL = "/nitro/v1/config/vrid_channel_binding" - vrIDInterfaceBindingURL = "/nitro/v1/config/vrid_interface_binding" - vrIDNSIP6BindingURL = "/nitro/v1/config/vrid_nsip6_binding" - vrIDNSIPBindingURL = "/nitro/v1/config/vrid_nsip_binding" - vrIDTrackInterfaceBindingURL = "/nitro/v1/config/vrid_trackinterface_binding" - vrID6URL = "/nitro/v1/config/vrid6" - vrID6BindingURL = "/nitro/v1/config/vrid6_binding" - vrID6ChannelBindingURL = "/nitro/v1/config/vrid6_channel_binding" - vrID6InterfaceBindingURL = "/nitro/v1/config/vrid6_interface_binding" - vrID6NSIP6BindingURL = "/nitro/v1/config/vrid6_nsip6_binding" - vrID6NSIPBindingURL = "/nitro/v1/config/vrid6_nsip_binding" - vrID6TrackInterfaceBindingURL = "/nitro/v1/config/vrid6_trackinterface_binding" - vrIDParamURL = "/nitro/v1/config/vridparam" + vridURL = "/nitro/v1/config/vrid" + vridBindingURL = "/nitro/v1/config/vrid_binding" + vridChannelBindingURL = "/nitro/v1/config/vrid_channel_binding" + vridInterfaceBindingURL = "/nitro/v1/config/vrid_interface_binding" + vridNSIP6BindingURL = "/nitro/v1/config/vrid_nsip6_binding" + vridNSIPBindingURL = "/nitro/v1/config/vrid_nsip_binding" + vridTrackInterfaceBindingURL = "/nitro/v1/config/vrid_trackinterface_binding" + vrid6URL = "/nitro/v1/config/vrid6" + vrid6BindingURL = "/nitro/v1/config/vrid6_binding" + vrid6ChannelBindingURL = "/nitro/v1/config/vrid6_channel_binding" + vrid6InterfaceBindingURL = "/nitro/v1/config/vrid6_interface_binding" + vrid6NSIP6BindingURL = "/nitro/v1/config/vrid6_nsip6_binding" + vrid6NSIPBindingURL = "/nitro/v1/config/vrid6_nsip_binding" + vrid6TrackInterfaceBindingURL = "/nitro/v1/config/vrid6_trackinterface_binding" + vridParamURL = "/nitro/v1/config/vridparam" vxlanURL = "/nitro/v1/config/vxlan" vxlanBindingURL = "/nitro/v1/config/vxlan_binding" vxlanIPTunnelBindingURL = "/nitro/v1/config/vxlan_iptunnel_binding" @@ -119,703 +128,9943 @@ type NetworkService struct { } // appalgparam -func (s *NetworkService) UpdateAppAlgParam() {} -func (s *NetworkService) UnsetAppAlgParam() {} -func (s *NetworkService) GetAllAppAlgParam() {} +func (s *NetworkService) UpdateAppAlgParam(resource models.AppALGParam) error { + payload := map[string]any{"appalgparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, appAlgParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetAppAlgParam(resource models.AppALGParam) error { + payload := map[string]any{"appalgparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", appAlgParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllAppAlgParam() ([]models.AppALGParam, error) { + req, err := s.client.NewRequest(http.MethodGet, appAlgParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.AppALGParam `json:"appalgparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} // arp -func (s *NetworkService) AddARP() {} -func (s *NetworkService) DeleteARP() {} -func (s *NetworkService) SendARP() {} -func (s *NetworkService) GetAllARP() {} -func (s *NetworkService) CountARP() {} +func (s *NetworkService) AddARP(resource models.ARP) error { + payload := map[string]any{"arp": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, arpURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteARP(ipaddress string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", arpURL, ipaddress), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) SendARP(resource models.ARP) error { + payload := map[string]any{"arp": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=send", arpURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllARP() ([]models.ARP, error) { + req, err := s.client.NewRequest(http.MethodGet, arpURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ARP `json:"arp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) CountARP() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", arpURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ARP `json:"arp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // arpparam -func (s *NetworkService) UpdateARPParam() {} -func (s *NetworkService) UnsetARPParam() {} -func (s *NetworkService) GetAllARPParam() {} +func (s *NetworkService) UpdateARPParam(resource models.ARPParam) error { + payload := map[string]any{"arpparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, arpParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetARPParam(resource models.ARPParam) error { + payload := map[string]any{"arpparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", arpParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllARPParam() ([]models.ARPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, arpParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ARPParam `json:"arpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} // bridgegroup -func (s *NetworkService) AddBridgeGroup() {} -func (s *NetworkService) DeleteBridgeGroup() {} -func (s *NetworkService) UpdateBridgeGroup() {} -func (s *NetworkService) UnsetBridgeGroup() {} -func (s *NetworkService) GetAllBridgeGroup() {} -func (s *NetworkService) GetBridgeGroup() {} -func (s *NetworkService) CountBridgeGroup() {} +func (s *NetworkService) AddBridgeGroup(resource models.BridgeGroup) error { + payload := map[string]any{"bridgegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, bridgeGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteBridgeGroup(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", bridgeGroupURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateBridgeGroup(resource models.BridgeGroup) error { + payload := map[string]any{"bridgegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, bridgeGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetBridgeGroup(resource models.BridgeGroup) error { + payload := map[string]any{"bridgegroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", bridgeGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllBridgeGroup() ([]models.BridgeGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroup `json:"bridgegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetBridgeGroup(id string) (*models.BridgeGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", bridgeGroupURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroup `json:"bridgegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountBridgeGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", bridgeGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.BridgeGroup `json:"bridgegroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // bridgegroup_binding -func (s *NetworkService) GetAllBridgeGroupBinding() {} -func (s *NetworkService) GetBridgeGroupBinding() {} +func (s *NetworkService) GetAllBridgeGroupBinding() ([]models.BridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroupBinding `json:"bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetBridgeGroupBinding(id string) (*models.BridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", bridgeGroupBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroupBinding `json:"bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} // bridgegroup_nsip6_binding -func (s *NetworkService) AddBridgeGroupNSIP6Binding() {} -func (s *NetworkService) DeleteBridgeGroupNSIP6Binding() {} -func (s *NetworkService) GetAllBridgeGroupNSIP6Binding() {} -func (s *NetworkService) GetBridgeGroupNSIP6Binding() {} -func (s *NetworkService) CountBridgeGroupNSIP6Binding() {} +func (s *NetworkService) AddBridgeGroupNSIP6Binding(resource models.BridgeGroupNSIP6Binding) error { + payload := map[string]any{"bridgegroup_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, bridgeGroupNSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteBridgeGroupNSIP6Binding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", bridgeGroupNSIP6BindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllBridgeGroupNSIP6Binding() ([]models.BridgeGroupNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeGroupNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroupNSIP6Binding `json:"bridgegroup_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetBridgeGroupNSIP6Binding(id string) (*models.BridgeGroupNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", bridgeGroupNSIP6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.BridgeGroupNSIP6Binding `json:"bridgegroup_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountBridgeGroupNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", bridgeGroupNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.BridgeGroupNSIP6Binding `json:"bridgegroup_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // bridgegroup_nsip_binding -func (s *NetworkService) AddBrigeGroupNSIPBinding() {} -func (s *NetworkService) DeleteBrigeGroupNSIPBinding() {} -func (s *NetworkService) GetAllBrigeGroupNSIPBinding() {} -func (s *NetworkService) GetBrigeGroupNSIPBinding() {} -func (s *NetworkService) CountBrigeGroupNSIPBinding() {} +func (s *NetworkService) AddBrigeGroupNSIPBinding(resource models.BridgeGroupNSIPBinding) error { + payload := map[string]any{"bridgegroup_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// bridgegroup_vlan_binding -func (s *NetworkService) AddBridgeGroupVLANBinding() {} -func (s *NetworkService) DeleteBridgeGroupVLANBinding() {} -func (s *NetworkService) GetAllBridgeGroupVLANBinding() {} -func (s *NetworkService) GetBridgeGroupVLANBinding() {} -func (s *NetworkService) CountBridgeGroupVLANBinding() {} + req, err := s.client.NewRequest(http.MethodPost, bridgeGroupNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// bridgetable -func (s *NetworkService) AddBridgeTable() {} -func (s *NetworkService) DeleteBridgeTable() {} -func (s *NetworkService) UpdateBridgeTable() {} -func (s *NetworkService) UnsetBridgeTable() {} -func (s *NetworkService) GetAllBridgeTable() {} -func (s *NetworkService) CountBridgeTable() {} + _, err = s.client.Do(req) + return err +} -// channel -func (s *NetworkService) AddChannel() {} -func (s *NetworkService) DeleteChannel() {} -func (s *NetworkService) UpdateChannel() {} -func (s *NetworkService) UnsetChannel() {} -func (s *NetworkService) GetAllChannel() {} -func (s *NetworkService) GetChannel() {} -func (s *NetworkService) CountChannel() {} +func (s *NetworkService) DeleteBrigeGroupNSIPBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", bridgeGroupNSIPBindingURL, id), nil) + if err != nil { + return err + } -// channel_binding -func (s *NetworkService) GetAllChannelBinding() {} -func (s *NetworkService) GetChannelBinding() {} + _, err = s.client.Do(req) + return err +} -// channel_interface_binding -func (s *NetworkService) AddChannelInterfaceBinding() {} -func (s *NetworkService) DeleteChannelInterfaceBinding() {} -func (s *NetworkService) GetAllChannelInterfaceBinding() {} -func (s *NetworkService) GetChannelInterfaceBinding() {} -func (s *NetworkService) CountChannelInterfaceBinding() {} +func (s *NetworkService) GetAllBrigeGroupNSIPBinding() ([]models.BridgeGroupNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeGroupNSIPBindingURL, nil) + if err != nil { + return nil, err + } -// ci -func (s *NetworkService) GetAllCI() {} -func (s *NetworkService) CountCI() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// fis -func (s *NetworkService) AddFIS() {} -func (s *NetworkService) DeleteFIS() {} -func (s *NetworkService) GetAllFIS() {} -func (s *NetworkService) GetFIS() {} -func (s *NetworkService) CountFIS() {} + var result struct { + Data []models.BridgeGroupNSIPBinding `json:"bridgegroup_nsip_binding"` + } -// fis_binding -func (s *NetworkService) GetAllFISBinding() {} -func (s *NetworkService) GetFISBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// fis_channel_binding -func (s *NetworkService) AddFISChannelBinding() {} -func (s *NetworkService) DeleteFISChannelBinding() {} -func (s *NetworkService) GetAllFISChannelBinding() {} -func (s *NetworkService) GetFISChannelBinding() {} -func (s *NetworkService) CountFISChannelBinding() {} + return result.Data, nil +} -// fis_interface_binding -func (s *NetworkService) AddFISInterfaceBinding() {} -func (s *NetworkService) DeleteFISInterfaceBinding() {} +func (s *NetworkService) GetBrigeGroupNSIPBinding(id string) (*models.BridgeGroupNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", bridgeGroupNSIPBindingURL, id), nil) + if err != nil { + return nil, err + } -// forwardingsession -func (s *NetworkService) AddFowardingSession() {} -func (s *NetworkService) DeleteFowardingSession() {} -func (s *NetworkService) UpdateFowardingSession() {} -func (s *NetworkService) GetAllFowardingSession() {} -func (s *NetworkService) GetFowardingSession() {} -func (s *NetworkService) CountFowardingSession() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// inat -func (s *NetworkService) AddINAT() {} -func (s *NetworkService) DeleteINAT() {} -func (s *NetworkService) UpdateINAT() {} -func (s *NetworkService) UnsetINAT() {} -func (s *NetworkService) GetAllINAT() {} -func (s *NetworkService) GetINAT() {} -func (s *NetworkService) CountINAT() {} + var result struct { + Data []models.BridgeGroupNSIPBinding `json:"bridgegroup_nsip_binding"` + } -// inatparam -func (s *NetworkService) UpdateINATParam() {} -func (s *NetworkService) UnsetINATParam() {} -func (s *NetworkService) GetAllINATParam() {} -func (s *NetworkService) GetINATParam() {} -func (s *NetworkService) CountINATParam() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// interface -func (s *NetworkService) ClearInterface() {} -func (s *NetworkService) UpdateInterface() {} -func (s *NetworkService) UnsetInterface() {} -func (s *NetworkService) EnableInterface() {} -func (s *NetworkService) DisableInterface() {} -func (s *NetworkService) ResetInterface() {} -func (s *NetworkService) GetAllInterface() {} -func (s *NetworkService) GetInterface() {} -func (s *NetworkService) CountInterface() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// interfacepair -func (s *NetworkService) AddInterfacePair() {} -func (s *NetworkService) DeleteInterfacePair() {} -func (s *NetworkService) GetAllInterfacePair() {} -func (s *NetworkService) GetInterfacePair() {} -func (s *NetworkService) CountInterfacePair() {} + return &result.Data[0], nil +} -// ip6tunnel -func (s *NetworkService) AddIP6Tunnel() {} -func (s *NetworkService) DeleteIP6Tunnel() {} -func (s *NetworkService) GetAllIP6Tunnel() {} -func (s *NetworkService) GetIP6Tunnel() {} -func (s *NetworkService) CountIP6Tunnel() {} +func (s *NetworkService) CountBrigeGroupNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", bridgeGroupNSIPBindingURL), nil) + if err != nil { + return 0, err + } -// ip6tunnelparam -func (s *NetworkService) UpdateIP6TunnelParam() {} -func (s *NetworkService) UnsetIP6TunnelParam() {} -func (s *NetworkService) GetAllIP6TunnelParam() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// ipset -func (s *NetworkService) AddIPSet() {} -func (s *NetworkService) DeleteIPSet() {} -func (s *NetworkService) GetAllIPSet() {} -func (s *NetworkService) GetIPSet() {} -func (s *NetworkService) CountIPSet() {} + var result struct { + Data []models.BridgeGroupNSIPBinding `json:"bridgegroup_nsip_binding"` + } -// ipset_binding -func (s *NetworkService) GetAllIPSetBinding() {} -func (s *NetworkService) GetIPSetBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// ipset_nsip6_binding -func (s *NetworkService) AddIPSetNSIP6Binding() {} -func (s *NetworkService) DeleteIPSetNSIP6Binding() {} -func (s *NetworkService) GetAllIPSetNSIP6Binding() {} -func (s *NetworkService) GetIPSetNSIP6Binding() {} -func (s *NetworkService) CountIPSetNSIP6Binding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// ipset_nsip_binding -func (s *NetworkService) AddIPSetNSIPBinding() {} -func (s *NetworkService) DeleteIPSetNSIPBinding() {} -func (s *NetworkService) GetAllIPSetNSIPBinding() {} -func (s *NetworkService) GetIPSetNSIPBinding() {} -func (s *NetworkService) CountIPSetNSIPBinding() {} +// bridgegroup_vlan_binding +func (s *NetworkService) AddBridgeGroupVLANBinding(resource models.BridgeGroupVLANBinding) error { + payload := map[string]any{"bridgegroup_vlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// iptunnel -func (s *NetworkService) AddIPTunnel() {} -func (s *NetworkService) DeleteIPTunnel() {} -func (s *NetworkService) UpdateIPTunnel() {} -func (s *NetworkService) UnsetIPTunnel() {} -func (s *NetworkService) GetAllIPTunnel() {} -func (s *NetworkService) GetIPTunnel() {} -func (s *NetworkService) CountIPTunnel() {} + req, err := s.client.NewRequest(http.MethodPost, bridgeGroupVLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// iptunnelparam -func (s *NetworkService) UpdateIPTunnelParam() {} -func (s *NetworkService) UnsetIPTunnelParam() {} -func (s *NetworkService) GetAllIPTunnelParam() {} + _, err = s.client.Do(req) + return err +} -// ipv6 -func (s *NetworkService) UpdateIPV6() {} -func (s *NetworkService) UnsetIPV6() {} -func (s *NetworkService) GetAllIPV6() {} -func (s *NetworkService) GetIPV6() {} -func (s *NetworkService) CountIPV6() {} +func (s *NetworkService) DeleteBridgeGroupVLANBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", bridgeGroupVLANBindingURL, id), nil) + if err != nil { + return err + } -// l2param -func (s *NetworkService) UpdateL2Param() {} -func (s *NetworkService) UnsetL2Param() {} -func (s *NetworkService) GetAllL2Param() {} + _, err = s.client.Do(req) + return err +} -// l3param -func (s *NetworkService) UpdateL3Param() {} -func (s *NetworkService) UnsetL3Param() {} -func (s *NetworkService) GetAllL3Param() {} +func (s *NetworkService) GetAllBridgeGroupVLANBinding() ([]models.BridgeGroupVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeGroupVLANBindingURL, nil) + if err != nil { + return nil, err + } -// l4param -func (s *NetworkService) UpdateL4Param() {} -func (s *NetworkService) UnsetL4Param() {} -func (s *NetworkService) GetAllL4Param() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// lacp -func (s *NetworkService) UpdateLACP() {} -func (s *NetworkService) GetAllLACP() {} -func (s *NetworkService) GetLACP() {} -func (s *NetworkService) CountLACP() {} + var result struct { + Data []models.BridgeGroupVLANBinding `json:"bridgegroup_vlan_binding"` + } -// linkset -func (s *NetworkService) AddLinkSet() {} -func (s *NetworkService) DeleteLinkSet() {} -func (s *NetworkService) GetAllLinkSet() {} -func (s *NetworkService) GetLinkSet() {} -func (s *NetworkService) CountLinkSet() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// linkset_binding -func (s *NetworkService) GetAllLinkSetBinding() {} -func (s *NetworkService) GetLinkSetBinding() {} + return result.Data, nil +} -// linkset_channel_binding -func (s *NetworkService) AddLinkSetChannelBinding() {} -func (s *NetworkService) DeleteLinkSetChannelBinding() {} -func (s *NetworkService) GetAllLinkSetChannelBinding() {} -func (s *NetworkService) GetLinkSetChannelBinding() {} -func (s *NetworkService) CountLinkSetChannelBinding() {} +func (s *NetworkService) GetBridgeGroupVLANBinding(id string) (*models.BridgeGroupVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", bridgeGroupVLANBindingURL, id), nil) + if err != nil { + return nil, err + } -// linkset_interface_binding -func (s *NetworkService) AddLinkSetInterfaceBinding() {} -func (s *NetworkService) DeleteLinkSetInterfaceBinding() {} -func (s *NetworkService) GetAllLinkSetInterfaceBinding() {} -func (s *NetworkService) GetLinkSetInterfaceBinding() {} -func (s *NetworkService) CountLinkSetInterfaceBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// mapbmr -func (s *NetworkService) AddMAPBMR() {} -func (s *NetworkService) DeleteMAPBMR() {} -func (s *NetworkService) GetAllMAPBMR() {} -func (s *NetworkService) GetMAPBMR() {} -func (s *NetworkService) CountMAPBMR() {} + var result struct { + Data []models.BridgeGroupVLANBinding `json:"bridgegroup_vlan_binding"` + } -// mapbr_binding -func (s *NetworkService) GetAllMAPBMRBinding() {} -func (s *NetworkService) GetMAPBMRBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// mapbmr_bmrv4network_binding -func (s *NetworkService) AddMAPBMRBMRV4NetworkBinding() {} -func (s *NetworkService) DeleteMAPBMRBMRV4NetworkBinding() {} -func (s *NetworkService) GetAllMAPBMRBMRV4NetworkBinding() {} -func (s *NetworkService) GetMAPBMRBMRV4NetworkBinding() {} -func (s *NetworkService) CountMAPBMRBMRV4NetworkBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// mapdmr -func (s *NetworkService) AddMAPDMR() {} -func (s *NetworkService) DeleteMAPDMR() {} -func (s *NetworkService) GetAllMAPDMR() {} -func (s *NetworkService) GetMAPDMR() {} -func (s *NetworkService) CountMAPDMR() {} + return &result.Data[0], nil +} -// mapdomain -func (s *NetworkService) AddMAPDomain() {} -func (s *NetworkService) DeleteMAPDomain() {} -func (s *NetworkService) GetAllMAPDomain() {} -func (s *NetworkService) GetMAPDomain() {} -func (s *NetworkService) CountMAPDomain() {} +func (s *NetworkService) CountBridgeGroupVLANBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", bridgeGroupVLANBindingURL), nil) + if err != nil { + return 0, err + } -// mapdomain_binding -func (s *NetworkService) GetAllMAPDomainBinding() {} -func (s *NetworkService) GetMAPDomainBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// mapdomain_mapbmr_binding -func (s *NetworkService) AddMAPDomainMAPBMRBinding() {} -func (s *NetworkService) DeleteMAPDomainMAPBMRBinding() {} -func (s *NetworkService) GetAllMAPDomainMAPBMRBinding() {} -func (s *NetworkService) GetMAPDomainMAPBMRBinding() {} -func (s *NetworkService) CountMAPDomainMAPBMRBinding() {} + var result struct { + Data []models.BridgeGroupVLANBinding `json:"bridgegroup_vlan_binding"` + } -// nat64 -func (s *NetworkService) AddNAT64() {} -func (s *NetworkService) DeleteNAT64() {} -func (s *NetworkService) UpdateNAT64() {} -func (s *NetworkService) UnsetNAT64() {} -func (s *NetworkService) GetAllNAT64() {} -func (s *NetworkService) GetNAT64() {} -func (s *NetworkService) CountNAT64() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// nat64param -func (s *NetworkService) UpdateNAT64Param() {} -func (s *NetworkService) UnsetNAT64Param() {} -func (s *NetworkService) GetAllNAT64Param() {} -func (s *NetworkService) GetNAT64Param() {} -func (s *NetworkService) CountNAT64Param() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// nd6 -func (s *NetworkService) AddND6() {} -func (s *NetworkService) DeleteND6() {} -func (s *NetworkService) ClearND6() {} -func (s *NetworkService) GetAllND6() {} -func (s *NetworkService) CountND6() {} +// bridgetable +func (s *NetworkService) AddBridgeTable(resource models.BridgeTable) error { + payload := map[string]any{"bridgetable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nd6ravariables -func (s *NetworkService) UpdateND6RAVariables() {} -func (s *NetworkService) UnsetND6RAVariables() {} -func (s *NetworkService) GetAllND6RAVariables() {} -func (s *NetworkService) GetND6RAVariables() {} -func (s *NetworkService) CountND6RAVariables() {} + req, err := s.client.NewRequest(http.MethodPost, bridgeTableURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nd6ravariables_binding -func (s *NetworkService) GetAllND6RAVariablesBinding() {} -func (s *NetworkService) GetND6RAVariablesBinding() {} + _, err = s.client.Do(req) + return err +} -// nd6ravariables_onlinkipv6prefix_binding -func (s *NetworkService) AddND6RAVariablesOnlinkIPV6PrefixBinding() {} -func (s *NetworkService) DeleteND6RAVariablesOnlinkIPV6PrefixBinding() {} -func (s *NetworkService) GetAllND6RAVariablesOnlinkIPV6PrefixBinding() {} -func (s *NetworkService) GetND6RAVariablesOnlinkIPV6PrefixBinding() {} -func (s *NetworkService) CountND6RAVariablesOnlinkIPV6PrefixBinding() {} +func (s *NetworkService) DeleteBridgeTable(mac string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", bridgeTableURL, mac), nil) + if err != nil { + return err + } -// netbridge -func (s *NetworkService) AddNetBridge() {} -func (s *NetworkService) DeleteNetBridge() {} -func (s *NetworkService) UpdateNetBridge() {} -func (s *NetworkService) UnsetNetBridge() {} -func (s *NetworkService) GetAllNetBridge() {} -func (s *NetworkService) GetNetBridge() {} -func (s *NetworkService) CountNetBridge() {} + _, err = s.client.Do(req) + return err +} -// netbridge_binding -func (s *NetworkService) GetAllNetBridgeBinding() {} -func (s *NetworkService) GetNetBridgeBinding() {} +func (s *NetworkService) UpdateBridgeTable(resource models.BridgeTable) error { + payload := map[string]any{"bridgetable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// netbridge_iptunnel_binding -func (s *NetworkService) AddNetBridgeIPTunnelBinding() {} -func (s *NetworkService) DeleteNetBridgeIPTunnelBinding() {} -func (s *NetworkService) GetAllNetBridgeIPTunnelBinding() {} -func (s *NetworkService) GetNetBridgeIPTunnelBinding() {} -func (s *NetworkService) CountNetBridgeIPTunnelBinding() {} + req, err := s.client.NewRequest(http.MethodPut, bridgeTableURL, bytes.NewReader(data)) + if err != nil { + return err + } -// netbridge_nsip6_binding -func (s *NetworkService) AddNetBridgeNSIP6Binding() {} -func (s *NetworkService) DeleteNetBridgeNSIP6Binding() {} -func (s *NetworkService) GetAllNetBridgeNSIP6Binding() {} -func (s *NetworkService) GetNetBridgeNSIP6Binding() {} -func (s *NetworkService) CountNetBridgeNSIP6Binding() {} + _, err = s.client.Do(req) + return err +} -// netbridge_nsip_binding -func (s *NetworkService) AddNetBridgeNSIPBinding() {} -func (s *NetworkService) DeleteNetBridgeNSIPBinding() {} -func (s *NetworkService) GetAllNetBridgeNSIPBinding() {} -func (s *NetworkService) GetNetBridgeNSIPBinding() {} -func (s *NetworkService) CountNetBridgeNSIPBinding() {} +func (s *NetworkService) UnsetBridgeTable(resource models.BridgeTable) error { + payload := map[string]any{"bridgetable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// netbridge_vlan_binding -func (s *NetworkService) AddNetBridgeVLANBinding() {} -func (s *NetworkService) DeleteNetBridgeVLANBinding() {} -func (s *NetworkService) GetAllNetBridgeVLANBinding() {} -func (s *NetworkService) GetNetBridgeVLANBinding() {} -func (s *NetworkService) CountNetBridgeVLANBinding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", bridgeTableURL), bytes.NewReader(data)) + if err != nil { + return err + } -// netprofile -func (s *NetworkService) AddNetProfile() {} -func (s *NetworkService) DeleteNetProfile() {} -func (s *NetworkService) UpdateNetProfile() {} -func (s *NetworkService) UnsetNetProfile() {} -func (s *NetworkService) GetAllNetProfile() {} -func (s *NetworkService) GetNetProfile() {} -func (s *NetworkService) CountNetProfile() {} + _, err = s.client.Do(req) + return err +} -// netprofile_binding -func (s *NetworkService) GetAllNetProfileBinding() {} -func (s *NetworkService) GetNetProfileBinding() {} +func (s *NetworkService) GetAllBridgeTable() ([]models.BridgeTable, error) { + req, err := s.client.NewRequest(http.MethodGet, bridgeTableURL, nil) + if err != nil { + return nil, err + } -// netprofile_natrule_binding -func (s *NetworkService) AddNetProfileNATRuleBinding() {} -func (s *NetworkService) DeleteNetProfileNATRuleBinding() {} -func (s *NetworkService) GetAllNetProfileNATRuleBinding() {} -func (s *NetworkService) GetNetProfileNATRuleBinding() {} -func (s *NetworkService) CountNetProfileNATRuleBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// netprofile_srcportset_binding -func (s *NetworkService) AddNetProfileSrcPortSetBinding() {} -func (s *NetworkService) DeleteNetProfileSrcPortSetBinding() {} -func (s *NetworkService) GetAllNetProfileSrcPortSetBinding() {} -func (s *NetworkService) GetNetProfileSrcPortSetBinding() {} -func (s *NetworkService) CountNetProfileSrcPortSetBinding() {} + var result struct { + Data []models.BridgeTable `json:"bridgetable"` + } -// onlinkipv6prefix -func (s *NetworkService) AddOnlinkIPV6Prefix() {} -func (s *NetworkService) DeleteOnlinkIPV6Prefix() {} -func (s *NetworkService) UpdateOnlinkIPV6Prefix() {} -func (s *NetworkService) UnsetOnlinkIPV6Prefix() {} -func (s *NetworkService) GetAllOnlinkIPV6Prefix() {} -func (s *NetworkService) GetOnlinkIPV6Prefix() {} -func (s *NetworkService) CountOnlinkIPV6Prefix() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// ptp -func (s *NetworkService) UpdatePTP() {} -func (s *NetworkService) GetAllPTP() {} + return result.Data, nil +} -// rnat -func (s *NetworkService) AddRNAT() {} -func (s *NetworkService) DeleteRNAT() {} -func (s *NetworkService) UpdateRNAT() {} -func (s *NetworkService) UnsetRNAT() {} -func (s *NetworkService) ClearRNAT() {} -func (s *NetworkService) RenameRNAT() {} -func (s *NetworkService) GetAllRNAT() {} -func (s *NetworkService) GetRNAT() {} -func (s *NetworkService) CountRNAT() {} +func (s *NetworkService) CountBridgeTable() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", bridgeTableURL), nil) + if err != nil { + return 0, err + } -// rnat6 -func (s *NetworkService) AddRNAT6() {} -func (s *NetworkService) DeleteRNAT6() {} -func (s *NetworkService) UpdateRNAT6() {} -func (s *NetworkService) UnsetRNAT6() {} -func (s *NetworkService) GetAllRNAT6() {} -func (s *NetworkService) GetRNAT6() {} -func (s *NetworkService) CountRNAT6() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// rnat6_binding -func (s *NetworkService) GetAllRNAT6Binding() {} -func (s *NetworkService) GetRNAT6Binding() {} + var result struct { + Data []models.BridgeTable `json:"bridgetable"` + } -// rnat6_nsip6_binding -func (s *NetworkService) AddRNAT6NSIP6Binding() {} -func (s *NetworkService) DeleteRNAT6NSIP6Binding() {} -func (s *NetworkService) GetAllRNAT6NSIP6Binding() {} -func (s *NetworkService) GetRNAT6NSIP6Binding() {} -func (s *NetworkService) CountRNAT6NSIP6Binding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// rnatglobal_auditsyslogpolicy_binding -func (s *NetworkService) AddRNATGlobalAuditSyslogPolicyBinding() {} -func (s *NetworkService) DeleteRNATGlobalAuditSyslogPolicyBinding() {} -func (s *NetworkService) GetRNATGlobalAuditSyslogPolicyBinding() {} -func (s *NetworkService) CountRNATGlobalAuditSyslogPolicyBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// rnatglobal_binding -func (s *NetworkService) GetRBATGlobalBinding() {} +// channel +func (s *NetworkService) AddChannel(resource models.Channel) error { + payload := map[string]any{"channel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// rnatparam -func (s *NetworkService) UpdateRNATParam() {} -func (s *NetworkService) UnsetRNATParam() {} -func (s *NetworkService) GetAllRNATParam() {} + req, err := s.client.NewRequest(http.MethodPost, channelURL, bytes.NewReader(data)) + if err != nil { + return err + } -// rnatsession -func (s *NetworkService) FlushRNATSession() {} + _, err = s.client.Do(req) + return err +} -// rnat_binding -func (s *NetworkService) GetAllRNATBinding() {} -func (s *NetworkService) GetRNATBinding() {} +func (s *NetworkService) DeleteChannel(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", channelURL, id), nil) + if err != nil { + return err + } -// rnat_nsip_binding -func (s *NetworkService) AddRNATNSIPBinding() {} -func (s *NetworkService) DeleteRNATNSIPBinding() {} -func (s *NetworkService) GetAllRNATNSIPBinding() {} -func (s *NetworkService) GetRNATNSIPBinding() {} -func (s *NetworkService) CountRNATNSIPBinding() {} + _, err = s.client.Do(req) + return err +} -// rnat_retainsourceportset_binding -func (s *NetworkService) AddRNATRetainSourcePortSetBinding() {} -func (s *NetworkService) DeleteRNATRetainSourcePortSetBinding() {} -func (s *NetworkService) GetAllRNATRetainSourcePortSetBinding() {} -func (s *NetworkService) GetRNATRetainSourcePortSetBinding() {} -func (s *NetworkService) CountRNATRetainSourcePortSetBinding() {} +func (s *NetworkService) UpdateChannel(resource models.Channel) error { + payload := map[string]any{"channel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// route -func (s *NetworkService) AddRoute() {} -func (s *NetworkService) DeleteRoute() {} -func (s *NetworkService) UpdateRoute() {} -func (s *NetworkService) UnsetRoute() {} -func (s *NetworkService) ClearRoute() {} -func (s *NetworkService) GetAllRoute() {} -func (s *NetworkService) CountRoute() {} + req, err := s.client.NewRequest(http.MethodPut, channelURL, bytes.NewReader(data)) + if err != nil { + return err + } -// route6 -func (s *NetworkService) AddRoute6() {} -func (s *NetworkService) DeleteRoute6() {} -func (s *NetworkService) UpdateRoute6() {} -func (s *NetworkService) UnsetRoute6() {} -func (s *NetworkService) ClearRoute6() {} -func (s *NetworkService) GetAllRoute6() {} -func (s *NetworkService) CountRoute6() {} + _, err = s.client.Do(req) + return err +} -// rsskeytype -func (s *NetworkService) UpdateRSSKeyType() {} -func (s *NetworkService) GetAllRSSKeyType() {} +func (s *NetworkService) UnsetChannel(resource models.Channel) error { + payload := map[string]any{"channel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vlan -func (s *NetworkService) AddVLAN() {} -func (s *NetworkService) DeleteVLAN() {} -func (s *NetworkService) UpdateVLAN() {} -func (s *NetworkService) UnsetVLAN() {} -func (s *NetworkService) GetAllVLAN() {} -func (s *NetworkService) GetVLAN() {} -func (s *NetworkService) CountVLAN() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", channelURL), bytes.NewReader(data)) + if err != nil { + return err + } -// vlan_binding -func (s *NetworkService) GetAllVLANBinding() {} -func (s *NetworkService) GetVLANBinding() {} + _, err = s.client.Do(req) + return err +} -// vlan_channel_binding -func (s *NetworkService) AddVLANChannelBinding() {} -func (s *NetworkService) DeleteVLANChannelBinding() {} -func (s *NetworkService) GetAllVLANChannelBinding() {} -func (s *NetworkService) GetVLANChannelBinding() {} -func (s *NetworkService) CountVLANChannelBinding() {} +func (s *NetworkService) GetAllChannel() ([]models.Channel, error) { + req, err := s.client.NewRequest(http.MethodGet, channelURL, nil) + if err != nil { + return nil, err + } -// vlan_interface_binding -func (s *NetworkService) AddVLANInterfaceBinding() {} -func (s *NetworkService) DeleteVLANInterfaceBinding() {} -func (s *NetworkService) GetAllVLANInterfaceBinding() {} -func (s *NetworkService) GetVLANInterfaceBinding() {} -func (s *NetworkService) CountVLANInterfaceBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vlan_linkset_binding -func (s *NetworkService) AddVLANLinkSetBinding() {} -func (s *NetworkService) DeleteVLANLinkSetBinding() {} -func (s *NetworkService) GetAllVLANLinkSetBinding() {} -func (s *NetworkService) GetVLANLinkSetBinding() {} -func (s *NetworkService) CountVLANLinkSetBinding() {} + var result struct { + Data []models.Channel `json:"channel"` + } -// vlan_nsip6_binding -func (s *NetworkService) AddVLANNSIP6Binding() {} -func (s *NetworkService) DeleteVLANNSIP6Binding() {} -func (s *NetworkService) GetAllVLANNSIP6Binding() {} -func (s *NetworkService) GetVLANNSIP6Binding() {} -func (s *NetworkService) CountVLANNSIP6Binding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vlan_nsip_binding -func (s *NetworkService) AddVLANNSIPBinding() {} -func (s *NetworkService) DeleteVLANNSIPBinding() {} -func (s *NetworkService) GetAllVLANNSIPBinding() {} -func (s *NetworkService) GetVLANNSIPBinding() {} -func (s *NetworkService) CountVLANNSIPBinding() {} + return result.Data, nil +} -// vrid -func (s *NetworkService) AddVRID() {} -func (s *NetworkService) DeleteVRID() {} -func (s *NetworkService) UpdateVRID() {} -func (s *NetworkService) UnsetVRID() {} -func (s *NetworkService) GetAllVRID() {} -func (s *NetworkService) GetVRID() {} -func (s *NetworkService) CountVRID() {} +func (s *NetworkService) GetChannel(id string) (*models.Channel, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", channelURL, id), nil) + if err != nil { + return nil, err + } -// vrid6 -func (s *NetworkService) AddVRID6() {} -func (s *NetworkService) DeleteVRID6() {} -func (s *NetworkService) UpdateVRID6() {} -func (s *NetworkService) UnsetVRID6() {} -func (s *NetworkService) GetAllVRID6() {} -func (s *NetworkService) GetVRID6() {} -func (s *NetworkService) CountVRID6() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vrid6_binding -func (s *NetworkService) GetAllVRID6Biding() {} -func (s *NetworkService) GetVRID6Biding() {} + var result struct { + Data []models.Channel `json:"channel"` + } -// vrid6_channel_binding -func (s *NetworkService) AddVRID6ChannelBinding() {} -func (s *NetworkService) DeleteVRID6ChannelBinding() {} -func (s *NetworkService) GetAllVRID6ChannelBinding() {} -func (s *NetworkService) GetVRID6ChannelBinding() {} -func (s *NetworkService) CountVRID6ChannelBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vrid6_interface_binding -func (s *NetworkService) AddVRID6InterfaceBinding() {} -func (s *NetworkService) DeleteVRID6InterfaceBinding() {} -func (s *NetworkService) GetAllVRID6InterfaceBinding() {} -func (s *NetworkService) GetVRID6InterfaceBinding() {} -func (s *NetworkService) CountVRID6InterfaceBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vrid6_nsip6_binding -func (s *NetworkService) GetAllVRID6NSIP6Binding() {} -func (s *NetworkService) GetVRID6NSIP6Binding() {} -func (s *NetworkService) CountVRID6NSIP6Binding() {} + return &result.Data[0], nil +} -// vrid6_nsip_binding -func (s *NetworkService) GetAllVRID6NSIPBinding() {} -func (s *NetworkService) GetVRID6NSIPBinding() {} -func (s *NetworkService) CountVRID6NSIPBinding() {} +func (s *NetworkService) CountChannel() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", channelURL), nil) + if err != nil { + return 0, err + } -// vrid6_trackinterface_binding -func (s *NetworkService) AddVRID6TrackInterfaceBinding() {} -func (s *NetworkService) DeleteVRID6TrackInterfaceBinding() {} -func (s *NetworkService) GetAllVRID6TrackInterfaceBinding() {} -func (s *NetworkService) GetVRID6TrackInterfaceBinding() {} -func (s *NetworkService) CountVRID6TrackInterfaceBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// vridparam -func (s *NetworkService) UpdateVRIDParam() {} -func (s *NetworkService) UnsetVRIDParam() {} -func (s *NetworkService) GetAllVRIDParam() {} + var result struct { + Data []models.Channel `json:"channel"` + } -// vrid_binding -func (s *NetworkService) GetAllVRIDBinding() {} -func (s *NetworkService) GetVRIDBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// vrid_channel_binding -func (s *NetworkService) AddVRIDChannelBinding() {} -func (s *NetworkService) DeleteVRIDChannelBinding() {} -func (s *NetworkService) GetAllVRIDChannelBinding() {} -func (s *NetworkService) GetVRIDChannelBinding() {} -func (s *NetworkService) CountVRIDChannelBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// vrid_interface_binding -func (s *NetworkService) AddVRIDInterfaceBinding() {} -func (s *NetworkService) DeleteVRIDInterfaceBinding() {} -func (s *NetworkService) GetAllVRIDInterfaceBinding() {} -func (s *NetworkService) GetVRIDInterfaceBinding() {} -func (s *NetworkService) CountVRIDInterfaceBinding() {} +// channel_binding +func (s *NetworkService) GetAllChannelBinding() ([]models.ChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, channelBindingURL, nil) + if err != nil { + return nil, err + } -// vrid_nsip6_binding -func (s *NetworkService) GetAllVRIDNSIP6Binding() {} -func (s *NetworkService) GetVRIDNSIP6Binding() {} -func (s *NetworkService) CountVRIDNSIP6Binding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vrid_nsip_binding -func (s *NetworkService) GetAllVRIDNSIPBinding() {} -func (s *NetworkService) GetVRIDNSIPBinding() {} -func (s *NetworkService) CountVRIDNSIPBinding() {} + var result struct { + Data []models.ChannelBinding `json:"channel_binding"` + } -// vrid_trackinterface_binding -func (s *NetworkService) AddVRIDTrackInterfaceBinding() {} -func (s *NetworkService) DeleteVRIDTrackInterfaceBinding() {} -func (s *NetworkService) GetAllVRIDTrackInterfaceBinding() {} -func (s *NetworkService) GetVRIDTrackInterfaceBinding() {} -func (s *NetworkService) CountVRIDTrackInterfaceBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vxlan -func (s *NetworkService) AddVXLAN() {} -func (s *NetworkService) DeleteVXLAN() {} -func (s *NetworkService) UpdateVXLAN() {} -func (s *NetworkService) UnsetVXLAN() {} -func (s *NetworkService) GetAllVXLAN() {} -func (s *NetworkService) GetVXLAN() {} -func (s *NetworkService) CountVXLAN() {} + return result.Data, nil +} -// vxlanvlanmap -func (s *NetworkService) AddVXLANVLANMap() {} -func (s *NetworkService) DeleteVXLANVLANMap() {} -func (s *NetworkService) GetAllVXLANVLANMap() {} -func (s *NetworkService) GetVXLANVLANMap() {} -func (s *NetworkService) CountVXLANVLANMap() {} +func (s *NetworkService) GetChannelBinding(id string) (*models.ChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", channelBindingURL, id), nil) + if err != nil { + return nil, err + } -// vxlanvlanmap_binding -func (s *NetworkService) GetAllVXLANVLANMapBinding() {} -func (s *NetworkService) GetVXLANVLANMapBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vxlanvlanmap_vxlan_binding -func (s *NetworkService) AddVXLANVLANMapVXLANBinding() {} -func (s *NetworkService) DeleteVXLANVLANMapVXLANBinding() {} -func (s *NetworkService) GetAllVXLANVLANMapVXLANBinding() {} -func (s *NetworkService) GetVXLANVLANMapVXLANBinding() {} -func (s *NetworkService) CountVXLANVLANMapVXLANBinding() {} + var result struct { + Data []models.ChannelBinding `json:"channel_binding"` + } -// vxlan_binding -func (s *NetworkService) GetAllVXLANBinding() {} -func (s *NetworkService) GetVXLANBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vxlan_iptunnel_binding -func (s *NetworkService) GetAllVXLANIPTunnelBinding() {} -func (s *NetworkService) GetVXLANIPTunnelBinding() {} -func (s *NetworkService) CountVXLANIPTunnelBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vxlan_nsip6_binding -func (s *NetworkService) AddVXLANNSIP6Binding() {} -func (s *NetworkService) DeleteVXLANNSIP6Binding() {} -func (s *NetworkService) GetAllVXLANNSIP6Binding() {} -func (s *NetworkService) GetVXLANNSIP6Binding() {} -func (s *NetworkService) CountVXLANNSIP6Binding() {} + return &result.Data[0], nil +} -// vxlan_nsip_binding -func (s *NetworkService) AddVXLANNSIPBinding() {} -func (s *NetworkService) DeleteVXLANNSIPBinding() {} -func (s *NetworkService) GetAllVXLANNSIPBinding() {} -func (s *NetworkService) GetVXLANNSIPBinding() {} -func (s *NetworkService) CountVXLANNSIPBinding() {} +// channel_interface_binding +func (s *NetworkService) AddChannelInterfaceBinding(resource models.ChannelInterfaceBinding) error { + payload := map[string]any{"channel_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vxlan_srcip_binding -func (s *NetworkService) AddVXLANSrcIPBinding() {} -func (s *NetworkService) DeleteVXLANSrcIPBinding() {} -func (s *NetworkService) GetAllVXLANSrcIPBinding() {} -func (s *NetworkService) GetVXLANSrcIPBinding() {} -func (s *NetworkService) CountVXLANSrcIPBinding() {} + req, err := s.client.NewRequest(http.MethodPost, channelInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteChannelInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", channelInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllChannelInterfaceBinding() ([]models.ChannelInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, channelInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ChannelInterfaceBinding `json:"channel_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetChannelInterfaceBinding(id string) (*models.ChannelInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", channelInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ChannelInterfaceBinding `json:"channel_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountChannelInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", channelInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ChannelInterfaceBinding `json:"channel_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ci +func (s *NetworkService) GetAllCI() ([]models.CI, error) { + req, err := s.client.NewRequest(http.MethodGet, ciURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.CI `json:"ci"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) CountCI() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ciURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.CI `json:"ci"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// fis +func (s *NetworkService) AddFIS(resource models.FIS) error { + payload := map[string]any{"fis": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fisURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteFIS(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", fisURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllFIS() ([]models.FIS, error) { + req, err := s.client.NewRequest(http.MethodGet, fisURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FIS `json:"fis"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetFIS(name string) (*models.FIS, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", fisURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FIS `json:"fis"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountFIS() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", fisURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.FIS `json:"fis"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// fis_binding +func (s *NetworkService) GetAllFISBinding() ([]models.FISBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fisBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FISBinding `json:"fis_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetFISBinding(name string) (*models.FISBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", fisBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FISBinding `json:"fis_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// fis_channel_binding +func (s *NetworkService) AddFISChannelBinding(resource models.FISChannelBinding) error { + payload := map[string]any{"fis_channel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fisChannelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteFISChannelBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", fisChannelBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllFISChannelBinding() ([]models.FISChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fisChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FISChannelBinding `json:"fis_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetFISChannelBinding(name string) (*models.FISChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", fisChannelBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.FISChannelBinding `json:"fis_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountFISChannelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", fisChannelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.FISChannelBinding `json:"fis_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// fis_interface_binding +func (s *NetworkService) AddFISInterfaceBinding(resource models.FISInterfaceBinding) error { + payload := map[string]any{"fis_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fisInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteFISInterfaceBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", fisInterfaceBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// forwardingsession +func (s *NetworkService) AddFowardingSession(resource models.ForwardingSession) error { + payload := map[string]any{"forwardingsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, forwardingSessionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteFowardingSession(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", forwardingSessionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateFowardingSession(resource models.ForwardingSession) error { + payload := map[string]any{"forwardingsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, forwardingSessionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllFowardingSession() ([]models.ForwardingSession, error) { + req, err := s.client.NewRequest(http.MethodGet, forwardingSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ForwardingSession `json:"forwardingsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetFowardingSession(name string) (*models.ForwardingSession, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", forwardingSessionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ForwardingSession `json:"forwardingsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountFowardingSession() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", forwardingSessionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ForwardingSession `json:"forwardingsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// inat +func (s *NetworkService) AddINAT(resource models.INAT) error { + payload := map[string]any{"inat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, inatURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteINAT(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", inatURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateINAT(resource models.INAT) error { + payload := map[string]any{"inat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, inatURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetINAT(resource models.INAT) error { + payload := map[string]any{"inat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", inatURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllINAT() ([]models.INAT, error) { + req, err := s.client.NewRequest(http.MethodGet, inatURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.INAT `json:"inat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetINAT(name string) (*models.INAT, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", inatURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.INAT `json:"inat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountINAT() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", inatURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.INAT `json:"inat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// inatparam +func (s *NetworkService) UpdateINATParam(resource models.INATParam) error { + payload := map[string]any{"inatparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, inatParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetINATParam(resource models.INATParam) error { + payload := map[string]any{"inatparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", inatParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllINATParam() ([]models.INATParam, error) { + req, err := s.client.NewRequest(http.MethodGet, inatParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.INATParam `json:"inatparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetINATParam(name string) (*models.INATParam, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", inatParamURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.INATParam `json:"inatparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountINATParam() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", inatParamURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.INATParam `json:"inatparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// interface +func (s *NetworkService) ClearInterface(id string) error { + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", interfaceURL), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateInterface(resource models.Interface) error { + payload := map[string]any{"interface": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, interfaceURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetInterface(resource models.Interface) error { + payload := map[string]any{"interface": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", interfaceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) EnableInterface(resource models.Interface) error { + payload := map[string]any{"interface": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", interfaceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DisableInterface(resource models.Interface) error { + payload := map[string]any{"interface": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", interfaceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) ResetInterface(resource models.Interface) error { + payload := map[string]any{"interface": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=reset", interfaceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllInterface() ([]models.Interface, error) { + req, err := s.client.NewRequest(http.MethodGet, interfaceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.Interface `json:"interface"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetInterface(id string) (*models.Interface, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", interfaceURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.Interface `json:"interface"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountInterface() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", interfaceURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.Interface `json:"interface"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// interfacepair +func (s *NetworkService) AddInterfacePair(resource models.InterfacePair) error { + payload := map[string]any{"interfacepair": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, interfacePairURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteInterfacePair(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", interfacePairURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllInterfacePair() ([]models.InterfacePair, error) { + req, err := s.client.NewRequest(http.MethodGet, interfacePairURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.InterfacePair `json:"interfacepair"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetInterfacePair(id string) (*models.InterfacePair, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", interfacePairURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.InterfacePair `json:"interfacepair"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountInterfacePair() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", interfacePairURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.InterfacePair `json:"interfacepair"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ip6tunnel +func (s *NetworkService) AddIP6Tunnel(resource models.IP6Tunnel) error { + payload := map[string]any{"ip6tunnel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, ip6TunnelURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteIP6Tunnel(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", ip6TunnelURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIP6Tunnel() ([]models.IP6Tunnel, error) { + req, err := s.client.NewRequest(http.MethodGet, ip6TunnelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IP6Tunnel `json:"ip6tunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIP6Tunnel(name string) (*models.IP6Tunnel, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ip6TunnelURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IP6Tunnel `json:"ip6tunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIP6Tunnel() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ip6TunnelURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IP6Tunnel `json:"ip6tunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ip6tunnelparam +func (s *NetworkService) UpdateIP6TunnelParam(resource models.IP6TunnelParam) error { + payload := map[string]any{"ip6tunnelparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, ip6TunnelParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetIP6TunnelParam(resource models.IP6TunnelParam) error { + payload := map[string]any{"ip6tunnelparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", ip6TunnelParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIP6TunnelParam() ([]models.IP6TunnelParam, error) { + req, err := s.client.NewRequest(http.MethodGet, ip6TunnelParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IP6TunnelParam `json:"ip6tunnelparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// ipset +func (s *NetworkService) AddIPSet(resource models.IPSet) error { + payload := map[string]any{"ipset": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, ipSetURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteIPSet(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", ipSetURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPSet() ([]models.IPSet, error) { + req, err := s.client.NewRequest(http.MethodGet, ipSetURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSet `json:"ipset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPSet(name string) (*models.IPSet, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipSetURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSet `json:"ipset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIPSet() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ipSetURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IPSet `json:"ipset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ipset_binding +func (s *NetworkService) GetAllIPSetBinding() ([]models.IPSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, ipSetBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetBinding `json:"ipset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPSetBinding(name string) (*models.IPSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipSetBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetBinding `json:"ipset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// ipset_nsip6_binding +func (s *NetworkService) AddIPSetNSIP6Binding(resource models.IPSetNSIP6Binding) error { + payload := map[string]any{"ipset_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, ipSetNSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteIPSetNSIP6Binding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", ipSetNSIP6BindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPSetNSIP6Binding() ([]models.IPSetNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, ipSetNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetNSIP6Binding `json:"ipset_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPSetNSIP6Binding(name string) (*models.IPSetNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipSetNSIP6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetNSIP6Binding `json:"ipset_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIPSetNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ipSetNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IPSetNSIP6Binding `json:"ipset_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ipset_nsip_binding +func (s *NetworkService) AddIPSetNSIPBinding(resource models.IPSetNSIPBinding) error { + payload := map[string]any{"ipset_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, ipSetNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteIPSetNSIPBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", ipSetNSIPBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPSetNSIPBinding() ([]models.IPSetNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, ipSetNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetNSIPBinding `json:"ipset_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPSetNSIPBinding(name string) (*models.IPSetNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipSetNSIPBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPSetNSIPBinding `json:"ipset_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIPSetNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ipSetNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IPSetNSIPBinding `json:"ipset_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// iptunnel +func (s *NetworkService) AddIPTunnel(resource models.IPTunnel) error { + payload := map[string]any{"iptunnel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, ipTunnelURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteIPTunnel(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", ipTunnelURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateIPTunnel(resource models.IPTunnel) error { + payload := map[string]any{"iptunnel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, ipTunnelURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetIPTunnel(resource models.IPTunnel) error { + payload := map[string]any{"iptunnel": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", ipTunnelURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPTunnel() ([]models.IPTunnel, error) { + req, err := s.client.NewRequest(http.MethodGet, ipTunnelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPTunnel `json:"iptunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPTunnel(name string) (*models.IPTunnel, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipTunnelURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPTunnel `json:"iptunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIPTunnel() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ipTunnelURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IPTunnel `json:"iptunnel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// iptunnelparam +func (s *NetworkService) UpdateIPTunnelParam(resource models.IPTunnelParam) error { + payload := map[string]any{"iptunnelparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, ipTunnelParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetIPTunnelParam(resource models.IPTunnelParam) error { + payload := map[string]any{"iptunnelparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", ipTunnelParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPTunnelParam() ([]models.IPTunnelParam, error) { + req, err := s.client.NewRequest(http.MethodGet, ipTunnelParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPTunnelParam `json:"iptunnelparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// ipv6 +func (s *NetworkService) UpdateIPV6(resource models.IPv6) error { + payload := map[string]any{"ipv6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, ipv6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetIPV6(resource models.IPv6) error { + payload := map[string]any{"ipv6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", ipv6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllIPV6() ([]models.IPv6, error) { + req, err := s.client.NewRequest(http.MethodGet, ipv6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPv6 `json:"ipv6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetIPV6(dodad string) (*models.IPv6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", ipv6URL, dodad), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.IPv6 `json:"ipv6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountIPV6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", ipv6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.IPv6 `json:"ipv6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// l2param +func (s *NetworkService) UpdateL2Param(resource models.L2Param) error { + payload := map[string]any{"l2param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, l2ParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetL2Param(resource models.L2Param) error { + payload := map[string]any{"l2param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", l2ParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllL2Param() ([]models.L2Param, error) { + req, err := s.client.NewRequest(http.MethodGet, l2ParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.L2Param `json:"l2param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// l3param +func (s *NetworkService) UpdateL3Param(resource models.L3Param) error { + payload := map[string]any{"l3param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, l3ParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetL3Param(resource models.L3Param) error { + payload := map[string]any{"l3param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", l3ParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllL3Param() ([]models.L3Param, error) { + req, err := s.client.NewRequest(http.MethodGet, l3ParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.L3Param `json:"l3param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// l4param +func (s *NetworkService) UpdateL4Param(resource models.L4Param) error { + payload := map[string]any{"l4param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, l4ParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetL4Param(resource models.L4Param) error { + payload := map[string]any{"l4param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", l4ParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllL4Param() ([]models.L4Param, error) { + req, err := s.client.NewRequest(http.MethodGet, l4ParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.L4Param `json:"l4param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// lacp +func (s *NetworkService) UpdateLACP(resource models.LACP) error { + payload := map[string]any{"lacp": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, lacpURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllLACP() ([]models.LACP, error) { + req, err := s.client.NewRequest(http.MethodGet, lacpURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LACP `json:"lacp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetLACP(syspriority string) (*models.LACP, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", lacpURL, syspriority), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LACP `json:"lacp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountLACP() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", lacpURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LACP `json:"lacp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// linkset +func (s *NetworkService) AddLinkSet(resource models.LinkSet) error { + payload := map[string]any{"linkset": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, linkSetURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteLinkSet(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", linkSetURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllLinkSet() ([]models.LinkSet, error) { + req, err := s.client.NewRequest(http.MethodGet, linkSetURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSet `json:"linkset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetLinkSet(id string) (*models.LinkSet, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", linkSetURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSet `json:"linkset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountLinkSet() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", linkSetURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LinkSet `json:"linkset"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// linkset_binding +func (s *NetworkService) GetAllLinkSetBinding() ([]models.LinkSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, linkSetBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetBinding `json:"linkset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetLinkSetBinding(id string) (*models.LinkSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", linkSetBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetBinding `json:"linkset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// linkset_channel_binding +func (s *NetworkService) AddLinkSetChannelBinding(resource models.LinkSetChannelBinding) error { + payload := map[string]any{"linkset_channel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, linkSetChannelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteLinkSetChannelBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", linkSetChannelBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllLinkSetChannelBinding() ([]models.LinkSetChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, linkSetChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetChannelBinding `json:"linkset_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetLinkSetChannelBinding(id string) (*models.LinkSetChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", linkSetChannelBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetChannelBinding `json:"linkset_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountLinkSetChannelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", linkSetChannelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LinkSetChannelBinding `json:"linkset_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// linkset_interface_binding +func (s *NetworkService) AddLinkSetInterfaceBinding(resource models.LinkSetInterfaceBinding) error { + payload := map[string]any{"linkset_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, linkSetInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteLinkSetInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", linkSetInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllLinkSetInterfaceBinding() ([]models.LinkSetInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, linkSetInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetInterfaceBinding `json:"linkset_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetLinkSetInterfaceBinding(id string) (*models.LinkSetInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", linkSetInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.LinkSetInterfaceBinding `json:"linkset_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountLinkSetInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", linkSetInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.LinkSetInterfaceBinding `json:"linkset_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// mapbmr +func (s *NetworkService) AddMAPBMR(resource models.MapBMR) error { + payload := map[string]any{"mapbmr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, mapBMRURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteMAPBMR(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", mapBMRURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllMAPBMR() ([]models.MapBMR, error) { + req, err := s.client.NewRequest(http.MethodGet, mapBMRURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMR `json:"mapbmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPBMR(name string) (*models.MapBMR, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapBMRURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMR `json:"mapbmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountMAPBMR() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", mapBMRURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.MapBMR `json:"mapbmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// mapbmr_binding +func (s *NetworkService) GetAllMAPBMRBinding() ([]models.MapBMRBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, mapBMRBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMRBinding `json:"mapbmr_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPBMRBinding(name string) (*models.MapBMRBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapBMRBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMRBinding `json:"mapbmr_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// mapbmr_bmrv4network_binding +func (s *NetworkService) AddMAPBMRBMRV4NetworkBinding(resource models.MapBMRBMRV4NetworkBinding) error { + payload := map[string]any{"mapbmr_bmrv4network_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, mapBMRBMRV4NetworkBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteMAPBMRBMRV4NetworkBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", mapBMRBMRV4NetworkBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllMAPBMRBMRV4NetworkBinding() ([]models.MapBMRBMRV4NetworkBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, mapBMRBMRV4NetworkBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMRBMRV4NetworkBinding `json:"mapbmr_bmrv4network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPBMRBMRV4NetworkBinding(name string) (*models.MapBMRBMRV4NetworkBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapBMRBMRV4NetworkBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapBMRBMRV4NetworkBinding `json:"mapbmr_bmrv4network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountMAPBMRBMRV4NetworkBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", mapBMRBMRV4NetworkBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.MapBMRBMRV4NetworkBinding `json:"mapbmr_bmrv4network_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// mapdmr +func (s *NetworkService) AddMAPDMR(resource models.MapDMR) error { + payload := map[string]any{"mapdmr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, mapDMRURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteMAPDMR(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", mapDMRURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllMAPDMR() ([]models.MapDMR, error) { + req, err := s.client.NewRequest(http.MethodGet, mapDMRURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDMR `json:"mapdmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPDMR(name string) (*models.MapDMR, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapDMRURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDMR `json:"mapdmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} +func (s *NetworkService) CountMAPDMR() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", mapDMRURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.MapDMR `json:"mapdmr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// mapdomain +func (s *NetworkService) AddMAPDomain(resource models.MapDomain) error { + payload := map[string]any{"mapdomain": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, mapDomainURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteMAPDomain(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", mapDomainURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllMAPDomain() ([]models.MapDomain, error) { + req, err := s.client.NewRequest(http.MethodGet, mapDomainURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomain `json:"mapdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPDomain(name string) (*models.MapDomain, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapDomainURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomain `json:"mapdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountMAPDomain() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", mapDomainURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.MapDomain `json:"mapdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// mapdomain_binding +func (s *NetworkService) GetAllMAPDomainBinding() ([]models.MapDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, mapDomainBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomainBinding `json:"mapdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPDomainBinding(name string) (*models.MapDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapDomainBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomainBinding `json:"mapdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// mapdomain_mapbmr_binding +func (s *NetworkService) AddMAPDomainMAPBMRBinding(resource models.MapDomainMapBMRBinding) error { + payload := map[string]any{"mapdomain_mapbmr_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, mapDomainMapBMRBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteMAPDomainMAPBMRBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", mapDomainMapBMRBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllMAPDomainMAPBMRBinding() ([]models.MapDomainMapBMRBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, mapDomainMapBMRBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomainMapBMRBinding `json:"mapdomain_mapbmr_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetMAPDomainMAPBMRBinding(name string) (*models.MapDomainMapBMRBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", mapDomainMapBMRBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.MapDomainMapBMRBinding `json:"mapdomain_mapbmr_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountMAPDomainMAPBMRBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", mapDomainMapBMRBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.MapDomainMapBMRBinding `json:"mapdomain_mapbmr_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nat64 +func (s *NetworkService) AddNAT64(resource models.NAT64) error { + payload := map[string]any{"nat64": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nat64URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNAT64(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nat64URL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateNAT64(resource models.NAT64) error { + payload := map[string]any{"nat64": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nat64URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetNAT64(resource models.NAT64) error { + payload := map[string]any{"nat64": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nat64URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNAT64() ([]models.NAT64, error) { + req, err := s.client.NewRequest(http.MethodGet, nat64URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NAT64 `json:"nat64"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNAT64(name string) (*models.NAT64, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nat64URL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NAT64 `json:"nat64"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNAT64() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nat64URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NAT64 `json:"nat64"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nat64param +func (s *NetworkService) UpdateNAT64Param(resource models.NAT64Param) error { + payload := map[string]any{"nat64param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nat64ParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetNAT64Param(resource models.NAT64Param) error { + payload := map[string]any{"nat64param": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nat64ParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNAT64Param() ([]models.NAT64Param, error) { + req, err := s.client.NewRequest(http.MethodGet, nat64ParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NAT64Param `json:"nat64param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNAT64Param() (*models.NAT64Param, error) { + req, err := s.client.NewRequest(http.MethodGet, nat64ParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NAT64Param `json:"nat64param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNAT64Param() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nat64ParamURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NAT64Param `json:"nat64param"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nd6 +func (s *NetworkService) AddND6(resource models.ND6) error { + payload := map[string]any{"nd6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nd6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteND6(neighbor string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nd6URL, neighbor), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) ClearND6(neighbor string) error { + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nd6URL), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllND6() ([]models.ND6, error) { + req, err := s.client.NewRequest(http.MethodGet, nd6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6 `json:"nd6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} +func (s *NetworkService) CountND6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nd6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ND6 `json:"nd6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nd6ravariables +func (s *NetworkService) UpdateND6RAVariables(resource models.ND6RAVariables) error { + payload := map[string]any{"nd6ravariables": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nd6RAVariablesURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetND6RAVariables(resource models.ND6RAVariables) error { + payload := map[string]any{"nd6ravariables": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nd6RAVariablesURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllND6RAVariables() ([]models.ND6RAVariables, error) { + req, err := s.client.NewRequest(http.MethodGet, nd6RAVariablesURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariables `json:"nd6ravariables"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetND6RAVariables(vlan string) (*models.ND6RAVariables, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nd6RAVariablesURL, vlan), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariables `json:"nd6ravariables"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountND6RAVariables() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nd6RAVariablesURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ND6RAVariables `json:"nd6ravariables"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nd6ravariables_binding +func (s *NetworkService) GetAllND6RAVariablesBinding() ([]models.ND6RAVariablesBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nd6RAVariablesBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariablesBinding `json:"nd6ravariables_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetND6RAVariablesBinding(vlan string) (*models.ND6RAVariablesBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nd6RAVariablesBindingURL, vlan), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariablesBinding `json:"nd6ravariables_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// nd6ravariables_onlinkipv6prefix_binding +func (s *NetworkService) AddND6RAVariablesOnlinkIPV6PrefixBinding(resource models.ND6RAVariablesOnLinkIPv6PrefixBinding) error { + payload := map[string]any{"nd6ravariables_onlinkipv6prefix_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nd6RAVariablesOnLinkIPV6PrefixBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteND6RAVariablesOnlinkIPV6PrefixBinding(vlan string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nd6RAVariablesOnLinkIPV6PrefixBindingURL, vlan), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllND6RAVariablesOnlinkIPV6PrefixBinding() ([]models.ND6RAVariablesOnLinkIPv6PrefixBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nd6RAVariablesOnLinkIPV6PrefixBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariablesOnLinkIPv6PrefixBinding `json:"nd6ravariables_onlinkipv6prefix_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetND6RAVariablesOnlinkIPV6PrefixBinding(vlan string) (*models.ND6RAVariablesOnLinkIPv6PrefixBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nd6RAVariablesOnLinkIPV6PrefixBindingURL, vlan), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.ND6RAVariablesOnLinkIPv6PrefixBinding `json:"nd6ravariables_onlinkipv6prefix_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountND6RAVariablesOnlinkIPV6PrefixBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nd6RAVariablesOnLinkIPV6PrefixBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.ND6RAVariablesOnLinkIPv6PrefixBinding `json:"nd6ravariables_onlinkipv6prefix_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netbridge +func (s *NetworkService) AddNetBridge(resource models.NetBridge) error { + payload := map[string]any{"netbridge": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netBridgeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetBridge(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netBridgeURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateNetBridge(resource models.NetBridge) error { + payload := map[string]any{"netbridge": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, netBridgeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetNetBridge(resource models.NetBridge) error { + payload := map[string]any{"netbridge": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", netBridgeURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetBridge() ([]models.NetBridge, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridge `json:"netbridge"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridge(name string) (*models.NetBridge, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridge `json:"netbridge"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetBridge() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netBridgeURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetBridge `json:"netbridge"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netbridge_binding +func (s *NetworkService) GetAllNetBridgeBinding() ([]models.NetBridgeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeBinding `json:"netbridge_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridgeBinding(name string) (*models.NetBridgeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeBinding `json:"netbridge_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// netbridge_iptunnel_binding +func (s *NetworkService) AddNetBridgeIPTunnelBinding(resource models.NetBridgeIPTunnelBinding) error { + payload := map[string]any{"netbridge_iptunnel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netBridgeIPTunnelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetBridgeIPTunnelBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netBridgeIPTunnelBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetBridgeIPTunnelBinding() ([]models.NetBridgeIPTunnelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeIPTunnelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeIPTunnelBinding `json:"netbridge_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridgeIPTunnelBinding(name string) (*models.NetBridgeIPTunnelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeIPTunnelBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeIPTunnelBinding `json:"netbridge_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetBridgeIPTunnelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netBridgeIPTunnelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetBridgeIPTunnelBinding `json:"netbridge_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netbridge_nsip6_binding +func (s *NetworkService) AddNetBridgeNSIP6Binding(resource models.NetBridgeNSIP6Binding) error { + payload := map[string]any{"netbridge_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netBridgeNSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetBridgeNSIP6Binding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netBridgeNSIP6BindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetBridgeNSIP6Binding() ([]models.NetBridgeNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeNSIP6Binding `json:"netbridge_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridgeNSIP6Binding(name string) (*models.NetBridgeNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeNSIP6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeNSIP6Binding `json:"netbridge_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetBridgeNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netBridgeNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetBridgeNSIP6Binding `json:"netbridge_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netbridge_nsip_binding +func (s *NetworkService) AddNetBridgeNSIPBinding(resource models.NetBridgeNSIPBinding) error { + payload := map[string]any{"netbridge_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netBridgeNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetBridgeNSIPBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netBridgeNSIPBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetBridgeNSIPBinding() ([]models.NetBridgeNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeNSIPBinding `json:"netbridge_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridgeNSIPBinding(name string) (*models.NetBridgeNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeNSIPBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeNSIPBinding `json:"netbridge_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetBridgeNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netBridgeNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetBridgeNSIPBinding `json:"netbridge_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netbridge_vlan_binding +func (s *NetworkService) AddNetBridgeVLANBinding(resource models.NetBridgeVLANBinding) error { + payload := map[string]any{"netbridge_vlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netBridgeVLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetBridgeVLANBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netBridgeVLANBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetBridgeVLANBinding() ([]models.NetBridgeVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netBridgeVLANBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeVLANBinding `json:"netbridge_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetBridgeVLANBinding(name string) (*models.NetBridgeVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netBridgeVLANBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetBridgeVLANBinding `json:"netbridge_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetBridgeVLANBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netBridgeVLANBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetBridgeVLANBinding `json:"netbridge_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netprofile +func (s *NetworkService) AddNetProfile(resource models.NetProfile) error { + payload := map[string]any{"netprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateNetProfile(resource models.NetProfile) error { + payload := map[string]any{"netprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, netProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetNetProfile(resource models.NetProfile) error { + payload := map[string]any{"netprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", netProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetProfile() ([]models.NetProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, netProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfile `json:"netprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetProfile(name string) (*models.NetProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfile `json:"netprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetProfile `json:"netprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netprofile_binding +func (s *NetworkService) GetAllNetProfileBinding() ([]models.NetProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileBinding `json:"netprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetProfileBinding(name string) (*models.NetProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netProfileBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileBinding `json:"netprofile_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// netprofile_natrule_binding +func (s *NetworkService) AddNetProfileNATRuleBinding(resource models.NetProfileNATRuleBinding) error { + payload := map[string]any{"netprofile_natrule_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netProfileNATRuleBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetProfileNATRuleBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netProfileNATRuleBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetProfileNATRuleBinding() ([]models.NetProfileNATRuleBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netProfileNATRuleBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileNATRuleBinding `json:"netprofile_natrule_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetProfileNATRuleBinding(name string) (*models.NetProfileNATRuleBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netProfileNATRuleBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileNATRuleBinding `json:"netprofile_natrule_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetProfileNATRuleBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netProfileNATRuleBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetProfileNATRuleBinding `json:"netprofile_natrule_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// netprofile_srcportset_binding +func (s *NetworkService) AddNetProfileSrcPortSetBinding(resource models.NetProfileSrcPortSetBinding) error { + payload := map[string]any{"netprofile_srcportset_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, netProfileSrcPortSetBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteNetProfileSrcPortSetBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", netProfileSrcPortSetBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllNetProfileSrcPortSetBinding() ([]models.NetProfileSrcPortSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, netProfileSrcPortSetBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileSrcPortSetBinding `json:"netprofile_srcportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetNetProfileSrcPortSetBinding(name string) (*models.NetProfileSrcPortSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", netProfileSrcPortSetBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NetProfileSrcPortSetBinding `json:"netprofile_srcportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountNetProfileSrcPortSetBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", netProfileSrcPortSetBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NetProfileSrcPortSetBinding `json:"netprofile_srcportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// onlinkipv6prefix +func (s *NetworkService) AddOnlinkIPV6Prefix(resource models.OnLinkIPv6Prefix) error { + payload := map[string]any{"onlinkipv6prefix": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, onLinkIPV6PrefixURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteOnlinkIPV6Prefix(ipv6prefix string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", onLinkIPV6PrefixURL, ipv6prefix), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateOnlinkIPV6Prefix(resource models.OnLinkIPv6Prefix) error { + payload := map[string]any{"onlinkipv6prefix": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, onLinkIPV6PrefixURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetOnlinkIPV6Prefix(resource models.OnLinkIPv6Prefix) error { + payload := map[string]any{"onlinkipv6prefix": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", onLinkIPV6PrefixURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllOnlinkIPV6Prefix() ([]models.OnLinkIPv6Prefix, error) { + req, err := s.client.NewRequest(http.MethodGet, onLinkIPV6PrefixURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.OnLinkIPv6Prefix `json:"onlinkipv6prefix"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetOnlinkIPV6Prefix(ipv6prefix string) (*models.OnLinkIPv6Prefix, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", onLinkIPV6PrefixURL, ipv6prefix), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.OnLinkIPv6Prefix `json:"onlinkipv6prefix"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountOnlinkIPV6Prefix() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", onLinkIPV6PrefixURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.OnLinkIPv6Prefix `json:"onlinkipv6prefix"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// ptp +func (s *NetworkService) UpdatePTP(resource models.PTP) error { + payload := map[string]any{"ptp": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, ptpURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllPTP() ([]models.PTP, error) { + req, err := s.client.NewRequest(http.MethodGet, ptpURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.PTP `json:"ptp"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// rnat +func (s *NetworkService) AddRNAT(resource models.RNAT) error { + payload := map[string]any{"rnat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnatURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNAT(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnatURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateRNAT(resource models.RNAT) error { + payload := map[string]any{"rnat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, rnatURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetRNAT(resource models.RNAT) error { + payload := map[string]any{"rnat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", rnatURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) ClearRNAT() error { + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", rnatURL), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) RenameRNAT(resource models.RNAT) error { + payload := map[string]any{"rnat": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", rnatURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNAT() ([]models.RNAT, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT `json:"rnat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNAT(name string) (*models.RNAT, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnatURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT `json:"rnat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountRNAT() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnatURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNAT `json:"rnat"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rnat6 +func (s *NetworkService) AddRNAT6(resource models.RNAT6) error { + payload := map[string]any{"rnat6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnat6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNAT6(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnat6URL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateRNAT6(resource models.RNAT6) error { + payload := map[string]any{"rnat6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, rnat6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetRNAT6(resource models.RNAT6) error { + payload := map[string]any{"rnat6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", rnat6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNAT6() ([]models.RNAT6, error) { + req, err := s.client.NewRequest(http.MethodGet, rnat6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6 `json:"rnat6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNAT6(name string) (*models.RNAT6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnat6URL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6 `json:"rnat6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountRNAT6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnat6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNAT6 `json:"rnat6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rnat6_binding +func (s *NetworkService) GetAllRNAT6Binding() ([]models.RNAT6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnat6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6Binding `json:"rnat6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNAT6Binding(name string) (*models.RNAT6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnat6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6Binding `json:"rnat6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// rnat6_nsip6_binding +func (s *NetworkService) AddRNAT6NSIP6Binding(resource models.RNAT6NSIP6Binding) error { + payload := map[string]any{"rnat6_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnat6NSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNAT6NSIP6Binding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnat6NSIP6BindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNAT6NSIP6Binding() ([]models.RNAT6NSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnat6NSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6NSIP6Binding `json:"rnat6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNAT6NSIP6Binding(name string) (*models.RNAT6NSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnat6NSIP6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNAT6NSIP6Binding `json:"rnat6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountRNAT6NSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnat6NSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNAT6NSIP6Binding `json:"rnat6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rnatglobal_auditsyslogpolicy_binding +func (s *NetworkService) AddRNATGlobalAuditSyslogPolicyBinding(resource models.RNATGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{"rnatglobal_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnatGlobalAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNATGlobalAuditSyslogPolicyBinding(policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnatGlobalAuditSyslogPolicyBindingURL, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetRNATGlobalAuditSyslogPolicyBinding() ([]models.RNATGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatGlobalAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATGlobalAuditSyslogPolicyBinding `json:"rnatglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) CountRNATGlobalAuditSyslogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnatGlobalAuditSyslogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNATGlobalAuditSyslogPolicyBinding `json:"rnatglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rnatglobal_binding +func (s *NetworkService) GetRBATGlobalBinding() ([]models.RNATGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATGlobalBinding `json:"rnatglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// rnatparam +func (s *NetworkService) UpdateRNATParam(resource models.RNATParam) error { + payload := map[string]any{"rnatparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, rnatParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetRNATParam(resource models.RNATParam) error { + payload := map[string]any{"rnatparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", rnatParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNATParam() ([]models.RNATParam, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATParam `json:"rnatparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// rnatsession +func (s *NetworkService) FlushRNATSession(resource models.RNATSession) error { + payload := map[string]any{"rnatsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", rnatSessionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// rnat_binding +func (s *NetworkService) GetAllRNATBinding() ([]models.RNATBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATBinding `json:"rnat_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNATBinding(name string) (*models.RNATBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnatBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATBinding `json:"rnat_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// rnat_nsip_binding +func (s *NetworkService) AddRNATNSIPBinding(resource models.RNATNSIPBinding) error { + payload := map[string]any{"rnat_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnatNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNATNSIPBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnatNSIPBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNATNSIPBinding() ([]models.RNATNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATNSIPBinding `json:"rnat_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNATNSIPBinding(name string) (*models.RNATNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnatNSIPBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATNSIPBinding `json:"rnat_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountRNATNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnatNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNATNSIPBinding `json:"rnat_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rnat_retainsourceportset_binding +func (s *NetworkService) AddRNATRetainSourcePortSetBinding(resource models.RNATRetainSourcePortSetBinding) error { + payload := map[string]any{"rnat_retainsourceportset_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rnatRetainSourcePortSetBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRNATRetainSourcePortSetBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", rnatRetainSourcePortSetBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRNATRetainSourcePortSetBinding() ([]models.RNATRetainSourcePortSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rnatRetainSourcePortSetBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATRetainSourcePortSetBinding `json:"rnat_retainsourceportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetRNATRetainSourcePortSetBinding(name string) (*models.RNATRetainSourcePortSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", rnatRetainSourcePortSetBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RNATRetainSourcePortSetBinding `json:"rnat_retainsourceportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountRNATRetainSourcePortSetBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", rnatRetainSourcePortSetBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.RNATRetainSourcePortSetBinding `json:"rnat_retainsourceportset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// route +func (s *NetworkService) AddRoute(resource models.Route) error { + payload := map[string]any{"route": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, routeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRoute(network string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", routeURL, network), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateRoute(resource models.Route) error { + payload := map[string]any{"route": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, routeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetRoute(resource models.Route) error { + payload := map[string]any{"route": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", routeURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) ClearRoute() error { + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", routeURL), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRoute() ([]models.Route, error) { + req, err := s.client.NewRequest(http.MethodGet, routeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.Route `json:"route"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) CountRoute() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", routeURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.Route `json:"route"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// route6 +func (s *NetworkService) AddRoute6(resource models.Route6) error { + payload := map[string]any{"route6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, route6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteRoute6(network string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", route6URL, network), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateRoute6(resource models.Route6) error { + payload := map[string]any{"route6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, route6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetRoute6(resource models.Route6) error { + payload := map[string]any{"route6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", route6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) ClearRoute6() error { + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", route6URL), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRoute6() ([]models.Route6, error) { + req, err := s.client.NewRequest(http.MethodGet, route6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.Route6 `json:"route6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) CountRoute6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", route6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.Route6 `json:"route6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// rsskeytype +func (s *NetworkService) UpdateRSSKeyType(resource models.RSSKeyType) error { + payload := map[string]any{"rsskeytype": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, rssKeyTypeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllRSSKeyType() ([]models.RSSKeyType, error) { + req, err := s.client.NewRequest(http.MethodGet, rssKeyTypeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.RSSKeyType `json:"rsskeytype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// vlan +func (s *NetworkService) AddVLAN(resource models.VLAN) error { + payload := map[string]any{"vlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLAN(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateVLAN(resource models.VLAN) error { + payload := map[string]any{"vlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vlanURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetVLAN(resource models.VLAN) error { + payload := map[string]any{"vlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vlanURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLAN() ([]models.VLAN, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLAN `json:"vlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLAN(id string) (*models.VLAN, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLAN `json:"vlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLAN() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLAN `json:"vlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vlan_binding +func (s *NetworkService) GetAllVLANBinding() ([]models.VLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANBinding `json:"vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANBinding(id string) (*models.VLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANBinding `json:"vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// vlan_channel_binding +func (s *NetworkService) AddVLANChannelBinding(resource models.VLANChannelBinding) error { + payload := map[string]any{"vlan_channel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanChannelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLANChannelBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanChannelBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLANChannelBinding() ([]models.VLANChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANChannelBinding `json:"vlan_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANChannelBinding(id string) (*models.VLANChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanChannelBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANChannelBinding `json:"vlan_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLANChannelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanChannelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLANChannelBinding `json:"vlan_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vlan_interface_binding +func (s *NetworkService) AddVLANInterfaceBinding(resource models.VLANInterfaceBinding) error { + payload := map[string]any{"vlan_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLANInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLANInterfaceBinding() ([]models.VLANInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANInterfaceBinding `json:"vlan_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANInterfaceBinding(id string) (*models.VLANInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANInterfaceBinding `json:"vlan_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLANInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLANInterfaceBinding `json:"vlan_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vlan_linkset_binding +func (s *NetworkService) AddVLANLinkSetBinding(resource models.VLANLinkSetBinding) error { + payload := map[string]any{"vlan_linkset_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanLinkSetBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLANLinkSetBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanLinkSetBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLANLinkSetBinding() ([]models.VLANLinkSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanLinkSetBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANLinkSetBinding `json:"vlan_linkset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANLinkSetBinding(id string) (*models.VLANLinkSetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanLinkSetBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANLinkSetBinding `json:"vlan_linkset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLANLinkSetBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanLinkSetBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLANLinkSetBinding `json:"vlan_linkset_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vlan_nsip6_binding +func (s *NetworkService) AddVLANNSIP6Binding(resource models.VLANNSIP6Binding) error { + payload := map[string]any{"vlan_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanNSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLANNSIP6Binding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanNSIP6BindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLANNSIP6Binding() ([]models.VLANNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANNSIP6Binding `json:"vlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANNSIP6Binding(id string) (*models.VLANNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanNSIP6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANNSIP6Binding `json:"vlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLANNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLANNSIP6Binding `json:"vlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vlan_nsip_binding +func (s *NetworkService) AddVLANNSIPBinding(resource models.VLANNSIPBinding) error { + payload := map[string]any{"vlan_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vlanNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVLANNSIPBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vlanNSIPBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVLANNSIPBinding() ([]models.VLANNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vlanNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANNSIPBinding `json:"vlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVLANNSIPBinding(id string) (*models.VLANNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vlanNSIPBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VLANNSIPBinding `json:"vlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVLANNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vlanNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VLANNSIPBinding `json:"vlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid +func (s *NetworkService) AddVRID(resource models.VRID) error { + payload := map[string]any{"vrid": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vridURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRID(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vridURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateVRID(resource models.VRID) error { + payload := map[string]any{"vrid": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vridURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetVRID(resource models.VRID) error { + payload := map[string]any{"vrid": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vridURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRID() ([]models.VRID, error) { + req, err := s.client.NewRequest(http.MethodGet, vridURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID `json:"vrid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID(id string) (*models.VRID, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID `json:"vrid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID `json:"vrid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6 +func (s *NetworkService) AddVRID6(resource models.VRID6) error { + payload := map[string]any{"vrid6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vrid6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRID6(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vrid6URL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateVRID6(resource models.VRID6) error { + payload := map[string]any{"vrid6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vrid6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetVRID6(resource models.VRID6) error { + payload := map[string]any{"vrid6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vrid6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRID6() ([]models.VRID6, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6 `json:"vrid6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6(id string) (*models.VRID6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6URL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6 `json:"vrid6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6 `json:"vrid6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6_binding +func (s *NetworkService) GetAllVRID6Biding() ([]models.VRID6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6Binding `json:"vrid6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6Biding(id string) (*models.VRID6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6Binding `json:"vrid6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// vrid6_channel_binding +func (s *NetworkService) AddVRID6ChannelBinding(resource models.VRID6ChannelBinding) error { + payload := map[string]any{"vrid6_channel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vrid6ChannelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRID6ChannelBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vrid6ChannelBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRID6ChannelBinding() ([]models.VRID6ChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6ChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6ChannelBinding `json:"vrid6_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6ChannelBinding(id string) (*models.VRID6ChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6ChannelBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6ChannelBinding `json:"vrid6_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6ChannelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6ChannelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6ChannelBinding `json:"vrid6_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6_interface_binding +func (s *NetworkService) AddVRID6InterfaceBinding(resource models.VRID6InterfaceBinding) error { + payload := map[string]any{"vrid6_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vrid6InterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRID6InterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vrid6InterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRID6InterfaceBinding() ([]models.VRID6InterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6InterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6InterfaceBinding `json:"vrid6_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6InterfaceBinding(id string) (*models.VRID6InterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6InterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6InterfaceBinding `json:"vrid6_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6InterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6InterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6InterfaceBinding `json:"vrid6_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6_nsip6_binding +func (s *NetworkService) GetAllVRID6NSIP6Binding() ([]models.VRID6NSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6NSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6NSIP6Binding `json:"vrid6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6NSIP6Binding(id string) (*models.VRID6NSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6NSIP6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6NSIP6Binding `json:"vrid6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6NSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6NSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6NSIP6Binding `json:"vrid6_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6_nsip_binding +func (s *NetworkService) GetAllVRID6NSIPBinding() ([]models.VRID6NSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6NSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6NSIPBinding `json:"vrid6_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6NSIPBinding(id string) (*models.VRID6NSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6NSIPBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6NSIPBinding `json:"vrid6_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6NSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6NSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6NSIPBinding `json:"vrid6_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid6_trackinterface_binding +func (s *NetworkService) AddVRID6TrackInterfaceBinding(resource models.VRID6TrackInterfaceBinding) error { + payload := map[string]any{"vrid6_trackinterface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vrid6TrackInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRID6TrackInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vrid6TrackInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRID6TrackInterfaceBinding() ([]models.VRID6TrackInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vrid6TrackInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6TrackInterfaceBinding `json:"vrid6_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRID6TrackInterfaceBinding(id string) (*models.VRID6TrackInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vrid6TrackInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRID6TrackInterfaceBinding `json:"vrid6_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRID6TrackInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vrid6TrackInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRID6TrackInterfaceBinding `json:"vrid6_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vridparam +func (s *NetworkService) UpdateVRIDParam(resource models.VRIDParam) error { + payload := map[string]any{"vridparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vridParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetVRIDParam(resource models.VRIDParam) error { + payload := map[string]any{"vridparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vridParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRIDParam() ([]models.VRIDParam, error) { + req, err := s.client.NewRequest(http.MethodGet, vridParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDParam `json:"vridparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// vrid_binding +func (s *NetworkService) GetAllVRIDBinding() ([]models.VRIDBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDBinding `json:"vrid_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDBinding(id string) (*models.VRIDBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDBinding `json:"vrid_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// vrid_channel_binding +func (s *NetworkService) AddVRIDChannelBinding(resource models.VRIDChannelBinding) error { + payload := map[string]any{"vrid_channel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vridChannelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRIDChannelBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vridChannelBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRIDChannelBinding() ([]models.VRIDChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridChannelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDChannelBinding `json:"vrid_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDChannelBinding(id string) (*models.VRIDChannelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridChannelBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDChannelBinding `json:"vrid_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRIDChannelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridChannelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRIDChannelBinding `json:"vrid_channel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid_interface_binding +func (s *NetworkService) AddVRIDInterfaceBinding(resource models.VRIDInterfaceBinding) error { + payload := map[string]any{"vrid_interface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vridInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRIDInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vridInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRIDInterfaceBinding() ([]models.VRIDInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDInterfaceBinding `json:"vrid_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDInterfaceBinding(id string) (*models.VRIDInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDInterfaceBinding `json:"vrid_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRIDInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRIDInterfaceBinding `json:"vrid_interface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid_nsip6_binding +func (s *NetworkService) GetAllVRIDNSIP6Binding() ([]models.VRIDNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDNSIP6Binding `json:"vrid_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDNSIP6Binding(id string) (*models.VRIDNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridNSIP6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDNSIP6Binding `json:"vrid_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRIDNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRIDNSIP6Binding `json:"vrid_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid_nsip_binding +func (s *NetworkService) GetAllVRIDNSIPBinding() ([]models.VRIDNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDNSIPBinding `json:"vrid_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDNSIPBinding(id string) (*models.VRIDNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridNSIPBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDNSIPBinding `json:"vrid_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRIDNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRIDNSIPBinding `json:"vrid_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vrid_trackinterface_binding +func (s *NetworkService) AddVRIDTrackInterfaceBinding(resource models.VRIDTrackInterfaceBinding) error { + payload := map[string]any{"vrid_trackinterface_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vridTrackInterfaceBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVRIDTrackInterfaceBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vridTrackInterfaceBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVRIDTrackInterfaceBinding() ([]models.VRIDTrackInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vridTrackInterfaceBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDTrackInterfaceBinding `json:"vrid_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVRIDTrackInterfaceBinding(id string) (*models.VRIDTrackInterfaceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vridTrackInterfaceBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VRIDTrackInterfaceBinding `json:"vrid_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVRIDTrackInterfaceBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vridTrackInterfaceBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VRIDTrackInterfaceBinding `json:"vrid_trackinterface_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlan +func (s *NetworkService) AddVXLAN(resource models.VXLAN) error { + payload := map[string]any{"vxlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLAN(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UpdateVXLAN(resource models.VXLAN) error { + payload := map[string]any{"vxlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vxlanURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) UnsetVXLAN(resource models.VXLAN) error { + payload := map[string]any{"vxlan": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vxlanURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLAN() ([]models.VXLAN, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLAN `json:"vxlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLAN(id string) (*models.VXLAN, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLAN `json:"vxlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLAN() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLAN `json:"vxlan"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlanvlanmap +func (s *NetworkService) AddVXLANVLANMap(resource models.VXLANVLANMap) error { + payload := map[string]any{"vxlanvlanmap": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanVLANMapURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANVLANMap(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanVLANMapURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANVLANMap() ([]models.VXLANVLANMap, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanVLANMapURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMap `json:"vxlanvlanmap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANVLANMap(name string) (*models.VXLANVLANMap, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanVLANMapURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMap `json:"vxlanvlanmap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANVLANMap() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanVLANMapURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANVLANMap `json:"vxlanvlanmap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlanvlanmap_binding +func (s *NetworkService) GetAllVXLANVLANMapBinding() ([]models.VXLANVLANMapBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanVLANMapBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMapBinding `json:"vxlanvlanmap_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANVLANMapBinding(name string) (*models.VXLANVLANMapBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanVLANMapBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMapBinding `json:"vxlanvlanmap_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// vxlanvlanmap_vxlan_binding +func (s *NetworkService) AddVXLANVLANMapVXLANBinding(resource models.VXLANVLANMapVXLANBinding) error { + payload := map[string]any{"vxlanvlanmap_vxlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanVLANMapVXLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANVLANMapVXLANBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanVLANMapVXLANBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANVLANMapVXLANBinding() ([]models.VXLANVLANMapVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanVLANMapVXLANBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMapVXLANBinding `json:"vxlanvlanmap_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANVLANMapVXLANBinding(name string) (*models.VXLANVLANMapVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanVLANMapVXLANBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANVLANMapVXLANBinding `json:"vxlanvlanmap_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANVLANMapVXLANBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanVLANMapVXLANBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANVLANMapVXLANBinding `json:"vxlanvlanmap_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlan_binding +func (s *NetworkService) GetAllVXLANBinding() ([]models.VxlanBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VxlanBinding `json:"vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANBinding(id string) (*models.VxlanBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VxlanBinding `json:"vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +// vxlan_iptunnel_binding +func (s *NetworkService) AddVXLANIPTunnelBinding(resource models.VXLANIPTunnelBinding) error { + payload := map[string]any{"vxlan_iptunnel_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanIPTunnelBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANIPTunnelBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanIPTunnelBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANIPTunnelBinding() ([]models.VXLANIPTunnelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanIPTunnelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANIPTunnelBinding `json:"vxlan_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANIPTunnelBinding(id string) (*models.VXLANIPTunnelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanIPTunnelBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANIPTunnelBinding `json:"vxlan_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANIPTunnelBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanIPTunnelBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANIPTunnelBinding `json:"vxlan_iptunnel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlan_nsip6_binding +func (s *NetworkService) AddVXLANNSIP6Binding(resource models.VXLANNSIP6Binding) error { + payload := map[string]any{"vxlan_nsip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanNSIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANNSIP6Binding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanNSIP6BindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANNSIP6Binding() ([]models.VXLANNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanNSIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANNSIP6Binding `json:"vxlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANNSIP6Binding(id string) (*models.VXLANNSIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanNSIP6BindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANNSIP6Binding `json:"vxlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANNSIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanNSIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANNSIP6Binding `json:"vxlan_nsip6_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlan_nsip_binding +func (s *NetworkService) AddVXLANNSIPBinding(resource models.VXLANNSIPBinding) error { + payload := map[string]any{"vxlan_nsip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanNSIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANNSIPBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanNSIPBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANNSIPBinding() ([]models.VXLANNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanNSIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANNSIPBinding `json:"vxlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANNSIPBinding(id string) (*models.VXLANNSIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanNSIPBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANNSIPBinding `json:"vxlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANNSIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanNSIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANNSIPBinding `json:"vxlan_nsip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vxlan_srcip_binding +func (s *NetworkService) AddVXLANSrcIPBinding(resource models.VXLANSrcIPBinding) error { + payload := map[string]any{"vxlan_srcip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vxlanSrcIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) DeleteVXLANSrcIPBinding(id string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vxlanSrcIPBindingURL, id), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NetworkService) GetAllVXLANSrcIPBinding() ([]models.VXLANSrcIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vxlanSrcIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANSrcIPBinding `json:"vxlan_srcip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NetworkService) GetVXLANSrcIPBinding(id string) (*models.VXLANSrcIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vxlanSrcIPBindingURL, id), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VXLANSrcIPBinding `json:"vxlan_srcip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *NetworkService) CountVXLANSrcIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vxlanSrcIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VXLANSrcIPBinding `json:"vxlan_srcip_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} diff --git a/nitrogo/ns.go b/nitrogo/ns.go index 43e1a9e..a38ab9b 100644 --- a/nitrogo/ns.go +++ b/nitrogo/ns.go @@ -1,72 +1,116 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( - nsACLURL = "/nitro/v1/config/nsacl" - nsACL6URL = "/nitro/v1/config/nsacl6" - nsAppFlowCollectorURL = "/nitro/v1/config/nsappflowcollector" - nsAppFlowParamURL = "/nitro/v1/config/nsappflowparam" - nsCapacityURL = "/nitro/v1/config/nscapacity" - nsConfigURL = "/nitro/v1/config/nsconfig" - nsConnectionTableURL = "/nitro/v1/config/nsconnectiontable" - nsConsoleLoginPromptURL = "/nitro/v1/config/nsconsoleloginprompt" - nsDHCPParamsURL = "/nitro/v1/config/nsdhcpparams" - nsDialogURL = "/nitro/v1/config/nsdialog" - nsEncryptionParamsURL = "/nitro/v1/config/nsencryptionparams" - nsEventsURL = "/nitro/v1/config/nsevents" - nsExtensionURL = "/nitro/v1/config/nsextension" - nsExtensionBindingURL = "/nitro/v1/config/nsextension_binding" - nsExtensionExtensionFunctionBindingURL = "/nitro/v1/config/nsextension_extensionfunction_binding" - nsFeatureURL = "/nitro/v1/config/nsfeature" - nsHardwareURL = "/nitro/v1/config/nshardware" - nsHostNameURL = "/nitro/v1/config/nshostname" - nsHTTPParamURL = "/nitro/v1/config/nshttpparam" - nsHTTPProfileURL = "/nitro/v1/config/nshttpprofile" - nsICAPProfileURL = "/nitro/v1/config/nsicapprofile" - nsIPURL = "/nitro/v1/config/nsip" - nsIP6URL = "/nitro/v1/config/nsip6" - nsLicenseURL = "/nitro/v1/config/nslicense" - nsLicenseParametersURL = "/nitro/v1/config/nslicenseparameters" - nsLicenseServerURL = "/nitro/v1/config/nslicenseserver" - nsLimitIdentifierURL = "/nitro/v1/config/nslimitidentifier" - nsLimitSelectorURL = "/nitro/v1/config/nslimitselector" - nsLimitSessionsURL = "/nitro/v1/config/nslimitsessions" - nsLogActionURL = "/nitro/v1/config/nslogaction" - nsLogGlobalBindingURL = "/nitro/v1/config/nslogglobal_binding" - nsLogGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/nslogglobal_auditnslogpolicy_binding" - nsLogParamsURL = "/nitro/v1/config/nslogparams" - nsLogPolicyURL = "/nitro/v1/config/nslogpolicy" - nsLogPolicyBindingURL = "/nitro/v1/config/nslogpolicy_binding" - nsModeURL = "/nitro/v1/config/nsmode" - nsParamURL = "/nitro/v1/config/nsparam" - nsPartitionURL = "/nitro/v1/config/nspartition" - nsPartitionBindingURL = "/nitro/v1/config/nspartition_binding" - nsPartitionBridgeGroupBindingURL = "/nitro/v1/config/nspartition_bridgegroup_binding" - nsPartitionVLANBindingURL = "/nitro/v1/config/nspartition_vlan_binding" - nsPartitionVXLANBindingURL = "/nitro/v1/config/nspartition_vxlan_binding" - nsRateControlURL = "/nitro/v1/config/nsratecontrol" - nsRPCNodeURL = "/nitro/v1/config/nsrpcnode" - nsRunningConfigURL = "/nitro/v1/config/nsrunningconfig" - nsSavedConfigURL = "/nitro/v1/config/nssavedconfig" - nsServicePathURL = "/nitro/v1/config/nsservicepath" - nsSimpleACLURL = "/nitro/v1/config/nssimpleacl" - nsSimpleACL6URL = "/nitro/v1/config/nssimpleacl6" - nsSPParamsURL = "/nitro/v1/config/nsspparams" - nsSurgeProtectionURL = "/nitro/v1/config/nssurgeprotection" - nsTCPBufParamURL = "/nitro/v1/config/nstcpbufparam" - nsTCPParamURL = "/nitro/v1/config/nstcpparam" - nsTCPProfileURL = "/nitro/v1/config/nstcpprofile" - nsTimeoutURL = "/nitro/v1/config/nstimeout" - nsTimerURL = "/nitro/v1/config/nstimer" - nsTrafficDomainURL = "/nitro/v1/config/nstrafficdomain" - nsTrafficDomainBindingURL = "/nitro/v1/config/nstrafficdomain_binding" - nsTrafficDomainBridgeGroupBindingURL = "/nitro/v1/config/nstrafficdomain_bridgegroup_binding" - nsTrafficDomainVLANBindingURL = "/nitro/v1/config/nstrafficdomain_vlan_binding" - nsTrafficDomainVXLANBindingURL = "/nitro/v1/config/nstrafficdomain_vxlan_binding" - nsVariableURL = "/nitro/v1/config/nsvariable" - nsVersionURL = "/nitro/v1/config/nsversion" - nsWebLogParamURL = "/nitro/v1/config/nsweblogparam" - nsXMLNamespaceURL = "/nitro/v1/config/nsxmlnamespace" - nsXMLSchemaURL = "/nitro/v1/config/nsxmlschema" + nsACLURL = "/nitro/v1/config/nsacl" + nsACL6URL = "/nitro/v1/config/nsacl6" + nsACLSURL = "/nitro/v1/config/nsacls" + nsACLS6URL = "/nitro/v1/config/nsacls6" + nsAppFlowCollectorURL = "/nitro/v1/config/nsappflowcollector" + nsAppFlowParamURL = "/nitro/v1/config/nsappflowparam" + nsCapacityURL = "/nitro/v1/config/nscapacity" + nsConfigURL = "/nitro/v1/config/nsconfig" + nsConnectionTableURL = "/nitro/v1/config/nsconnectiontable" + nsConsoleLoginPromptURL = "/nitro/v1/config/nsconsoleloginprompt" + nsDHCPParamsURL = "/nitro/v1/config/nsdhcpparams" + nsDialogURL = "/nitro/v1/config/nsdialog" + nsEncryptionParamsURL = "/nitro/v1/config/nsencryptionparams" + nsEventsURL = "/nitro/v1/config/nsevents" + nsExtensionURL = "/nitro/v1/config/nsextension" + nsExtensionBindingURL = "/nitro/v1/config/nsextension_binding" + nsExtensionExtensionFunctionBindingURL = "/nitro/v1/config/nsextension_extensionfunction_binding" + nsFeatureURL = "/nitro/v1/config/nsfeature" + nsHardwareURL = "/nitro/v1/config/nshardware" + nsHostNameURL = "/nitro/v1/config/nshostname" + nsHTTPParamURL = "/nitro/v1/config/nshttpparam" + nsHTTPProfileURL = "/nitro/v1/config/nshttpprofile" + nsICAPProfileURL = "/nitro/v1/config/nsicapprofile" + nsIPURL = "/nitro/v1/config/nsip" + nsIP6URL = "/nitro/v1/config/nsip6" + nsLicenseURL = "/nitro/v1/config/nslicense" + nsLicenseParametersURL = "/nitro/v1/config/nslicenseparameters" + nsLicenseServerURL = "/nitro/v1/config/nslicenseserver" + nsLimitIdentifierURL = "/nitro/v1/config/nslimitidentifier" + nsLimitSelectorURL = "/nitro/v1/config/nslimitselector" + nsLimitSessionsURL = "/nitro/v1/config/nslimitsessions" + nsLogActionURL = "/nitro/v1/config/nslogaction" + nsLogGlobalBindingURL = "/nitro/v1/config/nslogglobal_binding" + nsLogGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/nslogglobal_auditnslogpolicy_binding" + nsLogParamsURL = "/nitro/v1/config/nslogparams" + nsLogPolicyURL = "/nitro/v1/config/nslogpolicy" + nsLogPolicyBindingURL = "/nitro/v1/config/nslogpolicy_binding" + nsModeURL = "/nitro/v1/config/nsmode" + nsParamURL = "/nitro/v1/config/nsparam" + nsPartitionURL = "/nitro/v1/config/nspartition" + nsPartitionBindingURL = "/nitro/v1/config/nspartition_binding" + nsPartitionBridgeGroupBindingURL = "/nitro/v1/config/nspartition_bridgegroup_binding" + nsPartitionVLANBindingURL = "/nitro/v1/config/nspartition_vlan_binding" + nsPartitionVXLANBindingURL = "/nitro/v1/config/nspartition_vxlan_binding" + nsRateControlURL = "/nitro/v1/config/nsratecontrol" + nsRPCNodeURL = "/nitro/v1/config/nsrpcnode" + nsRunningConfigURL = "/nitro/v1/config/nsrunningconfig" + nsSavedConfigURL = "/nitro/v1/config/nssavedconfig" + nsServicePathURL = "/nitro/v1/config/nsservicepath" + nsSimpleACLURL = "/nitro/v1/config/nssimpleacl" + nsSimpleACL6URL = "/nitro/v1/config/nssimpleacl6" + nsSPParamsURL = "/nitro/v1/config/nsspparams" + nsSurgeProtectionURL = "/nitro/v1/config/nssurgeprotection" + nsTCPBufParamURL = "/nitro/v1/config/nstcpbufparam" + nsTCPParamURL = "/nitro/v1/config/nstcpparam" + nsTCPProfileURL = "/nitro/v1/config/nstcpprofile" + nsTimeoutURL = "/nitro/v1/config/nstimeout" + nsTimerURL = "/nitro/v1/config/nstimer" + nsTrafficDomainURL = "/nitro/v1/config/nstrafficdomain" + nsTrafficDomainBindingURL = "/nitro/v1/config/nstrafficdomain_binding" + nsTrafficDomainBridgeGroupBindingURL = "/nitro/v1/config/nstrafficdomain_bridgegroup_binding" + nsTrafficDomainVLANBindingURL = "/nitro/v1/config/nstrafficdomain_vlan_binding" + nsTrafficDomainVXLANBindingURL = "/nitro/v1/config/nstrafficdomain_vxlan_binding" + nsVariableURL = "/nitro/v1/config/nsvariable" + nsVersionURL = "/nitro/v1/config/nsversion" + nsWeblogParamURL = "/nitro/v1/config/nsweblogparam" + nsXMLNamespaceURL = "/nitro/v1/config/nsxmlnamespace" + nsXMLSchemaURL = "/nitro/v1/config/nsxmlschema" + nsAptLicenseURL = "/nitro/v1/config/nsaptlicense" + nsAssignmentURL = "/nitro/v1/config/nsassignment" + nsCQAParamURL = "/nitro/v1/config/nscqaparam" + nsDHCPIPURL = "/nitro/v1/config/nsdhcpip" + nsDiameterURL = "/nitro/v1/config/nsdiameter" + nsEncryptionKeyURL = "/nitro/v1/config/nsencryptionkey" + nsHostnameURL = "/nitro/v1/config/nshostname" + nsLicenseProxyServerURL = "/nitro/v1/config/nslicenseproxyserver" + nsLicenseServerPoolURL = "/nitro/v1/config/nslicenseserverpool" + nsMigrationURL = "/nitro/v1/config/nsmigration" + nsPartitionMACURL = "/nitro/v1/config/nspartitionmac" + nsPBRURL = "/nitro/v1/config/nspbr" + nsPBR6URL = "/nitro/v1/config/nspbr6" + nsPBRsURL = "/nitro/v1/config/nspbrs" + nsRollBackCMDURL = "/nitro/v1/config/nsrollbackcmd" + nsServiceFunctionURL = "/nitro/v1/config/nsservicefunction" + nsServicePathBindingURL = "/nitro/v1/config/nsservicepath_binding" + nsServicePathNSServiceFunctionBindingURL = "/nitro/v1/config/nsservicepath_nsservicefunction_binding" + nsSourceRouteCacheTableURL = "/nitro/v1/config/nssourceroutecachetable" + nsStatsURL = "/nitro/v1/config/nsstats" + nsSurgeQURL = "/nitro/v1/config/nssurgeq" + nsTimerAutoScalePolicyBindingURL = "/nitro/v1/config/nstimer_autoscalepolicy_binding" + nsTimerBindingURL = "/nitro/v1/config/nstimer_binding" + nsTimeZoneURL = "/nitro/v1/config/nstimezone" + nsVPXParamURL = "/nitro/v1/config/nsvpxparam" + nsCentralManagementServerURL = "/nitro/v1/config/nscentralmanagementserver" + nsHMACKeyURL = "/nitro/v1/config/nshmackey" + nsLimitIdentifierBindingURL = "/nitro/v1/config/nslimitidentifier_binding" + nsLimitIdentifierNSLimitSessionsBindingURL = "/nitro/v1/config/nslimitidentifier_nslimitsessions_binding" + nsPartitionVlanBindingURL = "/nitro/v1/config/nspartition_vlan_binding" + rebootURL = "/nitro/v1/config/reboot" + shutdownURL = "/nitro/v1/config/shutdown" ) // ns @@ -77,549 +121,7363 @@ type NSService struct { } // nsacl -func (s *NSService) AddNSACL() {} -func (s *NSService) DeleteNSACL() {} -func (s *NSService) UpdateNSACL() {} -func (s *NSService) UnsetNSACL() {} -func (s *NSService) EnableNSACL() {} -func (s *NSService) DisableNSACL() {} -func (s *NSService) RenameNSACL() {} -func (s *NSService) GetAllNSACL() {} -func (s *NSService) GetNSACL() {} -func (s *NSService) CountNSACL() {} +func (s *NSService) AddNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsACLURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSACL(aclname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsACLURL, aclname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsACLURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) RenameNSACL(resource models.NSACL) error { + payload := map[string]any{"nsacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", nsACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSACL() ([]models.NSACL, error) { + req, err := s.client.NewRequest(http.MethodGet, nsACLURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSACL `json:"nsacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSACL(aclname string) (*models.NSACL, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsACLURL, aclname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSACL `json:"nsacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsacl %s not found", aclname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSACL() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsACLURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSACL `json:"nsacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // nsacl6 -func (s *NSService) AddNSACL6() {} -func (s *NSService) DeleteNSACL6() {} -func (s *NSService) UpdateNSACL6() {} -func (s *NSService) UnsetNSACL6() {} -func (s *NSService) EnableNSACL6() {} -func (s *NSService) DisableNSACL6() {} -func (s *NSService) RenameNSACL6() {} -func (s *NSService) GetAllNSACL6() {} -func (s *NSService) GetNSACL6() {} -func (s *NSService) CountNSACL6() {} +func (s *NSService) AddNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsACL6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSACL6(acl6name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsACL6URL, acl6name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsACL6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) RenameNSACL6(resource models.NSACL6) error { + payload := map[string]any{"nsacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", nsACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSACL6() ([]models.NSACL6, error) { + req, err := s.client.NewRequest(http.MethodGet, nsACL6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSACL6 `json:"nsacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSACL6(acl6name string) (*models.NSACL6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsACL6URL, acl6name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSACL6 `json:"nsacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsacl6 %s not found", acl6name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSACL6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsACL6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSACL6 `json:"nsacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // nsacls -func (s *NSService) RenumberNSACLS() {} -func (s *NSService) ClearNSACLS() {} -func (s *NSService) ApplyNSACLS() {} +func (s *NSService) RenumberNSACLS() error { + payload := map[string]any{"nsacls": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=renumber", nsACLSURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ClearNSACLS() error { + payload := map[string]any{"nsacls": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsACLSURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ApplyNSACLS() error { + payload := map[string]any{"nsacls": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=apply", nsACLSURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // nsacls6 -func (s *NSService) RenumberNSACLS6() {} -func (s *NSService) ClearNSACLS6() {} -func (s *NSService) ApplyNSACLS6() {} +func (s *NSService) RenumberNSACLS6() error { + payload := map[string]any{"nsacls6": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=renumber", nsACLS6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ClearNSACLS6() error { + payload := map[string]any{"nsacls6": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsACLS6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ApplyNSACLS6() error { + payload := map[string]any{"nsacls6": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=apply", nsACLS6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // nsappflowcollector -func (s *NSService) AddNSAppFlowCollector() {} -func (s *NSService) DeleteNSAppFlowCollector() {} -func (s *NSService) GetAllNSAppFlowCollector() {} -func (s *NSService) GetNSAppFlowCollector() {} -func (s *NSService) CountNSAppFlowCollector() {} +func (s *NSService) AddNSAppFlowCollector(resource models.NSAppFlowCollector) error { + payload := map[string]any{"nsappflowcollector": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsAppFlowCollectorURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSAppFlowCollector(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsAppFlowCollectorURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSAppFlowCollector() ([]models.NSAppFlowCollector, error) { + req, err := s.client.NewRequest(http.MethodGet, nsAppFlowCollectorURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSAppFlowCollector `json:"nsappflowcollector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSAppFlowCollector(name string) (*models.NSAppFlowCollector, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsAppFlowCollectorURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSAppFlowCollector `json:"nsappflowcollector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsappflowcollector %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSAppFlowCollector() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsAppFlowCollectorURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSAppFlowCollector `json:"nsappflowcollector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // nsappflowparam -func (s *NSService) UpdateNSAppFlowParam() {} -func (s *NSService) UnsetNSAppFlowParam() {} -func (s *NSService) GetAllNSAppFlowParam() {} +func (s *NSService) UpdateNSAppFlowParam(resource models.NSAppFlowParam) error { + payload := map[string]any{"nsappflowparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nsaptlicense -func (s *NSService) GetAllNSAptLicense() {} -func (s *NSService) CountNSAptLicense() {} -func (s *NSService) ChangeNSAptLicense() {} + req, err := s.client.NewRequest(http.MethodPut, nsAppFlowParamURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nsassignment -func (s *NSService) AddNSAssignment() {} -func (s *NSService) DeleteNSAssignment() {} -func (s *NSService) UpdateNSAssignment() {} -func (s *NSService) UnsetNSAssignment() {} -func (s *NSService) GetAllNSAssignment() {} -func (s *NSService) GetNSAssignment() {} -func (s *NSService) CountNSAssignment() {} -func (s *NSService) RenameNSAssignment() {} + _, err = s.client.Do(req) + return err +} -// nscapacity -func (s *NSService) UpdateNSCapacity() {} -func (s *NSService) UnsetNSCapacity() {} -func (s *NSService) GetAllNSCapacity() {} +func (s *NSService) UnsetNSAppFlowParam(resource models.NSAppFlowParam) error { + payload := map[string]any{"nsappflowparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nscentralmanagementserver -func (s *NSService) AddNSCentralManagementServer() {} -func (s *NSService) DeleteNSCentralManagementServer() {} -func (s *NSService) GetAllNSCentralManagementServer() {} -func (s *NSService) GetNSCentralManagementServer() {} -func (s *NSService) CountNSCentralManagementServer() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsAppFlowParamURL), bytes.NewReader(data)) + if err != nil { + return err + } -// nsconfig -func (s *NSService) ClearNSConfig() {} -func (s *NSService) SaveNSConfig() {} -func (s *NSService) DiffNSConfig() {} -func (s *NSService) UpdateNSConfig() {} -func (s *NSService) UnsetNSConfig() {} -func (s *NSService) GetAllNSConfig() {} + _, err = s.client.Do(req) + return err +} -// nsconnectiontable -func (s *NSService) GetAllNSconnectionTable() {} -func (s *NSService) CountNSconnectionTable() {} +func (s *NSService) GetAllNSAppFlowParam() ([]models.NSAppFlowParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsAppFlowParamURL, nil) + if err != nil { + return nil, err + } -// nsconsoleloginprompt -func (s *NSService) UpdateNSConsoleLoginPrompt() {} -func (s *NSService) UnsetNSConsoleLoginPrompt() {} -func (s *NSService) GetAllNSConsoleLoginPrompt() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nscqaparam -func (s *NSService) UpdateNSCQAParam() {} -func (s *NSService) UnsetNSCQAParam() {} -func (s *NSService) GetAllNSCQAParam() {} + var result struct { + Data []models.NSAppFlowParam `json:"nsappflowparam"` + } -// nsdhcpip -func (s *NSService) ReleaseNSDHCPIP() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nsdhcpparams -func (s *NSService) UpdateNSDHCPParams() {} -func (s *NSService) UnsetNSDHCPParams() {} -func (s *NSService) GetAllNSDHCPParams() {} + return result.Data, nil +} -// nsdiamter -func (s *NSService) UpdateNSDiameter() {} -func (s *NSService) UnsetNSDiameter() {} -func (s *NSService) GetAllNSDiameter() {} -func (s *NSService) GetNSDiameter() {} -func (s *NSService) CountNSDiameter() {} +// nsaptlicense +func (s *NSService) GetAllNSAptLicense() ([]models.NSAPTLicense, error) { + req, err := s.client.NewRequest(http.MethodGet, nsAptLicenseURL, nil) + if err != nil { + return nil, err + } -// nsencyrptionkey -func (s *NSService) AddNSEncryptionKey() {} -func (s *NSService) DeleteNSEncryptionKey() {} -func (s *NSService) UpdateNSEncryptionKey() {} -func (s *NSService) UnsetNSEncryptionKey() {} -func (s *NSService) GetAllNSEncryptionKey() {} -func (s *NSService) GetNSEncryptionKey() {} -func (s *NSService) CountNSEncryptionKey() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nsencryptionparams -func (s *NSService) UpdateNSEncryptionParams() {} -func (s *NSService) GetAllNSEncryptionParams() {} + var result struct { + Data []models.NSAPTLicense `json:"nsaptlicense"` + } -// nsevents -func (s *NSService) GetAllNSEvents() {} -func (s *NSService) CountNSEvents() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nsextension -func (s *NSService) ImportNSExtension() {} -func (s *NSService) AddNSExtension() {} -func (s *NSService) DeleteNSExtension() {} -func (s *NSService) UpdateNSExtension() {} -func (s *NSService) UnsetNSExtension() {} -func (s *NSService) GetAllNSExtension() {} -func (s *NSService) GetNSExtension() {} -func (s *NSService) CountNSExtension() {} -func (s *NSService) ChangeNSExtension() {} + return result.Data, nil +} -// nsextension_binding -func (s *NSService) GetAllNSExtenionBinding() {} -func (s *NSService) GetNSExtenionBinding() {} +func (s *NSService) CountNSAptLicense() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsAptLicenseURL), nil) + if err != nil { + return 0, err + } -// nsextension_extensionfunction_binding -func (s *NSService) GetAllNSExtensionExtensionFunctionBinding() {} -func (s *NSService) GetNSExtensionExtensionFunctionBinding() {} -func (s *NSService) CountNSExtensionExtensionFunctionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// nsfeature -func (s *NSService) EnableNSFeature() {} -func (s *NSService) DisableNSFeature() {} -func (s *NSService) GetAllNSFeature() {} + var result struct { + Data []models.NSAPTLicense `json:"nsaptlicense"` + } -// nshardware -func (s *NSService) GetAllNSHardware() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// nshmackey -func (s *NSService) AddNSHMACKey() {} -func (s *NSService) DeleteNSHMACKey() {} -func (s *NSService) UpdateNSHMACKey() {} -func (s *NSService) UnsetNSHMACKey() {} -func (s *NSService) GetAllNSHMACKey() {} -func (s *NSService) GetNSHMACKey() {} -func (s *NSService) CountNSHMACKey() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// nshostname -func (s *NSService) UpdateNSHostname() {} -func (s *NSService) GetAllNSHostname() {} -func (s *NSService) CountNSHostname() {} +func (s *NSService) ChangeNSAptLicense(resource models.NSAPTLicense) error { + payload := map[string]any{"nsaptlicense": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nshttpparam -func (s *NSService) UpdateNSHTTPParam() {} -func (s *NSService) GetAllNSHTTPParam() {} -func (s *NSService) CountNSHTTPParam() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=change", nsAptLicenseURL), bytes.NewReader(data)) + if err != nil { + return err + } -// nshttpprofile -func (s *NSService) AddNSHTTPProfile() {} -func (s *NSService) DeleteNSHTTPProfile() {} -func (s *NSService) UpdateNSHTTPProfile() {} -func (s *NSService) UnsetNSHTTPProfile() {} -func (s *NSService) GetAllNSHTTPProfile() {} -func (s *NSService) GetNSHTTPProfile() {} -func (s *NSService) CountNSHTTPProfile() {} + _, err = s.client.Do(req) + return err +} -// nsicapprofile -func (s *NSService) AddNSICAPProfile() {} -func (s *NSService) DeleteNSICAPProfile() {} -func (s *NSService) UpdateNSICAPProfile() {} -func (s *NSService) UnsetNSICAPProfile() {} -func (s *NSService) GetAllNSICAPProfile() {} -func (s *NSService) GetNSICAPProfile() {} -func (s *NSService) CountNSICAPProfile() {} +// nsassignment +func (s *NSService) AddNSAssignment(resource models.NSAssignment) error { + payload := map[string]any{"nsassignment": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nsip -func (s *NSService) AddNSIP() {} -func (s *NSService) DeleteNSIP() {} -func (s *NSService) UpdateNSIP() {} -func (s *NSService) UnsetNSIP() {} -func (s *NSService) EnableNSIP() {} -func (s *NSService) DisableNSIP() {} -func (s *NSService) GetAllNSIP() {} -func (s *NSService) CountNSIP() {} + req, err := s.client.NewRequest(http.MethodPost, nsAssignmentURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nsip6 -func (s *NSService) AddNSIP6() {} -func (s *NSService) DeleteNSIP6() {} -func (s *NSService) UpdateNSIP6() {} -func (s *NSService) UnsetNSIP6() {} -func (s *NSService) GetAllNSIP6() {} -func (s *NSService) CountNSIP6() {} + _, err = s.client.Do(req) + return err +} -// nslicense -func (s *NSService) GetAllNSLicense() {} +func (s *NSService) DeleteNSAssignment(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsAssignmentURL, name), nil) + if err != nil { + return err + } -// nslicenseproxyserver -func (s *NSService) AddNSLicenseProxyServer() {} -func (s *NSService) DeleteNSLicenseProxyServer() {} -func (s *NSService) UpdateNSLicenseProxyServer() {} -func (s *NSService) GetAllNSLicenseProxyServer() {} -func (s *NSService) CountNSLicenseProxyServer() {} + _, err = s.client.Do(req) + return err +} -// nslicenseserver -func (s *NSService) AddNSLicenseServer() {} -func (s *NSService) DeleteNSLicenseServer() {} -func (s *NSService) UpdateNSLicenseServer() {} -func (s *NSService) GetAllNSLicenseServer() {} -func (s *NSService) CountNSLicenseServer() {} +func (s *NSService) UpdateNSAssignment(resource models.NSAssignment) error { + payload := map[string]any{"nsassignment": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nslicenseserverpool -func (s *NSService) GetAllNSLicenseServerPool() {} + req, err := s.client.NewRequest(http.MethodPut, nsAssignmentURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nslimitidentifier -func (s *NSService) AddNSLimitIdentifier() {} -func (s *NSService) DeleteNSLimitIdentifier() {} -func (s *NSService) UpdateNSLimitIdentifier() {} -func (s *NSService) UnsetNSLimitIdentifier() {} -func (s *NSService) GetAllNSLimitIdentifier() {} -func (s *NSService) GetNSLimitIdentifier() {} -func (s *NSService) CountNSLimitIdentifier() {} + _, err = s.client.Do(req) + return err +} -// nslimitidentifier_binding -func (s *NSService) GetAllNSLimitIdentifierBinding() {} -func (s *NSService) GetNSLimitIdentifierBinding() {} +func (s *NSService) UnsetNSAssignment(resource models.NSAssignment) error { + payload := map[string]any{"nsassignment": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nslimitidentifier_nslimitsessions_binding -func (s *NSService) GetAllNSLimitIdentifierNSLimitSessionsBinding() {} -func (s *NSService) GetNSLimitIdentifierNSLimitSessionsBinding() {} -func (s *NSService) CountNSLimitIdentifierNSLimitSessionsBinding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsAssignmentURL), bytes.NewReader(data)) + if err != nil { + return err + } -// nslimitselector -func (s *NSService) AddNSLimitSelector() {} -func (s *NSService) DeleteNSLimitSelector() {} -func (s *NSService) UpdateNSLimitSelector() {} -func (s *NSService) UnsetNSLimitSelector() {} -func (s *NSService) GetAllNSLimitSelector() {} -func (s *NSService) GetNSLimitSelector() {} -func (s *NSService) CountNSLimitSelector() {} + _, err = s.client.Do(req) + return err +} -// nslimitsessions -func (s *NSService) GetAllNSLimitSessions() {} -func (s *NSService) CountNSLimitSessions() {} -func (s *NSService) ClearNSLimitSessions() {} +func (s *NSService) GetAllNSAssignment() ([]models.NSAssignment, error) { + req, err := s.client.NewRequest(http.MethodGet, nsAssignmentURL, nil) + if err != nil { + return nil, err + } -// nsmigration -func (s *NSService) GetAllNSMigration() {} -func (s *NSService) CountNSMigration() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nsmode -func (s *NSService) EnableNSMode() {} -func (s *NSService) DisableNSMode() {} -func (s *NSService) GetAllNSMode() {} + var result struct { + Data []models.NSAssignment `json:"nsassignment"` + } -// nsparam -func (s *NSService) UpdateNSParam() {} -func (s *NSService) UnsetNSParam() {} -func (s *NSService) GetAllNSParam() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nspartition -func (s *NSService) AddNSPartition() {} -func (s *NSService) DeleteNSPartition() {} -func (s *NSService) UpdateNSPartition() {} -func (s *NSService) UnsetNSPartition() {} -func (s *NSService) SwitchNSPartition() {} -func (s *NSService) GetAllNSPartition() {} -func (s *NSService) GetNSPartition() {} -func (s *NSService) CountNSPartition() {} + return result.Data, nil +} -// nspartitionmac -func (s *NSService) GetAllNSPartitionMAC() {} -func (s *NSService) CountNSPartitionMAC() {} +func (s *NSService) GetNSAssignment(name string) (*models.NSAssignment, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsAssignmentURL, name), nil) + if err != nil { + return nil, err + } -// nspartition_binding -func (s *NSService) GetAllNSPartitionBinding() {} -func (s *NSService) GetNSPartitionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nspartition_bridgegroup_binding -func (s *NSService) AddNSPartitionBridgeGroupBinding() {} -func (s *NSService) DeleteNSPartitionBridgeGroupBinding() {} -func (s *NSService) GetAllNSPartitionBridgeGroupBinding() {} -func (s *NSService) GetNSPartitionBridgeGroupBinding() {} -func (s *NSService) CountNSPartitionBridgeGroupBinding() {} + var result struct { + Data []models.NSAssignment `json:"nsassignment"` + } -// nspartition_vlan_binding -func (s *NSService) AddNSPartitionVLANBinding() {} -func (s *NSService) DeleteNSPartitionVLANBinding() {} -func (s *NSService) GetAllNSPartitionVLANBinding() {} -func (s *NSService) GetNSPartitionVLANBinding() {} -func (s *NSService) CountNSPartitionVLANBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nspartition_vxlan_binding -func (s *NSService) AddNSPartitionVXLANBinding() {} -func (s *NSService) DeleteNSPartitionVXLANBinding() {} -func (s *NSService) GetAllNSPartitionVXLANBinding() {} -func (s *NSService) GetNSPartitionVXLANBinding() {} -func (s *NSService) CountNSPartitionVXLANBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsassignment %s not found", name) + } -// nspbr -func (s *NSService) AddNSPBR() {} -func (s *NSService) DeleteNSPBR() {} -func (s *NSService) UpdateNSPBR() {} -func (s *NSService) UnsetNSPBR() {} -func (s *NSService) EnableNSPBR() {} -func (s *NSService) DisableNSPBR() {} -func (s *NSService) GetAllNSPBR() {} -func (s *NSService) GetNSPBR() {} -func (s *NSService) CountNSPBR() {} + return &result.Data[0], nil +} -// nspbr6 -func (s *NSService) AddNSPBR6() {} -func (s *NSService) DeleteNSPBR6() {} -func (s *NSService) UpdateNSPBR6() {} -func (s *NSService) UnsetNSPBR6() {} -func (s *NSService) RenumberNSPBR6() {} -func (s *NSService) EnableNSPBR6() {} -func (s *NSService) DisableNSPBR6() {} -func (s *NSService) GetAllNSPBR6() {} -func (s *NSService) GetNSPBR6() {} -func (s *NSService) CountNSPBR6() {} -func (s *NSService) ClearNSPBR6() {} -func (s *NSService) ApplyNSPBR6() {} +func (s *NSService) CountNSAssignment() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsAssignmentURL), nil) + if err != nil { + return 0, err + } -// nspbrs -func (s *NSService) RenumberNSPBRs() {} -func (s *NSService) ClearNSPBRs() {} -func (s *NSService) ApplyNSPBRs() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// nsratecontrol -func (s *NSService) UpdateNSrateControl() {} -func (s *NSService) UnsetNSrateControl() {} -func (s *NSService) GetAllNSrateControl() {} + var result struct { + Data []models.NSAssignment `json:"nsassignment"` + } -// nsrollbackcmd -func (s *NSService) GetAllNSRollBackCMD() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// nsrpcnode -func (s *NSService) UpdateNSRPCNode() {} -func (s *NSService) UnsetNSRPCNode() {} -func (s *NSService) GetAllNSRPCNode() {} -func (s *NSService) GetNSRPCNode() {} -func (s *NSService) CountNSRPCNode() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// nsrunningconfig -func (s *NSService) GetAllNSRunningConfig() {} +func (s *NSService) RenameNSAssignment(resource models.NSAssignment) error { + payload := map[string]any{"nsassignment": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nssavedconfig -func (s *NSService) GetAllNSSavedConfig() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", nsAssignmentURL), bytes.NewReader(data)) + if err != nil { + return err + } -// nsservicefunction -func (s *NSService) AddNSServiceFunction() {} -func (s *NSService) DeleteNSServiceFunction() {} -func (s *NSService) GetAllNSServiceFunction() {} -func (s *NSService) GetNSServiceFunction() {} -func (s *NSService) CountNSServiceFunction() {} + _, err = s.client.Do(req) + return err +} -// nsservicepath -func (s *NSService) AddNSServicePath() {} -func (s *NSService) DeleteNSServicePath() {} -func (s *NSService) GetAllNSServicePath() {} -func (s *NSService) GetNSServicePath() {} -func (s *NSService) CountNSServicePath() {} +// nscapacity +func (s *NSService) UpdateNSCapacity(resource models.NSCapacity) error { + payload := map[string]any{"nscapacity": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nsservicepath_binding -func (s *NSService) GetAllNSServicePathBinding() {} -func (s *NSService) GetNSServicePathBinding() {} + req, err := s.client.NewRequest(http.MethodPut, nsCapacityURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nsservicepath_nsservicefunction_binding -func (s *NSService) AddNSServicePathNSServiceFunctionBinding() {} -func (s *NSService) DeleteNSServicePathNSServiceFunctionBinding() {} -func (s *NSService) GetAllNSServicePathNSServiceFunctionBinding() {} -func (s *NSService) GetNSServicePathNSServiceFunctionBinding() {} -func (s *NSService) CountNSServicePathNSServiceFunctionBinding() {} + _, err = s.client.Do(req) + return err +} -// nssimpleacl -func (s *NSService) AddNSSimpleACL() {} -func (s *NSService) DeleteNSSimpleACL() {} -func (s *NSService) FlushNSSimpleACL() {} -func (s *NSService) GetAllNSSimpleACL() {} -func (s *NSService) GetNSSimpleACL() {} -func (s *NSService) CountNSSimpleACL() {} -func (s *NSService) ClearNSSimpleACL() {} +func (s *NSService) UnsetNSCapacity(resource models.NSCapacity) error { + payload := map[string]any{"nscapacity": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nssimpleacl6 -func (s *NSService) AddNSSimpleACL6() {} -func (s *NSService) DeleteNSSimpleACL6() {} -func (s *NSService) FlushNSSimpleACL6() {} -func (s *NSService) GetAllNSSimpleACL6() {} -func (s *NSService) GetNSSimpleACL6() {} -func (s *NSService) CountNSSimpleACL6() {} -func (s *NSService) ClearNSSimpleACL6() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsCapacityURL), bytes.NewReader(data)) + if err != nil { + return err + } -// nssourceroutecachetable -func (s *NSService) FlushNSSourceRouteCacheTable() {} -func (s *NSService) GetAllNSSourceRouteCacheTable() {} -func (s *NSService) CountNSSourceRouteCacheTable() {} + _, err = s.client.Do(req) + return err +} -// nsspparams -func (s *NSService) UpdateNSSPParams() {} -func (s *NSService) UnsetNSSPParams() {} -func (s *NSService) GetAllNSSPParams() {} +func (s *NSService) GetAllNSCapacity() ([]models.NSCapacity, error) { + req, err := s.client.NewRequest(http.MethodGet, nsCapacityURL, nil) + if err != nil { + return nil, err + } -// nsstats -func (s *NSService) ClearNSStats() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nssurgeq -func (s *NSService) FlushNSSurgeQ() {} + var result struct { + Data []models.NSCapacity `json:"nscapacity"` + } -// nstcpbufparam -func (s *NSService) UpdateNSTCPBufParam() {} -func (s *NSService) UnsetNSTCPBufParam() {} -func (s *NSService) GetAllNSTCPBufParam() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nstcpparam -func (s *NSService) UpdateNSTCPParam() {} -func (s *NSService) UnsetNSTCPParam() {} -func (s *NSService) GetAllNSTCPParam() {} + return result.Data, nil +} -// nstcpprofile -func (s *NSService) AddNSTCPProfile() {} -func (s *NSService) DeleteNSTCPProfile() {} -func (s *NSService) UpdateNSTCPProfile() {} -func (s *NSService) UnsetNSTCPProfile() {} -func (s *NSService) GetAllNSTCPProfile() {} -func (s *NSService) GetNSTCPProfile() {} -func (s *NSService) CountNSTCPProfile() {} +// nscentralmanagementserver +func (s *NSService) AddNSCentralManagementServer(resource models.NSCentralManagementServer) error { + payload := map[string]any{"nscentralmanagementserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// nstimeout -func (s *NSService) UpdateNSTimeout() {} -func (s *NSService) UnsetNSTimeout() {} -func (s *NSService) GetAllNSTimeout() {} + req, err := s.client.NewRequest(http.MethodPost, nsCentralManagementServerURL, bytes.NewReader(data)) + if err != nil { + return err + } -// nstimer -func (s *NSService) AddNSTimer() {} -func (s *NSService) DeleteNSTimer() {} -func (s *NSService) UpdateNSTimer() {} -func (s *NSService) UnsetNSTimer() {} -func (s *NSService) GetAllNSTimer() {} -func (s *NSService) GetNSTimer() {} -func (s *NSService) CountNSTimer() {} -func (s *NSService) RenameNSTimer() {} + _, err = s.client.Do(req) + return err +} -// nstimer_autoscalepolicy_binding -func (s *NSService) AddNSTimerAutoScalePolicyBinding() {} -func (s *NSService) DeleteNSTimerAutoScalePolicyBinding() {} -func (s *NSService) GetAllNSTimerAutoScalePolicyBinding() {} -func (s *NSService) GetNSTimerAutoScalePolicyBinding() {} -func (s *NSService) CountNSTimerAutoScalePolicyBinding() {} +func (s *NSService) DeleteNSCentralManagementServer(servername string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsCentralManagementServerURL, servername), nil) + if err != nil { + return err + } -// nstimer_binding -func (s *NSService) GetAllNSTimerBinding() {} -func (s *NSService) GetNSTimerBinding() {} + _, err = s.client.Do(req) + return err +} -// nstimezone -func (s *NSService) GetAllNSTimeZone() {} -func (s *NSService) GetNSTimeZone() {} -func (s *NSService) CountNSTimeZone() {} +func (s *NSService) GetAllNSCentralManagementServer() ([]models.NSCentralManagementServer, error) { + req, err := s.client.NewRequest(http.MethodGet, nsCentralManagementServerURL, nil) + if err != nil { + return nil, err + } -// nstrafficdomain -func (s *NSService) AddNSTrafficDomain() {} -func (s *NSService) DeleteNSTrafficDomain() {} -func (s *NSService) EnableNSTrafficDomain() {} -func (s *NSService) DisableNSTrafficDomain() {} -func (s *NSService) GetAllNSTrafficDomain() {} -func (s *NSService) GetNSTrafficDomain() {} -func (s *NSService) CountNSTrafficDomain() {} -func (s *NSService) ClearNSTrafficDomain() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nstrafficdomain_binding -func (s *NSService) GetAllNSTrafficDomainBinding() {} -func (s *NSService) GetNSTrafficDomainBinding() {} + var result struct { + Data []models.NSCentralManagementServer `json:"nscentralmanagementserver"` + } -// nstrafficdomain_bridgegroup_binding -func (s *NSService) AddBSTrafficDomainBridgeGroupBinding() {} -func (s *NSService) DeleteBSTrafficDomainBridgeGroupBinding() {} -func (s *NSService) GetAllBSTrafficDomainBridgeGroupBinding() {} -func (s *NSService) GetBSTrafficDomainBridgeGroupBinding() {} -func (s *NSService) CountBSTrafficDomainBridgeGroupBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nstrafficdomain_vlan_binding -func (s *NSService) AddNSTrafficDomainVLANBinding() {} -func (s *NSService) DeleteNSTrafficDomainVLANBinding() {} -func (s *NSService) GetAllNSTrafficDomainVLANBinding() {} -func (s *NSService) GetNSTrafficDomainVLANBinding() {} -func (s *NSService) CountNSTrafficDomainVLANBinding() {} + return result.Data, nil +} -// nstrafficdomain_vxlan_binding -func (s *NSService) AddNSTrafficDomainVXLANBinding() {} -func (s *NSService) DeleteNSTrafficDomainVXLANBinding() {} -func (s *NSService) GetAllNSTrafficDomainVXLANBinding() {} -func (s *NSService) GetNSTrafficDomainVXLANBinding() {} -func (s *NSService) CountNSTrafficDomainVXLANBinding() {} +func (s *NSService) GetNSCentralManagementServer(servername string) (*models.NSCentralManagementServer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsCentralManagementServerURL, servername), nil) + if err != nil { + return nil, err + } -// nsvariable -func (s *NSService) AddNSVariable() {} -func (s *NSService) DeleteNSVariable() {} -func (s *NSService) UpdateNSVariable() {} -func (s *NSService) UnsetNSVariable() {} -func (s *NSService) GetAllNSVariable() {} -func (s *NSService) GetNSVariable() {} -func (s *NSService) CountNSVariable() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// nsversion -func (s *NSService) GetAllNSVersion() {} + var result struct { + Data []models.NSCentralManagementServer `json:"nscentralmanagementserver"` + } -// nsvpxparam -func (s *NSService) UpdateNSVPXParam() {} -func (s *NSService) UnsetNSVPXParam() {} -func (s *NSService) GetAllNSVPXParam() {} -func (s *NSService) CountNSVPXParam() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// nsweblogparam -func (s *NSService) UpdateNSWebLogParam() {} -func (s *NSService) UnsetNSWebLogParam() {} -func (s *NSService) GetAllNSWebLogParam() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("nscentralmanagementserver %s not found", servername) + } -// nsxmlnamespace -func (s *NSService) AddNSXMLNamespace() {} -func (s *NSService) DeleteNSXMLNamespace() {} -func (s *NSService) UpdateNSXMLNamespace() {} -func (s *NSService) UnsetNSXMLNamespace() {} -func (s *NSService) GetAllNSXMLNamespace() {} -func (s *NSService) GetNSXMLNamespace() {} -func (s *NSService) CountNSXMLNamespace() {} + return &result.Data[0], nil +} -// reboot -func (s *NSService) Reboot() {} +func (s *NSService) CountNSCentralManagementServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsCentralManagementServerURL), nil) + if err != nil { + return 0, err + } -// shutdown -func (s *NSService) Shutdown() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSCentralManagementServer `json:"nscentralmanagementserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsconfig +func (s *NSService) ClearNSConfig(resource models.NSConfig) error { + payload := map[string]any{"nsconfig": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsConfigURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) SaveNSConfig(resource models.NSConfig) error { + payload := map[string]any{"nsconfig": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=save", nsConfigURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DiffNSConfig(resource models.NSConfig) error { + payload := map[string]any{"nsconfig": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=diff", nsConfigURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSConfig(resource models.NSConfig) error { + payload := map[string]any{"nsconfig": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsConfigURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSConfig(resource models.NSConfig) error { + payload := map[string]any{"nsconfig": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsConfigURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSConfig() ([]models.NSConfig, error) { + req, err := s.client.NewRequest(http.MethodGet, nsConfigURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSConfig `json:"nsconfig"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsconnectiontable +func (s *NSService) GetAllNSconnectionTable(args map[string]string) ([]models.NSConnectionTable, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", nsConnectionTableURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSConnectionTable `json:"nsconnectiontable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSconnectionTable(args map[string]string) (int, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + "&count=yes" + } else { + argsStr = "?count=yes" + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", nsConnectionTableURL, argsStr), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSConnectionTable `json:"nsconnectiontable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsconsoleloginprompt +func (s *NSService) UpdateNSConsoleLoginPrompt(resource models.NSConsoleLoginPrompt) error { + payload := map[string]any{"nsconsoleloginprompt": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsConsoleLoginPromptURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSConsoleLoginPrompt(resource models.NSConsoleLoginPrompt) error { + payload := map[string]any{"nsconsoleloginprompt": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsConsoleLoginPromptURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSConsoleLoginPrompt() ([]models.NSConsoleLoginPrompt, error) { + req, err := s.client.NewRequest(http.MethodGet, nsConsoleLoginPromptURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSConsoleLoginPrompt `json:"nsconsoleloginprompt"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nscqaparam +func (s *NSService) UpdateNSCQAParam(resource models.NSCQAParam) error { + payload := map[string]any{"nscqaparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsCQAParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSCQAParam(resource models.NSCQAParam) error { + payload := map[string]any{"nscqaparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsCQAParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSCQAParam() ([]models.NSCQAParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsCQAParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSCQAParam `json:"nscqaparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsdhcpip +func (s *NSService) ReleaseNSDHCPIP() error { + payload := map[string]any{"nsdhcpip": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=release", nsDHCPIPURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nsdhcpparams +func (s *NSService) UpdateNSDHCPParams(resource models.NSDHCPParams) error { + payload := map[string]any{"nsdhcpparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsDHCPParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSDHCPParams(resource models.NSDHCPParams) error { + payload := map[string]any{"nsdhcpparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsDHCPParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSDHCPParams() ([]models.NSDHCPParams, error) { + req, err := s.client.NewRequest(http.MethodGet, nsDHCPParamsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSDHCPParams `json:"nsdhcpparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsdiamter +func (s *NSService) UpdateNSDiameter(resource models.NSDiameter) error { + payload := map[string]any{"nsdiameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsDiameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSDiameter(resource models.NSDiameter) error { + payload := map[string]any{"nsdiameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsDiameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSDiameter() ([]models.NSDiameter, error) { + req, err := s.client.NewRequest(http.MethodGet, nsDiameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSDiameter `json:"nsdiameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSDiameter() (*models.NSDiameter, error) { + req, err := s.client.NewRequest(http.MethodGet, nsDiameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSDiameter `json:"nsdiameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsdiameter not found") + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSDiameter() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsDiameterURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSDiameter `json:"nsdiameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsencyrptionkey +func (s *NSService) AddNSEncryptionKey(resource models.NSEncryptionKey) error { + payload := map[string]any{"nsencryptionkey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsEncryptionKeyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSEncryptionKey(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsEncryptionKeyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSEncryptionKey(resource models.NSEncryptionKey) error { + payload := map[string]any{"nsencryptionkey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsEncryptionKeyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSEncryptionKey(resource models.NSEncryptionKey) error { + payload := map[string]any{"nsencryptionkey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsEncryptionKeyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSEncryptionKey() ([]models.NSEncryptionKey, error) { + req, err := s.client.NewRequest(http.MethodGet, nsEncryptionKeyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSEncryptionKey `json:"nsencryptionkey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSEncryptionKey(name string) (*models.NSEncryptionKey, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsEncryptionKeyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSEncryptionKey `json:"nsencryptionkey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsencryptionkey %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSEncryptionKey() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsEncryptionKeyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSEncryptionKey `json:"nsencryptionkey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsencryptionparams +func (s *NSService) UpdateNSEncryptionParams(resource models.NSEncryptionParams) error { + payload := map[string]any{"nsencryptionparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsEncryptionParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSEncryptionParams() ([]models.NSEncryptionParams, error) { + req, err := s.client.NewRequest(http.MethodGet, nsEncryptionParamsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSEncryptionParams `json:"nsencryptionparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsevents +func (s *NSService) GetAllNSEvents() ([]models.NSEvents, error) { + req, err := s.client.NewRequest(http.MethodGet, nsEventsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSEvents `json:"nsevents"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSEvents() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsEventsURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSEvents `json:"nsevents"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsextension +func (s *NSService) ImportNSExtension(resource models.NSExtension) error { + payload := map[string]any{"nsextension": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=import", nsExtensionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) AddNSExtension(resource models.NSExtension) error { + payload := map[string]any{"nsextension": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsExtensionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSExtension(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsExtensionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSExtension(resource models.NSExtension) error { + payload := map[string]any{"nsextension": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsExtensionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSExtension(resource models.NSExtension) error { + payload := map[string]any{"nsextension": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsExtensionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSExtension() ([]models.NSExtension, error) { + req, err := s.client.NewRequest(http.MethodGet, nsExtensionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtension `json:"nsextension"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSExtension(name string) (*models.NSExtension, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsExtensionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtension `json:"nsextension"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsextension %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSExtension() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsExtensionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSExtension `json:"nsextension"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ChangeNSExtension(resource models.NSExtension) error { + payload := map[string]any{"nsextension": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=change", nsExtensionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nsextension_binding +func (s *NSService) GetAllNSExtenionBinding() ([]models.NSExtensionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsExtensionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtensionBinding `json:"nsextension_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSExtenionBinding(name string) (*models.NSExtensionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsExtensionBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtensionBinding `json:"nsextension_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsextension_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// nsextension_extensionfunction_binding +func (s *NSService) GetAllNSExtensionExtensionFunctionBinding() ([]models.NSExtensionExtensionFunctionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsExtensionExtensionFunctionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtensionExtensionFunctionBinding `json:"nsextension_extensionfunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSExtensionExtensionFunctionBinding(name string) ([]models.NSExtensionExtensionFunctionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsExtensionExtensionFunctionBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSExtensionExtensionFunctionBinding `json:"nsextension_extensionfunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSExtensionExtensionFunctionBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsExtensionExtensionFunctionBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSExtensionExtensionFunctionBinding `json:"nsextension_extensionfunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsfeature +func (s *NSService) EnableNSFeature(resource models.NSFeature) error { + payload := map[string]any{"nsfeature": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsFeatureURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSFeature(resource models.NSFeature) error { + payload := map[string]any{"nsfeature": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsFeatureURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSFeature() ([]models.NSFeature, error) { + req, err := s.client.NewRequest(http.MethodGet, nsFeatureURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSFeature `json:"nsfeature"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nshardware +func (s *NSService) GetAllNSHardware() ([]models.NSHardware, error) { + req, err := s.client.NewRequest(http.MethodGet, nsHardwareURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHardware `json:"nshardware"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nshmackey +func (s *NSService) AddNSHMACKey(resource models.NSHMACKey) error { + payload := map[string]any{"nshmackey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsHMACKeyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSHMACKey(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsHMACKeyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSHMACKey(resource models.NSHMACKey) error { + payload := map[string]any{"nshmackey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsHMACKeyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSHMACKey(resource models.NSHMACKey) error { + payload := map[string]any{"nshmackey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsHMACKeyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSHMACKey() ([]models.NSHMACKey, error) { + req, err := s.client.NewRequest(http.MethodGet, nsHMACKeyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHMACKey `json:"nshmackey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSHMACKey(name string) (*models.NSHMACKey, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsHMACKeyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHMACKey `json:"nshmackey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nshmackey %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSHMACKey() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsHMACKeyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSHMACKey `json:"nshmackey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nshostname +func (s *NSService) UpdateNSHostname(resource models.NSHostname) error { + payload := map[string]any{"nshostname": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsHostnameURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSHostname() ([]models.NSHostname, error) { + req, err := s.client.NewRequest(http.MethodGet, nsHostnameURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHostname `json:"nshostname"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSHostname() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsHostnameURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSHostname `json:"nshostname"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nshttpparam +func (s *NSService) UpdateNSHTTPParam(resource models.NSHTTPParam) error { + payload := map[string]any{"nshttpparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsHTTPParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSHTTPParam() ([]models.NSHTTPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsHTTPParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHTTPParam `json:"nshttpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSHTTPParam() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsHTTPParamURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSHTTPParam `json:"nshttpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nshttpprofile +func (s *NSService) AddNSHTTPProfile(resource models.NSHTTPProfile) error { + payload := map[string]any{"nshttpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsHTTPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSHTTPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsHTTPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSHTTPProfile(resource models.NSHTTPProfile) error { + payload := map[string]any{"nshttpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsHTTPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSHTTPProfile(resource models.NSHTTPProfile) error { + payload := map[string]any{"nshttpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsHTTPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSHTTPProfile() ([]models.NSHTTPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, nsHTTPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHTTPProfile `json:"nshttpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSHTTPProfile(name string) (*models.NSHTTPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsHTTPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSHTTPProfile `json:"nshttpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nshttpprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSHTTPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsHTTPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSHTTPProfile `json:"nshttpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsicapprofile +func (s *NSService) AddNSICAPProfile(resource models.NSICAPProfile) error { + payload := map[string]any{"nsicapprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsICAPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSICAPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsICAPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSICAPProfile(resource models.NSICAPProfile) error { + payload := map[string]any{"nsicapprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsICAPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSICAPProfile(resource models.NSICAPProfile) error { + payload := map[string]any{"nsicapprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsICAPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSICAPProfile() ([]models.NSICAPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, nsICAPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSICAPProfile `json:"nsicapprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSICAPProfile(name string) (*models.NSICAPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsICAPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSICAPProfile `json:"nsicapprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsicapprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSICAPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsICAPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSICAPProfile `json:"nsicapprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsip +func (s *NSService) AddNSIP(resource models.NSIP) error { + payload := map[string]any{"nsip": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsIPURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSIP(ipaddress string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsIPURL, ipaddress), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSIP(resource models.NSIP) error { + payload := map[string]any{"nsip": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsIPURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSIP(resource models.NSIP) error { + payload := map[string]any{"nsip": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsIPURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSIP(resource models.NSIP) error { + payload := map[string]any{"nsip": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsIPURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSIP(resource models.NSIP) error { + payload := map[string]any{"nsip": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsIPURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSIP() ([]models.NSIP, error) { + req, err := s.client.NewRequest(http.MethodGet, nsIPURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSIP `json:"nsip"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSIP() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsIPURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSIP `json:"nsip"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsip6 +func (s *NSService) AddNSIP6(resource models.NSIP6) error { + payload := map[string]any{"nsip6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsIP6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSIP6(ipv6address string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsIP6URL, ipv6address), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSIP6(resource models.NSIP6) error { + payload := map[string]any{"nsip6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsIP6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSIP6(resource models.NSIP6) error { + payload := map[string]any{"nsip6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsIP6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSIP6() ([]models.NSIP6, error) { + req, err := s.client.NewRequest(http.MethodGet, nsIP6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSIP6 `json:"nsip6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSIP6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsIP6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSIP6 `json:"nsip6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslicense +func (s *NSService) GetAllNSLicense() ([]models.NSLicense, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLicenseURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLicense `json:"nslicense"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nslicenseproxyserver +func (s *NSService) AddNSLicenseProxyServer(resource models.NSLicenseProxyServer) error { + payload := map[string]any{"nslicenseproxyserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsLicenseProxyServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSLicenseProxyServer(serverip string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsLicenseProxyServerURL, serverip), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSLicenseProxyServer(resource models.NSLicenseProxyServer) error { + payload := map[string]any{"nslicenseproxyserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsLicenseProxyServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSLicenseProxyServer() ([]models.NSLicenseProxyServer, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLicenseProxyServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLicenseProxyServer `json:"nslicenseproxyserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSLicenseProxyServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsLicenseProxyServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLicenseProxyServer `json:"nslicenseproxyserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslicenseserver +func (s *NSService) AddNSLicenseServer(resource models.NSLicenseServer) error { + payload := map[string]any{"nslicenseserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsLicenseServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSLicenseServer(servername string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsLicenseServerURL, servername), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSLicenseServer(resource models.NSLicenseServer) error { + payload := map[string]any{"nslicenseserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsLicenseServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSLicenseServer() ([]models.NSLicenseServer, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLicenseServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLicenseServer `json:"nslicenseserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSLicenseServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsLicenseServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLicenseServer `json:"nslicenseserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslicenseserverpool +func (s *NSService) GetAllNSLicenseServerPool() ([]models.NSLicenseServerPool, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLicenseServerPoolURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLicenseServerPool `json:"nslicenseserverpool"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nslimitidentifier +func (s *NSService) AddNSLimitIdentifier(resource models.NSLimitIdentifier) error { + payload := map[string]any{"nslimitidentifier": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsLimitIdentifierURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSLimitIdentifier(limitidentifier string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsLimitIdentifierURL, limitidentifier), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSLimitIdentifier(resource models.NSLimitIdentifier) error { + payload := map[string]any{"nslimitidentifier": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsLimitIdentifierURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSLimitIdentifier(resource models.NSLimitIdentifier) error { + payload := map[string]any{"nslimitidentifier": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsLimitIdentifierURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSLimitIdentifier() ([]models.NSLimitIdentifier, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLimitIdentifierURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifier `json:"nslimitidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSLimitIdentifier(limitidentifier string) (*models.NSLimitIdentifier, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsLimitIdentifierURL, limitidentifier), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifier `json:"nslimitidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nslimitidentifier %s not found", limitidentifier) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSLimitIdentifier() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsLimitIdentifierURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLimitIdentifier `json:"nslimitidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslimitidentifier_binding +func (s *NSService) GetAllNSLimitIdentifierBinding() ([]models.NSLimitIdentifierBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLimitIdentifierBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifierBinding `json:"nslimitidentifier_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSLimitIdentifierBinding(limitidentifier string) (*models.NSLimitIdentifierBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsLimitIdentifierBindingURL, limitidentifier), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifierBinding `json:"nslimitidentifier_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nslimitidentifier_binding %s not found", limitidentifier) + } + + return &result.Data[0], nil +} + +// nslimitidentifier_nslimitsessions_binding +func (s *NSService) GetAllNSLimitIdentifierNSLimitSessionsBinding() ([]models.NSLimitIdentifierNSLimitSessionsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLimitIdentifierNSLimitSessionsBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifierNSLimitSessionsBinding `json:"nslimitidentifier_nslimitsessions_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSLimitIdentifierNSLimitSessionsBinding(limitidentifier string) ([]models.NSLimitIdentifierNSLimitSessionsBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsLimitIdentifierNSLimitSessionsBindingURL, limitidentifier), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitIdentifierNSLimitSessionsBinding `json:"nslimitidentifier_nslimitsessions_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSLimitIdentifierNSLimitSessionsBinding(limitidentifier string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsLimitIdentifierNSLimitSessionsBindingURL, limitidentifier), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLimitIdentifierNSLimitSessionsBinding `json:"nslimitidentifier_nslimitsessions_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslimitselector +func (s *NSService) AddNSLimitSelector(resource models.NSLimitSelector) error { + payload := map[string]any{"nslimitselector": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsLimitSelectorURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSLimitSelector(selectorname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsLimitSelectorURL, selectorname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSLimitSelector(resource models.NSLimitSelector) error { + payload := map[string]any{"nslimitselector": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsLimitSelectorURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSLimitSelector(resource models.NSLimitSelector) error { + payload := map[string]any{"nslimitselector": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsLimitSelectorURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSLimitSelector() ([]models.NSLimitSelector, error) { + req, err := s.client.NewRequest(http.MethodGet, nsLimitSelectorURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitSelector `json:"nslimitselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSLimitSelector(selectorname string) (*models.NSLimitSelector, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsLimitSelectorURL, selectorname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitSelector `json:"nslimitselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nslimitselector %s not found", selectorname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSLimitSelector() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsLimitSelectorURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLimitSelector `json:"nslimitselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nslimitsessions +func (s *NSService) GetAllNSLimitSessions(args map[string]string) ([]models.NSLimitSessions, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", nsLimitSessionsURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSLimitSessions `json:"nslimitsessions"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSLimitSessions(args map[string]string) (int, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + "&count=yes" + } else { + argsStr = "?count=yes" + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", nsLimitSessionsURL, argsStr), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSLimitSessions `json:"nslimitsessions"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ClearNSLimitSessions(resource models.NSLimitSessions) error { + payload := map[string]any{"nslimitsessions": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsLimitSessionsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nsmigration +func (s *NSService) GetAllNSMigration() ([]models.NSMigration, error) { + req, err := s.client.NewRequest(http.MethodGet, nsMigrationURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSMigration `json:"nsmigration"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSMigration() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsMigrationURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSMigration `json:"nsmigration"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsmode +func (s *NSService) EnableNSMode(resource models.NSMode) error { + payload := map[string]any{"nsmode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsModeURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSMode(resource models.NSMode) error { + payload := map[string]any{"nsmode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsModeURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSMode() ([]models.NSMode, error) { + req, err := s.client.NewRequest(http.MethodGet, nsModeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSMode `json:"nsmode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsparam +func (s *NSService) UpdateNSParam(resource models.NSParam) error { + payload := map[string]any{"nsparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSParam(resource models.NSParam) error { + payload := map[string]any{"nsparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSParam() ([]models.NSParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSParam `json:"nsparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nspartition +func (s *NSService) AddNSPartition(resource models.NSPartition) error { + payload := map[string]any{"nspartition": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPartitionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPartition(partitionname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPartitionURL, partitionname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSPartition(resource models.NSPartition) error { + payload := map[string]any{"nspartition": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsPartitionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSPartition(resource models.NSPartition) error { + payload := map[string]any{"nspartition": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsPartitionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) SwitchNSPartition(resource models.NSPartition) error { + payload := map[string]any{"nspartition": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=switch", nsPartitionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPartition() ([]models.NSPartition, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartition `json:"nspartition"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPartition(partitionname string) (*models.NSPartition, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPartitionURL, partitionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartition `json:"nspartition"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nspartition %s not found", partitionname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSPartition() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsPartitionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPartition `json:"nspartition"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspartitionmac +func (s *NSService) GetAllNSPartitionMAC() ([]models.NSPartitionMac, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionMACURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionMac `json:"nspartitionmac"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSPartitionMAC() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsPartitionMACURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPartitionMac `json:"nspartitionmac"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspartition_binding +func (s *NSService) GetAllNSPartitionBinding() ([]models.NSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionBinding `json:"nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPartitionBinding(partitionname string) (*models.NSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPartitionBindingURL, partitionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionBinding `json:"nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nspartition_binding %s not found", partitionname) + } + + return &result.Data[0], nil +} + +// nspartition_bridgegroup_binding +func (s *NSService) AddNSPartitionBridgeGroupBinding(resource models.NSPartitionBridgeGroupBinding) error { + payload := map[string]any{"nspartition_bridgegroup_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPartitionBridgeGroupBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPartitionBridgeGroupBinding(partitionname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPartitionBridgeGroupBindingURL, partitionname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPartitionBridgeGroupBinding() ([]models.NSPartitionBridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionBridgeGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionBridgeGroupBinding `json:"nspartition_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPartitionBridgeGroupBinding(partitionname string) ([]models.NSPartitionBridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPartitionBridgeGroupBindingURL, partitionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionBridgeGroupBinding `json:"nspartition_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSPartitionBridgeGroupBinding(partitionname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsPartitionBridgeGroupBindingURL, partitionname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPartitionBridgeGroupBinding `json:"nspartition_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspartition_vlan_binding +func (s *NSService) AddNSPartitionVLANBinding(resource models.NSPartitionVlanBinding) error { + payload := map[string]any{"nspartition_vlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPartitionVlanBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPartitionVLANBinding(partitionname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPartitionVlanBindingURL, partitionname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPartitionVLANBinding() ([]models.NSPartitionVlanBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionVlanBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionVlanBinding `json:"nspartition_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPartitionVLANBinding(partitionname string) ([]models.NSPartitionVlanBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPartitionVlanBindingURL, partitionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionVlanBinding `json:"nspartition_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSPartitionVLANBinding(partitionname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsPartitionVlanBindingURL, partitionname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPartitionVlanBinding `json:"nspartition_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspartition_vxlan_binding +func (s *NSService) AddNSPartitionVXLANBinding(resource models.NSPartitionVXLANBinding) error { + payload := map[string]any{"nspartition_vxlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPartitionVXLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPartitionVXLANBinding(partitionname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPartitionVXLANBindingURL, partitionname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPartitionVXLANBinding() ([]models.NSPartitionVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPartitionVXLANBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionVXLANBinding `json:"nspartition_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPartitionVXLANBinding(partitionname string) ([]models.NSPartitionVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPartitionVXLANBindingURL, partitionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPartitionVXLANBinding `json:"nspartition_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSPartitionVXLANBinding(partitionname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsPartitionVXLANBindingURL, partitionname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPartitionVXLANBinding `json:"nspartition_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspbr +func (s *NSService) AddNSPBR(resource models.NSPBR) error { + payload := map[string]any{"nspbr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPBRURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPBR(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPBRURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSPBR(resource models.NSPBR) error { + payload := map[string]any{"nspbr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsPBRURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSPBR(resource models.NSPBR) error { + payload := map[string]any{"nspbr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsPBRURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSPBR(resource models.NSPBR) error { + payload := map[string]any{"nspbr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsPBRURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSPBR(resource models.NSPBR) error { + payload := map[string]any{"nspbr": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsPBRURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPBR() ([]models.NSPBR, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPBRURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPBR `json:"nspbr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPBR(name string) (*models.NSPBR, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPBRURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPBR `json:"nspbr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nspbr %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSPBR() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsPBRURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPBR `json:"nspbr"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nspbr6 +func (s *NSService) AddNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsPBR6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSPBR6(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsPBR6URL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsPBR6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) RenumberNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=renumber", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSPBR6() ([]models.NSPBR6, error) { + req, err := s.client.NewRequest(http.MethodGet, nsPBR6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPBR6 `json:"nspbr6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSPBR6(name string) (*models.NSPBR6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsPBR6URL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSPBR6 `json:"nspbr6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nspbr6 %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSPBR6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsPBR6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSPBR6 `json:"nspbr6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ClearNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ApplyNSPBR6(resource models.NSPBR6) error { + payload := map[string]any{"nspbr6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=apply", nsPBR6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nspbrs +func (s *NSService) RenumberNSPBRs() error { + payload := map[string]any{"nspbrs": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=renumber", nsPBRsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ClearNSPBRs() error { + payload := map[string]any{"nspbrs": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsPBRsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) ApplyNSPBRs() error { + payload := map[string]any{"nspbrs": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=apply", nsPBRsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nsratecontrol +func (s *NSService) UpdateNSrateControl(resource models.NSRateControl) error { + payload := map[string]any{"nsratecontrol": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsRateControlURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSrateControl(resource models.NSRateControl) error { + payload := map[string]any{"nsratecontrol": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsRateControlURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSrateControl() ([]models.NSRateControl, error) { + req, err := s.client.NewRequest(http.MethodGet, nsRateControlURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSRateControl `json:"nsratecontrol"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsrollbackcmd +func (s *NSService) GetAllNSRollBackCMD() ([]models.NSRollbackCmd, error) { + req, err := s.client.NewRequest(http.MethodGet, nsRollBackCMDURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSRollbackCmd `json:"nsrollbackcmd"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsrpcnode +func (s *NSService) UpdateNSRPCNode(resource models.NSRPCNode) error { + payload := map[string]any{"nsrpcnode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsRPCNodeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSRPCNode(resource models.NSRPCNode) error { + payload := map[string]any{"nsrpcnode": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsRPCNodeURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSRPCNode() ([]models.NSRPCNode, error) { + req, err := s.client.NewRequest(http.MethodGet, nsRPCNodeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSRPCNode `json:"nsrpcnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSRPCNode(ipaddress string) (*models.NSRPCNode, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsRPCNodeURL, ipaddress), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSRPCNode `json:"nsrpcnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsrpcnode %s not found", ipaddress) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSRPCNode() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsRPCNodeURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSRPCNode `json:"nsrpcnode"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsrunningconfig +func (s *NSService) GetAllNSRunningConfig() ([]models.NSRunningConfig, error) { + req, err := s.client.NewRequest(http.MethodGet, nsRunningConfigURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSRunningConfig `json:"nsrunningconfig"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nssavedconfig +func (s *NSService) GetAllNSSavedConfig() ([]models.NSSavedConfig, error) { + req, err := s.client.NewRequest(http.MethodGet, nsSavedConfigURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSavedConfig `json:"nssavedconfig"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsservicefunction +func (s *NSService) AddNSServiceFunction(resource models.NSServiceFunction) error { + payload := map[string]any{"nsservicefunction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsServiceFunctionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSServiceFunction(servicefunctionname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsServiceFunctionURL, servicefunctionname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSServiceFunction() ([]models.NSServiceFunction, error) { + req, err := s.client.NewRequest(http.MethodGet, nsServiceFunctionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServiceFunction `json:"nsservicefunction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSServiceFunction(servicefunctionname string) (*models.NSServiceFunction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsServiceFunctionURL, servicefunctionname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServiceFunction `json:"nsservicefunction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsservicefunction %s not found", servicefunctionname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSServiceFunction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsServiceFunctionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSServiceFunction `json:"nsservicefunction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsservicepath +func (s *NSService) AddNSServicePath(resource models.NSServicePath) error { + payload := map[string]any{"nsservicepath": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsServicePathURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSServicePath(servicepathname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsServicePathURL, servicepathname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSServicePath() ([]models.NSServicePath, error) { + req, err := s.client.NewRequest(http.MethodGet, nsServicePathURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePath `json:"nsservicepath"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSServicePath(servicepathname string) (*models.NSServicePath, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsServicePathURL, servicepathname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePath `json:"nsservicepath"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsservicepath %s not found", servicepathname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSServicePath() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsServicePathURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSServicePath `json:"nsservicepath"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsservicepath_binding +func (s *NSService) GetAllNSServicePathBinding() ([]models.NSServicePathBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsServicePathBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePathBinding `json:"nsservicepath_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSServicePathBinding(servicepathname string) (*models.NSServicePathBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsServicePathBindingURL, servicepathname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePathBinding `json:"nsservicepath_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsservicepath_binding %s not found", servicepathname) + } + + return &result.Data[0], nil +} + +// nsservicepath_nsservicefunction_binding +func (s *NSService) AddNSServicePathNSServiceFunctionBinding(resource models.NSServicePathNSServiceFunctionBinding) error { + payload := map[string]any{"nsservicepath_nsservicefunction_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsServicePathNSServiceFunctionBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSServicePathNSServiceFunctionBinding(servicepathname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsServicePathNSServiceFunctionBindingURL, servicepathname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSServicePathNSServiceFunctionBinding() ([]models.NSServicePathNSServiceFunctionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsServicePathNSServiceFunctionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePathNSServiceFunctionBinding `json:"nsservicepath_nsservicefunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSServicePathNSServiceFunctionBinding(servicepathname string) ([]models.NSServicePathNSServiceFunctionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsServicePathNSServiceFunctionBindingURL, servicepathname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSServicePathNSServiceFunctionBinding `json:"nsservicepath_nsservicefunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSServicePathNSServiceFunctionBinding(servicepathname string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsServicePathNSServiceFunctionBindingURL, servicepathname), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSServicePathNSServiceFunctionBinding `json:"nsservicepath_nsservicefunction_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nssimpleacl +func (s *NSService) AddNSSimpleACL(resource models.NSSimpleACL) error { + payload := map[string]any{"nssimpleacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsSimpleACLURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSSimpleACL(aclname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsSimpleACLURL, aclname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) FlushNSSimpleACL() error { + payload := map[string]any{"nssimpleacl": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", nsSimpleACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSSimpleACL() ([]models.NSSimpleACL, error) { + req, err := s.client.NewRequest(http.MethodGet, nsSimpleACLURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSimpleACL `json:"nssimpleacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSSimpleACL(aclname string) (*models.NSSimpleACL, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsSimpleACLURL, aclname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSimpleACL `json:"nssimpleacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nssimpleacl %s not found", aclname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSSimpleACL() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsSimpleACLURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSSimpleACL `json:"nssimpleacl"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ClearNSSimpleACL(resource models.NSSimpleACL) error { + payload := map[string]any{"nssimpleacl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsSimpleACLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nssimpleacl6 +func (s *NSService) AddNSSimpleACL6(resource models.NSSimpleACL6) error { + payload := map[string]any{"nssimpleacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsSimpleACL6URL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSSimpleACL6(aclname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsSimpleACL6URL, aclname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) FlushNSSimpleACL6() error { + payload := map[string]any{"nssimpleacl6": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", nsSimpleACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSSimpleACL6() ([]models.NSSimpleACL6, error) { + req, err := s.client.NewRequest(http.MethodGet, nsSimpleACL6URL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSimpleACL6 `json:"nssimpleacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSSimpleACL6(aclname string) (*models.NSSimpleACL6, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsSimpleACL6URL, aclname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSimpleACL6 `json:"nssimpleacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nssimpleacl6 %s not found", aclname) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSSimpleACL6() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsSimpleACL6URL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSSimpleACL6 `json:"nssimpleacl6"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ClearNSSimpleACL6(resource models.NSSimpleACL6) error { + payload := map[string]any{"nssimpleacl6": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsSimpleACL6URL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nssourceroutecachetable +func (s *NSService) FlushNSSourceRouteCacheTable() error { + payload := map[string]any{"nssourceroutecachetable": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", nsSourceRouteCacheTableURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSSourceRouteCacheTable() ([]models.NSSourceRouteCacheTable, error) { + req, err := s.client.NewRequest(http.MethodGet, nsSourceRouteCacheTableURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSourceRouteCacheTable `json:"nssourceroutecachetable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSSourceRouteCacheTable() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsSourceRouteCacheTableURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSSourceRouteCacheTable `json:"nssourceroutecachetable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsspparams +func (s *NSService) UpdateNSSPParams(resource models.NSSPParams) error { + payload := map[string]any{"nsspparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsSPParamsURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} +func (s *NSService) UnsetNSSPParams(resource models.NSSPParams) error { + payload := map[string]any{"nsspparams": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsSPParamsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSSPParams() ([]models.NSSPParams, error) { + req, err := s.client.NewRequest(http.MethodGet, nsSPParamsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSSPParams `json:"nsspparams"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsstats +func (s *NSService) ClearNSStats(resource models.NSStats) error { + payload := map[string]any{"nsstats": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsStatsURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nssurgeq +func (s *NSService) FlushNSSurgeQ() error { + payload := map[string]any{"nssurgeq": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=flush", nsSurgeQURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nstcpbufparam +func (s *NSService) UpdateNSTCPBufParam(resource models.NSTCPBufParam) error { + payload := map[string]any{"nstcpbufparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsTCPBufParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSTCPBufParam(resource models.NSTCPBufParam) error { + payload := map[string]any{"nstcpbufparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsTCPBufParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTCPBufParam() ([]models.NSTCPBufParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTCPBufParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTCPBufParam `json:"nstcpbufparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nstcpparam +func (s *NSService) UpdateNSTCPParam(resource models.NSTCPParam) error { + payload := map[string]any{"nstcpparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsTCPParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSTCPParam(resource models.NSTCPParam) error { + payload := map[string]any{"nstcpparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsTCPParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTCPParam() ([]models.NSTCPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTCPParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTCPParam `json:"nstcpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nstcpprofile +func (s *NSService) AddNSTCPProfile(resource models.NSTCPProfile) error { + payload := map[string]any{"nstcpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTCPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTCPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTCPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSTCPProfile(resource models.NSTCPProfile) error { + payload := map[string]any{"nstcpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsTCPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSTCPProfile(resource models.NSTCPProfile) error { + payload := map[string]any{"nstcpprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsTCPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTCPProfile() ([]models.NSTCPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTCPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTCPProfile `json:"nstcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTCPProfile(name string) (*models.NSTCPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTCPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTCPProfile `json:"nstcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstcpprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSTCPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsTCPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTCPProfile `json:"nstcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nstimeout +func (s *NSService) UpdateNSTimeout(resource models.NSTimeout) error { + payload := map[string]any{"nstimeout": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsTimeoutURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSTimeout(resource models.NSTimeout) error { + payload := map[string]any{"nstimeout": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsTimeoutURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTimeout() ([]models.NSTimeout, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimeoutURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimeout `json:"nstimeout"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nstimer +func (s *NSService) AddNSTimer(resource models.NSTimer) error { + payload := map[string]any{"nstimer": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTimerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTimer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTimerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSTimer(resource models.NSTimer) error { + payload := map[string]any{"nstimer": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsTimerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSTimer(resource models.NSTimer) error { + payload := map[string]any{"nstimer": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsTimerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTimer() ([]models.NSTimer, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimer `json:"nstimer"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTimer(name string) (*models.NSTimer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTimerURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimer `json:"nstimer"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstimer %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSTimer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsTimerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTimer `json:"nstimer"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) RenameNSTimer(resource models.NSTimer) error { + payload := map[string]any{"nstimer": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", nsTimerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nstimer_autoscalepolicy_binding +func (s *NSService) AddNSTimerAutoScalePolicyBinding(resource models.NSTimerAutoScalePolicyBinding) error { + payload := map[string]any{"nstimer_autoscalepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTimerAutoScalePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTimerAutoScalePolicyBinding(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTimerAutoScalePolicyBindingURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTimerAutoScalePolicyBinding() ([]models.NSTimerAutoScalePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimerAutoScalePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimerAutoScalePolicyBinding `json:"nstimer_autoscalepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTimerAutoScalePolicyBinding(name string) ([]models.NSTimerAutoScalePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTimerAutoScalePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimerAutoScalePolicyBinding `json:"nstimer_autoscalepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSTimerAutoScalePolicyBinding(name string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsTimerAutoScalePolicyBindingURL, name), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTimerAutoScalePolicyBinding `json:"nstimer_autoscalepolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nstimer_binding +func (s *NSService) GetAllNSTimerBinding() ([]models.NSTimerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimerBinding `json:"nstimer_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTimerBinding(name string) (*models.NSTimerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTimerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimerBinding `json:"nstimer_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstimer_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// nstimezone +func (s *NSService) GetAllNSTimeZone() ([]models.NSTimeZone, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimeZoneURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimeZone `json:"nstimezone"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTimeZone() (*models.NSTimeZone, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTimeZoneURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTimeZone `json:"nstimezone"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstimezone not found") + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSTimeZone() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsTimeZoneURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTimeZone `json:"nstimezone"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nstrafficdomain +func (s *NSService) AddNSTrafficDomain(resource models.NSTrafficDomain) error { + payload := map[string]any{"nstrafficdomain": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTrafficDomainURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTrafficDomain(td string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTrafficDomainURL, td), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) EnableNSTrafficDomain(resource models.NSTrafficDomain) error { + payload := map[string]any{"nstrafficdomain": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", nsTrafficDomainURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DisableNSTrafficDomain(resource models.NSTrafficDomain) error { + payload := map[string]any{"nstrafficdomain": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", nsTrafficDomainURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTrafficDomain() ([]models.NSTrafficDomain, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTrafficDomainURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomain `json:"nstrafficdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTrafficDomain(td string) (*models.NSTrafficDomain, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTrafficDomainURL, td), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomain `json:"nstrafficdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstrafficdomain %s not found", td) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSTrafficDomain() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsTrafficDomainURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTrafficDomain `json:"nstrafficdomain"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +func (s *NSService) ClearNSTrafficDomain(resource models.NSTrafficDomain) error { + payload := map[string]any{"nstrafficdomain": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=clear", nsTrafficDomainURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// nstrafficdomain_binding +func (s *NSService) GetAllNSTrafficDomainBinding() ([]models.NSTrafficDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTrafficDomainBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainBinding `json:"nstrafficdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTrafficDomainBinding(td string) (*models.NSTrafficDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTrafficDomainBindingURL, td), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainBinding `json:"nstrafficdomain_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nstrafficdomain_binding %s not found", td) + } + + return &result.Data[0], nil +} + +// nstrafficdomain_bridgegroup_binding +func (s *NSService) AddNSTrafficDomainBridgeGroupBinding(resource models.NSTrafficDomainBridgeGroupBinding) error { + payload := map[string]any{"nstrafficdomain_bridgegroup_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTrafficDomainBridgeGroupBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTrafficDomainBridgeGroupBinding(td string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTrafficDomainBridgeGroupBindingURL, td), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTrafficDomainBridgeGroupBinding() ([]models.NSTrafficDomainBridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTrafficDomainBridgeGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainBridgeGroupBinding `json:"nstrafficdomain_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTrafficDomainBridgeGroupBinding(td string) ([]models.NSTrafficDomainBridgeGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTrafficDomainBridgeGroupBindingURL, td), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainBridgeGroupBinding `json:"nstrafficdomain_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSTrafficDomainBridgeGroupBinding(td string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsTrafficDomainBridgeGroupBindingURL, td), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTrafficDomainBridgeGroupBinding `json:"nstrafficdomain_bridgegroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nstrafficdomain_vlan_binding +func (s *NSService) AddNSTrafficDomainVLANBinding(resource models.NSTrafficDomainVLANBinding) error { + payload := map[string]any{"nstrafficdomain_vlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTrafficDomainVLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTrafficDomainVLANBinding(td string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTrafficDomainVLANBindingURL, td), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTrafficDomainVLANBinding() ([]models.NSTrafficDomainVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTrafficDomainVLANBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainVLANBinding `json:"nstrafficdomain_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTrafficDomainVLANBinding(td string) ([]models.NSTrafficDomainVLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTrafficDomainVLANBindingURL, td), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainVLANBinding `json:"nstrafficdomain_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSTrafficDomainVLANBinding(td string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsTrafficDomainVLANBindingURL, td), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTrafficDomainVLANBinding `json:"nstrafficdomain_vlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nstrafficdomain_vxlan_binding +func (s *NSService) AddNSTrafficDomainVXLANBinding(resource models.NSTrafficDomainVXLANBinding) error { + payload := map[string]any{"nstrafficdomain_vxlan_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsTrafficDomainVXLANBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSTrafficDomainVXLANBinding(td string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsTrafficDomainVXLANBindingURL, td), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSTrafficDomainVXLANBinding() ([]models.NSTrafficDomainVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, nsTrafficDomainVXLANBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainVXLANBinding `json:"nstrafficdomain_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSTrafficDomainVXLANBinding(td string) ([]models.NSTrafficDomainVXLANBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsTrafficDomainVXLANBindingURL, td), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSTrafficDomainVXLANBinding `json:"nstrafficdomain_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSTrafficDomainVXLANBinding(td string) (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s?count=yes", nsTrafficDomainVXLANBindingURL, td), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSTrafficDomainVXLANBinding `json:"nstrafficdomain_vxlan_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsvariable +func (s *NSService) AddNSVariable(resource models.NSVariable) error { + payload := map[string]any{"nsvariable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsVariableURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSVariable(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsVariableURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSVariable(resource models.NSVariable) error { + payload := map[string]any{"nsvariable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsVariableURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSVariable(resource models.NSVariable) error { + payload := map[string]any{"nsvariable": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsVariableURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSVariable() ([]models.NSVariable, error) { + req, err := s.client.NewRequest(http.MethodGet, nsVariableURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSVariable `json:"nsvariable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSVariable(name string) (*models.NSVariable, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsVariableURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSVariable `json:"nsvariable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsvariable %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSVariable() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsVariableURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSVariable `json:"nsvariable"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsversion +func (s *NSService) GetAllNSVersion() ([]models.NSVersion, error) { + req, err := s.client.NewRequest(http.MethodGet, nsVersionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSVersion `json:"nsversion"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsvpxparam +func (s *NSService) UpdateNSVPXParam(resource models.NSVPXParam) error { + payload := map[string]any{"nsvpxparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsVPXParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSVPXParam(resource models.NSVPXParam) error { + payload := map[string]any{"nsvpxparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsVPXParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSVPXParam() ([]models.NSVPXParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsVPXParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSVPXParam `json:"nsvpxparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) CountNSVPXParam() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsVPXParamURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSVPXParam `json:"nsvpxparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// nsweblogparam +func (s *NSService) UpdateNSWebLogParam(resource models.NSWebLogParam) error { + payload := map[string]any{"nsweblogparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsWeblogParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSWebLogParam(resource models.NSWebLogParam) error { + payload := map[string]any{"nsweblogparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsWeblogParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSWebLogParam() ([]models.NSWebLogParam, error) { + req, err := s.client.NewRequest(http.MethodGet, nsWeblogParamURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSWebLogParam `json:"nsweblogparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// nsxmlnamespace +func (s *NSService) AddNSXMLNamespace(resource models.NSXMLNamespace) error { + payload := map[string]any{"nsxmlnamespace": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, nsXMLNamespaceURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) DeleteNSXMLNamespace(prefix string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", nsXMLNamespaceURL, prefix), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UpdateNSXMLNamespace(resource models.NSXMLNamespace) error { + payload := map[string]any{"nsxmlnamespace": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, nsXMLNamespaceURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) UnsetNSXMLNamespace(resource models.NSXMLNamespace) error { + payload := map[string]any{"nsxmlnamespace": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", nsXMLNamespaceURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NSService) GetAllNSXMLNamespace() ([]models.NSXMLNamespace, error) { + req, err := s.client.NewRequest(http.MethodGet, nsXMLNamespaceURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSXMLNamespace `json:"nsxmlnamespace"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *NSService) GetNSXMLNamespace(prefix string) (*models.NSXMLNamespace, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", nsXMLNamespaceURL, prefix), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.NSXMLNamespace `json:"nsxmlnamespace"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("nsxmlnamespace %s not found", prefix) + } + + return &result.Data[0], nil +} + +func (s *NSService) CountNSXMLNamespace() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", nsXMLNamespaceURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.NSXMLNamespace `json:"nsxmlnamespace"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// reboot +func (s *NSService) Reboot() error { + payload := map[string]any{"reboot": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, rebootURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// shutdown +func (s *NSService) Shutdown() error { + payload := map[string]any{"shutdown": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, shutdownURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/ntp.go b/nitrogo/ntp.go index 94efdc4..c90c409 100644 --- a/nitrogo/ntp.go +++ b/nitrogo/ntp.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( ntpParamURL = "/nitro/v1/config/ntpparam" ntpServerURL = "/nitro/v1/config/ntpserver" @@ -16,28 +26,290 @@ type NTPService struct { // ntpparam // Configuration for NTP parameter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ntp/ntpparam -func (s *NTPService) UpdateNTPParam() {} -func (s *NTPService) UnsetNTPParam() {} -func (s *NTPService) GetAllNTPParam() {} + +func (s *NTPService) UpdateNTPParam(param models.NTPParam) error { + payload := map[string]any{ + "ntpparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, ntpParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) UnsetNTPParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "ntpparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ntpParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) GetAllNTPParam() (models.NTPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, ntpParamURL, nil) + if err != nil { + return models.NTPParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.NTPParam{}, err + } + + var result struct { + NTPParams []models.NTPParam `json:"ntpparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.NTPParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.NTPParams) > 0 { + return result.NTPParams[0], nil + } + + return models.NTPParam{}, nil +} // ntpserver // Configuration for NTP server resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ntp/ntpserver -func (s *NTPService) AddNTPServer() {} -func (s *NTPService) DeleteNTPServer() {} -func (s *NTPService) UpdateNTPServer() {} -func (s *NTPService) UnsetNTPServer() {} -func (s *NTPService) GetAllNTPServer() {} -func (s *NTPService) CountNTPServer() {} + +func (s *NTPService) AddNTPServer(server models.NTPServer) error { + payload := map[string]any{ + "ntpserver": server, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ntpServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) DeleteNTPServer(serverip string, servername string) error { + reqURL := fmt.Sprintf("%s/%s", ntpServerURL, serverip) + if servername != "" { + reqURL += "?args=servername:" + url.QueryEscape(servername) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) UpdateNTPServer(server models.NTPServer) error { + payload := map[string]any{ + "ntpserver": server, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, ntpServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) UnsetNTPServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "ntpserver": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ntpServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) GetAllNTPServer() ([]models.NTPServer, error) { + req, err := s.client.NewRequest(http.MethodGet, ntpServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + NTPServers []models.NTPServer `json:"ntpserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.NTPServers, nil +} + +func (s *NTPService) CountNTPServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, ntpServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + NTPServers []struct { + Count float64 `json:"__count"` + } `json:"ntpserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.NTPServers) > 0 { + return result.NTPServers[0].Count, nil + } + + return 0, nil +} // ntpstatus // Configuration for ntp status resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ntp/ntpstatus -func (s *NTPService) GetAllNTPStatus() {} + +func (s *NTPService) GetAllNTPStatus() ([]models.NTPStatus, error) { + req, err := s.client.NewRequest(http.MethodGet, ntpStatusURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + NTPStatus []models.NTPStatus `json:"ntpstatus"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.NTPStatus, nil +} // ntpsync // Configuration for NTP sync resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ntp/ntpsync -func (s *NTPService) EnableNTPSync() {} -func (s *NTPService) DisableNTPSync() {} -func (s *NTPService) GetAllNTPSync() {} + +func (s *NTPService) EnableNTPSync() error { + payload := map[string]any{ + "ntpsync": map[string]any{}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ntpSyncURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) DisableNTPSync() error { + payload := map[string]any{ + "ntpsync": map[string]any{}, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ntpSyncURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *NTPService) GetAllNTPSync() ([]models.NTPSync, error) { + req, err := s.client.NewRequest(http.MethodGet, ntpSyncURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + NTPSync []models.NTPSync `json:"ntpsync"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.NTPSync, nil +} diff --git a/nitrogo/pcp.go b/nitrogo/pcp.go index 2af6daf..413cf29 100644 --- a/nitrogo/pcp.go +++ b/nitrogo/pcp.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( pcpMapURL = "/nitro/v1/config/pcpmap" pcpProfileURL = "/nitro/v1/config/pcpprofile" @@ -15,27 +24,355 @@ type PCPService struct { // pcpmap // Configuration for server resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/pcp/pcpmap -func (s *PCPService) GetAllPCPMap() {} -func (s *PCPService) CountPCPMap() {} + +func (s *PCPService) GetAllPCPMap() ([]models.PCPMap, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpMapURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + PCPMaps []models.PCPMap `json:"pcpmap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.PCPMaps, nil +} + +func (s *PCPService) CountPCPMap() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpMapURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + PCPMaps []struct { + Count float64 `json:"__count"` + } `json:"pcpmap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.PCPMaps) > 0 { + return result.PCPMaps[0].Count, nil + } + + return 0, nil +} // pcpprofile // Configuration for PCP Profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/pcp/pcpprofile -func (s *PCPService) AddPCPProfile() {} -func (s *PCPService) DeletePCPProfile() {} -func (s *PCPService) UpdatePCPProfile() {} -func (s *PCPService) UnsetPCPProfile() {} -func (s *PCPService) GetAllPCPProfile() {} -func (s *PCPService) GetPCPProfile() {} -func (s *PCPService) CountPCPProfile() {} + +func (s *PCPService) AddPCPProfile(profile models.PCPProfile) error { + payload := map[string]any{ + "pcpprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, pcpProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) DeletePCPProfile(name string) error { + url := fmt.Sprintf("%s/%s", pcpProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) UpdatePCPProfile(profile models.PCPProfile) error { + payload := map[string]any{ + "pcpprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, pcpProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) UnsetPCPProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "pcpprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, pcpProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) GetAllPCPProfile() ([]models.PCPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + PCPProfiles []models.PCPProfile `json:"pcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.PCPProfiles, nil +} + +func (s *PCPService) GetPCPProfile(name string) ([]models.PCPProfile, error) { + url := fmt.Sprintf("%s/%s", pcpProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + PCPProfiles []models.PCPProfile `json:"pcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.PCPProfiles, nil +} + +func (s *PCPService) CountPCPProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + PCPProfiles []struct { + Count float64 `json:"__count"` + } `json:"pcpprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.PCPProfiles) > 0 { + return result.PCPProfiles[0].Count, nil + } + + return 0, nil +} // pcpserver // Configuration for server resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/pcp/pcpserver -func (s *PCPService) AddPCPServer() {} -func (s *PCPService) DeletePCPServer() {} -func (s *PCPService) UpdatePCPServer() {} -func (s *PCPService) UnsetPCPServer() {} -func (s *PCPService) GetAllPCPServer() {} -func (s *PCPService) GetPCPServer() {} -func (s *PCPService) CountPCPServer() {} + +func (s *PCPService) AddPCPServer(server models.PCPServer) error { + payload := map[string]any{ + "pcpserver": server, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, pcpServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) DeletePCPServer(name string) error { + url := fmt.Sprintf("%s/%s", pcpServerURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) UpdatePCPServer(server models.PCPServer) error { + payload := map[string]any{ + "pcpserver": server, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, pcpServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) UnsetPCPServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "pcpserver": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, pcpServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *PCPService) GetAllPCPServer() ([]models.PCPServer, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + PCPServers []models.PCPServer `json:"pcpserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.PCPServers, nil +} + +func (s *PCPService) GetPCPServer(name string) ([]models.PCPServer, error) { + url := fmt.Sprintf("%s/%s", pcpServerURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + PCPServers []models.PCPServer `json:"pcpserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.PCPServers, nil +} + +func (s *PCPService) CountPCPServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, pcpServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + PCPServers []struct { + Count float64 `json:"__count"` + } `json:"pcpserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.PCPServers) > 0 { + return result.PCPServers[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/policy.go b/nitrogo/policy.go index c576331..4d6ad05 100644 --- a/nitrogo/policy.go +++ b/nitrogo/policy.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( policyDatasetURL = "/nitro/v1/config/policydataset" policyDatasetBindingURL = "/nitro/v1/config/policydataset_binding" @@ -25,105 +35,1370 @@ type PolicyService struct { } // policydataset -func (s *PolicyService) AddPolicyDataset() {} -func (s *PolicyService) DeletePolicyDataset() {} -func (s *PolicyService) UpdatePolicyDataset() {} -func (s *PolicyService) UnsetPolicyDataset() {} -func (s *PolicyService) GetAllPolicyDataset() {} -func (s *PolicyService) GetPolicyDataset() {} -func (s *PolicyService) CountPolicyDataset() {} + +func (s *PolicyService) AddPolicyDataset(dataset models.PolicyDataset) error { + payload := map[string]any{ + "policydataset": dataset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyDatasetURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyDataset(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyDatasetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UpdatePolicyDataset(dataset models.PolicyDataset) error { + payload := map[string]any{ + "policydataset": dataset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyDatasetURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyDataset(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policydataset": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyDatasetURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyDataset() ([]models.PolicyDataset, error) { + req, err := s.client.NewRequest(http.MethodGet, policyDatasetURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Datasets []models.PolicyDataset `json:"policydataset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Datasets, nil +} + +func (s *PolicyService) GetPolicyDataset(name string) ([]models.PolicyDataset, error) { + reqURL := fmt.Sprintf("%s/%s", policyDatasetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Datasets []models.PolicyDataset `json:"policydataset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Datasets, nil +} + +func (s *PolicyService) CountPolicyDataset() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyDatasetURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Datasets []struct { + Count float64 `json:"__count"` + } `json:"policydataset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Datasets) > 0 { + return result.Datasets[0].Count, nil + } + return 0, nil +} // policydataset_binding -func (s *PolicyService) GetAllPolicyDatasetBinding() {} -func (s *PolicyService) GetPolicyDatasetBinding() {} + +func (s *PolicyService) GetAllPolicyDatasetBinding() ([]models.PolicyDatasetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyDatasetBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyDatasetBinding `json:"policydataset_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyDatasetBinding(name string) ([]models.PolicyDatasetBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyDatasetBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyDatasetBinding `json:"policydataset_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // policydataset_value_binding -func (s *PolicyService) AddPolicyDatasetValueBinding() {} -func (s *PolicyService) DeletePolicyDatasetValueBinding() {} -func (s *PolicyService) GetAllPolicyDatasetValueBinding() {} -func (s *PolicyService) GetPolicyDatasetValueBinding() {} -func (s *PolicyService) CountPolicyDatasetValueBinding() {} + +func (s *PolicyService) AddPolicyDatasetValueBinding(binding models.PolicyDatasetValueBinding) error { + payload := map[string]any{ + "policydataset_value_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyDatasetValueBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyDatasetValueBinding(name, value string) error { + reqURL := fmt.Sprintf("%s/%s?args=value:%s", policyDatasetValueBindingURL, url.QueryEscape(name), url.QueryEscape(value)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyDatasetValueBinding() ([]models.PolicyDatasetValueBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyDatasetValueBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyDatasetValueBinding `json:"policydataset_value_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyDatasetValueBinding(name string) ([]models.PolicyDatasetValueBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyDatasetValueBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyDatasetValueBinding `json:"policydataset_value_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) CountPolicyDatasetValueBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", policyDatasetValueBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"policydataset_value_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // policyevaluation -func (s *PolicyService) GetAllPolicyEvaluation() {} -func (s *PolicyService) CountPolicyEvaluation() {} + +func (s *PolicyService) GetAllPolicyEvaluation() ([]models.PolicyEvaluation, error) { + req, err := s.client.NewRequest(http.MethodGet, policyEvaluationURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Evals []models.PolicyEvaluation `json:"policyevaluation"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Evals, nil +} + +func (s *PolicyService) CountPolicyEvaluation() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyEvaluationURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Evals []struct { + Count float64 `json:"__count"` + } `json:"policyevaluation"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Evals) > 0 { + return result.Evals[0].Count, nil + } + return 0, nil +} // policyexpression -func (s *PolicyService) AddPolicyExpression() {} -func (s *PolicyService) DeletePolicyExpression() {} -func (s *PolicyService) UpdatePolicyExpression() {} -func (s *PolicyService) UnsetPolicyExpression() {} -func (s *PolicyService) GetAllPolicyExpression() {} -func (s *PolicyService) GetPolicyExpression() {} -func (s *PolicyService) CountPolicyExpression() {} + +func (s *PolicyService) AddPolicyExpression(expression models.PolicyExpression) error { + payload := map[string]any{ + "policyexpression": expression, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyExpressionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyExpression(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyExpressionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UpdatePolicyExpression(expression models.PolicyExpression) error { + payload := map[string]any{ + "policyexpression": expression, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyExpressionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyExpression(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policyexpression": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyExpressionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyExpression() ([]models.PolicyExpression, error) { + req, err := s.client.NewRequest(http.MethodGet, policyExpressionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Exprs []models.PolicyExpression `json:"policyexpression"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Exprs, nil +} + +func (s *PolicyService) GetPolicyExpression(name string) ([]models.PolicyExpression, error) { + reqURL := fmt.Sprintf("%s/%s", policyExpressionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Exprs []models.PolicyExpression `json:"policyexpression"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Exprs, nil +} + +func (s *PolicyService) CountPolicyExpression() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyExpressionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Exprs []struct { + Count float64 `json:"__count"` + } `json:"policyexpression"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Exprs) > 0 { + return result.Exprs[0].Count, nil + } + return 0, nil +} // policyhttpcallout -func (s *PolicyService) AddPolicyHTTPCallout() {} -func (s *PolicyService) DeletePolicyHTTPCallout() {} -func (s *PolicyService) UpdatePolicyHTTPCallout() {} -func (s *PolicyService) UnsetPolicyHTTPCallout() {} -func (s *PolicyService) GetAllPolicyHTTPCallout() {} -func (s *PolicyService) GetPolicyHTTPCallout() {} -func (s *PolicyService) CountPolicyHTTPCallout() {} + +func (s *PolicyService) AddPolicyHTTPCallout(callout models.PolicyHTTPCallout) error { + payload := map[string]any{ + "policyhttpcallout": callout, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyHTTPCalloutURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyHTTPCallout(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyHTTPCalloutURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UpdatePolicyHTTPCallout(callout models.PolicyHTTPCallout) error { + payload := map[string]any{ + "policyhttpcallout": callout, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyHTTPCalloutURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyHTTPCallout(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policyhttpcallout": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyHTTPCalloutURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyHTTPCallout() ([]models.PolicyHTTPCallout, error) { + req, err := s.client.NewRequest(http.MethodGet, policyHTTPCalloutURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Callouts []models.PolicyHTTPCallout `json:"policyhttpcallout"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Callouts, nil +} + +func (s *PolicyService) GetPolicyHTTPCallout(name string) ([]models.PolicyHTTPCallout, error) { + reqURL := fmt.Sprintf("%s/%s", policyHTTPCalloutURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Callouts []models.PolicyHTTPCallout `json:"policyhttpcallout"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Callouts, nil +} + +func (s *PolicyService) CountPolicyHTTPCallout() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyHTTPCalloutURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Callouts []struct { + Count float64 `json:"__count"` + } `json:"policyhttpcallout"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Callouts) > 0 { + return result.Callouts[0].Count, nil + } + return 0, nil +} // policymap -func (s *PolicyService) AddPolicyMap() {} -func (s *PolicyService) DeletePolicyMap() {} -func (s *PolicyService) GetAllPolicyMap() {} -func (s *PolicyService) GetPolicyMap() {} -func (s *PolicyService) CountPolicyMap() {} + +func (s *PolicyService) AddPolicyMap(policymap models.PolicyMap) error { + payload := map[string]any{ + "policymap": policymap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyMapURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyMap(mappolicyname string) error { + reqURL := fmt.Sprintf("%s/%s", policyMapURL, url.QueryEscape(mappolicyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyMap() ([]models.PolicyMap, error) { + req, err := s.client.NewRequest(http.MethodGet, policyMapURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Maps []models.PolicyMap `json:"policymap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Maps, nil +} + +func (s *PolicyService) GetPolicyMap(mappolicyname string) ([]models.PolicyMap, error) { + reqURL := fmt.Sprintf("%s/%s", policyMapURL, url.QueryEscape(mappolicyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Maps []models.PolicyMap `json:"policymap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Maps, nil +} + +func (s *PolicyService) CountPolicyMap() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyMapURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Maps []struct { + Count float64 `json:"__count"` + } `json:"policymap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Maps) > 0 { + return result.Maps[0].Count, nil + } + return 0, nil +} // policyparam -func (s *PolicyService) UpdatePolicyParam() {} -func (s *PolicyService) UnsetPolicyParam() {} -func (s *PolicyService) GetAllPolicyParam() {} + +func (s *PolicyService) UpdatePolicyParam(param models.PolicyParam) error { + payload := map[string]any{ + "policyparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policyparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyParam() (models.PolicyParam, error) { + req, err := s.client.NewRequest(http.MethodGet, policyParamURL, nil) + if err != nil { + return models.PolicyParam{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.PolicyParam{}, err + } + var result struct { + Params []models.PolicyParam `json:"policyparam"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.PolicyParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.PolicyParam{}, nil +} // policypatset -func (s *PolicyService) AddPolicyPATSet() {} -func (s *PolicyService) DeletePolicyPATSet() {} -func (s *PolicyService) UpdatePolicyPATSet() {} -func (s *PolicyService) UnsetPolicyPATSet() {} -func (s *PolicyService) GetAllPolicyPATSet() {} -func (s *PolicyService) GetPolicyPATSet() {} -func (s *PolicyService) CountPolicyPATSet() {} + +func (s *PolicyService) AddPolicyPATSet(patset models.PolicyPatset) error { + payload := map[string]any{ + "policypatset": patset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyPATSetURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyPATSet(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyPATSetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UpdatePolicyPATSet(patset models.PolicyPatset) error { + payload := map[string]any{ + "policypatset": patset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyPATSetURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyPATSet(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policypatset": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyPATSetURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyPATSet() ([]models.PolicyPatset, error) { + req, err := s.client.NewRequest(http.MethodGet, policyPATSetURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Pats []models.PolicyPatset `json:"policypatset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Pats, nil +} + +func (s *PolicyService) GetPolicyPATSet(name string) ([]models.PolicyPatset, error) { + reqURL := fmt.Sprintf("%s/%s", policyPATSetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Pats []models.PolicyPatset `json:"policypatset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Pats, nil +} + +func (s *PolicyService) CountPolicyPATSet() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyPATSetURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Pats []struct { + Count float64 `json:"__count"` + } `json:"policypatset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Pats) > 0 { + return result.Pats[0].Count, nil + } + return 0, nil +} // policypatset_binding -func (s *PolicyService) GetAllPolicyPATSetBinding() {} -func (s *PolicyService) GetPolicyPATSetBinding() {} + +func (s *PolicyService) GetAllPolicyPATSetBinding() ([]models.PolicyPatsetBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyPATSetBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyPatsetBinding `json:"policypatset_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyPATSetBinding(name string) ([]models.PolicyPatsetBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyPATSetBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyPatsetBinding `json:"policypatset_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // policypatset_pattern_binding -func (s *PolicyService) AddPolicyPATSetPatternBinding() {} -func (s *PolicyService) DeletePolicyPATSetPatternBinding() {} -func (s *PolicyService) GetAllPolicyPATSetPatternBinding() {} -func (s *PolicyService) GetPolicyPATSetPatternBinding() {} -func (s *PolicyService) CountPolicyPATSetPatternBinding() {} + +func (s *PolicyService) AddPolicyPATSetPatternBinding(binding models.PolicyPatsetPatternBinding) error { + payload := map[string]any{ + "policypatset_pattern_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyPATSetPatternBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyPATSetPatternBinding(name, pattern string) error { + reqURL := fmt.Sprintf("%s/%s?args=String:%s", policyPATSetPatternBindingURL, url.QueryEscape(name), url.QueryEscape(pattern)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyPATSetPatternBinding() ([]models.PolicyPatsetPatternBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyPATSetPatternBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyPatsetPatternBinding `json:"policypatset_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyPATSetPatternBinding(name string) ([]models.PolicyPatsetPatternBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyPATSetPatternBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyPatsetPatternBinding `json:"policypatset_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) CountPolicyPATSetPatternBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", policyPATSetPatternBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"policypatset_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // policystringmap -func (s *PolicyService) AddPolicyStringMap() {} -func (s *PolicyService) DeletePolicyStringMap() {} -func (s *PolicyService) UpdatePolicyStringMap() {} -func (s *PolicyService) UnsetPolicyStringMap() {} -func (s *PolicyService) GetAllPolicyStringMap() {} -func (s *PolicyService) GetPolicyStringMap() {} -func (s *PolicyService) CountPolicyStringMap() {} + +func (s *PolicyService) AddPolicyStringMap(stringmap models.PolicyStringMap) error { + payload := map[string]any{ + "policystringmap": stringmap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyStringMapURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyStringMap(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyStringMapURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UpdatePolicyStringMap(stringmap models.PolicyStringMap) error { + payload := map[string]any{ + "policystringmap": stringmap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyStringMapURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) UnsetPolicyStringMap(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "policystringmap": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyStringMapURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyStringMap() ([]models.PolicyStringMap, error) { + req, err := s.client.NewRequest(http.MethodGet, policyStringMapURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Maps []models.PolicyStringMap `json:"policystringmap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Maps, nil +} + +func (s *PolicyService) GetPolicyStringMap(name string) ([]models.PolicyStringMap, error) { + reqURL := fmt.Sprintf("%s/%s", policyStringMapURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Maps []models.PolicyStringMap `json:"policystringmap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Maps, nil +} + +func (s *PolicyService) CountPolicyStringMap() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyStringMapURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Maps []struct { + Count float64 `json:"__count"` + } `json:"policystringmap"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Maps) > 0 { + return result.Maps[0].Count, nil + } + return 0, nil +} // policystringmap_binding -func (s *PolicyService) GetAllPolicyStringMapBinding() {} -func (s *PolicyService) GetPolicyStringMapBinding() {} + +func (s *PolicyService) GetAllPolicyStringMapBinding() ([]models.PolicyStringMapBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyStringMapBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyStringMapBinding `json:"policystringmap_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyStringMapBinding(name string) ([]models.PolicyStringMapBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyStringMapBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyStringMapBinding `json:"policystringmap_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // policystringmap_pattern_binding -func (s *PolicyService) AddPolicyStringMapPatternBinding() {} -func (s *PolicyService) DeletePolicyStringMapPatternBinding() {} -func (s *PolicyService) GetAllPolicyStringMapPatternBinding() {} -func (s *PolicyService) GetPolicyStringMapPatternBinding() {} -func (s *PolicyService) CountPolicyStringMapPatternBinding() {} + +func (s *PolicyService) AddPolicyStringMapPatternBinding(binding models.PolicyStringMapPatternBinding) error { + payload := map[string]any{ + "policystringmap_pattern_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, policyStringMapPatternBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyStringMapPatternBinding(name, key string) error { + reqURL := fmt.Sprintf("%s/%s?args=key:%s", policyStringMapPatternBindingURL, url.QueryEscape(name), url.QueryEscape(key)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyStringMapPatternBinding() ([]models.PolicyStringMapPatternBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, policyStringMapPatternBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyStringMapPatternBinding `json:"policystringmap_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) GetPolicyStringMapPatternBinding(name string) ([]models.PolicyStringMapPatternBinding, error) { + reqURL := fmt.Sprintf("%s/%s", policyStringMapPatternBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.PolicyStringMapPatternBinding `json:"policystringmap_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *PolicyService) CountPolicyStringMapPatternBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", policyStringMapPatternBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"policystringmap_pattern_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // policyurlset -func (s *PolicyService) AddPolicyURLSet() {} -func (s *PolicyService) DeletePolicyURLSet() {} -func (s *PolicyService) GetAllPolicyURLSet() {} -func (s *PolicyService) GetPolicyURLSet() {} -func (s *PolicyService) CountPolicyURLSet() {} -func (s *PolicyService) ImportPolicyURLSet() {} -func (s *PolicyService) ExportPolicyURLSet() {} -func (s *PolicyService) ChangePolicyURLSet() {} + +func (s *PolicyService) AddPolicyURLSet(urlset models.PolicyURLSet) error { + payload := map[string]any{ + "policyurlset": urlset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyURLSetURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) DeletePolicyURLSet(name string) error { + reqURL := fmt.Sprintf("%s/%s", policyURLSetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) GetAllPolicyURLSet() ([]models.PolicyURLSet, error) { + req, err := s.client.NewRequest(http.MethodGet, policyURLSetURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Sets []models.PolicyURLSet `json:"policyurlset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Sets, nil +} + +func (s *PolicyService) GetPolicyURLSet(name string) ([]models.PolicyURLSet, error) { + reqURL := fmt.Sprintf("%s/%s", policyURLSetURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Sets []models.PolicyURLSet `json:"policyurlset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Sets, nil +} + +func (s *PolicyService) CountPolicyURLSet() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, policyURLSetURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Sets []struct { + Count float64 `json:"__count"` + } `json:"policyurlset"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Sets) > 0 { + return result.Sets[0].Count, nil + } + return 0, nil +} + +func (s *PolicyService) ImportPolicyURLSet(urlset models.PolicyURLSet) error { + payload := map[string]any{ + "policyurlset": urlset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyURLSetURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) ExportPolicyURLSet(urlset models.PolicyURLSet) error { + payload := map[string]any{ + "policyurlset": urlset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyURLSetURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *PolicyService) ChangePolicyURLSet(urlset models.PolicyURLSet) error { + payload := map[string]any{ + "policyurlset": urlset, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, policyURLSetURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/protocol.go b/nitrogo/protocol.go index a7f1337..607c228 100644 --- a/nitrogo/protocol.go +++ b/nitrogo/protocol.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( protocolHTTPBandURL = "/nitro/v1/config/protocolhttpband" ) @@ -13,7 +22,86 @@ type ProtocolService struct { // protocolhttpband // Configuration for HTTP request/response band resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/protocol/protocolhttpband -func (s *ProtocolService) UpdateProtocolHTTPBand() {} -func (s *ProtocolService) UnsetProtocolHTTPBand() {} -func (s *ProtocolService) GetAllProtocolHTTPBand() {} -func (s *ProtocolService) ClearProtocolHTTPBand() {} + +func (s *ProtocolService) UpdateProtocolHTTPBand(band models.ProtocolHTTPBand) error { + payload := map[string]any{ + "protocolhttpband": band, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, protocolHTTPBandURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ProtocolService) UnsetProtocolHTTPBand(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "protocolhttpband": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, protocolHTTPBandURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ProtocolService) GetAllProtocolHTTPBand() ([]models.ProtocolHTTPBand, error) { + req, err := s.client.NewRequest(http.MethodGet, protocolHTTPBandURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bands []models.ProtocolHTTPBand `json:"protocolhttpband"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bands, nil +} + +func (s *ProtocolService) ClearProtocolHTTPBand(band models.ProtocolHTTPBand) error { + payload := map[string]any{ + "protocolhttpband": band, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, protocolHTTPBandURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/rdp.go b/nitrogo/rdp.go index 0d41c7b..6c55b19 100644 --- a/nitrogo/rdp.go +++ b/nitrogo/rdp.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( rdpClientProfileURL = "/nitro/v1/config/rdpclientprofile" rdpConnectionsURL = "/nitro/v1/config/rdpconnections" @@ -15,28 +24,373 @@ type RDPService struct { // rdpclientprofile // Configuration for RDP clientprofile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/rdp/rdpclientprofile -func (s *RDPService) AddRDPClientProfile() {} -func (s *RDPService) DeleteRDPClientProfile() {} -func (s *RDPService) UpdateRDPClientProfile() {} -func (s *RDPService) UnsetRDPClientProfile() {} -func (s *RDPService) GetAllRDPClientProfile() {} -func (s *RDPService) GetRDPClientProfile() {} -func (s *RDPService) CountRDPClientProfile() {} + +func (s *RDPService) AddRDPClientProfile(profile models.RDPClientProfile) error { + payload := map[string]any{ + "rdpclientprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, rdpClientProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) DeleteRDPClientProfile(name string) error { + url := fmt.Sprintf("%s/%s", rdpClientProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) UpdateRDPClientProfile(profile models.RDPClientProfile) error { + payload := map[string]any{ + "rdpclientprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, rdpClientProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) UnsetRDPClientProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "rdpclientprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, rdpClientProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) GetAllRDPClientProfile() ([]models.RDPClientProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpClientProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RDPClientProfiles []models.RDPClientProfile `json:"rdpclientprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RDPClientProfiles, nil +} + +func (s *RDPService) GetRDPClientProfile(name string) ([]models.RDPClientProfile, error) { + url := fmt.Sprintf("%s/%s", rdpClientProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RDPClientProfiles []models.RDPClientProfile `json:"rdpclientprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RDPClientProfiles, nil +} + +func (s *RDPService) CountRDPClientProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpClientProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + RDPClientProfiles []struct { + Count float64 `json:"__count"` + } `json:"rdpclientprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.RDPClientProfiles) > 0 { + return result.RDPClientProfiles[0].Count, nil + } + + return 0, nil +} // rdpconnections // Configuration for active rdp connections resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/rdp/rdpconnections -func (s *RDPService) GetAllRDPConnections() {} -func (s *RDPService) CountRDPConnections() {} -func (s *RDPService) KillRDPConnections() {} + +func (s *RDPService) GetAllRDPConnections() ([]models.RDPConnections, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpConnectionsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RDPConnections []models.RDPConnections `json:"rdpconnections"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RDPConnections, nil +} + +func (s *RDPService) CountRDPConnections() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpConnectionsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + RDPConnections []struct { + Count float64 `json:"__count"` + } `json:"rdpconnections"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.RDPConnections) > 0 { + return result.RDPConnections[0].Count, nil + } + + return 0, nil +} + +func (s *RDPService) KillRDPConnections(connections models.RDPConnections) error { + payload := map[string]any{ + "rdpconnections": connections, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, rdpConnectionsURL+"?action=kill", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // rspserverprofile // Configuration for RDP serverprofile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/rdp/rdpserverprofile -func (s *RDPService) AddRDPServerProfile() {} -func (s *RDPService) DeleteRDPServerProfile() {} -func (s *RDPService) UpdateRDPServerProfile() {} -func (s *RDPService) UnsetRDPServerProfile() {} -func (s *RDPService) GetAllRDPServerProfile() {} -func (s *RDPService) GetRDPServerProfile() {} -func (s *RDPService) CountRDPServerProfile() {} + +func (s *RDPService) AddRDPServerProfile(profile models.RDPServerProfile) error { + payload := map[string]any{ + "rdpserverprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, rdpServerProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) DeleteRDPServerProfile(name string) error { + url := fmt.Sprintf("%s/%s", rdpServerProfileURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) UpdateRDPServerProfile(profile models.RDPServerProfile) error { + payload := map[string]any{ + "rdpserverprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, rdpServerProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) UnsetRDPServerProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "rdpserverprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, rdpServerProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RDPService) GetAllRDPServerProfile() ([]models.RDPServerProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpServerProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RDPServerProfiles []models.RDPServerProfile `json:"rdpserverprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RDPServerProfiles, nil +} + +func (s *RDPService) GetRDPServerProfile(name string) ([]models.RDPServerProfile, error) { + url := fmt.Sprintf("%s/%s", rdpServerProfileURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RDPServerProfiles []models.RDPServerProfile `json:"rdpserverprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RDPServerProfiles, nil +} + +func (s *RDPService) CountRDPServerProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rdpServerProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + RDPServerProfiles []struct { + Count float64 `json:"__count"` + } `json:"rdpserverprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.RDPServerProfiles) > 0 { + return result.RDPServerProfiles[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/reputation.go b/nitrogo/reputation.go index 435e80a..6703402 100644 --- a/nitrogo/reputation.go +++ b/nitrogo/reputation.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( reputationSettingsURL = "/nitro/v1/config/reputationsettings" ) @@ -13,6 +22,72 @@ type ReputationService struct { // reputationsettings // Configuration for Reputation service settings resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/reputation/reputationsettings -func (s *ReputationService) UpdateReputationSettings() {} -func (s *ReputationService) UnsetReputationSettings() {} -func (s *ReputationService) GetAllReputationSettings() {} + +func (s *ReputationService) UpdateReputationSettings(settings models.ReputationSettings) error { + payload := map[string]any{ + "reputationsettings": settings, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, reputationSettingsURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ReputationService) UnsetReputationSettings(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "reputationsettings": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, reputationSettingsURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ReputationService) GetAllReputationSettings() (models.ReputationSettings, error) { + req, err := s.client.NewRequest(http.MethodGet, reputationSettingsURL, nil) + if err != nil { + return models.ReputationSettings{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.ReputationSettings{}, err + } + + var result struct { + Settings []models.ReputationSettings `json:"reputationsettings"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ReputationSettings{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Settings) > 0 { + return result.Settings[0], nil + } + + return models.ReputationSettings{}, nil +} diff --git a/nitrogo/responder.go b/nitrogo/responder.go index 66fdb47..81ebc4c 100644 --- a/nitrogo/responder.go +++ b/nitrogo/responder.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( responderActionURL = "/nitro/v1/config/responderaction" responderGlobalBindingURL = "/nitro/v1/config/responderglobal_binding" @@ -27,100 +37,1274 @@ type ResponderService struct { } // responderaction -func (s *ResponderService) AddResponderAction() {} -func (s *ResponderService) DeleteResponderAction() {} -func (s *ResponderService) UpdateResponderAction() {} -func (s *ResponderService) UnsetResponderAction() {} -func (s *ResponderService) GetAllResponderAction() {} -func (s *ResponderService) GetResponderAction() {} -func (s *ResponderService) CountResponderAction() {} -func (s *ResponderService) RenameResponderAction() {} + +func (s *ResponderService) AddResponderAction(action models.ResponderAction) error { + payload := map[string]any{ + "responderaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", responderActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) UpdateResponderAction(action models.ResponderAction) error { + payload := map[string]any{ + "responderaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, responderActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) UnsetResponderAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "responderaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderAction() ([]models.ResponderAction, error) { + req, err := s.client.NewRequest(http.MethodGet, responderActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.ResponderAction `json:"responderaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *ResponderService) GetResponderAction(name string) ([]models.ResponderAction, error) { + reqURL := fmt.Sprintf("%s/%s", responderActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.ResponderAction `json:"responderaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *ResponderService) CountResponderAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, responderActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"responderaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} + +func (s *ResponderService) RenameResponderAction(name, newname string) error { + payload := map[string]any{ + "responderaction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // responderglobal_binding -func (s *ResponderService) GetResponderGlobalBinding() {} + +func (s *ResponderService) GetResponderGlobalBinding() ([]models.ResponderGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderGlobalBinding `json:"responderglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // responderglobal_responderpolicy_binding -func (s *ResponderService) AddResponderGlobalResponderPolicyBinding() {} -func (s *ResponderService) DeleteResponderGlobalResponderPolicyBinding() {} -func (s *ResponderService) GetResponderGlobalResponderPolicyBinding() {} -func (s *ResponderService) CountResponderGlobalResponderPolicyBinding() {} + +func (s *ResponderService) AddResponderGlobalResponderPolicyBinding(binding models.ResponderGlobalResponderPolicyBinding) error { + payload := map[string]any{ + "responderglobal_responderpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, responderGlobalResponderPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderGlobalResponderPolicyBinding(policyname, typeField string, priority int) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s,type:%s,priority:%d", responderGlobalResponderPolicyBindingURL, url.QueryEscape(policyname), url.QueryEscape(typeField), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetResponderGlobalResponderPolicyBinding() ([]models.ResponderGlobalResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderGlobalResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderGlobalResponderPolicyBinding `json:"responderglobal_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderGlobalResponderPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, responderGlobalResponderPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderglobal_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderhtmlpage -func (s *ResponderService) ImportResponderHTMLPage() {} -func (s *ResponderService) DeleteResponderHTMLPage() {} -func (s *ResponderService) GetAllResponderHTMLPage() {} -func (s *ResponderService) GetResponderHTMLPage() {} -func (s *ResponderService) ChangeResponderHTMLPage() {} + +func (s *ResponderService) ImportResponderHTMLPage(page models.ResponderHTMLPage) error { + payload := map[string]any{ + "responderhtmlpage": page, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderHTMLPageURL+"?action=Import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderHTMLPage(name string) error { + reqURL := fmt.Sprintf("%s/%s", responderHTMLPageURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderHTMLPage() ([]models.ResponderHTMLPage, error) { + req, err := s.client.NewRequest(http.MethodGet, responderHTMLPageURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Pages []models.ResponderHTMLPage `json:"responderhtmlpage"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Pages, nil +} + +func (s *ResponderService) GetResponderHTMLPage(name string) ([]models.ResponderHTMLPage, error) { + reqURL := fmt.Sprintf("%s/%s", responderHTMLPageURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Pages []models.ResponderHTMLPage `json:"responderhtmlpage"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Pages, nil +} + +func (s *ResponderService) ChangeResponderHTMLPage(page models.ResponderHTMLPage) error { + payload := map[string]any{ + "responderhtmlpage": page, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderHTMLPageURL+"?action=update", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // responderparam -func (s *ResponderService) UpdateResponderParam() {} -func (s *ResponderService) UnsetResponderParam() {} -func (s *ResponderService) GetAllResponderParam() {} + +func (s *ResponderService) UpdateResponderParam(param models.ResponderParam) error { + payload := map[string]any{ + "responderparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, responderParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) UnsetResponderParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "responderparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderParam() (models.ResponderParam, error) { + req, err := s.client.NewRequest(http.MethodGet, responderParamURL, nil) + if err != nil { + return models.ResponderParam{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.ResponderParam{}, err + } + var result struct { + Params []models.ResponderParam `json:"responderparam"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.ResponderParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.ResponderParam{}, nil +} // responderpolicy -func (s *ResponderService) AddResponderPolicy() {} -func (s *ResponderService) DeleteResponderPolicy() {} -func (s *ResponderService) UpdateResponderPolicy() {} -func (s *ResponderService) UnsetResponderPolicy() {} -func (s *ResponderService) GetAllResponderPolicy() {} -func (s *ResponderService) GetResponderPolicy() {} -func (s *ResponderService) CountResponderPolicy() {} -func (s *ResponderService) RenameResponderPolicy() {} + +func (s *ResponderService) AddResponderPolicy(policy models.ResponderPolicy) error { + payload := map[string]any{ + "responderpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", responderPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) UpdateResponderPolicy(policy models.ResponderPolicy) error { + payload := map[string]any{ + "responderpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, responderPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) UnsetResponderPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "responderpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderPolicy() ([]models.ResponderPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.ResponderPolicy `json:"responderpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *ResponderService) GetResponderPolicy(name string) ([]models.ResponderPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.ResponderPolicy `json:"responderpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *ResponderService) CountResponderPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} + +func (s *ResponderService) RenameResponderPolicy(name, newname string) error { + payload := map[string]any{ + "responderpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // responderpolicylabel -func (s *ResponderService) AddResponderPolicyLabel() {} -func (s *ResponderService) DeleteResponderPolicyLabel() {} -func (s *ResponderService) GetAllResponderPolicyLabel() {} -func (s *ResponderService) GetResponderPolicyLabel() {} -func (s *ResponderService) CountResponderPolicyLabel() {} -func (s *ResponderService) RenameResponderPolicyLabel() {} + +func (s *ResponderService) AddResponderPolicyLabel(label models.ResponderPolicyLabel) error { + payload := map[string]any{ + "responderpolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderPolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderPolicyLabel() ([]models.ResponderPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.ResponderPolicyLabel `json:"responderpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *ResponderService) GetResponderPolicyLabel(labelname string) ([]models.ResponderPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.ResponderPolicyLabel `json:"responderpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *ResponderService) CountResponderPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"responderpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} + +func (s *ResponderService) RenameResponderPolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "responderpolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, responderPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // responderpolicylabel_binding -func (s *ResponderService) GetAllResponderPolicyLabelBinding() {} -func (s *ResponderService) GetResponderPolicyLabelBinding() {} + +func (s *ResponderService) GetAllResponderPolicyLabelBinding() ([]models.ResponderPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelBinding `json:"responderpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyLabelBinding(labelname string) ([]models.ResponderPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelBinding `json:"responderpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // respondrepolicylabel_policybinding_binding -func (s *ResponderService) GetAllResponderPolicyLabelPolicyBindingBinding() {} -func (s *ResponderService) GetResponderPolicyLabelPolicyBindingBinding() {} -func (s *ResponderService) CountResponderPolicyLabelPolicyBindingBinding() {} + +func (s *ResponderService) GetAllResponderPolicyLabelPolicyBindingBinding() ([]models.ResponderPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelPolicyBindingBinding `json:"responderpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyLabelPolicyBindingBinding(labelname string) ([]models.ResponderPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelPolicyBindingBinding `json:"responderpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyLabelPolicyBindingBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicylabel_responderpolicy_binding -func (s *ResponderService) AddResponderPolicyLabelResponderPolicyBinding() {} -func (s *ResponderService) DeleteResponderPolicyLabelResponderPolicyBinding() {} -func (s *ResponderService) GetAllResponderPolicyLabelResponderPolicyBinding() {} -func (s *ResponderService) GetResponderPolicyLabelResponderPolicyBinding() {} -func (s *ResponderService) CountResponderPolicyLabelResponderPolicyBinding() {} + +func (s *ResponderService) AddResponderPolicyLabelResponderPolicyBinding(binding models.ResponderPolicyLabelResponderPolicyBinding) error { + payload := map[string]any{ + "responderpolicylabel_responderpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, responderPolicyLabelResponderPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) DeleteResponderPolicyLabelResponderPolicyBinding(labelname, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", responderPolicyLabelResponderPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *ResponderService) GetAllResponderPolicyLabelResponderPolicyBinding() ([]models.ResponderPolicyLabelResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLabelResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelResponderPolicyBinding `json:"responderpolicylabel_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyLabelResponderPolicyBinding(labelname string) ([]models.ResponderPolicyLabelResponderPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLabelResponderPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLabelResponderPolicyBinding `json:"responderpolicylabel_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyLabelResponderPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyLabelResponderPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicylabel_responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_binding -func (s *ResponderService) GetAllResponderPolicyBinding() {} -func (s *ResponderService) GetResponderPolicyBinding() {} + +func (s *ResponderService) GetAllResponderPolicyBinding() ([]models.ResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyBinding `json:"responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyBinding(name string) ([]models.ResponderPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyBinding `json:"responderpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // responderpolicy_crvserver_binding -func (s *ResponderService) GetAllResponderPolicyCRVServerBinding() {} -func (s *ResponderService) GetResponderPolicyCRVServerBinding() {} -func (s *ResponderService) CountResponderPolicyCRVServerBinding() {} + +func (s *ResponderService) GetAllResponderPolicyCRVServerBinding() ([]models.ResponderPolicyCRVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyCRVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyCRVServerBinding `json:"responderpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyCRVServerBinding(name string) ([]models.ResponderPolicyCRVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyCRVServerBinding `json:"responderpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyCRVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyCRVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_crvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_csvserver_binding -func (s *ResponderService) GetAllResponderPolicyCSVServerBinding() {} -func (s *ResponderService) GetResponderPolicyCSVServerBinding() {} -func (s *ResponderService) CountResponderPolicyCSVServerBinding() {} + +func (s *ResponderService) GetAllResponderPolicyCSVServerBinding() ([]models.ResponderPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyCSVServerBinding `json:"responderpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyCSVServerBinding(name string) ([]models.ResponderPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyCSVServerBinding `json:"responderpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_lbvserver_binding -func (s *ResponderService) GetAllResponderPolicyLBVServerBinding() {} -func (s *ResponderService) GetResponderPolicyLBVServerBinding() {} -func (s *ResponderService) CountResponderPolicyLBVServerBinding() {} + +func (s *ResponderService) GetAllResponderPolicyLBVServerBinding() ([]models.ResponderPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLBVServerBinding `json:"responderpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyLBVServerBinding(name string) ([]models.ResponderPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyLBVServerBinding `json:"responderpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_responderglobal_binding -func (s *ResponderService) GetAllResponderPolicyResponderGlobalBinding() {} -func (s *ResponderService) GetResponderPolicyResponderGlobalBinding() {} -func (s *ResponderService) CountResponderPolicyResponderGlobalBinding() {} + +func (s *ResponderService) GetAllResponderPolicyResponderGlobalBinding() ([]models.ResponderPolicyResponderGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyResponderGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyResponderGlobalBinding `json:"responderpolicy_responderglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyResponderGlobalBinding(name string) ([]models.ResponderPolicyResponderGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyResponderGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyResponderGlobalBinding `json:"responderpolicy_responderglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyResponderGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyResponderGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_responderglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_responderpolicylabel_binding -func (s *ResponderService) GetAllResponderPolicyResponderPolicyLabelBinding() {} -func (s *ResponderService) GetResponderPolicyResponderPolicyLabelBinding() {} -func (s *ResponderService) CountResponderPolicyResponderPolicyLabelBinding() {} + +func (s *ResponderService) GetAllResponderPolicyResponderPolicyLabelBinding() ([]models.ResponderPolicyResponderPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyResponderPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyResponderPolicyLabelBinding `json:"responderpolicy_responderpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyResponderPolicyLabelBinding(name string) ([]models.ResponderPolicyResponderPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyResponderPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyResponderPolicyLabelBinding `json:"responderpolicy_responderpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyResponderPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyResponderPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_responderpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // responderpolicy_vpnvserver_binding -func (s *ResponderService) GetAllResponderPolicyVPNVServerBinding() {} -func (s *ResponderService) GetResponderPolicyVPNVServerBinding() {} -func (s *ResponderService) CountResponderPolicyVPNVServerBinding() {} + +func (s *ResponderService) GetAllResponderPolicyVPNVServerBinding() ([]models.ResponderPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, responderPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyVPNVServerBinding `json:"responderpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) GetResponderPolicyVPNVServerBinding(name string) ([]models.ResponderPolicyVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", responderPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.ResponderPolicyVPNVServerBinding `json:"responderpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *ResponderService) CountResponderPolicyVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", responderPolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"responderpolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/rewrite.go b/nitrogo/rewrite.go index 9b52677..97b8339 100644 --- a/nitrogo/rewrite.go +++ b/nitrogo/rewrite.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( rewriteActionURL = "/nitro/v1/config/rewriteaction" rewriteGlobalBindingURL = "/nitro/v1/config/rewriteglobal_binding" @@ -25,88 +35,1125 @@ type RewriteService struct { } // rewriteaction -func (s *RewriteService) AddRewriteAction() {} -func (s *RewriteService) DeleteRewriteAction() {} -func (s *RewriteService) UpdateRewriteAction() {} -func (s *RewriteService) UnsetRewriteAction() {} -func (s *RewriteService) GetAllRewriteAction() {} -func (s *RewriteService) GetRewriteAction() {} -func (s *RewriteService) CountRewriteAction() {} -func (s *RewriteService) RenameRewriteAction() {} + +func (s *RewriteService) AddRewriteAction(action models.RewriteAction) error { + payload := map[string]any{ + "rewriteaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewriteActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) DeleteRewriteAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", rewriteActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) UpdateRewriteAction(action models.RewriteAction) error { + payload := map[string]any{ + "rewriteaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, rewriteActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) UnsetRewriteAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "rewriteaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewriteActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetAllRewriteAction() ([]models.RewriteAction, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.RewriteAction `json:"rewriteaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *RewriteService) GetRewriteAction(name string) ([]models.RewriteAction, error) { + reqURL := fmt.Sprintf("%s/%s", rewriteActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.RewriteAction `json:"rewriteaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *RewriteService) CountRewriteAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"rewriteaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} + +func (s *RewriteService) RenameRewriteAction(name, newname string) error { + payload := map[string]any{ + "rewriteaction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewriteActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // rewriteglobal_binding -func (s *RewriteService) GetRewriteGlobalBinding() {} + +func (s *RewriteService) GetRewriteGlobalBinding() ([]models.RewriteGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewriteGlobalBinding `json:"rewriteglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // rewriteglobal_rewritepolicy_binding -func (s *RewriteService) AddRewriteGlobalRewritePolicyBinding() {} -func (s *RewriteService) DeleteRewriteGlobalRewritePolicyBinding() {} -func (s *RewriteService) GetRewriteGlobalRewritePolicyBinding() {} -func (s *RewriteService) CountRewriteGlobalRewritePolicyBinding() {} + +func (s *RewriteService) AddRewriteGlobalRewritePolicyBinding(binding models.RewriteGlobalRewritePolicyBinding) error { + payload := map[string]any{ + "rewriteglobal_rewritepolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, rewriteGlobalRewritePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) DeleteRewriteGlobalRewritePolicyBinding(policyname string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", rewriteGlobalRewritePolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetRewriteGlobalRewritePolicyBinding() ([]models.RewriteGlobalRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteGlobalRewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewriteGlobalRewritePolicyBinding `json:"rewriteglobal_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewriteGlobalRewritePolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteGlobalRewritePolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewriteglobal_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewriteparam -func (s *RewriteService) UpdateRewriteParam() {} -func (s *RewriteService) UnsetRewriteParam() {} -func (s *RewriteService) GetAllRewriteParam() {} + +func (s *RewriteService) UpdateRewriteParam(param models.RewriteParam) error { + payload := map[string]any{ + "rewriteparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, rewriteParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) UnsetRewriteParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "rewriteparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewriteParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetAllRewriteParam() (models.RewriteParam, error) { + req, err := s.client.NewRequest(http.MethodGet, rewriteParamURL, nil) + if err != nil { + return models.RewriteParam{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.RewriteParam{}, err + } + var result struct { + Params []models.RewriteParam `json:"rewriteparam"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.RewriteParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.RewriteParam{}, nil +} // rewritepolicy -func (s *RewriteService) AddRewritePolicy() {} -func (s *RewriteService) DeleteRewritePolicy() {} -func (s *RewriteService) UpdateRewritePolicy() {} -func (s *RewriteService) UnsetRewritePolicy() {} -func (s *RewriteService) GetAllRewritePolicy() {} -func (s *RewriteService) GetRewritePolicy() {} -func (s *RewriteService) CountRewritePolicy() {} -func (s *RewriteService) RenameRewritePolicy() {} + +func (s *RewriteService) AddRewritePolicy(policy models.RewritePolicy) error { + payload := map[string]any{ + "rewritepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewritePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) DeleteRewritePolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) UpdateRewritePolicy(policy models.RewritePolicy) error { + payload := map[string]any{ + "rewritepolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, rewritePolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) UnsetRewritePolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "rewritepolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewritePolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetAllRewritePolicy() ([]models.RewritePolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.RewritePolicy `json:"rewritepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *RewriteService) GetRewritePolicy(name string) ([]models.RewritePolicy, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.RewritePolicy `json:"rewritepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *RewriteService) CountRewritePolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} + +func (s *RewriteService) RenameRewritePolicy(name, newname string) error { + payload := map[string]any{ + "rewritepolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewritePolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // rewritepolicylabel -func (s *RewriteService) AddRewritePolicyLabel() {} -func (s *RewriteService) DeleteRewritePolicyLabel() {} -func (s *RewriteService) GetAllRewritePolicyLabel() {} -func (s *RewriteService) GetRewritePolicyLabel() {} -func (s *RewriteService) CountRewritePolicyLabel() {} -func (s *RewriteService) RenameRewritePolicyLabel() {} + +func (s *RewriteService) AddRewritePolicyLabel(label models.RewritePolicyLabel) error { + payload := map[string]any{ + "rewritepolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewritePolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) DeleteRewritePolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetAllRewritePolicyLabel() ([]models.RewritePolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.RewritePolicyLabel `json:"rewritepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *RewriteService) GetRewritePolicyLabel(labelname string) ([]models.RewritePolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.RewritePolicyLabel `json:"rewritepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *RewriteService) CountRewritePolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} + +func (s *RewriteService) RenameRewritePolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "rewritepolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, rewritePolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // rewritepolicylabel_binding -func (s *RewriteService) GetAllRewritePolicyLabelBinding() {} -func (s *RewriteService) GetRewritePolicyLabelBinding() {} + +func (s *RewriteService) GetAllRewritePolicyLabelBinding() ([]models.RewritePolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelBinding `json:"rewritepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyLabelBinding(labelname string) ([]models.RewritePolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelBinding `json:"rewritepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // rewritepolicylabel_policybinding_binding -func (s *RewriteService) GetAllRewritePolicyLabelPolicyBindingBinding() {} -func (s *RewriteService) GetRewritePolicyLabelPolicyBindingBinding() {} -func (s *RewriteService) CountRewritePolicyLabelPolicyBindingBinding() {} -// rewritepolicylabel-rewritepolicy_binding -func (s *RewriteService) AddRewritePolicyLabelRewritePolicyBinding() {} -func (s *RewriteService) DeleteRewritePolicyLabelRewritePolicyBinding() {} -func (s *RewriteService) GetAllRewritePolicyLabelRewritePolicyBinding() {} -func (s *RewriteService) GetRewritePolicyLabelRewritePolicyBinding() {} -func (s *RewriteService) CountRewritePolicyLabelRewritePolicyBinding() {} +func (s *RewriteService) GetAllRewritePolicyLabelPolicyBindingBinding() ([]models.RewritePolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelPolicyBindingBinding `json:"rewritepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyLabelPolicyBindingBinding(labelname string) ([]models.RewritePolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelPolicyBindingBinding `json:"rewritepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyLabelPolicyBindingBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// rewritepolicylabel_rewritepolicy_binding + +func (s *RewriteService) AddRewritePolicyLabelRewritePolicyBinding(binding models.RewritePolicyLabelRewritePolicyBinding) error { + payload := map[string]any{ + "rewritepolicylabel_rewritepolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, rewritePolicyLabelRewritePolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) DeleteRewritePolicyLabelRewritePolicyBinding(labelname, policyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s", rewritePolicyLabelRewritePolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *RewriteService) GetAllRewritePolicyLabelRewritePolicyBinding() ([]models.RewritePolicyLabelRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLabelRewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelRewritePolicyBinding `json:"rewritepolicylabel_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyLabelRewritePolicyBinding(labelname string) ([]models.RewritePolicyLabelRewritePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLabelRewritePolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLabelRewritePolicyBinding `json:"rewritepolicylabel_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyLabelRewritePolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyLabelRewritePolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicylabel_rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewritepolicy_binding -func (s *RewriteService) GetAllRewritePolicyBinding() {} -func (s *RewriteService) GetRewritePolicyBinding() {} + +func (s *RewriteService) GetAllRewritePolicyBinding() ([]models.RewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyBinding `json:"rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyBinding(name string) ([]models.RewritePolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyBinding `json:"rewritepolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // rewritepolicy_csvserver_binding -func (s *RewriteService) GetAllRewritePolicyCSVServerBinding() {} -func (s *RewriteService) GetRewritePolicyCSVServerBinding() {} -func (s *RewriteService) CountRewritePolicyCSVServerBinding() {} + +func (s *RewriteService) GetAllRewritePolicyCSVServerBinding() ([]models.RewritePolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyCSVServerBinding `json:"rewritepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyCSVServerBinding(name string) ([]models.RewritePolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyCSVServerBinding `json:"rewritepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewritepolicy_lbvserver_binding -func (s *RewriteService) GetAllRewritePolicyLBVServerBinding() {} -func (s *RewriteService) GetRewritePolicyLBVServerBinding() {} -func (s *RewriteService) CountRewritePolicyLBVServerBinding() {} + +func (s *RewriteService) GetAllRewritePolicyLBVServerBinding() ([]models.RewritePolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLBVServerBinding `json:"rewritepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyLBVServerBinding(name string) ([]models.RewritePolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyLBVServerBinding `json:"rewritepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewritepolicy_rewriteglobal_binding -func (s *RewriteService) GetAllRewritePolicyRewriteGlobalBinding() {} -func (s *RewriteService) GetRewritePolicyRewriteGlobalBinding() {} -func (s *RewriteService) CountRewritePolicyRewriteGlobalBinding() {} + +func (s *RewriteService) GetAllRewritePolicyRewriteGlobalBinding() ([]models.RewritePolicyRewriteGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyRewriteGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyRewriteGlobalBinding `json:"rewritepolicy_rewriteglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyRewriteGlobalBinding(name string) ([]models.RewritePolicyRewriteGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyRewriteGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyRewriteGlobalBinding `json:"rewritepolicy_rewriteglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyRewriteGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyRewriteGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy_rewriteglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewritepolicy_rewritepolicylabel_binding -func (s *RewriteService) GetAllRewritePolicyRewritePolicyLabelBinding() {} -func (s *RewriteService) GetRewritePolicyRewritePolicyLabelBinding() {} -func (s *RewriteService) CountRewritePolicyRewritePolicyLabelBinding() {} + +func (s *RewriteService) GetAllRewritePolicyRewritePolicyLabelBinding() ([]models.RewritePolicyRewritePolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyRewritePolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyRewritePolicyLabelBinding `json:"rewritepolicy_rewritepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyRewritePolicyLabelBinding(name string) ([]models.RewritePolicyRewritePolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyRewritePolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyRewritePolicyLabelBinding `json:"rewritepolicy_rewritepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyRewritePolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyRewritePolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy_rewritepolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // rewritepolicy_vpnvserver_binding -func (s *RewriteService) GetAllRewritePolicyVPNVServerBinding() {} -func (s *RewriteService) GetRewritePolicyVPNVServerBinding() {} -func (s *RewriteService) CountRewritePolicyVPNVServerBinding() {} + +func (s *RewriteService) GetAllRewritePolicyVPNVServerBinding() ([]models.RewritePolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, rewritePolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyVPNVServerBinding `json:"rewritepolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) GetRewritePolicyVPNVServerBinding(name string) ([]models.RewritePolicyVPNVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", rewritePolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.RewritePolicyVPNVServerBinding `json:"rewritepolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *RewriteService) CountRewritePolicyVPNVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", rewritePolicyVPNVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"rewritepolicy_vpnvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/router.go b/nitrogo/router.go index d57920d..e5dd3ac 100644 --- a/nitrogo/router.go +++ b/nitrogo/router.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( routerDynamicRoutingURL = "/nitro/v1/config/routerdynamicrouting" ) @@ -13,10 +23,145 @@ type RouterService struct { // routerdynamicrouting // Configuration for dynamic routing config resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/router/routerdynamicrouting -func (s *RouterService) AddRouterDynamicRouting() {} -func (s *RouterService) DeleteRouterDynamicRouting() {} -func (s *RouterService) UpdateRouterDynamicRouting() {} -func (s *RouterService) UnsetRouterDynamicRouting() {} -func (s *RouterService) GetAllRouterDynamicRouting() {} -func (s *RouterService) CountRouterDynamicRouting() {} -func (s *RouterService) ApplyRouterDynamicRouting() {} + +func (s *RouterService) AddRouterDynamicRouting(routing models.RouterDynamicRouting) error { + payload := map[string]any{ + "routerdynamicrouting": routing, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, routerDynamicRoutingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RouterService) DeleteRouterDynamicRouting(commandString string) error { + // The DELETE for routerdynamicrouting has URL parameters args=commandstring: + reqURL := fmt.Sprintf("%s?args=commandstring:%s", routerDynamicRoutingURL, url.QueryEscape(commandString)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RouterService) UpdateRouterDynamicRouting(routing models.RouterDynamicRouting) error { + payload := map[string]any{ + "routerdynamicrouting": routing, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, routerDynamicRoutingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RouterService) UnsetRouterDynamicRouting(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "routerdynamicrouting": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, routerDynamicRoutingURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *RouterService) GetAllRouterDynamicRouting() ([]models.RouterDynamicRouting, error) { + req, err := s.client.NewRequest(http.MethodGet, routerDynamicRoutingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + RouterDynamicRoutings []models.RouterDynamicRouting `json:"routerdynamicrouting"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.RouterDynamicRoutings, nil +} + +func (s *RouterService) CountRouterDynamicRouting() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, routerDynamicRoutingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + RouterDynamicRoutings []struct { + Count float64 `json:"__count"` + } `json:"routerdynamicrouting"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.RouterDynamicRoutings) > 0 { + return result.RouterDynamicRoutings[0].Count, nil + } + + return 0, nil +} + +func (s *RouterService) ApplyRouterDynamicRouting(routing models.RouterDynamicRouting) error { + payload := map[string]any{ + "routerdynamicrouting": routing, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, routerDynamicRoutingURL+"?action=apply", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/smpp.go b/nitrogo/smpp.go index 71f0c7c..b380d28 100644 --- a/nitrogo/smpp.go +++ b/nitrogo/smpp.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( smppParamURL = "/nitro/v1/config/smppparam" smppUserURL = "/nitro/v1/config/smppuser" @@ -14,16 +23,199 @@ type SMPPService struct { // smppparam // Configuration for SMPP configuration parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/smpp/smppparam -func (s *SMPPService) UpdateSMPPParam() {} -func (s *SMPPService) UnsetSMPPParam() {} -func (s *SMPPService) GetAllSMPPParam() {} + +func (s *SMPPService) UpdateSMPPParam(param models.SMPPParam) error { + payload := map[string]any{ + "smppparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, smppParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SMPPService) UnsetSMPPParam(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "smppparam": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, smppParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SMPPService) GetAllSMPPParam() (models.SMPPParam, error) { + req, err := s.client.NewRequest(http.MethodGet, smppParamURL, nil) + if err != nil { + return models.SMPPParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SMPPParam{}, err + } + + var result struct { + SMPPParams []models.SMPPParam `json:"smppparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SMPPParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SMPPParams) > 0 { + return result.SMPPParams[0], nil + } + + return models.SMPPParam{}, nil +} // smppuser // Configuration for SMPP user resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/smpp/smppuser -func (s *SMPPService) AddSMPPUser() {} -func (s *SMPPService) DeleteSMPPUser() {} -func (s *SMPPService) UpdateSMPPUser() {} -func (s *SMPPService) GetAllSMPPUser() {} -func (s *SMPPService) GetSMPPUser() {} -func (s *SMPPService) CountSMPPUser() {} + +func (s *SMPPService) AddSMPPUser(user models.SMPPUser) error { + payload := map[string]any{ + "smppuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, smppUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SMPPService) DeleteSMPPUser(username string) error { + url := fmt.Sprintf("%s/%s", smppUserURL, username) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SMPPService) UpdateSMPPUser(user models.SMPPUser) error { + payload := map[string]any{ + "smppuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, smppUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SMPPService) GetAllSMPPUser() ([]models.SMPPUser, error) { + req, err := s.client.NewRequest(http.MethodGet, smppUserURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SMPPUsers []models.SMPPUser `json:"smppuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SMPPUsers, nil +} + +func (s *SMPPService) GetSMPPUser(username string) ([]models.SMPPUser, error) { + url := fmt.Sprintf("%s/%s", smppUserURL, username) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SMPPUsers []models.SMPPUser `json:"smppuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SMPPUsers, nil +} + +func (s *SMPPService) CountSMPPUser() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, smppUserURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SMPPUsers []struct { + Count float64 `json:"__count"` + } `json:"smppuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SMPPUsers) > 0 { + return result.SMPPUsers[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/snmp.go b/nitrogo/snmp.go index 7fc0ac8..0f7d83d 100644 --- a/nitrogo/snmp.go +++ b/nitrogo/snmp.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( snmpAlarmURL = "/nitro/v1/config/snmpalarm" snmpCommunityURL = "/nitro/v1/config/snmpcommunity" @@ -23,90 +33,1390 @@ type SNMPService struct { } // snmpalarm -func (s *SNMPService) UpdateSNMPAlarm() {} -func (s *SNMPService) UnsetSNMPAlarm() {} -func (s *SNMPService) EnableSNMPAlarm() {} -func (s *SNMPService) DisableSNMPAlarm() {} -func (s *SNMPService) GetAllSNMPAlarm() {} -func (s *SNMPService) GetSNMPAlarm() {} -func (s *SNMPService) CountSNMPAlarm() {} + +func (s *SNMPService) UpdateSNMPAlarm(alarm models.SNMPAlarm) error { + payload := map[string]any{ + "snmpalarm": alarm, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpAlarmURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPAlarm(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpalarm": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpAlarmURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) EnableSNMPAlarm(trapname string) error { + payload := map[string]any{ + "snmpalarm": map[string]string{ + "trapname": trapname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpAlarmURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DisableSNMPAlarm(trapname string) error { + payload := map[string]any{ + "snmpalarm": map[string]string{ + "trapname": trapname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpAlarmURL+"?action=disable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPAlarm() ([]models.SNMPAlarm, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpAlarmURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Alarms []models.SNMPAlarm `json:"snmpalarm"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Alarms, nil +} + +func (s *SNMPService) GetSNMPAlarm(trapname string) ([]models.SNMPAlarm, error) { + urlReq := fmt.Sprintf("%s/%s", snmpAlarmURL, url.QueryEscape(trapname)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Alarms []models.SNMPAlarm `json:"snmpalarm"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Alarms, nil +} + +func (s *SNMPService) CountSNMPAlarm() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpAlarmURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Alarms []struct { + Count float64 `json:"__count"` + } `json:"snmpalarm"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Alarms) > 0 { + return result.Alarms[0].Count, nil + } + + return 0, nil +} // snmpcommunity -func (s *SNMPService) AddSNMPCommunity() {} -func (s *SNMPService) DeleteSNMPCommunity() {} -func (s *SNMPService) GetAllSNMPCommunity() {} -func (s *SNMPService) GetSNMPCommunity() {} -func (s *SNMPService) CountSNMPCommunity() {} + +func (s *SNMPService) AddSNMPCommunity(community models.SNMPCommunity) error { + payload := map[string]any{ + "snmpcommunity": community, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpCommunityURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPCommunity(communityname string) error { + urlReq := fmt.Sprintf("%s/%s", snmpCommunityURL, url.QueryEscape(communityname)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPCommunity() ([]models.SNMPCommunity, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpCommunityURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Communities []models.SNMPCommunity `json:"snmpcommunity"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Communities, nil +} + +func (s *SNMPService) GetSNMPCommunity(communityname string) ([]models.SNMPCommunity, error) { + urlReq := fmt.Sprintf("%s/%s", snmpCommunityURL, url.QueryEscape(communityname)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Communities []models.SNMPCommunity `json:"snmpcommunity"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Communities, nil +} + +func (s *SNMPService) CountSNMPCommunity() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpCommunityURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Communities []struct { + Count float64 `json:"__count"` + } `json:"snmpcommunity"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Communities) > 0 { + return result.Communities[0].Count, nil + } + + return 0, nil +} // snmpengineid -func (s *SNMPService) UpdateSNMPEngineId() {} -func (s *SNMPService) UnsetSNMPEngineId() {} -func (s *SNMPService) GetAllSNMPEngineId() {} -func (s *SNMPService) GetSNMPEngineId() {} -func (s *SNMPService) CountSNMPEngineId() {} + +func (s *SNMPService) UpdateSNMPEngineId(engineid models.SNMPEngineID) error { + payload := map[string]any{ + "snmpengineid": engineid, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpEngineIdURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPEngineId(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpengineid": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpEngineIdURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPEngineId() ([]models.SNMPEngineID, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpEngineIdURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + EngineIDs []models.SNMPEngineID `json:"snmpengineid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.EngineIDs, nil +} + +func (s *SNMPService) GetSNMPEngineId(ownernode string) ([]models.SNMPEngineID, error) { + urlReq := fmt.Sprintf("%s/%s", snmpEngineIdURL, url.QueryEscape(ownernode)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + EngineIDs []models.SNMPEngineID `json:"snmpengineid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.EngineIDs, nil +} + +func (s *SNMPService) CountSNMPEngineId() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpEngineIdURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + EngineIDs []struct { + Count float64 `json:"__count"` + } `json:"snmpengineid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.EngineIDs) > 0 { + return result.EngineIDs[0].Count, nil + } + + return 0, nil +} // snmpgroup -func (s *SNMPService) AddSNMPGroup() {} -func (s *SNMPService) DeleteSNMPGroup() {} -func (s *SNMPService) GetAllSNMPGroup() {} -func (s *SNMPService) GetSNMPGroup() {} -func (s *SNMPService) CountSNMPGroup() {} + +func (s *SNMPService) AddSNMPGroup(group models.SNMPGroup) error { + payload := map[string]any{ + "snmpgroup": group, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPGroup(name string, securitylevel string) error { + urlReq := fmt.Sprintf("%s/%s?args=securitylevel:%s", snmpGroupURL, url.QueryEscape(name), url.QueryEscape(securitylevel)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPGroup() ([]models.SNMPGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.SNMPGroup `json:"snmpgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Groups, nil +} + +func (s *SNMPService) GetSNMPGroup(name string) ([]models.SNMPGroup, error) { + urlReq := fmt.Sprintf("%s/%s", snmpGroupURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Groups []models.SNMPGroup `json:"snmpgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Groups, nil +} + +func (s *SNMPService) CountSNMPGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Groups []struct { + Count float64 `json:"__count"` + } `json:"snmpgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Groups) > 0 { + return result.Groups[0].Count, nil + } + + return 0, nil +} // snmpmanager -func (s *SNMPService) AddSNMPManager() {} -func (s *SNMPService) DeleteSNMPManager() {} -func (s *SNMPService) UpdateSNMPManager() {} -func (s *SNMPService) UnsetSNMPManager() {} -func (s *SNMPService) GetAllSNMPManager() {} -func (s *SNMPService) CountSNMPManager() {} + +func (s *SNMPService) AddSNMPManager(manager models.SNMPManager) error { + payload := map[string]any{ + "snmpmanager": manager, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpManagerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPManager(ip string) error { + urlReq := fmt.Sprintf("%s/%s", snmpManagerURL, url.QueryEscape(ip)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UpdateSNMPManager(manager models.SNMPManager) error { + payload := map[string]any{ + "snmpmanager": manager, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpManagerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPManager(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpmanager": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpManagerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPManager() ([]models.SNMPManager, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpManagerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Managers []models.SNMPManager `json:"snmpmanager"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Managers, nil +} + +func (s *SNMPService) CountSNMPManager() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpManagerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Managers []struct { + Count float64 `json:"__count"` + } `json:"snmpmanager"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Managers) > 0 { + return result.Managers[0].Count, nil + } + + return 0, nil +} // snmpmib -func (s *SNMPService) UpdateSNMPMIB() {} -func (s *SNMPService) UnsetSNMPMIB() {} -func (s *SNMPService) GetAllSNMPMIB() {} -func (s *SNMPService) GetSNMPMIB() {} -func (s *SNMPService) CountSNMPMIB() {} + +func (s *SNMPService) UpdateSNMPMIB(mib models.SNMPMIB) error { + payload := map[string]any{ + "snmpmib": mib, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpMIBURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPMIB(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpmib": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpMIBURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPMIB() ([]models.SNMPMIB, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpMIBURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + MIBs []models.SNMPMIB `json:"snmpmib"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.MIBs, nil +} + +func (s *SNMPService) GetSNMPMIB(ownernode string) ([]models.SNMPMIB, error) { + urlReq := fmt.Sprintf("%s/%s", snmpMIBURL, url.QueryEscape(ownernode)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + MIBs []models.SNMPMIB `json:"snmpmib"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.MIBs, nil +} + +func (s *SNMPService) CountSNMPMIB() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpMIBURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + MIBs []struct { + Count float64 `json:"__count"` + } `json:"snmpmib"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.MIBs) > 0 { + return result.MIBs[0].Count, nil + } + + return 0, nil +} // snmpoid -func (s *SNMPService) GetAllSNMPOId() {} -func (s *SNMPService) CountSNMPOId() {} + +func (s *SNMPService) GetAllSNMPOId() ([]models.SNMPOID, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpOIDURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + OIDs []models.SNMPOID `json:"snmpoid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.OIDs, nil +} + +func (s *SNMPService) CountSNMPOId() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpOIDURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + OIDs []struct { + Count float64 `json:"__count"` + } `json:"snmpoid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.OIDs) > 0 { + return result.OIDs[0].Count, nil + } + + return 0, nil +} // snmpoption -func (s *SNMPService) UpdateSNMPOption() {} -func (s *SNMPService) UnsetSNMPOption() {} -func (s *SNMPService) GetAllSNMPOption() {} + +func (s *SNMPService) UpdateSNMPOption(option models.SNMPOption) error { + payload := map[string]any{ + "snmpoption": option, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpOptionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPOption(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpoption": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpOptionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPOption() (models.SNMPOption, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpOptionURL, nil) + if err != nil { + return models.SNMPOption{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SNMPOption{}, err + } + + var result struct { + Options []models.SNMPOption `json:"snmpoption"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SNMPOption{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Options) > 0 { + return result.Options[0], nil + } + + return models.SNMPOption{}, nil +} // snmptrap -func (s *SNMPService) AddSNMPTrap() {} -func (s *SNMPService) DeleteSNMPTrap() {} -func (s *SNMPService) UpdateSNMPTrap() {} -func (s *SNMPService) UnsetSNMPTrap() {} -func (s *SNMPService) GetAllSNMPTrap() {} -func (s *SNMPService) CountSNMPTrap() {} + +func (s *SNMPService) AddSNMPTrap(trap models.SNMPTrap) error { + payload := map[string]any{ + "snmptrap": trap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpTrapURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPTrap(trapclass string, trapdestination string) error { + urlReq := fmt.Sprintf("%s/%s?args=trapdestination:%s", snmpTrapURL, url.QueryEscape(trapclass), url.QueryEscape(trapdestination)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UpdateSNMPTrap(trap models.SNMPTrap) error { + payload := map[string]any{ + "snmptrap": trap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpTrapURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPTrap(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmptrap": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpTrapURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPTrap() ([]models.SNMPTrap, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpTrapURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Traps []models.SNMPTrap `json:"snmptrap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Traps, nil +} + +func (s *SNMPService) CountSNMPTrap() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpTrapURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Traps []struct { + Count float64 `json:"__count"` + } `json:"snmptrap"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Traps) > 0 { + return result.Traps[0].Count, nil + } + + return 0, nil +} // snmptrap_binding -func (s *SNMPService) GetAllSNMPTrapBinding() {} -func (s *SNMPService) GetSNMPTrapBinding() {} + +func (s *SNMPService) GetAllSNMPTrapBinding() ([]models.SNMPTrapBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpTrapBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SNMPTrapBinding `json:"snmptrap_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SNMPService) GetSNMPTrapBinding(trapclass string) ([]models.SNMPTrapBinding, error) { + urlReq := fmt.Sprintf("%s/%s", snmpTrapBindingURL, url.QueryEscape(trapclass)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SNMPTrapBinding `json:"snmptrap_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // snmptrap_snmpuser_binding -func (s *SNMPService) AddSNMPTrapSNMPUserBinding() {} -func (s *SNMPService) DeleteSNMPTrapSNMPUserBinding() {} -func (s *SNMPService) GetAllSNMPTrapSNMPUserBinding() {} -func (s *SNMPService) GetSNMPTrapSNMPUserBinding() {} -func (s *SNMPService) CountSNMPTrapSNMPUserBinding() {} + +func (s *SNMPService) AddSNMPTrapSNMPUserBinding(binding models.SNMPTrapSNMPUserBinding) error { + payload := map[string]any{ + "snmptrap_snmpuser_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpTrapSNMPUserBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPTrapSNMPUserBinding(trapclass string, trapdestination string) error { + urlReq := fmt.Sprintf("%s/%s?args=trapdestination:%s", snmpTrapSNMPUserBindingURL, url.QueryEscape(trapclass), url.QueryEscape(trapdestination)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPTrapSNMPUserBinding() ([]models.SNMPTrapSNMPUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpTrapSNMPUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SNMPTrapSNMPUserBinding `json:"snmptrap_snmpuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SNMPService) GetSNMPTrapSNMPUserBinding(trapclass string) ([]models.SNMPTrapSNMPUserBinding, error) { + urlReq := fmt.Sprintf("%s/%s", snmpTrapSNMPUserBindingURL, url.QueryEscape(trapclass)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SNMPTrapSNMPUserBinding `json:"snmptrap_snmpuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SNMPService) CountSNMPTrapSNMPUserBinding(trapclass string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", snmpTrapSNMPUserBindingURL, url.QueryEscape(trapclass)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"snmptrap_snmpuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // snmpuser -func (s *SNMPService) AddSNMPUser() {} -func (s *SNMPService) DeleteSNMPUser() {} -func (s *SNMPService) UpdateSNMPUser() {} -func (s *SNMPService) UnsetSNMPUser() {} -func (s *SNMPService) GetAllSNMPUser() {} -func (s *SNMPService) GetSNMPUser() {} -func (s *SNMPService) CountSNMPUser() {} + +func (s *SNMPService) AddSNMPUser(user models.SNMPUser) error { + payload := map[string]any{ + "snmpuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPUser(name string) error { + urlReq := fmt.Sprintf("%s/%s", snmpUserURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UpdateSNMPUser(user models.SNMPUser) error { + payload := map[string]any{ + "snmpuser": user, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpUserURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UnsetSNMPUser(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "snmpuser": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpUserURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPUser() ([]models.SNMPUser, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpUserURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Users []models.SNMPUser `json:"snmpuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Users, nil +} + +func (s *SNMPService) GetSNMPUser(name string) ([]models.SNMPUser, error) { + urlReq := fmt.Sprintf("%s/%s", snmpUserURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Users []models.SNMPUser `json:"snmpuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Users, nil +} + +func (s *SNMPService) CountSNMPUser() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpUserURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Users []struct { + Count float64 `json:"__count"` + } `json:"snmpuser"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Users) > 0 { + return result.Users[0].Count, nil + } + + return 0, nil +} // snmpview -func (s *SNMPService) AddSNMPView() {} -func (s *SNMPService) DeleteSNMPView() {} -func (s *SNMPService) UpdateSNMPView() {} -func (s *SNMPService) GetAllSNMPView() {} -func (s *SNMPService) CountSNMPView() {} + +func (s *SNMPService) AddSNMPView(view models.SNMPView) error { + payload := map[string]any{ + "snmpview": view, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, snmpViewURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) DeleteSNMPView(name string, subtree string) error { + urlReq := fmt.Sprintf("%s/%s?args=subtree:%s", snmpViewURL, url.QueryEscape(name), url.QueryEscape(subtree)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) UpdateSNMPView(view models.SNMPView) error { + payload := map[string]any{ + "snmpview": view, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, snmpViewURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SNMPService) GetAllSNMPView() ([]models.SNMPView, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpViewURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Views []models.SNMPView `json:"snmpview"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Views, nil +} + +func (s *SNMPService) CountSNMPView() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, snmpViewURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Views []struct { + Count float64 `json:"__count"` + } `json:"snmpview"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Views) > 0 { + return result.Views[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/spillover.go b/nitrogo/spillover.go index 9b7c316..97fa57f 100644 --- a/nitrogo/spillover.go +++ b/nitrogo/spillover.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( spilloverActionURL = "/nitro/v1/config/spilloveraction" spilloverPolicyURL = "/nitro/v1/config/spilloverpolicy" @@ -18,48 +28,594 @@ type SpilloverService struct { // spilloveraction // Configuration for Spillover action resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloveraction -func (s *SpilloverService) AddSpilloverAction() {} -func (s *SpilloverService) DeleteSpilloverAction() {} -func (s *SpilloverService) GetAllSpilloverAction() {} -func (s *SpilloverService) GetSpilloverAction() {} -func (s *SpilloverService) CountSpilloverAction() {} -func (s *SpilloverService) RenameSpilloverAction() {} + +func (s *SpilloverService) AddSpilloverAction(action models.SpilloverAction) error { + payload := map[string]any{ + "spilloveraction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, spilloverActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) DeleteSpilloverAction(name string) error { + urlReq := fmt.Sprintf("%s/%s", spilloverActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) GetAllSpilloverAction() ([]models.SpilloverAction, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.SpilloverAction `json:"spilloveraction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *SpilloverService) GetSpilloverAction(name string) ([]models.SpilloverAction, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.SpilloverAction `json:"spilloveraction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *SpilloverService) CountSpilloverAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"spilloveraction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} + +func (s *SpilloverService) RenameSpilloverAction(name string, newname string) error { + payload := map[string]any{ + "spilloveraction": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, spilloverActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // spilloverpolicy // Configuration for Spillover policy resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloverpolicy -func (s *SpilloverService) AddSpilloverPolicy() {} -func (s *SpilloverService) DeleteSpilloverPolicy() {} -func (s *SpilloverService) UpdateSpilloverPolicy() {} -func (s *SpilloverService) UnsetSpilloverPolicy() {} -func (s *SpilloverService) GetAllSpilloverPolicy() {} -func (s *SpilloverService) GetSpilloverPolicy() {} -func (s *SpilloverService) CountSpilloverPolicy() {} -func (s *SpilloverService) RenameSpilloverPolicy() {} + +func (s *SpilloverService) AddSpilloverPolicy(policy models.SpilloverPolicy) error { + payload := map[string]any{ + "spilloverpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, spilloverPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) DeleteSpilloverPolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) UpdateSpilloverPolicy(policy models.SpilloverPolicy) error { + payload := map[string]any{ + "spilloverpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, spilloverPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) UnsetSpilloverPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "spilloverpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, spilloverPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SpilloverService) GetAllSpilloverPolicy() ([]models.SpilloverPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.SpilloverPolicy `json:"spilloverpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *SpilloverService) GetSpilloverPolicy(name string) ([]models.SpilloverPolicy, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.SpilloverPolicy `json:"spilloverpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *SpilloverService) CountSpilloverPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"spilloverpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} + +func (s *SpilloverService) RenameSpilloverPolicy(name string, newname string) error { + payload := map[string]any{ + "spilloverpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, spilloverPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // spilloverpolicy_binding // Binding object which returns the resources bound to spilloverpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloverpolicy_binding -func (s *SpilloverService) GetAllSpilloverPolicyBinding() {} -func (s *SpilloverService) GetSpilloverPolicyBinding() {} + +func (s *SpilloverService) GetAllSpilloverPolicyBinding() ([]models.SpilloverPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyBinding `json:"spilloverpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) GetSpilloverPolicyBinding(name string) ([]models.SpilloverPolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyBinding `json:"spilloverpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // spilloverpolicy_csvserver_binding // Binding object showing the csvserver that can be bound to spilloverpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloverpolicy_csvserver_binding -func (s *SpilloverService) GetAllSpilloverPolicyCSVServerBinding() {} -func (s *SpilloverService) GetSpilloverPolicyCSVServerBinding() {} -func (s *SpilloverService) CountSpilloverPolicyCSVServerBinding() {} + +func (s *SpilloverService) GetAllSpilloverPolicyCSVServerBinding() ([]models.SpilloverPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyCSVServerBinding `json:"spilloverpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) GetSpilloverPolicyCSVServerBinding(name string) ([]models.SpilloverPolicyCSVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyCSVServerBinding `json:"spilloverpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) CountSpilloverPolicyCSVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", spilloverPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"spilloverpolicy_csvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // spilloverpolicy_gslbvserver_binding // Binding object showing the gslbvserver that can be bound to spilloverpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloverpolicy_gslbvserver_binding -func (s *SpilloverService) GetAllSpilloverPolicyGSLBVServerBinding() {} -func (s *SpilloverService) GetSpilloverPolicyGSLBVServerBinding() {} -func (s *SpilloverService) CountSpilloverPolicyGSLBVServerBinding() {} + +func (s *SpilloverService) GetAllSpilloverPolicyGSLBVServerBinding() ([]models.SpilloverPolicyGSLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyGSLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyGSLBVServerBinding `json:"spilloverpolicy_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) GetSpilloverPolicyGSLBVServerBinding(name string) ([]models.SpilloverPolicyGSLBVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyGSLBVServerBinding `json:"spilloverpolicy_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) CountSpilloverPolicyGSLBVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", spilloverPolicyGSLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"spilloverpolicy_gslbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // spilloverpolicy_lbvserver_binding // Binding object showing the lbvserver that can be bound to spilloverpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/spillover/spilloverpolicy_lbvserver_binding -func (s *SpilloverService) GetAllSpilloverPolicyLBVServerBinding() {} -func (s *SpilloverService) GetSpilloverPolicyLBVServerBinding() {} -func (s *SpilloverService) CountSpilloverPolicyLBVServerBinding() {} + +func (s *SpilloverService) GetAllSpilloverPolicyLBVServerBinding() ([]models.SpilloverPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, spilloverPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyLBVServerBinding `json:"spilloverpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) GetSpilloverPolicyLBVServerBinding(name string) ([]models.SpilloverPolicyLBVServerBinding, error) { + urlReq := fmt.Sprintf("%s/%s", spilloverPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.SpilloverPolicyLBVServerBinding `json:"spilloverpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *SpilloverService) CountSpilloverPolicyLBVServerBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", spilloverPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"spilloverpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/ssl.go b/nitrogo/ssl.go index 1912231..92b7edc 100644 --- a/nitrogo/ssl.go +++ b/nitrogo/ssl.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( sslActionURL = "/nitro/v1/config/sslaction" sslCACertGroupURL = "/nitro/v1/config/sslcacertgroup" @@ -101,138 +111,1605 @@ type SSLService struct { } // sslaction -func (s *SSLService) AddSSLAction() {} -func (s *SSLService) DeleteSSLAction() {} -func (s *SSLService) GetAllSSLAction() {} -func (s *SSLService) GetSSLAction() {} -func (s *SSLService) CountSSLAction() {} +func (s *SSLService) AddSSLAction(action models.SSLAction) error { + payload := map[string]any{"sslaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLAction() ([]models.SSLAction, error) { + req, err := s.client.NewRequest(http.MethodGet, sslActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLAction `json:"sslaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLAction(name string) ([]models.SSLAction, error) { + reqURL := fmt.Sprintf("%s/%s", sslActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLAction `json:"sslaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcacertgroup -func (s *SSLService) AddSSLCACertGroup() {} -func (s *SSLService) DeleteSSLCACertGroup() {} -func (s *SSLService) GetAllSSLCACertGroup() {} -func (s *SSLService) GetSSLCACertGroup() {} -func (s *SSLService) CountSSLCACertGroup() {} +func (s *SSLService) AddSSLCACertGroup(group models.SSLCACertGroup) error { + payload := map[string]any{"sslcacertgroup": group} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCACertGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCACertGroup(cacertgroupname string) error { + reqURL := fmt.Sprintf("%s/%s", sslCACertGroupURL, url.QueryEscape(cacertgroupname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCACertGroup() ([]models.SSLCACertGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCACertGroupURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroup `json:"sslcacertgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCACertGroup(cacertgroupname string) ([]models.SSLCACertGroup, error) { + reqURL := fmt.Sprintf("%s/%s", sslCACertGroupURL, url.QueryEscape(cacertgroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroup `json:"sslcacertgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCACertGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCACertGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcacertgroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcacertgroup_binding -func (s *SSLService) GetAllSSLCACertGroupBinding() {} -func (s *SSLService) GetSSLCACertGroupBinding() {} +func (s *SSLService) GetAllSSLCACertGroupBinding() ([]models.SSLCACertGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCACertGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroupBinding `json:"sslcacertgroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCACertGroupBinding(cacertgroupname string) ([]models.SSLCACertGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCACertGroupBindingURL, url.QueryEscape(cacertgroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroupBinding `json:"sslcacertgroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslcacertgroup_sslcertkey_binding -func (s *SSLService) AddSSLCACertGroupSSLCertKeyBinding() {} -func (s *SSLService) DeleteSSLCACertGroupSSLCertKeyBinding() {} -func (s *SSLService) GetAllSSLCACertGroupSSLCertKeyBinding() {} -func (s *SSLService) GetSSLCACertGroupSSLCertKeyBinding() {} -func (s *SSLService) CountSSLCACertGroupSSLCertKeyBinding() {} +func (s *SSLService) AddSSLCACertGroupSSLCertKeyBinding(binding models.SSLCACertGroupSSLCertKeyBinding) error { + payload := map[string]any{"sslcacertgroup_sslcertkey_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCACertGroupSSLCertKeyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCACertGroupSSLCertKeyBinding(cacertgroupname string, certkeyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=certkeyname:%s", sslCACertGroupSSLCertKeyBindingURL, url.QueryEscape(cacertgroupname), url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCACertGroupSSLCertKeyBinding() ([]models.SSLCACertGroupSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCACertGroupSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroupSSLCertKeyBinding `json:"sslcacertgroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCACertGroupSSLCertKeyBinding(cacertgroupname string) ([]models.SSLCACertGroupSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCACertGroupSSLCertKeyBindingURL, url.QueryEscape(cacertgroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCACertGroupSSLCertKeyBinding `json:"sslcacertgroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCACertGroupSSLCertKeyBinding(cacertgroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCACertGroupSSLCertKeyBindingURL, url.QueryEscape(cacertgroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcacertgroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcert -func (s *SSLService) CreateSSLCert() {} +func (s *SSLService) CreateSSLCert(cert models.SSLCert) error { + payload := map[string]any{"sslcert": cert} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // sslcertbundle -func (s *SSLService) ImportSSLCertBundle() {} -func (s *SSLService) DeleteSSLCertBundle() {} -func (s *SSLService) ApplySSLCertBundle() {} -func (s *SSLService) ExportSSLCertBundle() {} -func (s *SSLService) GetAllSSLCertBundle() {} -func (s *SSLService) CountSSLCertBundle() {} +func (s *SSLService) ImportSSLCertBundle(bundle models.SSLCertBundle) error { + payload := map[string]any{"sslcertbundle": bundle} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertBundleURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCertBundle(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslCertBundleURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) ApplySSLCertBundle() error { + req, err := s.client.NewRequest(http.MethodPost, sslCertBundleURL+"?action=apply", nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) ExportSSLCertBundle(bundle models.SSLCertBundle) error { + payload := map[string]any{"sslcertbundle": bundle} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertBundleURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCertBundle() ([]models.SSLCertBundle, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertBundleURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertBundle `json:"sslcertbundle"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertBundle() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertBundleURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertbundle"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertchain -func (s *SSLService) GetAllSSLCertChain() {} -func (s *SSLService) GetSSLCertChain() {} -func (s *SSLService) CountSSLCertChain() {} +func (s *SSLService) GetAllSSLCertChain() ([]models.SSLCertChain, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertChainURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertChain `json:"sslcertchain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertChain(certkeyname string) ([]models.SSLCertChain, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertChainURL, url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertChain `json:"sslcertchain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertChain() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertChainURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertchain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertchain_binding -func (s *SSLService) GetSSLCertChainBinding() {} +func (s *SSLService) GetSSLCertChainBinding(certkeyname string) ([]models.SSLCertChainBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertChainBindingURL, url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertChainBinding `json:"sslcertchain_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslcertchain_sslcertkey_binding -func (s *SSLService) GetSSLCertChainSSLCertKeyBinding() {} -func (s *SSLService) CountSSLCertChainSSLCertKeyBinding() {} +func (s *SSLService) GetSSLCertChainSSLCertKeyBinding(certkeyname string) ([]models.SSLCertChainSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertChainSSLCertKeyBindingURL, url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertChainSSLCertKeyBinding `json:"sslcertchain_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertChainSSLCertKeyBinding(certkeyname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertChainSSLCertKeyBindingURL, url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertchain_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertfile -func (s *SSLService) ImportSSLCertFile() {} -func (s *SSLService) DeleteSSLCertFile() {} -func (s *SSLService) GetAllSSLCertFile() {} -func (s *SSLService) CountSSLCertFile() {} +func (s *SSLService) ImportSSLCertFile(file models.SSLCertFile) error { + payload := map[string]any{"sslcertfile": file} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertFileURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCertFile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslCertFileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCertFile() ([]models.SSLCertFile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertFileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertFile `json:"sslcertfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertFile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertFileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertificatechain -func (s *SSLService) AddSSLCertificateChain() {} -func (s *SSLService) GetAllSSLCertificateChain() {} -func (s *SSLService) GetSSLCertificateChain() {} -func (s *SSLService) CountSSLCertificateChain() {} +func (s *SSLService) AddSSLCertificateChain(chain models.SSLCertificateChain) error { + payload := map[string]any{"sslcertificatechain": chain} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertificateChainURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCertificateChain() ([]models.SSLCertificateChain, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertificateChainURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertificateChain `json:"sslcertificatechain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertificateChain(certkeyname string) ([]models.SSLCertificateChain, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertificateChainURL, url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertificateChain `json:"sslcertificatechain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertificateChain() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertificateChainURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertificatechain"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey -func (s *SSLService) AddSSLCertKey() {} -func (s *SSLService) DeleteSSLCertKey() {} -func (s *SSLService) UpdateSSLCertKey() {} -func (s *SSLService) UnsetSSLCertKey() {} -func (s *SSLService) LinkSSLCertKey() {} -func (s *SSLService) UnlinkSSLCertKey() {} -func (s *SSLService) ChangeSSLCertKey() {} -func (s *SSLService) ClearSSLCertKey() {} -func (s *SSLService) GetAllSSLCertKey() {} -func (s *SSLService) GetSSLCertKey() {} -func (s *SSLService) CountSSLCertKey() {} +func (s *SSLService) AddSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCertKey(certkey string) error { + reqURL := fmt.Sprintf("%s/%s", sslCertKeyURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCertKeyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLCertKey(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslcertkey": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) LinkSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL+"?action=link", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnlinkSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL+"?action=unlink", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) ChangeSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) ClearSSLCertKey(certkey models.SSLCertKey) error { + payload := map[string]any{"sslcertkey": certkey} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertKeyURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCertKey() ([]models.SSLCertKey, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKey `json:"sslcertkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKey(certkey string) ([]models.SSLCertKey, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeyURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKey `json:"sslcertkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKey() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey_binding -func (s *SSLService) GetAllSSLCertKeyBinding() {} -func (s *SSLService) GetSSLCertKeyBinding() {} +func (s *SSLService) GetAllSSLCertKeyBinding() ([]models.SSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyBinding `json:"sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeyBinding(certkey string) ([]models.SSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeyBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyBinding `json:"sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslcertkey_crldistribution_binding -func (s *SSLService) GetAllSSLCertKeyCRLDistributionBinding() {} -func (s *SSLService) GetSSLCertKeyCRLDistributionBinding() {} -func (s *SSLService) CountSSLCertKeyCRLDistributionBinding() {} +func (s *SSLService) GetAllSSLCertKeyCRLDistributionBinding() ([]models.SSLCertKeyCRLDistributionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeyCRLDistributionBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyCRLDistributionBinding `json:"sslcertkey_crldistribution_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeyCRLDistributionBinding(certkey string) ([]models.SSLCertKeyCRLDistributionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeyCRLDistributionBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyCRLDistributionBinding `json:"sslcertkey_crldistribution_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKeyCRLDistributionBinding(certkey string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertKeyCRLDistributionBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey_crldistribution_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey_service_binding -func (s *SSLService) GetAllSSLCertKeyServiceBinding() {} -func (s *SSLService) GetSSLCertKeyServiceBinding() {} -func (s *SSLService) CountSSLCertKeyServiceBinding() {} +func (s *SSLService) GetAllSSLCertKeyServiceBinding() ([]models.SSLCertKeyServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeyServiceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyServiceBinding `json:"sslcertkey_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeyServiceBinding(certkey string) ([]models.SSLCertKeyServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeyServiceBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeyServiceBinding `json:"sslcertkey_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKeyServiceBinding(certkey string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertKeyServiceBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey_service_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey_sslocspresponder_binding -func (s *SSLService) AddSSLCertKeySSLOCSPResponderBinding() {} -func (s *SSLService) DeleteSSLCertKeySSLOCSPResponderBinding() {} -func (s *SSLService) GetAllSSLCertKeySSLOCSPResponderBinding() {} -func (s *SSLService) GetSSLCertKeySSLOCSPResponderBinding() {} -func (s *SSLService) CountSSLCertKeySSLOCSPResponderBinding() {} +func (s *SSLService) AddSSLCertKeySSLOCSPResponderBinding(binding models.SSLCertKeySSLOCSPResponderBinding) error { + payload := map[string]any{"sslcertkey_sslocspresponder_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCertKeySSLOCSPResponderBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCertKeySSLOCSPResponderBinding(certkey string, ocspresponder string) error { + reqURL := fmt.Sprintf("%s/%s?args=ocspresponder:%s", sslCertKeySSLOCSPResponderBindingURL, url.QueryEscape(certkey), url.QueryEscape(ocspresponder)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCertKeySSLOCSPResponderBinding() ([]models.SSLCertKeySSLOCSPResponderBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeySSLOCSPResponderBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLOCSPResponderBinding `json:"sslcertkey_sslocspresponder_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeySSLOCSPResponderBinding(certkey string) ([]models.SSLCertKeySSLOCSPResponderBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeySSLOCSPResponderBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLOCSPResponderBinding `json:"sslcertkey_sslocspresponder_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKeySSLOCSPResponderBinding(certkey string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertKeySSLOCSPResponderBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey_sslocspresponder_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey_sslprofile_binding -func (s *SSLService) GetAllSSLCertKeySSLProfileBinding() {} -func (s *SSLService) GetSSLCertKeySSLProfileBinding() {} -func (s *SSLService) CountSSLCertKeySSLProfileBinding() {} +func (s *SSLService) GetAllSSLCertKeySSLProfileBinding() ([]models.SSLCertKeySSLProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeySSLProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLProfileBinding `json:"sslcertkey_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeySSLProfileBinding(certkey string) ([]models.SSLCertKeySSLProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeySSLProfileBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLProfileBinding `json:"sslcertkey_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKeySSLProfileBinding(certkey string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertKeySSLProfileBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertkey_sslvserver_binding -func (s *SSLService) GetAllSSLCertKeySSLVServerBinding() {} -func (s *SSLService) GetSSLCertKeySSLVServerBinding() {} -func (s *SSLService) CountSSLCertKeySSLVServerBinding() {} +func (s *SSLService) GetAllSSLCertKeySSLVServerBinding() ([]models.SSLCertKeySSLVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertKeySSLVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLVServerBinding `json:"sslcertkey_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCertKeySSLVServerBinding(certkey string) ([]models.SSLCertKeySSLVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCertKeySSLVServerBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertKeySSLVServerBinding `json:"sslcertkey_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertKeySSLVServerBinding(certkey string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCertKeySSLVServerBindingURL, url.QueryEscape(certkey)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertkey_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertlink -func (s *SSLService) GetAllSSLCertLink() {} -func (s *SSLService) CountSSLCertLink() {} +func (s *SSLService) GetAllSSLCertLink() ([]models.SSLCertLink, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertLinkURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCertLink `json:"sslcertlink"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCertLink() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCertLinkURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcertlink"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcertreq -func (s *SSLService) CreateSSLCertReq() {} +func (s *SSLService) CreateSSLCertReq(certreq models.SSLCertReq) error { + payload := map[string]any{"sslcertreq": certreq} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCertReqURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} // sslcipher -func (s *SSLService) AddSSLCipher() {} -func (s *SSLService) DeleteSSLCipher() {} -func (s *SSLService) UpdateSSLCipher() {} -func (s *SSLService) UnsetSSLCipher() {} -func (s *SSLService) GetAllSSLCipher() {} -func (s *SSLService) GetSSLCipher() {} -func (s *SSLService) CountSSLCipher() {} +func (s *SSLService) AddSSLCipher(cipher models.SSLCipher) error { + payload := map[string]any{"sslcipher": cipher} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCipherURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCipher(ciphergroupname string) error { + reqURL := fmt.Sprintf("%s/%s", sslCipherURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLCipher(cipher models.SSLCipher) error { + payload := map[string]any{"sslcipher": cipher} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCipherURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLCipher(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslcipher": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCipherURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCipher() ([]models.SSLCipher, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipher `json:"sslcipher"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipher(ciphergroupname string) ([]models.SSLCipher, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipher `json:"sslcipher"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCipher() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcipher"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslciphersuite -func (s *SSLService) GetAllSSLCipherSuite() {} -func (s *SSLService) GetSSLCipherSuite() {} -func (s *SSLService) CountSSLCipherSuite() {} +func (s *SSLService) GetAllSSLCipherSuite() ([]models.SSLCipherSuite, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherSuiteURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSuite `json:"sslciphersuite"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipherSuite(ciphername string) ([]models.SSLCipherSuite, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherSuiteURL, url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSuite `json:"sslciphersuite"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCipherSuite() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherSuiteURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslciphersuite"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcipher_binding -func (s *SSLService) GetAllSSLCipherBinding() {} -func (s *SSLService) GetSSLCipherBinding() {} +func (s *SSLService) GetAllSSLCipherBinding() ([]models.SSLCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherBinding `json:"sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipherBinding(ciphergroupname string) ([]models.SSLCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherBinding `json:"sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslcipher_individualcipher_binding -func (s *SSLService) GetAllSSLCipherIndividualCipherBinding() {} -func (s *SSLService) GetSSLCipherIndividualCipherBinding() {} -func (s *SSLService) CountSSLCipherIndividualCipherBinding() {} +func (s *SSLService) GetAllSSLCipherIndividualCipherBinding() ([]models.SSLCipherIndividualCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherIndividualCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherIndividualCipherBinding `json:"sslcipher_individualcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipherIndividualCipherBinding(ciphergroupname string) ([]models.SSLCipherIndividualCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherIndividualCipherBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherIndividualCipherBinding `json:"sslcipher_individualcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCipherIndividualCipherBinding(ciphergroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCipherIndividualCipherBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcipher_individualcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcipher_servicegroup_binding // This object has no operations documented. These are guesses and need to be tested before they will be uncommented. @@ -247,16 +1724,158 @@ func (s *SSLService) CountSSLCipherIndividualCipherBinding() {} // func (s *SSLService) CountSSLCipherServiceBinding() {} // sslcipher_sslciphersuite_binding -func (s *SSLService) AddSSLCipherSSLCipherSuiteBinding() {} -func (s *SSLService) DeleteSSLCipherSSLCipherSuiteBinding() {} -func (s *SSLService) GetAllSSLCipherSSLCipherSuiteBinding() {} -func (s *SSLService) GetSSLCipherSSLCipherSuiteBinding() {} -func (s *SSLService) CountSSLCipherSSLCipherSuiteBinding() {} +func (s *SSLService) AddSSLCipherSSLCipherSuiteBinding(binding models.SSLCipherSSLCipherSuiteBinding) error { + payload := map[string]any{"sslcipher_sslciphersuite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCipherSSLCipherSuiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLCipherSSLCipherSuiteBinding(ciphergroupname string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslCipherSSLCipherSuiteBindingURL, url.QueryEscape(ciphergroupname), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLCipherSSLCipherSuiteBinding() ([]models.SSLCipherSSLCipherSuiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherSSLCipherSuiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSSLCipherSuiteBinding `json:"sslcipher_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipherSSLCipherSuiteBinding(ciphergroupname string) ([]models.SSLCipherSSLCipherSuiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherSSLCipherSuiteBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSSLCipherSuiteBinding `json:"sslcipher_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCipherSSLCipherSuiteBinding(ciphergroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCipherSSLCipherSuiteBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcipher_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcipher_sslprofile_binding -func (s *SSLService) GetAllSSLCipherSSLProfileBinding() {} -func (s *SSLService) GetSSLCipherSSLProfileBinding() {} -func (s *SSLService) CountSSLCipherSSLProfileBinding() {} +func (s *SSLService) GetAllSSLCipherSSLProfileBinding() ([]models.SSLCipherSSLProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCipherSSLProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSSLProfileBinding `json:"sslcipher_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLCipherSSLProfileBinding(ciphergroupname string) ([]models.SSLCipherSSLProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCipherSSLProfileBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCipherSSLProfileBinding `json:"sslcipher_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLCipherSSLProfileBinding(ciphergroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCipherSSLProfileBindingURL, url.QueryEscape(ciphergroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcipher_sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslcipher_sslvserver_binding // This object has no operations documented. These are guesses and need to be tested before they will be uncommented. @@ -265,369 +1884,4437 @@ func (s *SSLService) CountSSLCipherSSLProfileBinding() {} // func (s *SSLService) CountSSLCipherSSLVServerBinding() {} // sslcrl -func (s *SSLService) AddSSLCRL() {} -func (s *SSLService) DeleteSSLCRL() {} -func (s *SSLService) UpdateSSLCRL() {} -func (s *SSLService) UnsetSSLCRL() {} -func (s *SSLService) CreateSSLCRL() {} -func (s *SSLService) GetAllSSLCRL() {} -func (s *SSLService) GetSSLCRL() {} -func (s *SSLService) CountSSLCRL() {} +func (s *SSLService) AddSSLCRL(crl models.SSLCRL) error { + payload := map[string]any{"sslcrl": crl} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCRLURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslcrlfile -func (s *SSLService) ImportSSLCRLFile() {} -func (s *SSLService) DeleteSSLCRLFile() {} -func (s *SSLService) GetAllSSLCRLFile() {} -func (s *SSLService) CountSSLCRLFile() {} +func (s *SSLService) DeleteSSLCRL(crlname string) error { + reqURL := fmt.Sprintf("%s/%s", sslCRLURL, url.QueryEscape(crlname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslcrl_binding -func (s *SSLService) GetAllSSLCRLBinding() {} -func (s *SSLService) GetSSLCRLBinding() {} +func (s *SSLService) UpdateSSLCRL(crl models.SSLCRL) error { + payload := map[string]any{"sslcrl": crl} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslCRLURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslcrl_serialnumber_binding -func (s *SSLService) GetAllSSLCRLSerialNumberBinding() {} -func (s *SSLService) GetSSLCRLSerialNumberBinding() {} -func (s *SSLService) CountSSLCRLSerialNumberBinding() {} +func (s *SSLService) UnsetSSLCRL(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslcrl": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCRLURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// ssldhfile -func (s *SSLService) ImportSSLDHFile() {} -func (s *SSLService) DeleteSSLDHFile() {} -func (s *SSLService) GetAllSSLDHFile() {} -func (s *SSLService) CountSSLDHFile() {} +func (s *SSLService) CreateSSLCRL(crl models.SSLCRL) error { + payload := map[string]any{"sslcrl": crl} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCRLURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// ssldhparam -func (s *SSLService) ParamSSLDHParam() {} +func (s *SSLService) GetAllSSLCRL() ([]models.SSLCRL, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRL `json:"sslcrl"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// ssldtlsprofile -func (s *SSLService) AddSSLDTLSProfile() {} -func (s *SSLService) DeleteSSLDTLSProfile() {} -func (s *SSLService) UpdateSSLDTLSProfile() {} -func (s *SSLService) UnsetSSLDTLSProfile() {} -func (s *SSLService) GetAllSSLDTLSProfile() {} -func (s *SSLService) GetSSLDTLSProfile() {} -func (s *SSLService) CountSSLDTLSProfile() {} +func (s *SSLService) GetSSLCRL(crlname string) ([]models.SSLCRL, error) { + reqURL := fmt.Sprintf("%s/%s", sslCRLURL, url.QueryEscape(crlname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRL `json:"sslcrl"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslecdsakey -func (s *SSLService) CreateSSLECDSAKey() {} +func (s *SSLService) CountSSLCRL() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcrl"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} -// sslfips -func (s *SSLService) UpdateSSLFIPs() {} -func (s *SSLService) UnsetSSLFIPs() {} -func (s *SSLService) ChangeSSLFIPs() {} -func (s *SSLService) ResetSSLFIPs() {} -func (s *SSLService) GetAllSSLFIPs() {} +// sslcrlfile +func (s *SSLService) ImportSSLCRLFile(file models.SSLCRLFile) error { + payload := map[string]any{"sslcrlfile": file} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslCRLFileURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslfipskey -func (s *SSLService) CreateSSLFIPsKey() {} -func (s *SSLService) DeleteSSLFIPsKey() {} -func (s *SSLService) ImportSSLFIPsKey() {} -func (s *SSLService) ExportSSLFIPsKey() {} -func (s *SSLService) GetAllSSLFIPsKey() {} -func (s *SSLService) GetSSLFIPsKey() {} -func (s *SSLService) CountSSLFIPsKey() {} +func (s *SSLService) DeleteSSLCRLFile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslCRLFileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslfipssimsource -func (s *SSLService) EnableSSLFIPsSIMSource() {} -func (s *SSLService) InitSSLFIPsSIMSource() {} +func (s *SSLService) GetAllSSLCRLFile() ([]models.SSLCRLFile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLFileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRLFile `json:"sslcrlfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslfipssimtarget -func (s *SSLService) EnableSSLFIPsSIMTarget() {} -func (s *SSLService) InitSSLFIPsSIMTarget() {} +func (s *SSLService) CountSSLCRLFile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLFileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcrlfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} -// sslglobal_binding -func (s *SSLService) GetSSLGLobalBinding() {} +// sslcrl_binding +func (s *SSLService) GetAllSSLCRLBinding() ([]models.SSLCRLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRLBinding `json:"sslcrl_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslglobal_sslpolicy_binding -func (s *SSLService) AddSSLGlobalSSLPolicyBinding() {} -func (s *SSLService) DeleteSSLGlobalSSLPolicyBinding() {} -func (s *SSLService) GetSSLGlobalSSLPolicyBinding() {} -func (s *SSLService) CountSSLGlobalSSLPolicyBinding() {} +func (s *SSLService) GetSSLCRLBinding(crlname string) ([]models.SSLCRLBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCRLBindingURL, url.QueryEscape(crlname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRLBinding `json:"sslcrl_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslhsmkey -func (s *SSLService) AddSSLHSMKey() {} -func (s *SSLService) DeleteSSLHSMKey() {} -func (s *SSLService) GetAllSSLHSMKey() {} -func (s *SSLService) GetSSLHSMKey() {} -func (s *SSLService) CountSSLHSMKey() {} +// sslcrl_serialnumber_binding +func (s *SSLService) GetAllSSLCRLSerialNumberBinding() ([]models.SSLCRLSerialNumberBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslCRLSerialNumberBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRLSerialNumberBinding `json:"sslcrl_serialnumber_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslkeyfile -func (s *SSLService) ImportSSLKeyFile() {} -func (s *SSLService) DeleteSSLKeyFile() {} -func (s *SSLService) GetAllSSLKeyFile() {} -func (s *SSLService) CountSSLKeyFile() {} +func (s *SSLService) GetSSLCRLSerialNumberBinding(crlname string) ([]models.SSLCRLSerialNumberBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslCRLSerialNumberBindingURL, url.QueryEscape(crlname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLCRLSerialNumberBinding `json:"sslcrl_serialnumber_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// ssllogprofile -func (s *SSLService) AddSSLLogProfile() {} -func (s *SSLService) DeleteSSLLogProfile() {} -func (s *SSLService) UpdateSSLLogProfile() {} -func (s *SSLService) UnsetSSLLogProfile() {} -func (s *SSLService) GetAllSSLLogProfile() {} -func (s *SSLService) GetSSLLogProfile() {} -func (s *SSLService) CountSSLLogProfile() {} +func (s *SSLService) CountSSLCRLSerialNumberBinding(crlname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslCRLSerialNumberBindingURL, url.QueryEscape(crlname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslcrl_serialnumber_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} -// sslocspresponder -func (s *SSLService) AddSSLOCSPResponder() {} -func (s *SSLService) DeleteSSLOCSPResponder() {} -func (s *SSLService) UpdateSSLOCSPResponder() {} -func (s *SSLService) UnsetSSLOCSPResponder() {} -func (s *SSLService) GetAllSSLOCSPResponder() {} -func (s *SSLService) GetSSLOCSPResponder() {} -func (s *SSLService) CountSSLOCSPResponder() {} +// ssldhfile +func (s *SSLService) ImportSSLDHFile(file models.SSLDHFile) error { + payload := map[string]any{"ssldhfile": file} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslDHFileURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslparameter -func (s *SSLService) UpdateSSLParameter() {} -func (s *SSLService) UnsetSSLParameter() {} -func (s *SSLService) GetAllSSLParameter() {} +func (s *SSLService) DeleteSSLDHFile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslDHFileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpkcs12 -func (s *SSLService) ConvertSSLPKCS12() {} +func (s *SSLService) GetAllSSLDHFile() ([]models.SSLDHFile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslDHFileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLDHFile `json:"ssldhfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslpkcs8 -func (s *SSLService) ConvertSSLPKCS8() {} +func (s *SSLService) CountSSLDHFile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslDHFileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"ssldhfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} -// sslpolicy -func (s *SSLService) AddSSLPolicy() {} -func (s *SSLService) DeleteSSLPolicy() {} -func (s *SSLService) UpdateSSLPolicy() {} -func (s *SSLService) UnsetSSLPolicy() {} -func (s *SSLService) GetAllSSLPolicy() {} -func (s *SSLService) GetSSLPolicy() {} -func (s *SSLService) CountSSLPolicy() {} +// ssldhparam +func (s *SSLService) ParamSSLDHParam(param models.SSLDHParam) error { + payload := map[string]any{"ssldhparam": param} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslDHParamURL+"?action=param", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicylabel -func (s *SSLService) AddSSLPolicyLabel() {} -func (s *SSLService) DeleteSSLPolicyLabel() {} -func (s *SSLService) GetAllSSLPolicyLabel() {} -func (s *SSLService) GetSSLPolicyLabel() {} -func (s *SSLService) CountSSLPolicyLabel() {} +// ssldtlsprofile +func (s *SSLService) AddSSLDTLSProfile(profile models.SSLDTLSProfile) error { + payload := map[string]any{"ssldtlsprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslDTLSProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicylabel_binding -func (s *SSLService) GetAllSSLPolicyLabelBinding() {} -func (s *SSLService) GetSSLPolicyLabelBinding() {} +func (s *SSLService) DeleteSSLDTLSProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslDTLSProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicylabel_sslpolicy_binding -func (s *SSLService) AddSSLpolicyLabelSSLPolicyBinding() {} -func (s *SSLService) DeleteSSLpolicyLabelSSLPolicyBinding() {} -func (s *SSLService) GetAllSSLpolicyLabelSSLPolicyBinding() {} -func (s *SSLService) GetSSLpolicyLabelSSLPolicyBinding() {} -func (s *SSLService) CountSSLpolicyLabelSSLPolicyBinding() {} +func (s *SSLService) UpdateSSLDTLSProfile(profile models.SSLDTLSProfile) error { + payload := map[string]any{"ssldtlsprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslDTLSProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicy_binding -func (s *SSLService) GetAllSSLPolicyBinding() {} -func (s *SSLService) GetSSLPolicyBinding() {} +func (s *SSLService) UnsetSSLDTLSProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"ssldtlsprofile": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslDTLSProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicy_csvserver_binding -func (s *SSLService) GetAllSSLPolicyCSVServerBinding() {} -func (s *SSLService) GetSSLPolicyCSVServerBinding() {} -func (s *SSLService) CountSSLPolicyCSVServerBinding() {} +func (s *SSLService) GetAllSSLDTLSProfile() ([]models.SSLDTLSProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslDTLSProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLDTLSProfile `json:"ssldtlsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslpolicy_lbvserver_binding -func (s *SSLService) GetAllSSLPolicyLBVServerBinding() {} -func (s *SSLService) GetSSLPolicyLBVServerBinding() {} -func (s *SSLService) CountSSLPolicyLBVServerBinding() {} +func (s *SSLService) GetSSLDTLSProfile(name string) ([]models.SSLDTLSProfile, error) { + reqURL := fmt.Sprintf("%s/%s", sslDTLSProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLDTLSProfile `json:"ssldtlsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslpolicy_sslglobal_binding -func (s *SSLService) GetAllSSLPolicySSLGlobalBinding() {} -func (s *SSLService) GetSSLPolicySSLGlobalBinding() {} -func (s *SSLService) CountSSLPolicySSLGlobalBinding() {} +func (s *SSLService) CountSSLDTLSProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslDTLSProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"ssldtlsprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} -// sslpolicy_sslpolicylabel_binding -func (s *SSLService) GetAllSSLPolicySSLPolicyLabelBinding() {} -func (s *SSLService) GetSSLPolicySSLPolicyLabelBinding() {} -func (s *SSLService) CountSSLPolicySSLPolicyLabelBinding() {} +// sslecdsakey +func (s *SSLService) CreateSSLECDSAKey(key models.SSLECDSAKey) error { + payload := map[string]any{"sslecdsakey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslECDSAKeyURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicy_sslservice_binding -func (s *SSLService) GetAllSSLPolicySSLServiceBinding() {} -func (s *SSLService) GetSSLPolicySSLServiceBinding() {} -func (s *SSLService) CountSSLPolicySSLServiceBinding() {} +// sslfips +func (s *SSLService) UpdateSSLFIPS(fips models.SSLFIPS) error { + payload := map[string]any{"sslfips": fips} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslFIPSURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslpolicy_sslvserver_binding -func (s *SSLService) GetAllSSLPolicySSLVServerBinding() {} -func (s *SSLService) GetSSLPolicySSLVServerBinding() {} -func (s *SSLService) CountSSLPolicySSLVServerBinding() {} +func (s *SSLService) UnsetSSLFIPS(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslfips": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile -func (s *SSLService) AddSSLProfile() {} -func (s *SSLService) DeleteSSLProfile() {} -func (s *SSLService) UpdateSSLProfile() {} -func (s *SSLService) UnsetSSLProfile() {} -func (s *SSLService) GetAllSSLProfile() {} -func (s *SSLService) GetSSLProfile() {} -func (s *SSLService) CountSSLProfile() {} +func (s *SSLService) ChangeSSLFIPS(fips models.SSLFIPS) error { + payload := map[string]any{"sslfips": fips} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSURL+"?action=change", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile_binding -func (s *SSLService) GetAllSSLProfileBinding() {} -func (s *SSLService) GetSSLProfileBinding() {} +func (s *SSLService) ResetSSLFIPS(fips models.SSLFIPS) error { + payload := map[string]any{"sslfips": fips} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSURL+"?action=reset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile_eccurve_binding -func (s *SSLService) AddSSLProfileECCCurveBinding() {} -func (s *SSLService) DeleteSSLProfileECCCurveBinding() {} -func (s *SSLService) GetAllSSLProfileECCCurveBinding() {} -func (s *SSLService) GetSSLProfileECCCurveBinding() {} -func (s *SSLService) CountSSLProfileECCCurveBinding() {} +func (s *SSLService) GetAllSSLFIPS() (models.SSLFIPS, error) { + req, err := s.client.NewRequest(http.MethodGet, sslFIPSURL, nil) + if err != nil { + return models.SSLFIPS{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.SSLFIPS{}, err + } + var result struct { + Items []models.SSLFIPS `json:"sslfips"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SSLFIPS{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0], nil + } + return models.SSLFIPS{}, nil +} -// sslprofile_sslcertkey_binding -func (s *SSLService) AddSSLProfileSSLCertKeyBinding() {} -func (s *SSLService) DeleteSSLProfileSSLCertKeyBinding() {} -func (s *SSLService) GetAllSSLProfileSSLCertKeyBinding() {} -func (s *SSLService) GetSSLProfileSSLCertKeyBinding() {} -func (s *SSLService) CountSSLProfileSSLCertKeyBinding() {} +// sslfipskey +func (s *SSLService) CreateSSLFIPSKey(key models.SSLFIPSKey) error { + payload := map[string]any{"sslfipskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSKeyURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile_sslciphersuite_binding -func (s *SSLService) AddSSLProfileSSLCipherSuiteBinding() {} -func (s *SSLService) DeleteSSLProfileSSLCipherSuiteBinding() {} -func (s *SSLService) GetAllSSLProfileSSLCipherSuiteBinding() {} -func (s *SSLService) GetSSLProfileSSLCipherSuiteBinding() {} -func (s *SSLService) CountSSLProfileSSLCipherSuiteBinding() {} +func (s *SSLService) DeleteSSLFIPSKey(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslFIPSKeyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile_sslcipher_binding -func (s *SSLService) AddSSLProfileSSLCipherBinding() {} -func (s *SSLService) DeleteSSLProfileSSLCipherBinding() {} -func (s *SSLService) GetAllSSLProfileSSLCipherBinding() {} -func (s *SSLService) GetSSLProfileSSLCipherBinding() {} -func (s *SSLService) CountSSLProfileSSLCipherBinding() {} +func (s *SSLService) ImportSSLFIPSKey(key models.SSLFIPSKey) error { + payload := map[string]any{"sslfipskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSKeyURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslprofile_sslvserver_binding -func (s *SSLService) GetAllSSLProfileSSLVServerBinding() {} -func (s *SSLService) GetSSLProfileSSLVServerBinding() {} -func (s *SSLService) CountSSLProfileSSLVServerBinding() {} +func (s *SSLService) ExportSSLFIPSKey(key models.SSLFIPSKey) error { + payload := map[string]any{"sslfipskey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSKeyURL+"?action=export", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// sslrsakey -func (s *SSLService) CreateSSLRSAKey() {} +func (s *SSLService) GetAllSSLFIPSKey() ([]models.SSLFIPSKey, error) { + req, err := s.client.NewRequest(http.MethodGet, sslFIPSKeyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLFIPSKey `json:"sslfipskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslservice -func (s *SSLService) UpdateSSLService() {} -func (s *SSLService) UnsetSSLService() {} -func (s *SSLService) GetAllSSLService() {} -func (s *SSLService) GetSSLService() {} -func (s *SSLService) CountSSLService() {} +func (s *SSLService) GetSSLFIPSKey(name string) ([]models.SSLFIPSKey, error) { + reqURL := fmt.Sprintf("%s/%s", sslFIPSKeyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLFIPSKey `json:"sslfipskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} -// sslservicegroup -func (s *SSLService) UpdateSSLServiceGroup() {} -func (s *SSLService) UnsetSSLServiceGroup() {} -func (s *SSLService) GetAllSSLServiceGroup() {} -func (s *SSLService) GetSSLServiceGroup() {} -func (s *SSLService) CountSSLServiceGroup() {} +func (s *SSLService) CountSSLFIPSKey() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslFIPSKeyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslfipskey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslfipssimsource +func (s *SSLService) EnableSSLFIPSSimSource(source models.SSLFIPSSimSource) error { + payload := map[string]any{"sslfipssimsource": source} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSSIMSourceURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) InitSSLFIPSSimSource(source models.SSLFIPSSimSource) error { + payload := map[string]any{"sslfipssimsource": source} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSSIMSourceURL+"?action=init", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +// sslfipssimtarget +func (s *SSLService) EnableSSLFIPSSimTarget(target models.SSLFIPSSimTarget) error { + payload := map[string]any{"sslfipssimtarget": target} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSSIMTargetURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) InitSSLFIPSSimTarget(target models.SSLFIPSSimTarget) error { + payload := map[string]any{"sslfipssimtarget": target} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslFIPSSIMTargetURL+"?action=init", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +// sslglobal_binding +func (s *SSLService) GetSSLGlobalBinding() ([]models.SSLGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLGlobalBinding `json:"sslglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +// sslglobal_sslpolicy_binding +func (s *SSLService) AddSSLGlobalSSLPolicyBinding(binding models.SSLGlobalSSLPolicyBinding) error { + payload := map[string]any{"sslglobal_sslpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslGlobalSSLPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLGlobalSSLPolicyBinding(policyname string, typefield string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=type:%s,priority:%d", sslGlobalSSLPolicyBindingURL, url.QueryEscape(policyname), url.QueryEscape(typefield), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetSSLGlobalSSLPolicyBinding() ([]models.SSLGlobalSSLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslGlobalSSLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLGlobalSSLPolicyBinding `json:"sslglobal_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLGlobalSSLPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslGlobalSSLPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslglobal_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslhsmkey +func (s *SSLService) AddSSLHSMKey(key models.SSLHSMKey) error { + payload := map[string]any{"sslhsmkey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslHSMKeyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLHSMKey(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslHSMKeyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLHSMKey() ([]models.SSLHSMKey, error) { + req, err := s.client.NewRequest(http.MethodGet, sslHSMKeyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLHSMKey `json:"sslhsmkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLHSMKey(name string) ([]models.SSLHSMKey, error) { + reqURL := fmt.Sprintf("%s/%s", sslHSMKeyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLHSMKey `json:"sslhsmkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLHSMKey() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslHSMKeyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslhsmkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslkeyfile +func (s *SSLService) ImportSSLKeyFile(file models.SSLKeyFile) error { + payload := map[string]any{"sslkeyfile": file} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslKeyFileURL+"?action=import", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLKeyFile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslKeyFileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLKeyFile() ([]models.SSLKeyFile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslKeyFileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLKeyFile `json:"sslkeyfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLKeyFile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslKeyFileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslkeyfile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// ssllogprofile +func (s *SSLService) AddSSLLogProfile(profile models.SSLLogProfile) error { + payload := map[string]any{"ssllogprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslLogProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLLogProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslLogProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLLogProfile(profile models.SSLLogProfile) error { + payload := map[string]any{"ssllogprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslLogProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLLogProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"ssllogprofile": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslLogProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLLogProfile() ([]models.SSLLogProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslLogProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLLogProfile `json:"ssllogprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLLogProfile(name string) ([]models.SSLLogProfile, error) { + reqURL := fmt.Sprintf("%s/%s", sslLogProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLLogProfile `json:"ssllogprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLLogProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslLogProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"ssllogprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslocspresponder +func (s *SSLService) AddSSLOCSPResponder(responder models.SSLOCSPResponder) error { + payload := map[string]any{"sslocspresponder": responder} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslOCSPResponderURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLOCSPResponder(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslOCSPResponderURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLOCSPResponder(responder models.SSLOCSPResponder) error { + payload := map[string]any{"sslocspresponder": responder} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslOCSPResponderURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLOCSPResponder(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslocspresponder": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslOCSPResponderURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLOCSPResponder() ([]models.SSLOCSPResponder, error) { + req, err := s.client.NewRequest(http.MethodGet, sslOCSPResponderURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLOCSPResponder `json:"sslocspresponder"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLOCSPResponder(name string) ([]models.SSLOCSPResponder, error) { + reqURL := fmt.Sprintf("%s/%s", sslOCSPResponderURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLOCSPResponder `json:"sslocspresponder"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLOCSPResponder() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslOCSPResponderURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslocspresponder"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslparameter +func (s *SSLService) UpdateSSLParameter(param models.SSLParameter) error { + payload := map[string]any{"sslparameter": param} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslparameter": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLParameter() (models.SSLParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, sslParameterURL, nil) + if err != nil { + return models.SSLParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.SSLParameter{}, err + } + var result struct { + Items []models.SSLParameter `json:"sslparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SSLParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0], nil + } + return models.SSLParameter{}, nil +} + +// sslpkcs12 +func (s *SSLService) ConvertSSLPKCS12(pkcs12 models.SSLPKCS12) error { + payload := map[string]any{"sslpkcs12": pkcs12} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslPKCS12URL+"?action=convert", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +// sslpkcs8 +func (s *SSLService) ConvertSSLPKCS8(pkcs8 models.SSLPKCS8) error { + payload := map[string]any{"sslpkcs8": pkcs8} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslPKCS8URL+"?action=convert", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +// sslpolicy +func (s *SSLService) AddSSLPolicy(policy models.SSLPolicy) error { + payload := map[string]any{"sslpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLPolicy(policy models.SSLPolicy) error { + payload := map[string]any{"sslpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslpolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLPolicy() ([]models.SSLPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicy `json:"sslpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicy(name string) ([]models.SSLPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicy `json:"sslpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicylabel +func (s *SSLService) AddSSLPolicyLabel(label models.SSLPolicyLabel) error { + payload := map[string]any{"sslpolicylabel": label} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLPolicyLabel(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslPolicyLabelURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLPolicyLabel() ([]models.SSLPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabel `json:"sslpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicyLabel(name string) ([]models.SSLPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyLabelURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabel `json:"sslpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicylabel_binding +func (s *SSLService) GetAllSSLPolicyLabelBinding() ([]models.SSLPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabelBinding `json:"sslpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicyLabelBinding(name string) ([]models.SSLPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabelBinding `json:"sslpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +// sslpolicylabel_sslpolicy_binding +func (s *SSLService) AddSSLpolicyLabelSSLPolicyBinding(binding models.SSLPolicyLabelSSLPolicyBinding) error { + payload := map[string]any{"sslpolicylabel_sslpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslPolicyLabelSSLPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLpolicyLabelSSLPolicyBinding(labelname string, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", sslPolicyLabelSSLPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLpolicyLabelSSLPolicyBinding() ([]models.SSLPolicyLabelSSLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyLabelSSLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabelSSLPolicyBinding `json:"sslpolicylabel_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLpolicyLabelSSLPolicyBinding(labelname string) ([]models.SSLPolicyLabelSSLPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyLabelSSLPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLabelSSLPolicyBinding `json:"sslpolicylabel_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLpolicyLabelSSLPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicyLabelSSLPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicylabel_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_binding +func (s *SSLService) GetAllSSLPolicyBinding() ([]models.SSLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyBinding `json:"sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicyBinding(name string) ([]models.SSLPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyBinding `json:"sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +// sslpolicy_csvserver_binding +func (s *SSLService) GetAllSSLPolicyCSVServerBinding() ([]models.SSLPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyCSVServerBinding `json:"sslpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicyCSVServerBinding(name string) ([]models.SSLPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyCSVServerBinding `json:"sslpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_lbvserver_binding +func (s *SSLService) GetAllSSLPolicyLBVServerBinding() ([]models.SSLPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLBVServerBinding `json:"sslpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicyLBVServerBinding(name string) ([]models.SSLPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicyLBVServerBinding `json:"sslpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_sslglobal_binding +func (s *SSLService) GetAllSSLPolicySSLGlobalBinding() ([]models.SSLPolicySSLGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicySSLGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLGlobalBinding `json:"sslpolicy_sslglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicySSLGlobalBinding(name string) ([]models.SSLPolicySSLGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicySSLGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLGlobalBinding `json:"sslpolicy_sslglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicySSLGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicySSLGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_sslglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_sslpolicylabel_binding +func (s *SSLService) GetAllSSLPolicySSLPolicyLabelBinding() ([]models.SSLPolicySSLPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicySSLPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLPolicyLabelBinding `json:"sslpolicy_sslpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicySSLPolicyLabelBinding(name string) ([]models.SSLPolicySSLPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicySSLPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLPolicyLabelBinding `json:"sslpolicy_sslpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicySSLPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicySSLPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_sslpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_sslservice_binding +func (s *SSLService) GetAllSSLPolicySSLServiceBinding() ([]models.SSLPolicySSLServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicySSLServiceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLServiceBinding `json:"sslpolicy_sslservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicySSLServiceBinding(name string) ([]models.SSLPolicySSLServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicySSLServiceBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLServiceBinding `json:"sslpolicy_sslservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicySSLServiceBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicySSLServiceBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_sslservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslpolicy_sslvserver_binding +func (s *SSLService) GetAllSSLPolicySSLVServerBinding() ([]models.SSLPolicySSLVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslPolicySSLVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLVServerBinding `json:"sslpolicy_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLPolicySSLVServerBinding(name string) ([]models.SSLPolicySSLVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslPolicySSLVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLPolicySSLVServerBinding `json:"sslpolicy_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLPolicySSLVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslPolicySSLVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslpolicy_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile +func (s *SSLService) AddSSLProfile(profile models.SSLProfile) error { + payload := map[string]any{"sslprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UpdateSSLProfile(profile models.SSLProfile) error { + payload := map[string]any{"sslprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslprofile": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLProfile() ([]models.SSLProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfile `json:"sslprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfile(name string) ([]models.SSLProfile, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfile `json:"sslprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile_binding +func (s *SSLService) GetAllSSLProfileBinding() ([]models.SSLProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileBinding `json:"sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileBinding(name string) ([]models.SSLProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileBinding `json:"sslprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +// sslprofile_eccurve_binding +func (s *SSLService) AddSSLProfileECCCurveBinding(binding models.SSLProfileECCCurveBinding) error { + payload := map[string]any{"sslprofile_ecccurve_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslProfileECCCurveBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLProfileECCCurveBinding(name string, ecccurvename string) error { + reqURL := fmt.Sprintf("%s/%s?args=ecccurvename:%s", sslProfileECCCurveBindingURL, url.QueryEscape(name), url.QueryEscape(ecccurvename)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLProfileECCCurveBinding() ([]models.SSLProfileECCCurveBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileECCCurveBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileECCCurveBinding `json:"sslprofile_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileECCCurveBinding(name string) ([]models.SSLProfileECCCurveBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileECCCurveBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileECCCurveBinding `json:"sslprofile_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfileECCCurveBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslProfileECCCurveBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile_sslcertkey_binding +func (s *SSLService) AddSSLProfileSSLCertKeyBinding(binding models.SSLProfileSSLCertKeyBinding) error { + payload := map[string]any{"sslprofile_sslcertkey_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslProfileSSLCertKeyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLProfileSSLCertKeyBinding(name string, certkeyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=certkeyname:%s", sslProfileSSLCertKeyBindingURL, url.QueryEscape(name), url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLProfileSSLCertKeyBinding() ([]models.SSLProfileSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCertKeyBinding `json:"sslprofile_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileSSLCertKeyBinding(name string) ([]models.SSLProfileSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileSSLCertKeyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCertKeyBinding `json:"sslprofile_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfileSSLCertKeyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslProfileSSLCertKeyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile_sslciphersuite_binding +func (s *SSLService) AddSSLProfileSSLCipherSuiteBinding(binding models.SSLProfileSSLCipherSuiteBinding) error { + payload := map[string]any{"sslprofile_sslciphersuite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslProfileSSLCipherSuiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLProfileSSLCipherSuiteBinding(name string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslProfileSSLCipherSuiteBindingURL, url.QueryEscape(name), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLProfileSSLCipherSuiteBinding() ([]models.SSLProfileSSLCipherSuiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileSSLCipherSuiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCipherSuiteBinding `json:"sslprofile_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileSSLCipherSuiteBinding(name string) ([]models.SSLProfileSSLCipherSuiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileSSLCipherSuiteBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCipherSuiteBinding `json:"sslprofile_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfileSSLCipherSuiteBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslProfileSSLCipherSuiteBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile_sslcipher_binding +func (s *SSLService) AddSSLProfileSSLCipherBinding(binding models.SSLProfileSSLCipherBinding) error { + payload := map[string]any{"sslprofile_sslcipher_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslProfileSSLCipherBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLProfileSSLCipherBinding(name string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslProfileSSLCipherBindingURL, url.QueryEscape(name), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLProfileSSLCipherBinding() ([]models.SSLProfileSSLCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileSSLCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCipherBinding `json:"sslprofile_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileSSLCipherBinding(name string) ([]models.SSLProfileSSLCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileSSLCipherBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLCipherBinding `json:"sslprofile_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfileSSLCipherBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslProfileSSLCipherBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslprofile_sslvserver_binding +func (s *SSLService) GetAllSSLProfileSSLVServerBinding() ([]models.SSLProfileSSLVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslProfileSSLVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLVServerBinding `json:"sslprofile_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLProfileSSLVServerBinding(name string) ([]models.SSLProfileSSLVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslProfileSSLVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLProfileSSLVServerBinding `json:"sslprofile_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLProfileSSLVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslProfileSSLVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslprofile_sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslrsakey +func (s *SSLService) CreateSSLRSAKey(key models.SSLRSAKey) error { + payload := map[string]any{"sslrsakey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslRSAKeyURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +// sslservice +func (s *SSLService) UpdateSSLService(service models.SSLService) error { + payload := map[string]any{"sslservice": service} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLService(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslservice": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslServiceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLService() ([]models.SSLService, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLService `json:"sslservice"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLService(servicename string) ([]models.SSLService, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLService `json:"sslservice"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLService() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} + +// sslservicegroup +func (s *SSLService) UpdateSSLServiceGroup(group models.SSLServiceGroup) error { + payload := map[string]any{"sslservicegroup": group} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceGroupURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLServiceGroup(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslservicegroup": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslServiceGroupURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceGroup() ([]models.SSLServiceGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroup `json:"sslservicegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroup(servicegroupname string) ([]models.SSLServiceGroup, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroup `json:"sslservicegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceGroup() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservicegroup"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservicegroup_binding -func (s *SSLService) GetAllSSLServiceGroupBinding() {} -func (s *SSLService) GetSSLServiceGroupBinding() {} +func (s *SSLService) GetAllSSLServiceGroupBinding() ([]models.SSLServiceGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupBinding `json:"sslservicegroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroupBinding(servicegroupname string) ([]models.SSLServiceGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupBinding `json:"sslservicegroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslservicegroup_ecccurve_binding -func (s *SSLService) AddSSLServiceGroupECCCurveBinding() {} -func (s *SSLService) DeleteSSLServiceGroupECCCurveBinding() {} -func (s *SSLService) GetAllSSLServiceGroupECCCurveBinding() {} -func (s *SSLService) GetSSLServiceGroupECCCurveBinding() {} -func (s *SSLService) CountSSLServiceGroupECCCurveBinding() {} +func (s *SSLService) AddSSLServiceGroupECCCurveBinding(binding models.SSLServiceGroupECCCurveBinding) error { + payload := map[string]any{"sslservicegroup_ecccurve_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceGroupECCCurveBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceGroupECCCurveBinding(servicegroupname string, ecccurvename string) error { + reqURL := fmt.Sprintf("%s/%s?args=ecccurvename:%s", sslServiceGroupECCCurveBindingURL, url.QueryEscape(servicegroupname), url.QueryEscape(ecccurvename)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceGroupECCCurveBinding() ([]models.SSLServiceGroupECCCurveBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupECCCurveBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupECCCurveBinding `json:"sslservicegroup_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroupECCCurveBinding(servicegroupname string) ([]models.SSLServiceGroupECCCurveBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupECCCurveBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupECCCurveBinding `json:"sslservicegroup_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceGroupECCCurveBinding(servicegroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceGroupECCCurveBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservicegroup_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservicegroup_sslcertkey_binding -func (s *SSLService) AddSSLServiceGroupSSLCertKeyBinding() {} -func (s *SSLService) DeleteSSLServiceGroupSSLCertKeyBinding() {} -func (s *SSLService) GetAllSSLServiceGroupSSLCertKeyBinding() {} -func (s *SSLService) GetSSLServiceGroupSSLCertKeyBinding() {} -func (s *SSLService) CountSSLServiceGroupSSLCertKeyBinding() {} +func (s *SSLService) AddSSLServiceGroupSSLCertKeyBinding(binding models.SSLServiceGroupSSLCertKeyBinding) error { + payload := map[string]any{"sslservicegroup_sslcertkey_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceGroupSSLCertKeyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceGroupSSLCertKeyBinding(servicegroupname string, certkeyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=certkeyname:%s", sslServiceGroupSSLCertKeyBindingURL, url.QueryEscape(servicegroupname), url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceGroupSSLCertKeyBinding() ([]models.SSLServiceGroupSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCertKeyBinding `json:"sslservicegroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroupSSLCertKeyBinding(servicegroupname string) ([]models.SSLServiceGroupSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupSSLCertKeyBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCertKeyBinding `json:"sslservicegroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceGroupSSLCertKeyBinding(servicegroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceGroupSSLCertKeyBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservicegroup_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservicegroup_sslciphersuite_binding -func (s *SSLService) AddSSLServiceGroupSSLCipherSuiteBinding() {} -func (s *SSLService) DeleteSSLServiceGroupSSLCipherSuiteBinding() {} -func (s *SSLService) GetAllSSLServiceGroupSSLCipherSuiteBinding() {} -func (s *SSLService) GetSSLServiceGroupSSLCipherSuiteBinding() {} -func (s *SSLService) CountSSLServiceGroupSSLCipherSuiteBinding() {} +func (s *SSLService) AddSSLServiceGroupSSLCipherSuiteBinding(binding models.SSLServiceGroupSSLCipherSuiteBinding) error { + payload := map[string]any{"sslservicegroup_sslciphersuite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceGroupSSLCipherSuiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceGroupSSLCipherSuiteBinding(servicegroupname string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslServiceGroupSSLCipherSuiteBindingURL, url.QueryEscape(servicegroupname), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceGroupSSLCipherSuiteBinding() ([]models.SSLServiceGroupSSLCipherSuiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupSSLCipherSuiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCipherSuiteBinding `json:"sslservicegroup_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroupSSLCipherSuiteBinding(servicegroupname string) ([]models.SSLServiceGroupSSLCipherSuiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupSSLCipherSuiteBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCipherSuiteBinding `json:"sslservicegroup_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceGroupSSLCipherSuiteBinding(servicegroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceGroupSSLCipherSuiteBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservicegroup_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservicegroup_sslcipher_binding -func (s *SSLService) AddSSLServiceGroupSSLCipherBinding() {} -func (s *SSLService) DeleteSSLServiceGroupSSLCipherBinding() {} -func (s *SSLService) GetAllSSLServiceGroupSSLCipherBinding() {} -func (s *SSLService) GetSSLServiceGroupSSLCipherBinding() {} -func (s *SSLService) CountSSLServiceGroupSSLCipherBinding() {} +func (s *SSLService) AddSSLServiceGroupSSLCipherBinding(binding models.SSLServiceGroupSSLCipherBinding) error { + payload := map[string]any{"sslservicegroup_sslcipher_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceGroupSSLCipherBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceGroupSSLCipherBinding(servicegroupname string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslServiceGroupSSLCipherBindingURL, url.QueryEscape(servicegroupname), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceGroupSSLCipherBinding() ([]models.SSLServiceGroupSSLCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceGroupSSLCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCipherBinding `json:"sslservicegroup_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceGroupSSLCipherBinding(servicegroupname string) ([]models.SSLServiceGroupSSLCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceGroupSSLCipherBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceGroupSSLCipherBinding `json:"sslservicegroup_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceGroupSSLCipherBinding(servicegroupname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceGroupSSLCipherBindingURL, url.QueryEscape(servicegroupname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservicegroup_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservice_binding -func (s *SSLService) GetAllSSLServiceBinding() {} -func (s *SSLService) GetSSLServiceBinding() {} +func (s *SSLService) GetAllSSLServiceBinding() ([]models.SSLServiceBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceBinding `json:"sslservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceBinding(servicename string) ([]models.SSLServiceBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceBinding `json:"sslservice_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslservice_ecccurve_binding -func (s *SSLService) SSLServiceECCCurveBinding() {} -func (s *SSLService) DeleteSSLServiceECCCurveBinding() {} -func (s *SSLService) GetAllSSLServiceECCCurveBinding() {} -func (s *SSLService) GetSSLServiceECCCurveBinding() {} -func (s *SSLService) CountSSLServiceECCCurveBinding() {} +func (s *SSLService) AddSSLServiceECCCurveBinding(binding models.SSLServiceECCCurveBinding) error { + payload := map[string]any{"sslservice_ecccurve_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceECCCurveBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceECCCurveBinding(servicename string, ecccurvename string) error { + reqURL := fmt.Sprintf("%s/%s?args=ecccurvename:%s", sslServiceECCCurveBindingURL, url.QueryEscape(servicename), url.QueryEscape(ecccurvename)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceECCCurveBinding() ([]models.SSLServiceECCCurveBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceECCCurveBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceECCCurveBinding `json:"sslservice_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceECCCurveBinding(servicename string) ([]models.SSLServiceECCCurveBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceECCCurveBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceECCCurveBinding `json:"sslservice_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceECCCurveBinding(servicename string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceECCCurveBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservice_sslcertkey_binding -func (s *SSLService) AddSSLServiceSSLCertKeyBinding() {} -func (s *SSLService) DeleteSSLServiceSSLCertKeyBinding() {} -func (s *SSLService) GetAllSSLServiceSSLCertKeyBinding() {} -func (s *SSLService) GetSSLServiceSSLCertKeyBinding() {} -func (s *SSLService) CountSSLServiceSSLCertKeyBinding() {} +func (s *SSLService) AddSSLServiceSSLCertKeyBinding(binding models.SSLServiceSSLCertKeyBinding) error { + payload := map[string]any{"sslservice_sslcertkey_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceSSLCertKeyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceSSLCertKeyBinding(servicename string, certkeyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=certkeyname:%s", sslServiceSSLCertKeyBindingURL, url.QueryEscape(servicename), url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceSSLCertKeyBinding() ([]models.SSLServiceSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCertKeyBinding `json:"sslservice_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceSSLCertKeyBinding(servicename string) ([]models.SSLServiceSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceSSLCertKeyBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCertKeyBinding `json:"sslservice_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceSSLCertKeyBinding(servicename string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceSSLCertKeyBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservice_sslciphersuite_binding -func (s *SSLService) AddSSLServiceSSLCipherSuiteBinding() {} -func (s *SSLService) DeleteSSLServiceSSLCipherSuiteBinding() {} -func (s *SSLService) GetAllSSLServiceSSLCipherSuiteBinding() {} -func (s *SSLService) GetSSLServiceSSLCipherSuiteBinding() {} -func (s *SSLService) CountSSLServiceSSLCipherSuiteBinding() {} +func (s *SSLService) AddSSLServiceSSLCipherSuiteBinding(binding models.SSLServiceSSLCipherSuiteBinding) error { + payload := map[string]any{"sslservice_sslciphersuite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceSSLCipherSuiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceSSLCipherSuiteBinding(servicename string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslServiceSSLCipherSuiteBindingURL, url.QueryEscape(servicename), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceSSLCipherSuiteBinding() ([]models.SSLServiceSSLCipherSuiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceSSLCipherSuiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCipherSuiteBinding `json:"sslservice_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceSSLCipherSuiteBinding(servicename string) ([]models.SSLServiceSSLCipherSuiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceSSLCipherSuiteBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCipherSuiteBinding `json:"sslservice_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceSSLCipherSuiteBinding(servicename string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceSSLCipherSuiteBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservice_sslcipher_binding -func (s *SSLService) AddSSLServiceSSLCipherBinding() {} -func (s *SSLService) DeleteSSLServiceSSLCipherBinding() {} -func (s *SSLService) GetAllSSLServiceSSLCipherBinding() {} -func (s *SSLService) GetSSLServiceSSLCipherBinding() {} -func (s *SSLService) CountSSLServiceSSLCipherBinding() {} +func (s *SSLService) AddSSLServiceSSLCipherBinding(binding models.SSLServiceSSLCipherBinding) error { + payload := map[string]any{"sslservice_sslcipher_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceSSLCipherBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceSSLCipherBinding(servicename string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslServiceSSLCipherBindingURL, url.QueryEscape(servicename), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceSSLCipherBinding() ([]models.SSLServiceSSLCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceSSLCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCipherBinding `json:"sslservice_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceSSLCipherBinding(servicename string) ([]models.SSLServiceSSLCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceSSLCipherBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLCipherBinding `json:"sslservice_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceSSLCipherBinding(servicename string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceSSLCipherBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslservice_sslpolicy_binding -func (s *SSLService) AddSSLServiceSSLPolicyBinding() {} -func (s *SSLService) DeleteSSLServiceSSLPolicyBinding() {} -func (s *SSLService) GetAllSSLServiceSSLPolicyBinding() {} -func (s *SSLService) GetSSLServiceSSLPolicyBinding() {} -func (s *SSLService) CountSSLServiceSSLPolicyBinding() {} +func (s *SSLService) AddSSLServiceSSLPolicyBinding(binding models.SSLServiceSSLPolicyBinding) error { + payload := map[string]any{"sslservice_sslpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslServiceSSLPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLServiceSSLPolicyBinding(servicename string, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", sslServiceSSLPolicyBindingURL, url.QueryEscape(servicename), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLServiceSSLPolicyBinding() ([]models.SSLServiceSSLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslServiceSSLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLPolicyBinding `json:"sslservice_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLServiceSSLPolicyBinding(servicename string) ([]models.SSLServiceSSLPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslServiceSSLPolicyBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLServiceSSLPolicyBinding `json:"sslservice_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLServiceSSLPolicyBinding(servicename string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslServiceSSLPolicyBindingURL, url.QueryEscape(servicename)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslservice_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver -func (s *SSLService) UpdateSSLVServer() {} -func (s *SSLService) UnsetSSLVServer() {} -func (s *SSLService) GetAllSSLVServer() {} -func (s *SSLService) GetSSLVServer() {} -func (s *SSLService) CountSSLVServer() {} +func (s *SSLService) UpdateSSLVServer(vserver models.SSLVServer) error { + payload := map[string]any{"sslvserver": vserver} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) UnsetSSLVServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"sslvserver": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslVServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServer() ([]models.SSLVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServer `json:"sslvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServer(vservername string) ([]models.SSLVServer, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServer `json:"sslvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver_binding -func (s *SSLService) GetAllSSLVServerBinding() {} -func (s *SSLService) GetSSLVServerBinding() {} +func (s *SSLService) GetAllSSLVServerBinding() ([]models.SSLVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerBinding `json:"sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerBinding(vservername string) ([]models.SSLVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerBinding `json:"sslvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} // sslvserver_ecccurve_binding -func (s *SSLService) AddSSLVServerECCCurveBinding() {} -func (s *SSLService) DeleteSSLVServerECCCurveBinding() {} -func (s *SSLService) GetAllSSLVServerECCCurveBinding() {} -func (s *SSLService) GetSSLVServerECCCurveBinding() {} -func (s *SSLService) CountSSLVServerECCCurveBinding() {} +func (s *SSLService) AddSSLVServerECCCurveBinding(binding models.SSLVServerECCCurveBinding) error { + payload := map[string]any{"sslvserver_ecccurve_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerECCCurveBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLVServerECCCurveBinding(vservername string, ecccurvename string) error { + reqURL := fmt.Sprintf("%s/%s?args=ecccurvename:%s", sslVServerECCCurveBindingURL, url.QueryEscape(vservername), url.QueryEscape(ecccurvename)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServerECCCurveBinding() ([]models.SSLVServerECCCurveBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerECCCurveBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerECCCurveBinding `json:"sslvserver_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerECCCurveBinding(vservername string) ([]models.SSLVServerECCCurveBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerECCCurveBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerECCCurveBinding `json:"sslvserver_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServerECCCurveBinding(vservername string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslVServerECCCurveBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver_ecccurve_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver_sslcertkey_binding -func (s *SSLService) AddSSLVServerSSLCertKeyBinding() {} -func (s *SSLService) DeleteSSLVServerSSLCertKeyBinding() {} -func (s *SSLService) GetAllSSLVServerSSLCertKeyBinding() {} -func (s *SSLService) GetSSLVServerSSLCertKeyBinding() {} -func (s *SSLService) CountSSLVServerSSLCertKeyBinding() {} +func (s *SSLService) AddSSLVServerSSLCertKeyBinding(binding models.SSLVServerSSLCertKeyBinding) error { + payload := map[string]any{"sslvserver_sslcertkey_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerSSLCertKeyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLVServerSSLCertKeyBinding(vservername string, certkeyname string) error { + reqURL := fmt.Sprintf("%s/%s?args=certkeyname:%s", sslVServerSSLCertKeyBindingURL, url.QueryEscape(vservername), url.QueryEscape(certkeyname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServerSSLCertKeyBinding() ([]models.SSLVServerSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCertKeyBinding `json:"sslvserver_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerSSLCertKeyBinding(vservername string) ([]models.SSLVServerSSLCertKeyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerSSLCertKeyBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCertKeyBinding `json:"sslvserver_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServerSSLCertKeyBinding(vservername string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslVServerSSLCertKeyBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver_sslcertkey_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver_sslciphersuite_binding -func (s *SSLService) AddSSLVServerSSLCipherSuiteBinding() {} -func (s *SSLService) DeleteSSLVServerSSLCipherSuiteBinding() {} -func (s *SSLService) GetAllSSLVServerSSLCipherSuiteBinding() {} -func (s *SSLService) GetSSLVServerSSLCipherSuiteBinding() {} -func (s *SSLService) CountSSLVServerSSLCipherSuiteBinding() {} +func (s *SSLService) AddSSLVServerSSLCipherSuiteBinding(binding models.SSLVServerSSLCipherSuiteBinding) error { + payload := map[string]any{"sslvserver_sslciphersuite_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerSSLCipherSuiteBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLVServerSSLCipherSuiteBinding(vservername string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslVServerSSLCipherSuiteBindingURL, url.QueryEscape(vservername), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServerSSLCipherSuiteBinding() ([]models.SSLVServerSSLCipherSuiteBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerSSLCipherSuiteBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCipherSuiteBinding `json:"sslvserver_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerSSLCipherSuiteBinding(vservername string) ([]models.SSLVServerSSLCipherSuiteBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerSSLCipherSuiteBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCipherSuiteBinding `json:"sslvserver_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServerSSLCipherSuiteBinding(vservername string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslVServerSSLCipherSuiteBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver_sslciphersuite_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver_sslcipher_binding -func (s *SSLService) AddSSLVServerSSLCipherBInding() {} -func (s *SSLService) DeleteSSLVServerSSLCipherBInding() {} -func (s *SSLService) GetAllSSLVServerSSLCipherBInding() {} -func (s *SSLService) GetSSLVServerSSLCipherBInding() {} -func (s *SSLService) CountSSLVServerSSLCipherBInding() {} +func (s *SSLService) AddSSLVServerSSLCipherBinding(binding models.SSLVServerSSLCipherBinding) error { + payload := map[string]any{"sslvserver_sslcipher_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerSSLCipherBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLVServerSSLCipherBinding(vservername string, ciphername string) error { + reqURL := fmt.Sprintf("%s/%s?args=ciphername:%s", sslVServerSSLCipherBindingURL, url.QueryEscape(vservername), url.QueryEscape(ciphername)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServerSSLCipherBinding() ([]models.SSLVServerSSLCipherBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerSSLCipherBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCipherBinding `json:"sslvserver_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerSSLCipherBinding(vservername string) ([]models.SSLVServerSSLCipherBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerSSLCipherBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLCipherBinding `json:"sslvserver_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServerSSLCipherBinding(vservername string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslVServerSSLCipherBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver_sslcipher_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslvserver_sslpolicy_binding -func (s *SSLService) AddSSLVServerSSLPolicyBinding() {} -func (s *SSLService) DeleteSSLVServerSSLPolicyBinding() {} -func (s *SSLService) GetAllSSLVServerSSLPolicyBinding() {} -func (s *SSLService) GetSSLVServerSSLPolicyBinding() {} -func (s *SSLService) CountSSLVServerSSLPolicyBinding() {} +func (s *SSLService) AddSSLVServerSSLPolicyBinding(binding models.SSLVServerSSLPolicyBinding) error { + payload := map[string]any{"sslvserver_sslpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, sslVServerSSLPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLVServerSSLPolicyBinding(vservername string, policyname string, typefield string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,type:%s,priority:%d", sslVServerSSLPolicyBindingURL, url.QueryEscape(vservername), url.QueryEscape(policyname), url.QueryEscape(typefield), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLVServerSSLPolicyBinding() ([]models.SSLVServerSSLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, sslVServerSSLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLPolicyBinding `json:"sslvserver_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) GetSSLVServerSSLPolicyBinding(vservername string) ([]models.SSLVServerSSLPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", sslVServerSSLPolicyBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLVServerSSLPolicyBinding `json:"sslvserver_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLVServerSSLPolicyBinding(vservername string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", sslVServerSSLPolicyBindingURL, url.QueryEscape(vservername)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslvserver_sslpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} // sslwrapkey -func (s *SSLService) CreateSSLWrapKey() {} -func (s *SSLService) DeleteSSLWrapKey() {} -func (s *SSLService) GetAllSSLWrapKey() {} -func (s *SSLService) CountSSLWrapKey() {} +func (s *SSLService) CreateSSLWrapKey(key models.SSLWrapKey) error { + payload := map[string]any{"sslwrapkey": key} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, sslWrapKeyURL+"?action=create", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) DeleteSSLWrapKey(name string) error { + reqURL := fmt.Sprintf("%s/%s", sslWrapKeyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *SSLService) GetAllSSLWrapKey() ([]models.SSLWrapKey, error) { + req, err := s.client.NewRequest(http.MethodGet, sslWrapKeyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Items []models.SSLWrapKey `json:"sslwrapkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Items, nil +} + +func (s *SSLService) CountSSLWrapKey() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, sslWrapKeyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Items []struct { + Count float64 `json:"__count"` + } `json:"sslwrapkey"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Items) > 0 { + return result.Items[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/stream.go b/nitrogo/stream.go index ff6ef84..05bd205 100644 --- a/nitrogo/stream.go +++ b/nitrogo/stream.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( streamIdentifierURL = "/nitro/v1/config/streamidentifier" streamIdentifierBindingURL = "/nitro/v1/config/streamidentifier_binding" @@ -17,38 +27,430 @@ type StreamService struct { // streamidentifier // Configuration for identifier resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/streamidentifier -func (s *StreamService) AddStreamIdentifier() {} -func (s *StreamService) DeleteStreamIdentifier() {} -func (s *StreamService) UpdateStreamIdentifier() {} -func (s *StreamService) UnsetStreamIdentifier() {} -func (s *StreamService) GetAllStreamIdentifier() {} -func (s *StreamService) GetStreamIdentifier() {} -func (s *StreamService) CountStreamIdentifier() {} + +func (s *StreamService) AddStreamIdentifier(identifier models.StreamIdentifier) error { + payload := map[string]any{ + "streamidentifier": identifier, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, streamIdentifierURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) DeleteStreamIdentifier(name string) error { + url := fmt.Sprintf("%s/%s", streamIdentifierURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) UpdateStreamIdentifier(identifier models.StreamIdentifier) error { + payload := map[string]any{ + "streamidentifier": identifier, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, streamIdentifierURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) UnsetStreamIdentifier(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "streamidentifier": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, streamIdentifierURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) GetAllStreamIdentifier() ([]models.StreamIdentifier, error) { + req, err := s.client.NewRequest(http.MethodGet, streamIdentifierURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + StreamIdentifiers []models.StreamIdentifier `json:"streamidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.StreamIdentifiers, nil +} + +func (s *StreamService) GetStreamIdentifier(name string) ([]models.StreamIdentifier, error) { + url := fmt.Sprintf("%s/%s", streamIdentifierURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + StreamIdentifiers []models.StreamIdentifier `json:"streamidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.StreamIdentifiers, nil +} + +func (s *StreamService) CountStreamIdentifier() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, streamIdentifierURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + StreamIdentifiers []struct { + Count float64 `json:"__count"` + } `json:"streamidentifier"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.StreamIdentifiers) > 0 { + return result.StreamIdentifiers[0].Count, nil + } + + return 0, nil +} // streamidentifier_binding // Binding object which returns the resources bound to streamidentifier. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/streamidentifier_binding -func (s *StreamService) GetAllStreamIdentifierBinding() {} -func (s *StreamService) GetStreamIdentifierBinding() {} + +func (s *StreamService) GetAllStreamIdentifierBinding() ([]models.StreamIdentifierBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, streamIdentifierBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.StreamIdentifierBinding `json:"streamidentifier_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *StreamService) GetStreamIdentifierBinding(name string) ([]models.StreamIdentifierBinding, error) { + url := fmt.Sprintf("%s/%s", streamIdentifierBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.StreamIdentifierBinding `json:"streamidentifier_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // streamidentifier_streamsession_binding // Binding object showing the streamsession that can be bound to streamidentifier. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/streamidentifier_streamsession_binding -func (s *StreamService) GetAllStreamIdentifierStreamSessionBinding() {} -func (s *StreamService) GetStreamIdentifierStreamSessionBinding() {} -func (s *StreamService) CountStreamIdentifierStreamSessionBinding() {} + +func (s *StreamService) GetAllStreamIdentifierStreamSessionBinding() ([]models.StreamIdentifierStreamSessionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, streamIdentifierStreamSessionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.StreamIdentifierStreamSessionBinding `json:"streamidentifier_streamsession_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *StreamService) GetStreamIdentifierStreamSessionBinding(name string) ([]models.StreamIdentifierStreamSessionBinding, error) { + url := fmt.Sprintf("%s/%s", streamIdentifierStreamSessionBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.StreamIdentifierStreamSessionBinding `json:"streamidentifier_streamsession_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *StreamService) CountStreamIdentifierStreamSessionBinding(name string) (float64, error) { + url := fmt.Sprintf("%s/%s?count=yes", streamIdentifierStreamSessionBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"streamidentifier_streamsession_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // streamselector // Configuration for selector resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/streamselector -func (s *StreamService) AddStreamSelector() {} -func (s *StreamService) DeleteStreamSelector() {} -func (s *StreamService) UpdateStreamSelector() {} -func (s *StreamService) GetAllStreamSelector() {} -func (s *StreamService) GetStreamSelector() {} -func (s *StreamService) CountStreamSelector() {} + +func (s *StreamService) AddStreamSelector(selector models.StreamSelector) error { + payload := map[string]any{ + "streamselector": selector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, streamSelectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) DeleteStreamSelector(name string) error { + url := fmt.Sprintf("%s/%s", streamSelectorURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) UpdateStreamSelector(selector models.StreamSelector) error { + payload := map[string]any{ + "streamselector": selector, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, streamSelectorURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *StreamService) GetAllStreamSelector() ([]models.StreamSelector, error) { + req, err := s.client.NewRequest(http.MethodGet, streamSelectorURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + StreamSelectors []models.StreamSelector `json:"streamselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.StreamSelectors, nil +} + +func (s *StreamService) GetStreamSelector(name string) ([]models.StreamSelector, error) { + url := fmt.Sprintf("%s/%s", streamSelectorURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + StreamSelectors []models.StreamSelector `json:"streamselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.StreamSelectors, nil +} + +func (s *StreamService) CountStreamSelector() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, streamSelectorURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + StreamSelectors []struct { + Count float64 `json:"__count"` + } `json:"streamselector"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.StreamSelectors) > 0 { + return result.StreamSelectors[0].Count, nil + } + + return 0, nil +} // streamsession // Configuration for active connection resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/stream/streamsession -func (s *StreamService) ClearStreamSession() {} + +func (s *StreamService) ClearStreamSession(session models.StreamSession) error { + payload := map[string]any{ + "streamsession": session, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, streamSessionURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} diff --git a/nitrogo/subscriber.go b/nitrogo/subscriber.go index 0ddcae7..3604dc3 100644 --- a/nitrogo/subscriber.go +++ b/nitrogo/subscriber.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( subscriberGxInterfaceURL = "/nitro/v1/config/subscribergxinterface" subscriberParamURL = "/nitro/v1/config/subscriberparam" @@ -17,37 +26,415 @@ type SubscriberService struct { // subscribergxinterface // Configuration for Gx interface Parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscribergxinterface -func (s *SubscriberService) UpdateSubscriberGxInterface() {} -func (s *SubscriberService) UnsetSubscriberGxInterface() {} -func (s *SubscriberService) GetAllSubscriberGxInterface() {} + +func (s *SubscriberService) UpdateSubscriberGxInterface(param models.SubscriberGxInterface) error { + payload := map[string]any{ + "subscribergxinterface": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, subscriberGxInterfaceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) UnsetSubscriberGxInterface(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "subscribergxinterface": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberGxInterfaceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) GetAllSubscriberGxInterface() (models.SubscriberGxInterface, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberGxInterfaceURL, nil) + if err != nil { + return models.SubscriberGxInterface{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SubscriberGxInterface{}, err + } + + var result struct { + SubscriberGxInterfaces []models.SubscriberGxInterface `json:"subscribergxinterface"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SubscriberGxInterface{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SubscriberGxInterfaces) > 0 { + return result.SubscriberGxInterfaces[0], nil + } + + return models.SubscriberGxInterface{}, nil +} // subscriberparam // Configuration for Subscriber Params resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscriberparam -func (s *SubscriberService) UpdateSubscriberParam() {} -func (s *SubscriberService) UnsetSubscriberParam() {} -func (s *SubscriberService) GetAllSubscriberParam() {} + +func (s *SubscriberService) UpdateSubscriberParam(param models.SubscriberParam) error { + payload := map[string]any{ + "subscriberparam": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, subscriberParamURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) UnsetSubscriberParam(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "subscriberparam": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberParamURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) GetAllSubscriberParam() (models.SubscriberParam, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberParamURL, nil) + if err != nil { + return models.SubscriberParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SubscriberParam{}, err + } + + var result struct { + SubscriberParams []models.SubscriberParam `json:"subscriberparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SubscriberParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SubscriberParams) > 0 { + return result.SubscriberParams[0], nil + } + + return models.SubscriberParam{}, nil +} // subscriberprofile // Configuration for Subscriber Profile resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscriberprofile -func (s *SubscriberService) AddSubscriberProfile() {} -func (s *SubscriberService) DeleteSubscriberProfile() {} -func (s *SubscriberService) UpdateSubscriberProfile() {} -func (s *SubscriberService) UnsetSubscriberProfile() {} -func (s *SubscriberService) GetAllSubscriberProfile() {} -func (s *SubscriberService) CountSubscriberProfile() {} + +func (s *SubscriberService) AddSubscriberProfile(profile models.SubscriberProfile) error { + payload := map[string]any{ + "subscriberprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) DeleteSubscriberProfile(ip string) error { + url := fmt.Sprintf("%s/%s", subscriberProfileURL, ip) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) UpdateSubscriberProfile(profile models.SubscriberProfile) error { + payload := map[string]any{ + "subscriberprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, subscriberProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) UnsetSubscriberProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "subscriberprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) GetAllSubscriberProfile() ([]models.SubscriberProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SubscriberProfiles []models.SubscriberProfile `json:"subscriberprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SubscriberProfiles, nil +} + +func (s *SubscriberService) CountSubscriberProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SubscriberProfiles []struct { + Count float64 `json:"__count"` + } `json:"subscriberprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SubscriberProfiles) > 0 { + return result.SubscriberProfiles[0].Count, nil + } + + return 0, nil +} // subscriberradiusinterface // Configuration for RADIUS interface Parameters resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscriberradiusinterface -func (s *SubscriberService) UpdateSubscriberRADIUSInterface() {} -func (s *SubscriberService) UnsetSubscriberRADIUSInterface() {} -func (s *SubscriberService) GetAllSubscriberRADIUSInterface() {} + +func (s *SubscriberService) UpdateSubscriberRADIUSInterface(param models.SubscriberRadiusInterface) error { + payload := map[string]any{ + "subscriberradiusinterface": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, subscriberRADIUSInterfaceURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) UnsetSubscriberRADIUSInterface(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "subscriberradiusinterface": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberRADIUSInterfaceURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) GetAllSubscriberRADIUSInterface() (models.SubscriberRadiusInterface, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberRADIUSInterfaceURL, nil) + if err != nil { + return models.SubscriberRadiusInterface{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SubscriberRadiusInterface{}, err + } + + var result struct { + SubscriberRADIUSInterfaces []models.SubscriberRadiusInterface `json:"subscriberradiusinterface"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SubscriberRadiusInterface{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SubscriberRADIUSInterfaces) > 0 { + return result.SubscriberRADIUSInterfaces[0], nil + } + + return models.SubscriberRadiusInterface{}, nil +} // subscribersessions // Configuration for subscriber sesions resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/subscriber/subscribersessions -func (s *SubscriberService) ClearSubscriberSessions() {} -func (s *SubscriberService) GetAllSubscriberSessions() {} -func (s *SubscriberService) CountSubscriberSessions() {} + +func (s *SubscriberService) ClearSubscriberSessions(session models.SubscriberSessions) error { + payload := map[string]any{ + "subscribersessions": session, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, subscriberSessionsURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SubscriberService) GetAllSubscriberSessions() ([]models.SubscriberSessions, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberSessionsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SubscriberSessions []models.SubscriberSessions `json:"subscribersessions"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SubscriberSessions, nil +} + +func (s *SubscriberService) CountSubscriberSessions() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, subscriberSessionsURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SubscriberSessions []struct { + Count float64 `json:"__count"` + } `json:"subscribersessions"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SubscriberSessions) > 0 { + return result.SubscriberSessions[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/system.go b/nitrogo/system.go index 5577a27..b594965 100644 --- a/nitrogo/system.go +++ b/nitrogo/system.go @@ -1,16 +1,56 @@ package nitrogo import ( + "bytes" "encoding/json" "fmt" "net/http" + "strings" "github.com/AdamJCrawford/NitroGo/nitrogo/models" ) const ( - systemExtraMgmtCPUURL = "/nitro/v1/config/systemextramgmtcpu" - systemStatsURL = "/nitro/v1/stat/system" + systemAutoRestoreFeatureURL = "/nitro/v1/config/systemautorestorefeature" + systemBackupURL = "/nitro/v1/config/systembackup" + systemCmdPolicyURL = "/nitro/v1/config/systemcmdpolicy" + systemCollectionParamURL = "/nitro/v1/config/systemcollectionparam" + systemCoreURL = "/nitro/v1/config/systemcore" + systemCounterGroupURL = "/nitro/v1/config/systemcountergroup" + systemCountersURL = "/nitro/v1/config/systemcounters" + systemDataSourceURL = "/nitro/v1/config/systemdatasource" + systemEntityURL = "/nitro/v1/config/systementity" + systemEntityDataURL = "/nitro/v1/config/systementitydata" + systemEntityTypeURL = "/nitro/v1/config/systementitytype" + systemEventHistoryURL = "/nitro/v1/config/systemeventhistory" + systemExtraMgmtCPUURL = "/nitro/v1/config/systemextramgmtcpu" + systemFileURL = "/nitro/v1/config/systemfile" + systemGlobalDataURL = "/nitro/v1/config/systemglobaldata" + systemGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/systemglobal_auditnslogpolicy_binding" + systemGlobalAuditSyslogPolicyBindingURL = "/nitro/v1/config/systemglobal_auditsyslogpolicy_binding" + systemGlobalAuthenticationLDAPPolicyBindingURL = "/nitro/v1/config/systemglobal_authenticationldappolicy_binding" + systemGlobalAuthenticationLocalPolicyBindingURL = "/nitro/v1/config/systemglobal_authenticationlocalpolicy_binding" + systemGlobalAuthenticationPolicyBindingURL = "/nitro/v1/config/systemglobal_authenticationpolicy_binding" + systemGlobalAuthenticationRADIUSPolicyBindingURL = "/nitro/v1/config/systemglobal_authenticationradiuspolicy_binding" + systemGlobalAuthenticationTACACSPolicyBindingURL = "/nitro/v1/config/systemglobal_authenticationtacacspolicy_binding" + systemGlobalBindingURL = "/nitro/v1/config/systemglobal_binding" + systemGroupURL = "/nitro/v1/config/systemgroup" + systemGroupBindingURL = "/nitro/v1/config/systemgroup_binding" + systemGroupNSPartitionBindingURL = "/nitro/v1/config/systemgroup_nspartition_binding" + systemGroupSystemCmdPolicyBindingURL = "/nitro/v1/config/systemgroup_systemcmdpolicy_binding" + systemGroupSystemUserBindingURL = "/nitro/v1/config/systemgroup_systemuser_binding" + systemHWErrorURL = "/nitro/v1/config/systemhwerror" + systemKEKURL = "/nitro/v1/config/systemkek" + systemParameterURL = "/nitro/v1/config/systemparameter" + systemRestorePointURL = "/nitro/v1/config/systemrestorepoint" + systemSessionURL = "/nitro/v1/config/systemsession" + systemSSHKeyURL = "/nitro/v1/config/systemsshkey" + systemUserURL = "/nitro/v1/config/systemuser" + systemUserBindingURL = "/nitro/v1/config/systemuser_binding" + systemUserNSPartitionBindingURL = "/nitro/v1/config/systemuser_nspartition_binding" + systemUserSystemCmdPolicyBindingURL = "/nitro/v1/config/systemuser_systemcmdpolicy_binding" + systemUserSystemGroupBindingURL = "/nitro/v1/config/systemuser_systemgroup_binding" + systemStatsURL = "/nitro/v1/stat/system" ) // System @@ -21,230 +61,2747 @@ type SystemService struct { } // systemautorestorefeature -func (s *SystemService) EnableSystemAutoRestoreFeature() {} -func (s *SystemService) DisableSystemAutoRestoreFeature() {} +func (s *SystemService) EnableSystemAutoRestoreFeature() error { + payload := map[string]any{"systemautorestorefeature": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", systemAutoRestoreFeatureURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DisableSystemAutoRestoreFeature() error { + payload := map[string]any{"systemautorestorefeature": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", systemAutoRestoreFeatureURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// systembackup +func (s *SystemService) AddSystemBackup(resource models.SystemBackup) error { + payload := map[string]any{"systembackup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemBackupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemBackup(filename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemBackupURL, filename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) CreateSystemBackup(resource models.SystemBackup) error { + payload := map[string]any{"systembackup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=create", systemBackupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) RestoreSystemBackup(resource models.SystemBackup) error { + payload := map[string]any{"systembackup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=restore", systemBackupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemBackup() ([]models.SystemBackup, error) { + req, err := s.client.NewRequest(http.MethodGet, systemBackupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemBackup []models.SystemBackup `json:"systembackup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemBackup, nil +} + +func (s *SystemService) GetSystemBackup(filename string) (models.SystemBackup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemBackupURL, filename), nil) + if err != nil { + return models.SystemBackup{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemBackup{}, err + } + + var result struct { + SystemBackup []models.SystemBackup `json:"systembackup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemBackup{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemBackup) == 0 { + return models.SystemBackup{}, fmt.Errorf("systembackup %s not found", filename) + } + + return result.SystemBackup[0], nil +} + +func (s *SystemService) CountSystemBackup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemBackupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemBackup []models.SystemBackup `json:"systembackup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemBackup) > 0 { + return int(result.SystemBackup[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemcmdpolicy +func (s *SystemService) AddSystemCmdPolicy(resource models.SystemCmdPolicy) error { + payload := map[string]any{"systemcmdpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemCmdPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemCmdPolicy(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemCmdPolicyURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UpdateSystemCmdPolicy(resource models.SystemCmdPolicy) error { + payload := map[string]any{"systemcmdpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, systemCmdPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemCmdPolicy() ([]models.SystemCmdPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, systemCmdPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemCmdPolicy []models.SystemCmdPolicy `json:"systemcmdpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemCmdPolicy, nil +} + +func (s *SystemService) GetSystemCmdPolicy(policyname string) (models.SystemCmdPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemCmdPolicyURL, policyname), nil) + if err != nil { + return models.SystemCmdPolicy{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemCmdPolicy{}, err + } + + var result struct { + SystemCmdPolicy []models.SystemCmdPolicy `json:"systemcmdpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemCmdPolicy{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemCmdPolicy) == 0 { + return models.SystemCmdPolicy{}, fmt.Errorf("systemcmdpolicy %s not found", policyname) + } + + return result.SystemCmdPolicy[0], nil +} + +func (s *SystemService) CountSystemCmdPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemCmdPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemCmdPolicy []models.SystemCmdPolicy `json:"systemcmdpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemCmdPolicy) > 0 { + return int(result.SystemCmdPolicy[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemcollectionparam +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemcollectionparam +func (s *SystemService) UpdateSystemCollectionParam(resource models.SystemCollectionParam) error { + payload := map[string]any{"systemcollectionparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, systemCollectionParamURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UnsetSystemCollectionParam(resource models.SystemCollectionParam) error { + payload := map[string]any{"systemcollectionparam": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", systemCollectionParamURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemCollectionParam() (models.SystemCollectionParam, error) { + req, err := s.client.NewRequest(http.MethodGet, systemCollectionParamURL, nil) + if err != nil { + return models.SystemCollectionParam{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemCollectionParam{}, err + } + + var result struct { + Data models.SystemCollectionParam `json:"systemcollectionparam"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemCollectionParam{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemcore +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemcore +func (s *SystemService) GetAllSystemCore(args map[string]string) ([]models.SystemCore, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemCoreURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemCore `json:"systemcore"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemcountergroup +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemcountergroup +func (s *SystemService) GetAllSystemCounterGroup(args map[string]string) ([]models.SystemCounterGroup, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemCounterGroupURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemCounterGroup `json:"systemcountergroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemcounters +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemcounters +func (s *SystemService) GetAllSystemCounters(args map[string]string) ([]models.SystemCounters, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemCountersURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemCounters `json:"systemcounters"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemdatasource +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemdatasource +func (s *SystemService) GetAllSystemDataSource(args map[string]string) ([]models.SystemDataSource, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemDataSourceURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemDataSource `json:"systemdatasource"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systementity +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systementity +func (s *SystemService) GetAllSystemEntity(args map[string]string) ([]models.SystemEntity, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemEntityURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemEntity `json:"systementity"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systementitydata +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systementitydata +func (s *SystemService) DeleteSystemEntityData(args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s%s", systemEntityDataURL, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemEntityData(args map[string]string) ([]models.SystemEntityData, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemEntityDataURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemEntityData `json:"systementitydata"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systementitytype +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systementitytype +func (s *SystemService) GetAllSystemEntityType(args map[string]string) ([]models.SystemEntityType, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemEntityTypeURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemEntityType `json:"systementitytype"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemeventhistory +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemeventhistory +func (s *SystemService) GetAllSystemEventHistory(args map[string]string) ([]models.SystemEventHistory, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemEventHistoryURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemEventHistory `json:"systemeventhistory"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemextramgmtcpu +func (s *SystemService) EnableSystemExtraMgmtCPU() error { + payload := map[string]any{"systemextramgmtcpu": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", systemExtraMgmtCPUURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DisableSystemExtraMgmtCPU() error { + payload := map[string]any{"systemextramgmtcpu": map[string]any{}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", systemExtraMgmtCPUURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemExtraMgmtCPU() (models.SystemExtraMgmtCPU, error) { + req, err := s.client.NewRequest(http.MethodGet, systemExtraMgmtCPUURL, nil) + if err != nil { + return models.SystemExtraMgmtCPU{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemExtraMgmtCPU{}, err + } + + var result struct { + ExtraMgmtCPU models.SystemExtraMgmtCPU `json:"systemextramgmtcpu"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemExtraMgmtCPU{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ExtraMgmtCPU, nil +} + +// systemfile +func (s *SystemService) AddSystemFile(resource models.SystemFile) error { + payload := map[string]any{"systemfile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemFileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemFile(filename string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemFileURL, filename, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemFile() ([]models.SystemFile, error) { + req, err := s.client.NewRequest(http.MethodGet, systemFileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemFile []models.SystemFile `json:"systemfile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemFile, nil +} + +func (s *SystemService) CountSystemFile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemFileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemFile []models.SystemFile `json:"systemfile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemFile) > 0 { + return int(result.SystemFile[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemglobaldata +// https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemglobaldata +func (s *SystemService) GetAllSystemGlobalData(args map[string]string) ([]models.SystemGlobalData, error) { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s%s", systemGlobalDataURL, argsStr), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.SystemGlobalData `json:"systemglobaldata"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +// systemglobal_auditnslogpolicy_binding +func (s *SystemService) AddSystemGlobalAuditNSLogPolicyBinding(resource models.SystemGlobalAuditNSLogPolicyBinding) error { + payload := map[string]any{"systemglobal_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuditNSLogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuditNSLogPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuditNSLogPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuditNSLogPolicyBinding() ([]models.SystemGlobalAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuditNSLogPolicyBinding []models.SystemGlobalAuditNSLogPolicyBinding `json:"systemglobal_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuditNSLogPolicyBinding, nil +} + +func (s *SystemService) CountSystemGlobalAuditNSLogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuditNSLogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_auditsyslogpolicy_binding +func (s *SystemService) AddSystemGlobalAuditSyslogPolicyBinding(resource models.SystemGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{"systemglobal_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuditSyslogPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuditSyslogPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuditSyslogPolicyBinding() ([]models.SystemGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuditSyslogPolicyBinding []models.SystemGlobalAuditSyslogPolicyBinding `json:"systemglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuditSyslogPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuditSyslogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuditSyslogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_authenticationldappolicy_binding +func (s *SystemService) AddSystemGlobalAuthenticationLDAPPolicyBinding(resource models.SystemGlobalAuthenticationLDAPPolicyBinding) error { + payload := map[string]any{"systemglobal_authenticationldappolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuthenticationLDAPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuthenticationLDAPPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuthenticationLDAPPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuthenticationLDAPPolicyBinding() ([]models.SystemGlobalAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationLDAPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuthenticationLDAPPolicyBinding []models.SystemGlobalAuthenticationLDAPPolicyBinding `json:"systemglobal_authenticationldappolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuthenticationLDAPPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuthenticationLDAPPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationLDAPPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_authenticationldappolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_authenticationlocalpolicy_binding +func (s *SystemService) AddSystemGlobalAuthenticationLocalPolicyBinding(resource models.SystemGlobalAuthenticationLocalPolicyBinding) error { + payload := map[string]any{"systemglobal_authenticationlocalpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuthenticationLocalPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuthenticationLocalPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuthenticationLocalPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuthenticationLocalPolicyBinding() ([]models.SystemGlobalAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationLocalPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuthenticationLocalPolicyBinding []models.SystemGlobalAuthenticationLocalPolicyBinding `json:"systemglobal_authenticationlocalpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuthenticationLocalPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuthenticationLocalPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationLocalPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_authenticationlocalpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_authenticationpolicy_binding +func (s *SystemService) AddSystemGlobalAuthenticationPolicyBinding(resource models.SystemGlobalAuthenticationPolicyBinding) error { + payload := map[string]any{"systemglobal_authenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuthenticationPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuthenticationPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuthenticationPolicyBinding() ([]models.SystemGlobalAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuthenticationPolicyBinding []models.SystemGlobalAuthenticationPolicyBinding `json:"systemglobal_authenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuthenticationPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuthenticationPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_authenticationpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_authenticationradiuspolicy_binding +func (s *SystemService) AddSystemGlobalAuthenticationRADIUSPolicyBinding(resource models.SystemGlobalAuthenticationRADIUSPolicyBinding) error { + payload := map[string]any{"systemglobal_authenticationradiuspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuthenticationRADIUSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuthenticationRADIUSPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuthenticationRADIUSPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuthenticationRADIUSPolicyBinding() ([]models.SystemGlobalAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationRADIUSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuthenticationRADIUSPolicyBinding []models.SystemGlobalAuthenticationRADIUSPolicyBinding `json:"systemglobal_authenticationradiuspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuthenticationRADIUSPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuthenticationRADIUSPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationRADIUSPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_authenticationradiuspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_authenticationtacacspolicy_binding +func (s *SystemService) AddSystemGlobalAuthenticationTACACSPolicyBinding(resource models.SystemGlobalAuthenticationTACACSPolicyBinding) error { + payload := map[string]any{"systemglobal_authenticationtacacspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGlobalAuthenticationTACACSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGlobalAuthenticationTACACSPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGlobalAuthenticationTACACSPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetSystemGlobalAuthenticationTACACSPolicyBinding() ([]models.SystemGlobalAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationTACACSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGlobalAuthenticationTACACSPolicyBinding []models.SystemGlobalAuthenticationTACACSPolicyBinding `json:"systemglobal_authenticationtacacspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGlobalAuthenticationTACACSPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGlobalAuthenticationTACACSPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalAuthenticationTACACSPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemglobal_authenticationtacacspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemglobal_binding +func (s *SystemService) GetSystemGlobalBinding() (models.SystemGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGlobalBindingURL, nil) + if err != nil { + return models.SystemGlobalBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemGlobalBinding{}, err + } + + var result struct { + SystemGlobalBinding []models.SystemGlobalBinding `json:"systemglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemGlobalBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemGlobalBinding) == 0 { + return models.SystemGlobalBinding{}, fmt.Errorf("systemglobal_binding not found") + } + + return result.SystemGlobalBinding[0], nil +} + +// systemgroup +func (s *SystemService) AddSystemGroup(resource models.SystemGroup) error { + payload := map[string]any{"systemgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGroup(groupname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemGroupURL, groupname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UpdateSystemGroup(resource models.SystemGroup) error { + payload := map[string]any{"systemgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, systemGroupURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UnsetSystemGroup(resource models.SystemGroup) error { + payload := map[string]any{"systemgroup": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", systemGroupURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemGroup() ([]models.SystemGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroup []models.SystemGroup `json:"systemgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroup, nil +} + +func (s *SystemService) GetSystemGroup(groupname string) (models.SystemGroup, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemGroupURL, groupname), nil) + if err != nil { + return models.SystemGroup{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemGroup{}, err + } + + var result struct { + SystemGroup []models.SystemGroup `json:"systemgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemGroup{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemGroup) == 0 { + return models.SystemGroup{}, fmt.Errorf("systemgroup %s not found", groupname) + } + + return result.SystemGroup[0], nil +} + +func (s *SystemService) CountSystemGroup() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemGroupURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemGroup []models.SystemGroup `json:"systemgroup"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemGroup) > 0 { + return int(result.SystemGroup[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemgroup_binding +func (s *SystemService) GetAllSystemGroupBinding() ([]models.SystemGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupBinding []models.SystemGroupBinding `json:"systemgroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupBinding, nil +} + +func (s *SystemService) GetSystemGroupBinding(groupname string) (models.SystemGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemGroupBindingURL, groupname), nil) + if err != nil { + return models.SystemGroupBinding{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemGroupBinding{}, err + } + + var result struct { + SystemGroupBinding []models.SystemGroupBinding `json:"systemgroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemGroupBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemGroupBinding) == 0 { + return models.SystemGroupBinding{}, fmt.Errorf("systemgroup_binding %s not found", groupname) + } + + return result.SystemGroupBinding[0], nil +} + +// systemgroup_nspartition_binding +func (s *SystemService) AddSystemGroupNSPartitionBinding(resource models.SystemGroupNSPartitionBinding) error { + payload := map[string]any{"systemgroup_nspartition_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGroupNSPartitionBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGroupNSPartitionBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemGroupNSPartitionBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemGroupNSPartitionBinding() ([]models.SystemGroupNSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupNSPartitionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupNSPartitionBinding []models.SystemGroupNSPartitionBinding `json:"systemgroup_nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupNSPartitionBinding, nil +} + +func (s *SystemService) GetSystemGroupNSPartitionBinding(groupname string) ([]models.SystemGroupNSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemGroupNSPartitionBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupNSPartitionBinding []models.SystemGroupNSPartitionBinding `json:"systemgroup_nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupNSPartitionBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGroupNSPartitionBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupNSPartitionBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemgroup_nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemgroup_systemcmdpolicy_binding +func (s *SystemService) AddSystemGroupSystemCmdPolicyBinding(resource models.SystemGroupSystemCmdPolicyBinding) error { + payload := map[string]any{"systemgroup_systemcmdpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGroupSystemCmdPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGroupSystemCmdPolicyBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemGroupSystemCmdPolicyBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemGroupSystemCmdPolicyBinding() ([]models.SystemGroupSystemCmdPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupSystemCmdPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupSystemCmdPolicyBinding []models.SystemGroupSystemCmdPolicyBinding `json:"systemgroup_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupSystemCmdPolicyBinding, nil +} + +func (s *SystemService) GetSystemGroupSystemCmdPolicyBinding(groupname string) ([]models.SystemGroupSystemCmdPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemGroupSystemCmdPolicyBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupSystemCmdPolicyBinding []models.SystemGroupSystemCmdPolicyBinding `json:"systemgroup_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupSystemCmdPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGroupSystemCmdPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupSystemCmdPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemgroup_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemgroup_systemuser_binding +func (s *SystemService) AddSystemGroupSystemUserBinding(resource models.SystemGroupSystemUserBinding) error { + payload := map[string]any{"systemgroup_systemuser_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemGroupSystemUserBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemGroupSystemUserBinding(groupname string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemGroupSystemUserBindingURL, groupname, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemGroupSystemUserBinding() ([]models.SystemGroupSystemUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupSystemUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupSystemUserBinding []models.SystemGroupSystemUserBinding `json:"systemgroup_systemuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupSystemUserBinding, nil +} + +func (s *SystemService) GetSystemGroupSystemUserBinding(groupname string) ([]models.SystemGroupSystemUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemGroupSystemUserBindingURL, groupname), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemGroupSystemUserBinding []models.SystemGroupSystemUserBinding `json:"systemgroup_systemuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemGroupSystemUserBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemGroupSystemUserBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemGroupSystemUserBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemgroup_systemuser_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} + +// systemhwerror +func (s *SystemService) CheckSystemHWError() (models.SystemHWError, error) { + req, err := s.client.NewRequest(http.MethodGet, systemHWErrorURL, nil) + if err != nil { + return models.SystemHWError{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemHWError{}, err + } + + var result struct { + SystemHWError []models.SystemHWError `json:"systemhwerror"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemHWError{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemHWError) == 0 { + return models.SystemHWError{}, fmt.Errorf("systemhwerror not found") + } + + return result.SystemHWError[0], nil +} + +// systemkek +func (s *SystemService) ChangeSystemKEK(resource models.SystemKEK) error { + payload := map[string]any{"systemkek": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemKEKURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +// systemparameter +func (s *SystemService) UpdateSystemParameter(resource models.SystemParameter) error { + payload := map[string]any{"systemparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, systemParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UnsetSystemParameter(resource models.SystemParameter) error { + payload := map[string]any{"systemparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", systemParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemParameter() (models.SystemParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, systemParameterURL, nil) + if err != nil { + return models.SystemParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemParameter{}, err + } + + var result struct { + SystemParameter models.SystemParameter `json:"systemparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemParameter, nil +} + +// systemrestorepoint +func (s *SystemService) CreateSystemRestorePoint(resource models.SystemRestorePoint) error { + payload := map[string]any{"systemrestorepoint": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=create", systemRestorePointURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemRestorePoint(filename string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemRestorePointURL, filename), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemRestorePoint() ([]models.SystemRestorePoint, error) { + req, err := s.client.NewRequest(http.MethodGet, systemRestorePointURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemRestorePoint []models.SystemRestorePoint `json:"systemrestorepoint"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemRestorePoint, nil +} + +func (s *SystemService) GetSystemRestorePoint(filename string) (models.SystemRestorePoint, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemRestorePointURL, filename), nil) + if err != nil { + return models.SystemRestorePoint{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemRestorePoint{}, err + } + + var result struct { + SystemRestorePoint []models.SystemRestorePoint `json:"systemrestorepoint"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemRestorePoint{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemRestorePoint) == 0 { + return models.SystemRestorePoint{}, fmt.Errorf("systemrestorepoint %s not found", filename) + } + + return result.SystemRestorePoint[0], nil +} + +func (s *SystemService) CountSystemRestorePoint() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemRestorePointURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemRestorePoint []models.SystemRestorePoint `json:"systemrestorepoint"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemRestorePoint) > 0 { + return int(result.SystemRestorePoint[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemsession +func (s *SystemService) KillSystemSession(resource models.SystemSession) error { + payload := map[string]any{"systemsession": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=kill", systemSessionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemSession() ([]models.SystemSession, error) { + req, err := s.client.NewRequest(http.MethodGet, systemSessionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemSession []models.SystemSession `json:"systemsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemSession, nil +} + +func (s *SystemService) GetSystemSession(sid string) (models.SystemSession, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemSessionURL, sid), nil) + if err != nil { + return models.SystemSession{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.SystemSession{}, err + } + + var result struct { + SystemSession []models.SystemSession `json:"systemsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemSession{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemSession) == 0 { + return models.SystemSession{}, fmt.Errorf("systemsession %s not found", sid) + } + + return result.SystemSession[0], nil +} + +func (s *SystemService) CountSystemSession() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemSessionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + SystemSession []models.SystemSession `json:"systemsession"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.SystemSession) > 0 { + return int(result.SystemSession[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// systemsshkey +func (s *SystemService) ImportSystemSSHKey(resource models.SystemSSHKey) error { + payload := map[string]any{"systemsshkey": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=import", systemSSHKeyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemSSHKey(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemSSHKeyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemSSHKey() ([]models.SystemSSHKey, error) { + req, err := s.client.NewRequest(http.MethodGet, systemSSHKeyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemSSHKey []models.SystemSSHKey `json:"systemsshkey"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemSSHKey, nil +} + +// systemuser +func (s *SystemService) AddSystemUser(resource models.SystemUser) error { + payload := map[string]any{"systemuser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemUserURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemUser(username string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", systemUserURL, username), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UpdateSystemUser(resource models.SystemUser) error { + payload := map[string]any{"systemuser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, systemUserURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) UnsetSystemUser(resource models.SystemUser) error { + payload := map[string]any{"systemuser": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", systemUserURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} -// systembackup -func (s *SystemService) AddSystemBackup() {} -func (s *SystemService) DeleteSystemBackup() {} -func (s *SystemService) CreateSystemBackup() {} -func (s *SystemService) RestoreSystemBackup() {} -func (s *SystemService) GetAllSystemBackup() {} -func (s *SystemService) GetSystemBackup() {} -func (s *SystemService) CountSystemBackup() {} +func (s *SystemService) GetAllSystemUser() ([]models.SystemUser, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserURL, nil) + if err != nil { + return nil, err + } -// systemcmdpolicy -func (s *SystemService) AddSystemCmdPolicy() {} -func (s *SystemService) DeleteSystemCmdPolicy() {} -func (s *SystemService) UpdateSystemCmdPolicy() {} -func (s *SystemService) GetAllSystemCmdPolicy() {} -func (s *SystemService) GetSystemCmdPolicy() {} -func (s *SystemService) CountSystemCmdPolicy() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// systemcollectionparam -func (s *SystemService) UpdateSystemCollectionParam() {} -func (s *SystemService) UnsetSystemCollectionParam() {} -func (s *SystemService) GetAllSystemCollectionParam() {} + var result struct { + SystemUser []models.SystemUser `json:"systemuser"` + } -// systemcore -func (s *SystemService) GetAllSystemCore() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// systemcountergroup -func (s *SystemService) GetAllSystemCounterGroup() {} + return result.SystemUser, nil +} -// systemcounters -func (s *SystemService) GetAllSystemCounters() {} +func (s *SystemService) GetSystemUser(username string) (models.SystemUser, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemUserURL, username), nil) + if err != nil { + return models.SystemUser{}, err + } -// systemdatasource -func (s *SystemService) GetAllSystemDataSource() {} + resp, err := s.client.Do(req) + if err != nil { + return models.SystemUser{}, err + } -// systementity -func (s *SystemService) GetAllSystemEntity() {} + var result struct { + SystemUser []models.SystemUser `json:"systemuser"` + } -// systementitydata -func (s *SystemService) DeleteSystemEntityData() {} -func (s *SystemService) GetAllSystemEntityData() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemUser{}, fmt.Errorf("failed to unmarshal: %w", err) + } -// systementitytype -func (s *SystemService) GetAllSystemEntityType() {} + if len(result.SystemUser) == 0 { + return models.SystemUser{}, fmt.Errorf("systemuser %s not found", username) + } -// systemeventhistory -func (s *SystemService) GetAllSystemEventHistory() {} + return result.SystemUser[0], nil +} -// systemextramgmtcpu -func (s *SystemService) EnableSystemExtraMgmtCPU() {} -func (s *SystemService) DisableSystemExtraMgmtCPU() {} -func (s *SystemService) GetAllSystemExtraMgmtCPU() (models.SystemExtraMgmtCPU, error) { - req, err := s.client.NewRequest(http.MethodGet, systemExtraMgmtCPUURL, nil) +func (s *SystemService) CountSystemUser() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", systemUserURL), nil) if err != nil { - return models.SystemExtraMgmtCPU{}, err + return 0, err } resp, err := s.client.Do(req) if err != nil { - return models.SystemExtraMgmtCPU{}, err + return 0, err } var result struct { - ExtraMgmtCPU models.SystemExtraMgmtCPU `json:"systemextramgmtcpu"` + SystemUser []models.SystemUser `json:"systemuser"` } err = json.Unmarshal(resp, &result) if err != nil { - return models.SystemExtraMgmtCPU{}, fmt.Errorf("failed to unmarshal: %w", err) + return 0, fmt.Errorf("failed to unmarshal: %w", err) } - return result.ExtraMgmtCPU, nil + if len(result.SystemUser) > 0 { + return int(result.SystemUser[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") } -// systemfile -func (s *SystemService) AddSystemFile() {} -func (s *SystemService) DeleteSystemFile() {} -func (s *SystemService) GetAllSystemFile() {} -func (s *SystemService) CountSystemFile() {} +// systemuser_binding +func (s *SystemService) GetAllSystemUserBinding() ([]models.SystemUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserBindingURL, nil) + if err != nil { + return nil, err + } -// systemglobaldata -func (s *SystemService) GetAllSystemGlobalData() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// systemglobal_auditglobal_auditnslogpolicy_binding -func (s *SystemService) AddSystemGlobalAuditNSLogPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuditNSLogPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuditNSLogPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuditNSLogPolicyBinding() {} + var result struct { + SystemUserBinding []models.SystemUserBinding `json:"systemuser_binding"` + } -// systemglobal_auditsyslogpolicy_binding -func (s *SystemService) AddSystemGlobalAuditSyslogPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuditSyslogPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuditSyslogPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuditSyslogPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// systemglobal_authenticationldappolicy_binding -func (s *SystemService) AddSystemGlobalAuthenticationLDAPPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuthenticationLDAPPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuthenticationLDAPPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuthenticationLDAPPolicyBinding() {} + return result.SystemUserBinding, nil +} -// systemglobal_authenticationlocalpolicy_binding -func (s *SystemService) AddSystemGlobalAuthenticationLocalPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuthenticationLocalPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuthenticationLocalPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuthenticationLocalPolicyBinding() {} +func (s *SystemService) GetSystemUserBinding(username string) (models.SystemUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemUserBindingURL, username), nil) + if err != nil { + return models.SystemUserBinding{}, err + } -// systemglobal_authenticationpolicy_binding -func (s *SystemService) AddSystemGlobalAuthenticationPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuthenticationPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuthenticationPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuthenticationPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return models.SystemUserBinding{}, err + } -// systemglobal_authenticationradiuspolicy_binding -func (s *SystemService) AddSystemGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuthenticationRADIUSPolicyBinding() {} + var result struct { + SystemUserBinding []models.SystemUserBinding `json:"systemuser_binding"` + } -// systemglobal_authenticationtacacspolicy_binding -func (s *SystemService) AddSystemGlobalAuthenticationTACACSPolicyBinding() {} -func (s *SystemService) DeleteSystemGlobalAuthenticationTACACSPolicyBinding() {} -func (s *SystemService) GetSystemGlobalAuthenticationTACACSPolicyBinding() {} -func (s *SystemService) CountSystemGlobalAuthenticationTACACSPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return models.SystemUserBinding{}, fmt.Errorf("failed to unmarshal: %w", err) + } -// systemglobal_binding -func (s *SystemService) GetSystemGlobalBinding() {} + if len(result.SystemUserBinding) == 0 { + return models.SystemUserBinding{}, fmt.Errorf("systemuser_binding %s not found", username) + } -// systemgroup -func (s *SystemService) AddSystemGroup() {} -func (s *SystemService) DeleteSystemGroup() {} -func (s *SystemService) UpdateSystemGroup() {} -func (s *SystemService) UnsetSystemGroup() {} -func (s *SystemService) GetAllSystemGroup() {} -func (s *SystemService) GetSystemGroup() {} -func (s *SystemService) CountSystemGroup() {} + return result.SystemUserBinding[0], nil +} -// systemgroup_binding -func (s *SystemService) GetAllSystemGroupBinding() {} -func (s *SystemService) GetSystemGroupBinding() {} +// systemuser_nspartition_binding +func (s *SystemService) AddSystemUserNSPartitionBinding(resource models.SystemUserNSPartitionBinding) error { + payload := map[string]any{"systemuser_nspartition_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// systemgroup_nspartition_binding -func (s *SystemService) AddSystemGroupNSPartitionBinding() {} -func (s *SystemService) DeleteSystemGroupNSPartitionBinding() {} -func (s *SystemService) GetAllSystemGroupNSPartitionBinding() {} -func (s *SystemService) GetSystemGroupNSPartitionBinding() {} -func (s *SystemService) CountSystemGroupNSPartitionBinding() {} + req, err := s.client.NewRequest(http.MethodPost, systemUserNSPartitionBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// systemgroup_systemcmdpolicy_binding -func (s *SystemService) AddSystemGroupSystemCmdPolicyBinding() {} -func (s *SystemService) DeleteSystemGroupSystemCmdPolicyBinding() {} -func (s *SystemService) GetAllSystemGroupSystemCmdPolicyBinding() {} -func (s *SystemService) GetSystemGroupSystemCmdPolicyBinding() {} -func (s *SystemService) CountSystemGroupSystemCmdPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// systemgroup_systemuser_binding -func (s *SystemService) AddSystemGroupSystemUserBinding() {} -func (s *SystemService) DeleteSystemGroupSystemUserBinding() {} -func (s *SystemService) GetAllSystemGroupSystemUserBinding() {} -func (s *SystemService) GetSystemGroupSystemUserBinding() {} -func (s *SystemService) CountSystemGroupSystemUserBinding() {} +func (s *SystemService) DeleteSystemUserNSPartitionBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } -// systemhwerror -func (s *SystemService) CheckSystemHWError() {} + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemUserNSPartitionBindingURL, username, argsStr), nil) + if err != nil { + return err + } -// systemkek -func (s *SystemService) ChangeSystemKEK() {} + _, err = s.client.Do(req) + return err +} -// systemparameter -func (s *SystemService) UpdateSystemParameter() {} -func (s *SystemService) UnsetSystemParameter() {} -func (s *SystemService) GetAllSystemParameter() {} +func (s *SystemService) GetAllSystemUserNSPartitionBinding() ([]models.SystemUserNSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserNSPartitionBindingURL, nil) + if err != nil { + return nil, err + } -// systemrestorepoint -func (s *SystemService) CreateSystemRestorePoint() {} -func (s *SystemService) DeleteSystemRestorePoint() {} -func (s *SystemService) GetAllSystemRestorePoint() {} -func (s *SystemService) GetSystemRestorePoint() {} -func (s *SystemService) CountSystemRestorePoint() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// systemsession -func (s *SystemService) KillSystemSession() {} -func (s *SystemService) GetAllSystemSession() {} -func (s *SystemService) GetSystemSession() {} -func (s *SystemService) CountSystemSession() {} + var result struct { + SystemUserNSPartitionBinding []models.SystemUserNSPartitionBinding `json:"systemuser_nspartition_binding"` + } -// systemsshkey -func (s *SystemService) ImportSystemSSHKey() {} -func (s *SystemService) DeleteSystemSSHKey() {} -func (s *SystemService) GetAllSystemSSHKey() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// systemuser -func (s *SystemService) AddSystemUser() {} -func (s *SystemService) DeleteSystemUser() {} -func (s *SystemService) UpdateSystemUser() {} -func (s *SystemService) UnsetSystemUser() {} -func (s *SystemService) GetAllSystemUser() {} -func (s *SystemService) GetSystemUser() {} -func (s *SystemService) CountSystemUser() {} + return result.SystemUserNSPartitionBinding, nil +} -// systemuser_binding -func (s *SystemService) GetAllSystemUserBinding() {} -func (s *SystemService) GetSystemUserBinding() {} +func (s *SystemService) GetSystemUserNSPartitionBinding(username string) ([]models.SystemUserNSPartitionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemUserNSPartitionBindingURL, username), nil) + if err != nil { + return nil, err + } -// systemuser_nspartition_binding -func (s *SystemService) AddSystemUserNSPartitionBinding() {} -func (s *SystemService) DeleteSystemUserNSPartitionBinding() {} -func (s *SystemService) GetAllSystemUserNSPartitionBinding() {} -func (s *SystemService) GetSystemUserNSPartitionBinding() {} -func (s *SystemService) CountSystemUserNSPartitionBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemUserNSPartitionBinding []models.SystemUserNSPartitionBinding `json:"systemuser_nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemUserNSPartitionBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemUserNSPartitionBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserNSPartitionBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemuser_nspartition_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // systemuser_systemcmdpolicy_binding -func (s *SystemService) AddSystemUserSystemCmdPolicyBinding() {} -func (s *SystemService) DeleteSystemUserSystemCmdPolicyBinding() {} -func (s *SystemService) GetAllSystemUserSystemCmdPolicyBinding() {} -func (s *SystemService) GetSystemUserSystemCmdPolicyBinding() {} -func (s *SystemService) CountSystemUserSystemCmdPolicyBinding() {} +func (s *SystemService) AddSystemUserSystemCmdPolicyBinding(resource models.SystemUserSystemCmdPolicyBinding) error { + payload := map[string]any{"systemuser_systemcmdpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, systemUserSystemCmdPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) DeleteSystemUserSystemCmdPolicyBinding(username string, args map[string]string) error { + var argsStr string + if len(args) > 0 { + var parts []string + for k, v := range args { + parts = append(parts, fmt.Sprintf("%s:%s", k, v)) + } + argsStr = "?args=" + strings.Join(parts, ",") + } + + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s%s", systemUserSystemCmdPolicyBindingURL, username, argsStr), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *SystemService) GetAllSystemUserSystemCmdPolicyBinding() ([]models.SystemUserSystemCmdPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserSystemCmdPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemUserSystemCmdPolicyBinding []models.SystemUserSystemCmdPolicyBinding `json:"systemuser_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemUserSystemCmdPolicyBinding, nil +} + +func (s *SystemService) GetSystemUserSystemCmdPolicyBinding(username string) ([]models.SystemUserSystemCmdPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemUserSystemCmdPolicyBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemUserSystemCmdPolicyBinding []models.SystemUserSystemCmdPolicyBinding `json:"systemuser_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemUserSystemCmdPolicyBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemUserSystemCmdPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserSystemCmdPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemuser_systemcmdpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // systemuser_systemgroup_binding -func (s *SystemService) GetAllSystemUserSystemGroupBinding() {} -func (s *SystemService) GetSystemUserSystemGroupBinding() {} -func (s *SystemService) CountSystemUserSystemGroupBinding() {} +func (s *SystemService) GetAllSystemUserSystemGroupBinding() ([]models.SystemUserSystemGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserSystemGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemUserSystemGroupBinding []models.SystemUserSystemGroupBinding `json:"systemuser_systemgroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemUserSystemGroupBinding, nil +} + +func (s *SystemService) GetSystemUserSystemGroupBinding(username string) ([]models.SystemUserSystemGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", systemUserSystemGroupBindingURL, username), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + SystemUserSystemGroupBinding []models.SystemUserSystemGroupBinding `json:"systemuser_systemgroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.SystemUserSystemGroupBinding, nil +} + +// Struct lacks Count field, leaving for later +func (s *SystemService) CountSystemUserSystemGroupBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, systemUserSystemGroupBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"systemuser_systemgroup_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} //////////////// // statistics // diff --git a/nitrogo/tm.go b/nitrogo/tm.go index e4e575d..7504938 100644 --- a/nitrogo/tm.go +++ b/nitrogo/tm.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( tmFormSSOActionURL = "/nitro/v1/config/tmformssoaction" tmGlobalAuditNSLogPolicyBindingURL = "/nitro/v1/config/tmglobal_auditnslogpolicy_binding" @@ -32,130 +42,1603 @@ type TMService struct { } // tmformssoaction -func (s *TMService) AddTMFormSSOAction() {} -func (s *TMService) DeleteTMFormSSOAction() {} -func (s *TMService) UpdateTMFormSSOAction() {} -func (s *TMService) UnsetTMFormSSOAction() {} -func (s *TMService) GetAllTMFormSSOAction() {} -func (s *TMService) GetTMFormSSOAction() {} -func (s *TMService) CountTMFormSSOAction() {} +func (s *TMService) AddTMFormSSOAction(action models.TMFormSSOAction) error { + payload := map[string]any{"tmformssoaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmFormSSOActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMFormSSOAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmFormSSOActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMFormSSOAction(action models.TMFormSSOAction) error { + payload := map[string]any{"tmformssoaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmFormSSOActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMFormSSOAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmformssoaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmFormSSOActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMFormSSOAction() ([]models.TMFormSSOAction, error) { + req, err := s.client.NewRequest(http.MethodGet, tmFormSSOActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMFormSSOAction `json:"tmformssoaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) GetTMFormSSOAction(name string) ([]models.TMFormSSOAction, error) { + reqURL := fmt.Sprintf("%s/%s", tmFormSSOActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMFormSSOAction `json:"tmformssoaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) CountTMFormSSOAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmFormSSOActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"tmformssoaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // tmglobal_auditnslogpolicy_binding -func (s *TMService) AddTMGlobalAuditNSLogPolicyBinding() {} -func (s *TMService) DeleteTMGlobalAuditNSLogPolicyBinding() {} -func (s *TMService) GetTMGlobalAuditNSLogPolicyBinding() {} -func (s *TMService) CountTMGlobalAuditNSLogPolicyBinding() {} +func (s *TMService) AddTMGlobalAuditNSLogPolicyBinding(binding models.TMGlobalAuditNSLogPolicyBinding) error { + payload := map[string]any{"tmglobal_auditnslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmGlobalAuditNSLogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} -// tmglobal_auditsyslogpolcy_binding -func (s *TMService) AddTMGlobalAuditSyslogPolicyBinding() {} -func (s *TMService) DeleteTMGlobalAuditSyslogPolicyBinding() {} -func (s *TMService) GetTMGlobalAuditSyslogPolicyBinding() {} -func (s *TMService) CountTMGlobalAuditSyslogPolicyBinding() {} +func (s *TMService) DeleteTMGlobalAuditNSLogPolicyBinding(policyName string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", tmGlobalAuditNSLogPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetTMGlobalAuditNSLogPolicyBinding() ([]models.TMGlobalAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMGlobalAuditNSLogPolicyBinding `json:"tmglobal_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMGlobalAuditNSLogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalAuditNSLogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmglobal_auditnslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// tmglobal_auditsyslogpolicy_binding +func (s *TMService) AddTMGlobalAuditSyslogPolicyBinding(binding models.TMGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{"tmglobal_auditsyslogpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmGlobalAuditSyslogPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMGlobalAuditSyslogPolicyBinding(policyName string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", tmGlobalAuditSyslogPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetTMGlobalAuditSyslogPolicyBinding() ([]models.TMGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMGlobalAuditSyslogPolicyBinding `json:"tmglobal_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMGlobalAuditSyslogPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalAuditSyslogPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmglobal_auditsyslogpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmglobal_binding -func (s *TMService) GetTMGlobalBinding() {} +func (s *TMService) GetTMGlobalBinding() ([]models.TMGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMGlobalBinding `json:"tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // tmglobal_tmsessionpolicy_binding -func (s *TMService) AddTMGlobalTMSessionPolicyBinding() {} -func (s *TMService) DeleteTMGlobalTMSessionPolicyBinding() {} -func (s *TMService) GetTMGlobalTMSessionPolicyBinding() {} -func (s *TMService) CountTMGlobalTMSessionPolicyBinding() {} +func (s *TMService) AddTMGlobalTMSessionPolicyBinding(binding models.TMGlobalTMSessionPolicyBinding) error { + payload := map[string]any{"tmglobal_tmsessionpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmGlobalTMSessionPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMGlobalTMSessionPolicyBinding(policyName string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", tmGlobalTMSessionPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetTMGlobalTMSessionPolicyBinding() ([]models.TMGlobalTMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalTMSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMGlobalTMSessionPolicyBinding `json:"tmglobal_tmsessionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMGlobalTMSessionPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalTMSessionPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmglobal_tmsessionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmglobal_tmtrafficpolicy_binding -func (s *TMService) AddTMGlobalTMTrafficPolicyBinding() {} -func (s *TMService) DeleteTMGlobalTMTrafficPolicyBinding() {} -func (s *TMService) GetTMGlobalTMTrafficPolicyBinding() {} -func (s *TMService) CountTMGlobalTMTrafficPolicyBinding() {} +func (s *TMService) AddTMGlobalTMTrafficPolicyBinding(binding models.TMGlobalTMTrafficPolicyBinding) error { + payload := map[string]any{"tmglobal_tmtrafficpolicy_binding": binding} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmGlobalTMTrafficPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMGlobalTMTrafficPolicyBinding(policyName string) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s", tmGlobalTMTrafficPolicyBindingURL, url.QueryEscape(policyName)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetTMGlobalTMTrafficPolicyBinding() ([]models.TMGlobalTMTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalTMTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMGlobalTMTrafficPolicyBinding `json:"tmglobal_tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMGlobalTMTrafficPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmGlobalTMTrafficPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmglobal_tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmsamlssoprofile -func (s *TMService) AddTMSAMLSSOProfile() {} -func (s *TMService) DeleteTMSAMLSSOProfile() {} -func (s *TMService) UpdateTMSAMLSSOProfile() {} -func (s *TMService) UnsetTMSAMLSSOProfile() {} -func (s *TMService) GetAllTMSAMLSSOProfile() {} -func (s *TMService) GetTMSAMLSSOProfile() {} -func (s *TMService) CountTMSAMLSSOProfile() {} +func (s *TMService) AddTMSAMLSSOProfile(profile models.TMSAMLSSOProfile) error { + payload := map[string]any{"tmsamlssoprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSAMLSSOProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMSAMLSSOProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmSAMLSSOProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMSAMLSSOProfile(profile models.TMSAMLSSOProfile) error { + payload := map[string]any{"tmsamlssoprofile": profile} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmSAMLSSOProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMSAMLSSOProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmsamlssoprofile": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSAMLSSOProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMSAMLSSOProfile() ([]models.TMSAMLSSOProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSAMLSSOProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.TMSAMLSSOProfile `json:"tmsamlssoprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *TMService) GetTMSAMLSSOProfile(name string) ([]models.TMSAMLSSOProfile, error) { + reqURL := fmt.Sprintf("%s/%s", tmSAMLSSOProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.TMSAMLSSOProfile `json:"tmsamlssoprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *TMService) CountTMSAMLSSOProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSAMLSSOProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"tmsamlssoprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + return 0, nil +} // tmsessionaction -func (s *TMService) AddTMSessionAction() {} -func (s *TMService) DeleteTMSessionAction() {} -func (s *TMService) UpdateTMSessionAction() {} -func (s *TMService) UnsetTMSessionAction() {} -func (s *TMService) GetAllTMSessionAction() {} -func (s *TMService) GetTMSessionAction() {} -func (s *TMService) CountTMSessionAction() {} +func (s *TMService) AddTMSessionAction(action models.TMSessionAction) error { + payload := map[string]any{"tmsessionaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSessionActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMSessionAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmSessionActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMSessionAction(action models.TMSessionAction) error { + payload := map[string]any{"tmsessionaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmSessionActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMSessionAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmsessionaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSessionActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMSessionAction() ([]models.TMSessionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMSessionAction `json:"tmsessionaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) GetTMSessionAction(name string) ([]models.TMSessionAction, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMSessionAction `json:"tmsessionaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) CountTMSessionAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"tmsessionaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // tmsessionparameter -func (s *TMService) UpdateTMSessonParameter() {} -func (s *TMService) UnsetTMSessonParameter() {} -func (s *TMService) GetAllTMSessonParameter() {} +func (s *TMService) UpdateTMSessionParameter(param models.TMSessionParameter) error { + payload := map[string]any{"tmsessionparameter": param} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmSessionParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMSessionParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmsessionparameter": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSessionParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMSessionParameter() (models.TMSessionParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionParameterURL, nil) + if err != nil { + return models.TMSessionParameter{}, err + } + resp, err := s.client.Do(req) + if err != nil { + return models.TMSessionParameter{}, err + } + var result struct { + Params []models.TMSessionParameter `json:"tmsessionparameter"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.TMSessionParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Params) > 0 { + return result.Params[0], nil + } + return models.TMSessionParameter{}, nil +} // tmsessionpolicy -func (s *TMService) AddTMSessionPolicy() {} -func (s *TMService) DeleteTMSessionPolicy() {} -func (s *TMService) UpdateTMSessionPolicy() {} -func (s *TMService) UnsetTMSessionPolicy() {} -func (s *TMService) GetAllTMSessionPolicy() {} -func (s *TMService) GetTMSessionPolicy() {} -func (s *TMService) CountTMSessionPolicy() {} +func (s *TMService) AddTMSessionPolicy(policy models.TMSessionPolicy) error { + payload := map[string]any{"tmsessionpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSessionPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMSessionPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMSessionPolicy(policy models.TMSessionPolicy) error { + payload := map[string]any{"tmsessionpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmSessionPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMSessionPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmsessionpolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmSessionPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMSessionPolicy() ([]models.TMSessionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TMSessionPolicy `json:"tmsessionpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TMService) GetTMSessionPolicy(name string) ([]models.TMSessionPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TMSessionPolicy `json:"tmsessionpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TMService) CountTMSessionPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"tmsessionpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // tmsessionpolicy_aaagroup_binding -func (s *TMService) GetAllTMSessionPolicyAAAGroupBinding() {} -func (s *TMService) GetTMSessionPolicyAAAGroupBinding() {} -func (s *TMService) CountTMSessionPolicyAAAGroupBinding() {} +func (s *TMService) GetAllTMSessionPolicyAAAGroupBinding() ([]models.TMSessionPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAAAGroupBinding `json:"tmsessionpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMSessionPolicyAAAGroupBinding(name string) ([]models.TMSessionPolicyAAAGroupBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAAAGroupBinding `json:"tmsessionpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMSessionPolicyAAAGroupBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmSessionPolicyAAAGroupBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmsessionpolicy_aaagroup_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmsessionpolicy_aaauser_binding -func (s *TMService) GetAllTMSessionPolicyAAAUserBinding() {} -func (s *TMService) GetTMSessionPolicyAAAUserBinding() {} -func (s *TMService) CountTMSessionPolicyAAAUserBinding() {} +func (s *TMService) GetAllTMSessionPolicyAAAUserBinding() ([]models.TMSessionPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAAAUserBinding `json:"tmsessionpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} -// tmsesisonpolicy_authenticationvserver_binding -func (s *TMService) GetAllTMSessionPolicyAuthenticationVServerBinding() {} -func (s *TMService) GetTMSessionPolicyAuthenticationVServerBinding() {} -func (s *TMService) CountTMSessionPolicyAuthenticationVServerBinding() {} +func (s *TMService) GetTMSessionPolicyAAAUserBinding(name string) ([]models.TMSessionPolicyAAAUserBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAAAUserBinding `json:"tmsessionpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMSessionPolicyAAAUserBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmSessionPolicyAAAUserBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmsessionpolicy_aaauser_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// tmsessionpolicy_authenticationvserver_binding +func (s *TMService) GetAllTMSessionPolicyAuthenticationVServerBinding() ([]models.TMSessionPolicyAuthenticationVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyAuthenticationVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAuthenticationVServerBinding `json:"tmsessionpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMSessionPolicyAuthenticationVServerBinding(name string) ([]models.TMSessionPolicyAuthenticationVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyAuthenticationVServerBinding `json:"tmsessionpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMSessionPolicyAuthenticationVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmSessionPolicyAuthenticationVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmsessionpolicy_authenticationvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmsessionpolicy_binding -func (s *TMService) GetAllTMSessionPolicyBinding() {} -func (s *TMService) GetTMSessionPolicyBinding() {} +func (s *TMService) GetAllTMSessionPolicyBinding() ([]models.TMSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyBinding `json:"tmsessionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMSessionPolicyBinding(name string) ([]models.TMSessionPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyBinding `json:"tmsessionpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // tmsessionpolicy_tmglobal_binding -func (s *TMService) GetAllTMSessionPolicyTMGlobalBinding() {} -func (s *TMService) GetTMSessionPolicyTMGlobalBinding() {} -func (s *TMService) CountTMSessionPolicyTMGlobalBinding() {} +func (s *TMService) GetAllTMSessionPolicyTMGlobalBinding() ([]models.TMSessionPolicyTMGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmSessionPolicyTMGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyTMGlobalBinding `json:"tmsessionpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMSessionPolicyTMGlobalBinding(name string) ([]models.TMSessionPolicyTMGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmSessionPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMSessionPolicyTMGlobalBinding `json:"tmsessionpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMSessionPolicyTMGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmSessionPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmsessionpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmtrafficaction -func (s *TMService) AddTMTrafficAction() {} -func (s *TMService) DeleteTMTrafficAction() {} -func (s *TMService) UpdateTMTrafficAction() {} -func (s *TMService) UnsetTMTrafficAction() {} -func (s *TMService) GetAllTMTrafficAction() {} -func (s *TMService) GetTMTrafficAction() {} -func (s *TMService) CountTMTrafficAction() {} +func (s *TMService) AddTMTrafficAction(action models.TMTrafficAction) error { + payload := map[string]any{"tmtrafficaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmTrafficActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMTrafficAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmTrafficActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMTrafficAction(action models.TMTrafficAction) error { + payload := map[string]any{"tmtrafficaction": action} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmTrafficActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMTrafficAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmtrafficaction": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmTrafficActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMTrafficAction() ([]models.TMTrafficAction, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMTrafficAction `json:"tmtrafficaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) GetTMTrafficAction(name string) ([]models.TMTrafficAction, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TMTrafficAction `json:"tmtrafficaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TMService) CountTMTrafficAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"tmtrafficaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // tmtrafficpolicy -func (s *TMService) AddTMTrafficPolicy() {} -func (s *TMService) DeleteTMTrafficPolicy() {} -func (s *TMService) UpdateTMTrafficPolicy() {} -func (s *TMService) UnsetTMTrafficPolicy() {} -func (s *TMService) GetAllTMTrafficPolicy() {} -func (s *TMService) GetTMTrafficPolicy() {} -func (s *TMService) CountTMTrafficPolicy() {} +func (s *TMService) AddTMTrafficPolicy(policy models.TMTrafficPolicy) error { + payload := map[string]any{"tmtrafficpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmTrafficPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) DeleteTMTrafficPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UpdateTMTrafficPolicy(policy models.TMTrafficPolicy) error { + payload := map[string]any{"tmtrafficpolicy": policy} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, tmTrafficPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) UnsetTMTrafficPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{"tmtrafficpolicy": unsetMap} + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, tmTrafficPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TMService) GetAllTMTrafficPolicy() ([]models.TMTrafficPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TMTrafficPolicy `json:"tmtrafficpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TMService) GetTMTrafficPolicy(name string) ([]models.TMTrafficPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TMTrafficPolicy `json:"tmtrafficpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TMService) CountTMTrafficPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"tmtrafficpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // tmtrafficpolicy_binding -func (s *TMService) GetAllTMTrafficPolicyBinding() {} -func (s *TMService) GetTMTrafficPolicyBinding() {} +func (s *TMService) GetAllTMTrafficPolicyBinding() ([]models.TMTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyBinding `json:"tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMTrafficPolicyBinding(name string) ([]models.TMTrafficPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyBinding `json:"tmtrafficpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // tmtrafficpolicy_csvserver_binding -func (s *TMService) GetAllTMTrafficPolicyCSVServerBinding() {} -func (s *TMService) GetTMTrafficPolicyCSVServerBinding() {} -func (s *TMService) CountTMTrafficPolicyCSVServerBinding() {} +func (s *TMService) GetAllTMTrafficPolicyCSVServerBinding() ([]models.TMTrafficPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyCSVServerBinding `json:"tmtrafficpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMTrafficPolicyCSVServerBinding(name string) ([]models.TMTrafficPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyCSVServerBinding `json:"tmtrafficpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMTrafficPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmTrafficPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmtrafficpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmtrafficpolicy_lbvserver_binding -func (s *TMService) GetAllTMTrafficPolicyLBVServerBinding() {} -func (s *TMService) GetTMTrafficPolicyLBVServerBinding() {} -func (s *TMService) CountTMTrafficPolicyLBVServerBinding() {} +func (s *TMService) GetAllTMTrafficPolicyLBVServerBinding() ([]models.TMTrafficPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyLBVServerBinding `json:"tmtrafficpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMTrafficPolicyLBVServerBinding(name string) ([]models.TMTrafficPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyLBVServerBinding `json:"tmtrafficpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMTrafficPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmTrafficPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmtrafficpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // tmtrafficpolicy_tmglobal_binding -func (s *TMService) GetAllTMTrafficPolicyTMGlobalBinding() {} -func (s *TMService) GetTMTrafficPolicyTMGlobalBinding() {} -func (s *TMService) CountTMTrafficPolicyTMGlobalBinding() {} +func (s *TMService) GetAllTMTrafficPolicyTMGlobalBinding() ([]models.TMTrafficPolicyTMGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tmTrafficPolicyTMGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyTMGlobalBinding `json:"tmtrafficpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) GetTMTrafficPolicyTMGlobalBinding(name string) ([]models.TMTrafficPolicyTMGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", tmTrafficPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TMTrafficPolicyTMGlobalBinding `json:"tmtrafficpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TMService) CountTMTrafficPolicyTMGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", tmTrafficPolicyTMGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tmtrafficpolicy_tmglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/transform.go b/nitrogo/transform.go index 9590432..caad108 100644 --- a/nitrogo/transform.go +++ b/nitrogo/transform.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( transformActionURL = "/nitro/v1/config/transformaction" transformGlobalBindingURL = "/nitro/v1/config/transformglobal_binding" @@ -27,95 +37,1214 @@ type TransformService struct { } // transformaction -func (s *TransformService) AddTransformAction() {} -func (s *TransformService) DeleteTransformAction() {} -func (s *TransformService) UpdateTransformAction() {} -func (s *TransformService) UnsetTransformAction() {} -func (s *TransformService) GetAllTransformAction() {} -func (s *TransformService) GetTransformAction() {} -func (s *TransformService) CountTransformAction() {} + +func (s *TransformService) AddTransformAction(action models.TransformAction) error { + payload := map[string]any{ + "transformaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", transformActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UpdateTransformAction(action models.TransformAction) error { + payload := map[string]any{ + "transformaction": action, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, transformActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UnsetTransformAction(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "transformaction": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetAllTransformAction() ([]models.TransformAction, error) { + req, err := s.client.NewRequest(http.MethodGet, transformActionURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TransformAction `json:"transformaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TransformService) GetTransformAction(name string) ([]models.TransformAction, error) { + reqURL := fmt.Sprintf("%s/%s", transformActionURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Actions []models.TransformAction `json:"transformaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Actions, nil +} + +func (s *TransformService) CountTransformAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, transformActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"transformaction"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + return 0, nil +} // transformglobal_binding -func (s *TransformService) GetTransformGlobalBinding() {} + +func (s *TransformService) GetTransformGlobalBinding() ([]models.TransformGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformGlobalBinding `json:"transformglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // transformglobal_transformpolicy_binding -func (s *TransformService) AddTransformGlobalTransformPolicyBinding() {} -func (s *TransformService) DeleteTransformGlobalTransformPolicyBinding() {} -func (s *TransformService) GetTransformGlobalTransformPolicyBinding() {} -func (s *TransformService) CountTransformGlobalTransformPolicyBinding() {} + +func (s *TransformService) AddTransformGlobalTransformPolicyBinding(binding models.TransformGlobalTransformPolicyBinding) error { + payload := map[string]any{ + "transformglobal_transformpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, transformGlobalTransformPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformGlobalTransformPolicyBinding(policyname string, typeField string, priority int) error { + reqURL := fmt.Sprintf("%s?args=policyname:%s,type:%s,priority:%d", transformGlobalTransformPolicyBindingURL, url.QueryEscape(policyname), url.QueryEscape(typeField), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetTransformGlobalTransformPolicyBinding() ([]models.TransformGlobalTransformPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformGlobalTransformPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformGlobalTransformPolicyBinding `json:"transformglobal_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformGlobalTransformPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, transformGlobalTransformPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformglobal_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformpolicy -func (s *TransformService) AddTransformPolicy() {} -func (s *TransformService) DeleteTransformPolicy() {} -func (s *TransformService) UpdateTransformPolicy() {} -func (s *TransformService) UnsetTransformPolicy() {} -func (s *TransformService) RenameTransformPolicy() {} -func (s *TransformService) GetAllTransformPolicy() {} -func (s *TransformService) GetTransformPolicy() {} -func (s *TransformService) CountTransformPolicy() {} + +func (s *TransformService) AddTransformPolicy(policy models.TransformPolicy) error { + payload := map[string]any{ + "transformpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", transformPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UpdateTransformPolicy(policy models.TransformPolicy) error { + payload := map[string]any{ + "transformpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, transformPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UnsetTransformPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "transformpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) RenameTransformPolicy(name, newname string) error { + payload := map[string]any{ + "transformpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetAllTransformPolicy() ([]models.TransformPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TransformPolicy `json:"transformpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TransformService) GetTransformPolicy(name string) ([]models.TransformPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Policies []models.TransformPolicy `json:"transformpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Policies, nil +} + +func (s *TransformService) CountTransformPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"transformpolicy"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + return 0, nil +} // transformpolicylabel -func (s *TransformService) AddTransformPolicyLabel() {} -func (s *TransformService) DeleteTransformPolicyLabel() {} -func (s *TransformService) RenameTransformPolicyLabel() {} -func (s *TransformService) GetAllTransformPolicyLabel() {} -func (s *TransformService) GetTransformPolicyLabel() {} -func (s *TransformService) CountTransformPolicyLabel() {} + +func (s *TransformService) AddTransformPolicyLabel(label models.TransformPolicyLabel) error { + payload := map[string]any{ + "transformpolicylabel": label, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformPolicyLabel(labelname string) error { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) RenameTransformPolicyLabel(labelname, newname string) error { + payload := map[string]any{ + "transformpolicylabel": map[string]string{ + "labelname": labelname, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetAllTransformPolicyLabel() ([]models.TransformPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLabelURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.TransformPolicyLabel `json:"transformpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *TransformService) GetTransformPolicyLabel(labelname string) ([]models.TransformPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLabelURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Labels []models.TransformPolicyLabel `json:"transformpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Labels, nil +} + +func (s *TransformService) CountTransformPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"transformpolicylabel"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + return 0, nil +} // transformpolicylabel_binding -func (s *TransformService) GetAllTransformPolicyLabelBinding() {} -func (s *TransformService) GetTransformPolicyLabelBinding() {} + +func (s *TransformService) GetAllTransformPolicyLabelBinding() ([]models.TransformPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelBinding `json:"transformpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyLabelBinding(labelname string) ([]models.TransformPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLabelBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelBinding `json:"transformpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // transformpolicylabel_policybinding_binding -func (s *TransformService) GetAllTransformPolicyLabelPolicyBindingBinding() {} -func (s *TransformService) GetTransformPolicyLabelPolicyBindingBinding() {} -func (s *TransformService) CountTransformPolicyLabelPolicyBindingBinding() {} -// transformpolicytlabel_transformpolicy_binding -func (s *TransformService) AddTransformPolicyLabelTransformPolicyBinding() {} -func (s *TransformService) DeleteTransformPolicyLabelTransformPolicyBinding() {} -func (s *TransformService) GetAllTransformPolicyLabelTransformPolicyBinding() {} -func (s *TransformService) GetTransformPolicyLabelTransformPolicyBinding() {} -func (s *TransformService) CountTransformPolicyLabelTransformPolicyBinding() {} +func (s *TransformService) GetAllTransformPolicyLabelPolicyBindingBinding() ([]models.TransformPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelPolicyBindingBinding `json:"transformpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyLabelPolicyBindingBinding(labelname string) ([]models.TransformPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelPolicyBindingBinding `json:"transformpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyLabelPolicyBindingBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyLabelPolicyBindingBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicylabel_policybinding_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} + +// transformpolicylabel_transformpolicy_binding + +func (s *TransformService) AddTransformPolicyLabelTransformPolicyBinding(binding models.TransformPolicyLabelTransformPolicyBinding) error { + payload := map[string]any{ + "transformpolicylabel_transformpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, transformPolicyLabelTransformPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformPolicyLabelTransformPolicyBinding(labelname, policyname string, priority int) error { + reqURL := fmt.Sprintf("%s/%s?args=policyname:%s,priority:%d", transformPolicyLabelTransformPolicyBindingURL, url.QueryEscape(labelname), url.QueryEscape(policyname), priority) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetAllTransformPolicyLabelTransformPolicyBinding() ([]models.TransformPolicyLabelTransformPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLabelTransformPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelTransformPolicyBinding `json:"transformpolicylabel_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyLabelTransformPolicyBinding(labelname string) ([]models.TransformPolicyLabelTransformPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLabelTransformPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLabelTransformPolicyBinding `json:"transformpolicylabel_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyLabelTransformPolicyBinding(labelname string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyLabelTransformPolicyBindingURL, url.QueryEscape(labelname)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicylabel_transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformpolicy_binding -func (s *TransformService) GetAllTransformPolicyBinding() {} -func (s *TransformService) GetTransformPolicyBinding() {} + +func (s *TransformService) GetAllTransformPolicyBinding() ([]models.TransformPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyBinding `json:"transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyBinding(name string) ([]models.TransformPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyBinding `json:"transformpolicy_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // transformpolicy_csvserver_binding -func (s *TransformService) GetAllTransformPolicyCSVServerBinding() {} -func (s *TransformService) GetTransformPolicyCSVServerBinding() {} -func (s *TransformService) CountTransformPolicyCSVServerBinding() {} + +func (s *TransformService) GetAllTransformPolicyCSVServerBinding() ([]models.TransformPolicyCSVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyCSVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyCSVServerBinding `json:"transformpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyCSVServerBinding(name string) ([]models.TransformPolicyCSVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyCSVServerBinding `json:"transformpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyCSVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyCSVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicy_csvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformpolicy_lbvserver_binding -func (s *TransformService) GetAllTransformPolicyLBVServerBinding() {} -func (s *TransformService) GetTransformPolicyLBVServerBinding() {} -func (s *TransformService) CountTransformPolicyLBVServerBinding() {} + +func (s *TransformService) GetAllTransformPolicyLBVServerBinding() ([]models.TransformPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLBVServerBinding `json:"transformpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyLBVServerBinding(name string) ([]models.TransformPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyLBVServerBinding `json:"transformpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyLBVServerBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicy_lbvserver_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformpolicy_transformglobal_binding -func (s *TransformService) GetAllTransformPolicyTransformGlobalBinding() {} -func (s *TransformService) GetTransformPolicyTransformGlobalBinding() {} -func (s *TransformService) CountTransformPolicyTransformGlobalBinding() {} + +func (s *TransformService) GetAllTransformPolicyTransformGlobalBinding() ([]models.TransformPolicyTransformGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyTransformGlobalBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyTransformGlobalBinding `json:"transformpolicy_transformglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyTransformGlobalBinding(name string) ([]models.TransformPolicyTransformGlobalBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyTransformGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyTransformGlobalBinding `json:"transformpolicy_transformglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyTransformGlobalBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyTransformGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicy_transformglobal_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformpolicy_transformpolicylabel_binding -func (s *TransformService) GetAllTransformPolicyTransformPolicyLabelBinding() {} -func (s *TransformService) GetTransformPolicyTransformPolicyLabelBinding() {} -func (s *TransformService) CountTransformPolicyTransformPolicyLabelBinding() {} + +func (s *TransformService) GetAllTransformPolicyTransformPolicyLabelBinding() ([]models.TransformPolicyTransformPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformPolicyTransformPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyTransformPolicyLabelBinding `json:"transformpolicy_transformpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformPolicyTransformPolicyLabelBinding(name string) ([]models.TransformPolicyTransformPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformPolicyTransformPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformPolicyTransformPolicyLabelBinding `json:"transformpolicy_transformpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformPolicyTransformPolicyLabelBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformPolicyTransformPolicyLabelBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformpolicy_transformpolicylabel_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} // transformprofile -func (s *TransformService) AddTransformProfile() {} -func (s *TransformService) DeleteTransformProfile() {} -func (s *TransformService) UpdateTransformProfile() {} -func (s *TransformService) UnsetTransformProfile() {} -func (s *TransformService) GetAllTransformProfile() {} -func (s *TransformService) GetTransformProfile() {} -func (s *TransformService) CountTransformProfile() {} + +func (s *TransformService) AddTransformProfile(profile models.TransformProfile) error { + payload := map[string]any{ + "transformprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) DeleteTransformProfile(name string) error { + reqURL := fmt.Sprintf("%s/%s", transformProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UpdateTransformProfile(profile models.TransformProfile) error { + payload := map[string]any{ + "transformprofile": profile, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPut, transformProfileURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) UnsetTransformProfile(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + payload := map[string]any{ + "transformprofile": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + req, err := s.client.NewRequest(http.MethodPost, transformProfileURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + _, err = s.client.Do(req) + return err +} + +func (s *TransformService) GetAllTransformProfile() ([]models.TransformProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, transformProfileURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.TransformProfile `json:"transformprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *TransformService) GetTransformProfile(name string) ([]models.TransformProfile, error) { + reqURL := fmt.Sprintf("%s/%s", transformProfileURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Profiles []models.TransformProfile `json:"transformprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Profiles, nil +} + +func (s *TransformService) CountTransformProfile() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, transformProfileURL+"?count=yes", nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Profiles []struct { + Count float64 `json:"__count"` + } `json:"transformprofile"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Profiles) > 0 { + return result.Profiles[0].Count, nil + } + return 0, nil +} // transformprofile_binding -func (s *TransformService) GetAllTransformProfileBinding() {} -func (s *TransformService) GetTransformProfileBinding() {} + +func (s *TransformService) GetAllTransformProfileBinding() ([]models.TransformProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformProfileBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformProfileBinding `json:"transformprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformProfileBinding(name string) ([]models.TransformProfileBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformProfileBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformProfileBinding `json:"transformprofile_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} // transformprofile_transformaction_binding -func (s *TransformService) GetAllTransformProfileTransformActionBinding() {} -func (s *TransformService) GetTransformProfileTransformActionBinding() {} -func (s *TransformService) CountTransformProfileTransformActionBinding() {} + +func (s *TransformService) GetAllTransformProfileTransformActionBinding() ([]models.TransformProfileTransformActionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, transformProfileTransformActionBindingURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformProfileTransformActionBinding `json:"transformprofile_transformaction_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) GetTransformProfileTransformActionBinding(name string) ([]models.TransformProfileTransformActionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", transformProfileTransformActionBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + var result struct { + Bindings []models.TransformProfileTransformActionBinding `json:"transformprofile_transformaction_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + return result.Bindings, nil +} + +func (s *TransformService) CountTransformProfileTransformActionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", transformProfileTransformActionBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"transformprofile_transformaction_binding"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + return 0, nil +} diff --git a/nitrogo/tunnel.go b/nitrogo/tunnel.go index d14e0e6..c7e4b35 100644 --- a/nitrogo/tunnel.go +++ b/nitrogo/tunnel.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( tunnelGlobalBindingURL = "/nitro/v1/config/tunnelglobal_binding" tunnelGlobalTunnelTrafficPolicyBindingURL = "/nitro/v1/config/tunnelglobal_tunneltrafficpolicy_binding" @@ -17,37 +27,414 @@ type TunnelService struct { // tunnelglobal_binding // Binding object which returns the resources bound to tunnelglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunnelglobal_binding -func (s *TunnelService) GetTunnelGlobalBinding() {} + +func (s *TunnelService) GetTunnelGlobalBinding() ([]models.TunnelGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelGlobalBinding `json:"tunnelglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // tunnelglobal_tunneltrafficpolicy_binding // Binding object showing the tunneltrafficpolicy that can be bound to tunnelglobal. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunnelglobal_tunneltrafficpolicy_binding -func (s *TunnelService) AddTunnelGlobalTunnelTrafficPolicyBinding() {} -func (s *TunnelService) DeleteTunnelGlobalTunnelTrafficPolicyBinding() {} -func (s *TunnelService) GetTunnelGlobalTunnelTrafficPolicyBinding() {} -func (s *TunnelService) CountTunnelGlobalTunnelTrafficPolicyBinding() {} + +func (s *TunnelService) AddTunnelGlobalTunnelTrafficPolicyBinding(binding models.TunnelGlobalTunnelTrafficPolicyBinding) error { + payload := map[string]any{ + "tunnelglobal_tunneltrafficpolicy_binding": binding, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, tunnelGlobalTunnelTrafficPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) DeleteTunnelGlobalTunnelTrafficPolicyBinding(policyname string) error { + urlReq := fmt.Sprintf("%s?args=policyname:%s", tunnelGlobalTunnelTrafficPolicyBindingURL, url.QueryEscape(policyname)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) GetTunnelGlobalTunnelTrafficPolicyBinding() ([]models.TunnelGlobalTunnelTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelGlobalTunnelTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelGlobalTunnelTrafficPolicyBinding `json:"tunnelglobal_tunneltrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *TunnelService) CountTunnelGlobalTunnelTrafficPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelGlobalTunnelTrafficPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tunnelglobal_tunneltrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // tunneltrafficpolicy // Configuration for tunnel policy resource // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunneltrafficpolicy -func (s *TunnelService) AddTunnelTrafficPolicy() {} -func (s *TunnelService) DeleteTunnelTrafficPolicy() {} -func (s *TunnelService) UpdateTunnelTrafficPolicy() {} -func (s *TunnelService) UnsetTunnelTrafficPolicy() {} -func (s *TunnelService) GetAllTunnelTrafficPolicy() {} -func (s *TunnelService) GetTunnelTrafficPolicy() {} -func (s *TunnelService) CountTunnelTrafficPolicy() {} -func (s *TunnelService) RenameTunnelTrafficPolicy() {} + +func (s *TunnelService) AddTunnelTrafficPolicy(policy models.TunnelTrafficPolicy) error { + payload := map[string]any{ + "tunneltrafficpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, tunnelTrafficPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) DeleteTunnelTrafficPolicy(name string) error { + urlReq := fmt.Sprintf("%s/%s", tunnelTrafficPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, urlReq, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) UpdateTunnelTrafficPolicy(policy models.TunnelTrafficPolicy) error { + payload := map[string]any{ + "tunneltrafficpolicy": policy, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, tunnelTrafficPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) UnsetTunnelTrafficPolicy(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "tunneltrafficpolicy": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, tunnelTrafficPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *TunnelService) GetAllTunnelTrafficPolicy() ([]models.TunnelTrafficPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelTrafficPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.TunnelTrafficPolicy `json:"tunneltrafficpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *TunnelService) GetTunnelTrafficPolicy(name string) ([]models.TunnelTrafficPolicy, error) { + urlReq := fmt.Sprintf("%s/%s", tunnelTrafficPolicyURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.TunnelTrafficPolicy `json:"tunneltrafficpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *TunnelService) CountTunnelTrafficPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelTrafficPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"tunneltrafficpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} + +func (s *TunnelService) RenameTunnelTrafficPolicy(name string, newname string) error { + payload := map[string]any{ + "tunneltrafficpolicy": map[string]string{ + "name": name, + "newname": newname, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, tunnelTrafficPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // tunneltrafficpolicy_binding // Binding object which returns the resources bound to tunneltrafficpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunneltrafficpolicy_binding -func (s *TunnelService) GetAllTunnelTrafficPolicyBinding() {} -func (s *TunnelService) GetTunnelTrafficPolicyBinding() {} + +func (s *TunnelService) GetAllTunnelTrafficPolicyBinding() ([]models.TunnelTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelTrafficPolicyBinding `json:"tunneltrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *TunnelService) GetTunnelTrafficPolicyBinding(name string) ([]models.TunnelTrafficPolicyBinding, error) { + urlReq := fmt.Sprintf("%s/%s", tunnelTrafficPolicyBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelTrafficPolicyBinding `json:"tunneltrafficpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} // tunneltrafficpolicy_tunnelglobal_binding // Binding object showing the tunnelglobal that can be bound to tunneltrafficpolicy. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/tunnel/tunneltrafficpolicy_tunnelglobal_binding -func (s *TunnelService) GetAllTunnelTrafficPolicyTunnelGlobalBinding() {} -func (s *TunnelService) GetTunnelTrafficPolicyTunnelGlobalBinding() {} -func (s *TunnelService) CountTunnelTrafficPolicyTunnelGlobalBinding() {} + +func (s *TunnelService) GetAllTunnelTrafficPolicyTunnelGlobalBinding() ([]models.TunnelTrafficPolicyTunnelGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, tunnelTrafficPolicyTunnelGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelTrafficPolicyTunnelGlobalBinding `json:"tunneltrafficpolicy_tunnelglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *TunnelService) GetTunnelTrafficPolicyTunnelGlobalBinding(name string) ([]models.TunnelTrafficPolicyTunnelGlobalBinding, error) { + urlReq := fmt.Sprintf("%s/%s", tunnelTrafficPolicyTunnelGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.TunnelTrafficPolicyTunnelGlobalBinding `json:"tunneltrafficpolicy_tunnelglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *TunnelService) CountTunnelTrafficPolicyTunnelGlobalBinding(name string) (float64, error) { + urlReq := fmt.Sprintf("%s/%s?count=yes", tunnelTrafficPolicyTunnelGlobalBindingURL, url.QueryEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, urlReq, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"tunneltrafficpolicy_tunnelglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/ulfd.go b/nitrogo/ulfd.go index 331c9e0..892a2bf 100644 --- a/nitrogo/ulfd.go +++ b/nitrogo/ulfd.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( ulfdServerURL = "/nitro/v1/config/ulfdserver" ) @@ -13,8 +22,108 @@ type ULFDService struct { // ulfdserver // Configuration for ulfd server resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/ulfd/ulfdserver -func (s *ULFDService) AddULFDServer() {} -func (s *ULFDService) DeleteULFDServer() {} -func (s *ULFDService) GetAllULFDServer() {} -func (s *ULFDService) GetULFDServer() {} -func (s *ULFDService) CountULFDServer() {} + +func (s *ULFDService) AddULFDServer(server models.ULFDServer) error { + payload := map[string]any{ + "ulfdserver": server, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ulfdServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ULFDService) DeleteULFDServer(loggerip string) error { + url := fmt.Sprintf("%s/%s", ulfdServerURL, loggerip) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *ULFDService) GetAllULFDServer() ([]models.ULFDServer, error) { + req, err := s.client.NewRequest(http.MethodGet, ulfdServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ULFDServers []models.ULFDServer `json:"ulfdserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ULFDServers, nil +} + +func (s *ULFDService) GetULFDServer(loggerip string) ([]models.ULFDServer, error) { + url := fmt.Sprintf("%s/%s", ulfdServerURL, loggerip) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + ULFDServers []models.ULFDServer `json:"ulfdserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.ULFDServers, nil +} + +func (s *ULFDService) CountULFDServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, ulfdServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + ULFDServers []struct { + Count float64 `json:"__count"` + } `json:"ulfdserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.ULFDServers) > 0 { + return result.ULFDServers[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/url_filtering.go b/nitrogo/url_filtering.go index c89e0c4..9cf9eaf 100644 --- a/nitrogo/url_filtering.go +++ b/nitrogo/url_filtering.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( urlFilteringCategoriesURL = "/nitro/v1/config/urlfilteringcategories" urlFilteringCategorizationURL = "/nitro/v1/config/urlfilteringcategorization" @@ -16,24 +25,217 @@ type URLFilteringService struct { // urlfilteringcategories // Configuration for Categories resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/urlfiltering/urlfilteringcategories -func (s *URLFilteringService) GetAllURLFilteringCategories() {} + +func (s *URLFilteringService) GetAllURLFilteringCategories() ([]models.URLFilteringCategories, error) { + req, err := s.client.NewRequest(http.MethodGet, urlFilteringCategoriesURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Categories []models.URLFilteringCategories `json:"urlfilteringcategories"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Categories, nil +} // urlfilteringcategorization // Configuration for Categorization resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/urlfiltering/urlfilteringcategorization -func (s *URLFilteringService) AddURLFilteringCategorization() {} -func (s *URLFilteringService) ClearURLFilteringCategorization() {} -func (s *URLFilteringService) GetAllURLFilteringCategorization() {} -func (s *URLFilteringService) CountURLFilteringCategorization() {} + +func (s *URLFilteringService) AddURLFilteringCategorization(categorization models.URLFilteringCategorization) error { + payload := map[string]any{ + "urlfilteringcategorization": categorization, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, urlFilteringCategorizationURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *URLFilteringService) ClearURLFilteringCategorization(categorization models.URLFilteringCategorization) error { + payload := map[string]any{ + "urlfilteringcategorization": categorization, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, urlFilteringCategorizationURL+"?action=clear", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *URLFilteringService) GetAllURLFilteringCategorization() ([]models.URLFilteringCategorization, error) { + req, err := s.client.NewRequest(http.MethodGet, urlFilteringCategorizationURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Categorization []models.URLFilteringCategorization `json:"urlfilteringcategorization"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Categorization, nil +} + +func (s *URLFilteringService) CountURLFilteringCategorization() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, urlFilteringCategorizationURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Categorization []struct { + Count float64 `json:"__count"` + } `json:"urlfilteringcategorization"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Categorization) > 0 { + return result.Categorization[0].Count, nil + } + + return 0, nil +} // urlfilteringcategorygroups // Configuration for Category Groups resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/urlfiltering/urlfilteringcategorygroups -func (s *URLFilteringService) GetAllURLFilteringCategoryGroups() {} + +func (s *URLFilteringService) GetAllURLFilteringCategoryGroups() ([]models.URLFilteringCategoryGroups, error) { + req, err := s.client.NewRequest(http.MethodGet, urlFilteringCategoryGroupsURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + CategoryGroups []models.URLFilteringCategoryGroups `json:"urlfilteringcategorygroups"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.CategoryGroups, nil +} // urlfilteringparameter // Configuration for URLFILTERING paramter resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/urlfiltering/urlfilteringparameter -func (s *URLFilteringService) UpdateURLFilteringParameter() {} -func (s *URLFilteringService) UnsetURLFilteringParameter() {} -func (s *URLFilteringService) GetAllURLFilteringParameter() {} + +func (s *URLFilteringService) UpdateURLFilteringParameter(param models.URLFilteringParameter) error { + payload := map[string]any{ + "urlfilteringparameter": param, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, urlFilteringParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *URLFilteringService) UnsetURLFilteringParameter(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "urlfilteringparameter": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, urlFilteringParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *URLFilteringService) GetAllURLFilteringParameter() (models.URLFilteringParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, urlFilteringParameterURL, nil) + if err != nil { + return models.URLFilteringParameter{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.URLFilteringParameter{}, err + } + + var result struct { + URLFilteringParameters []models.URLFilteringParameter `json:"urlfilteringparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.URLFilteringParameter{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.URLFilteringParameters) > 0 { + return result.URLFilteringParameters[0], nil + } + + return models.URLFilteringParameter{}, nil +} diff --git a/nitrogo/user.go b/nitrogo/user.go index 9eba3ed..b4d6c23 100644 --- a/nitrogo/user.go +++ b/nitrogo/user.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( userProtocolURL = "/nitro/v1/config/userprotocol" userVServerURL = "/nitro/v1/config/uservserver" @@ -14,22 +23,319 @@ type UserService struct { // userprotocol // Configuration for user protocol resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/user/userprotocol -func (s *UserService) AddUserProtocol() {} -func (s *UserService) DeleteUserProtocol() {} -func (s *UserService) UpdateUserProtocol() {} -func (s *UserService) UnsetUserProtocol() {} -func (s *UserService) GetAllUserProtocol() {} -func (s *UserService) GetUserProtocol() {} -func (s *UserService) CountUserProtocol() {} + +func (s *UserService) AddUserProtocol(protocol models.UserProtocol) error { + payload := map[string]any{ + "userprotocol": protocol, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, userProtocolURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) DeleteUserProtocol(name string) error { + url := fmt.Sprintf("%s/%s", userProtocolURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) UpdateUserProtocol(protocol models.UserProtocol) error { + payload := map[string]any{ + "userprotocol": protocol, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, userProtocolURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) UnsetUserProtocol(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "userprotocol": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, userProtocolURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) GetAllUserProtocol() ([]models.UserProtocol, error) { + req, err := s.client.NewRequest(http.MethodGet, userProtocolURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + UserProtocols []models.UserProtocol `json:"userprotocol"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.UserProtocols, nil +} + +func (s *UserService) GetUserProtocol(name string) ([]models.UserProtocol, error) { + url := fmt.Sprintf("%s/%s", userProtocolURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + UserProtocols []models.UserProtocol `json:"userprotocol"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.UserProtocols, nil +} + +func (s *UserService) CountUserProtocol() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, userProtocolURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + UserProtocols []struct { + Count float64 `json:"__count"` + } `json:"userprotocol"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.UserProtocols) > 0 { + return result.UserProtocols[0].Count, nil + } + + return 0, nil +} // uservserver // Configuration for virtual server resource. // https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/user/uservserver -func (s *UserService) AddUserVServer() {} -func (s *UserService) DeleteUserVServer() {} -func (s *UserService) UpdateUserVServer() {} -func (s *UserService) UnsetUserVServer() {} -func (s *UserService) EnableUserVServer() {} -func (s *UserService) GetAllUserVServer() {} -func (s *UserService) GetUserVServer() {} -func (s *UserService) CountUserVServer() {} + +func (s *UserService) AddUserVServer(vserver models.UserVServer) error { + payload := map[string]any{ + "uservserver": vserver, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, userVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) DeleteUserVServer(name string) error { + url := fmt.Sprintf("%s/%s", userVServerURL, name) + req, err := s.client.NewRequest(http.MethodDelete, url, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) UpdateUserVServer(vserver models.UserVServer) error { + payload := map[string]any{ + "uservserver": vserver, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, userVServerURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) UnsetUserVServer(args []string) error { + unsetMap := make(map[string]any) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "uservserver": unsetMap, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, userVServerURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) EnableUserVServer(name string) error { + payload := map[string]any{ + "uservserver": map[string]any{ + "name": name, + }, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, userVServerURL+"?action=enable", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UserService) GetAllUserVServer() ([]models.UserVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, userVServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + UserVServers []models.UserVServer `json:"uservserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.UserVServers, nil +} + +func (s *UserService) GetUserVServer(name string) ([]models.UserVServer, error) { + url := fmt.Sprintf("%s/%s", userVServerURL, name) + req, err := s.client.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + UserVServers []models.UserVServer `json:"uservserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.UserVServers, nil +} + +func (s *UserService) CountUserVServer() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, userVServerURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + UserVServers []struct { + Count float64 `json:"__count"` + } `json:"uservserver"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.UserVServers) > 0 { + return result.UserVServers[0].Count, nil + } + + return 0, nil +} diff --git a/nitrogo/utility.go b/nitrogo/utility.go index 266e570..b58ef27 100644 --- a/nitrogo/utility.go +++ b/nitrogo/utility.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( callHomeURL = "/nitro/v1/config/callhome" installURL = "/nitro/v1/config/install" @@ -18,27 +27,286 @@ type UtilityService struct { } // callhome -func (s *UtilityService) UpdateCallHome() {} -func (s *UtilityService) UnsetCallHome() {} -func (s *UtilityService) GetAllCallHome() {} + +func (s *UtilityService) UpdateCallHome(callhome models.CallHome) error { + payload := map[string]any{ + "callhome": callhome, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, callHomeURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UtilityService) UnsetCallHome(args []string) error { + unsetMap := make(map[string]bool) + for _, arg := range args { + unsetMap[arg] = true + } + + payload := map[string]any{ + "callhome": unsetMap, + } + + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, callHomeURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *UtilityService) GetAllCallHome() (models.CallHome, error) { + req, err := s.client.NewRequest(http.MethodGet, callHomeURL, nil) + if err != nil { + return models.CallHome{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.CallHome{}, err + } + + var result struct { + CallHomes []models.CallHome `json:"callhome"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return models.CallHome{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.CallHomes) > 0 { + return result.CallHomes[0], nil + } + + return models.CallHome{}, nil +} // install -func (s *UtilityService) InstallInstall() {} + +func (s *UtilityService) InstallInstall(install models.Install) error { + payload := map[string]any{ + "install": install, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, installURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} // ping -func (s *UtilityService) PingPing() {} + +func (s *UtilityService) PingPing(ping models.Ping) (models.Ping, error) { + payload := map[string]any{ + "ping": ping, + } + body, err := json.Marshal(payload) + if err != nil { + return models.Ping{}, fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, pingURL, bytes.NewBuffer(body)) + if err != nil { + return models.Ping{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Ping{}, err + } + + var result struct { + Pings []models.Ping `json:"ping"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Ping{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Pings) > 0 { + return result.Pings[0], nil + } + + return models.Ping{}, nil +} // ping6 -func (s *UtilityService) Ping6Ping6() {} + +func (s *UtilityService) Ping6Ping6(ping6 models.Ping6) (models.Ping6, error) { + payload := map[string]any{ + "ping6": ping6, + } + body, err := json.Marshal(payload) + if err != nil { + return models.Ping6{}, fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, ping6URL, bytes.NewBuffer(body)) + if err != nil { + return models.Ping6{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Ping6{}, err + } + + var result struct { + Ping6s []models.Ping6 `json:"ping6"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Ping6{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Ping6s) > 0 { + return result.Ping6s[0], nil + } + + return models.Ping6{}, nil +} // raid -func (s *UtilityService) GetAllRAID() {} + +func (s *UtilityService) GetAllRAID() ([]models.Raid, error) { + req, err := s.client.NewRequest(http.MethodGet, raidURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Raids []models.Raid `json:"raid"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Raids, nil +} // techsupport -func (s *UtilityService) GetAllTechSupport() {} + +func (s *UtilityService) GetAllTechSupport() ([]models.TechSupport, error) { + req, err := s.client.NewRequest(http.MethodGet, techSupportURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + TechSupports []models.TechSupport `json:"techsupport"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.TechSupports, nil +} // traceroute -func (s *UtilityService) TraceRouteTraceRoute() {} + +func (s *UtilityService) TraceRouteTraceRoute(traceroute models.Traceroute) (models.Traceroute, error) { + payload := map[string]any{ + "traceroute": traceroute, + } + body, err := json.Marshal(payload) + if err != nil { + return models.Traceroute{}, fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, traceRouteURL, bytes.NewBuffer(body)) + if err != nil { + return models.Traceroute{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Traceroute{}, err + } + + var result struct { + Traceroutes []models.Traceroute `json:"traceroute"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Traceroute{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Traceroutes) > 0 { + return result.Traceroutes[0], nil + } + + return models.Traceroute{}, nil +} // traceroute6 -func (s *UtilityService) TraceRoute6TraceRoute6() {} + +func (s *UtilityService) TraceRoute6TraceRoute6(traceroute6 models.Traceroute6) (models.Traceroute6, error) { + payload := map[string]any{ + "traceroute6": traceroute6, + } + body, err := json.Marshal(payload) + if err != nil { + return models.Traceroute6{}, fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, traceRoute6URL, bytes.NewBuffer(body)) + if err != nil { + return models.Traceroute6{}, err + } + + resp, err := s.client.Do(req) + if err != nil { + return models.Traceroute6{}, err + } + + var result struct { + Traceroute6s []models.Traceroute6 `json:"traceroute6"` + } + err = json.Unmarshal(resp, &result) + if err != nil { + return models.Traceroute6{}, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Traceroute6s) > 0 { + return result.Traceroute6s[0], nil + } + + return models.Traceroute6{}, nil +} diff --git a/nitrogo/video_optimization.go b/nitrogo/video_optimization.go index 9f54484..03812da 100644 --- a/nitrogo/video_optimization.go +++ b/nitrogo/video_optimization.go @@ -1,5 +1,15 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( videoOptimizationDetectionActionURL = "/nitro/v1/config/videooptimizationdetectionaction" videoOptimizationDetectionPolicyURL = "/nitro/v1/config/videooptimizationdetectionpolicy" @@ -34,165 +44,2099 @@ type VideoOptimizationService struct { } // videooptimizationdetectionaction -func (s *VideoOptimizationService) AddVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) UpdateVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) UnsetVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) RenameVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionAction() {} -func (s *VideoOptimizationService) CountVideoOptimizationDetectionAction() {} +func (s *VideoOptimizationService) AddVideoOptimizationDetectionAction(resource models.VideoOptimizationDetectionAction) error { + payload := map[string]any{ + "videooptimizationdetectionaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionActionURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UpdateVideoOptimizationDetectionAction(resource models.VideoOptimizationDetectionAction) error { + payload := map[string]any{ + "videooptimizationdetectionaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, videoOptimizationDetectionActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UnsetVideoOptimizationDetectionAction(resource models.VideoOptimizationDetectionAction) error { + payload := map[string]any{ + "videooptimizationdetectionaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationDetectionAction(resource models.VideoOptimizationDetectionAction) error { + payload := map[string]any{ + "videooptimizationdetectionaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionAction() ([]models.VideoOptimizationDetectionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.VideoOptimizationDetectionAction `json:"videooptimizationdetectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionAction(name string) (*models.VideoOptimizationDetectionAction, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionActionURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.VideoOptimizationDetectionAction `json:"videooptimizationdetectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) == 0 { + return nil, fmt.Errorf("videooptimizationdetectionaction not found") + } + + return &result.Actions[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} // videooptimizationdetectionpolicy -func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) UpdateVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) UnsetVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) RenameVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicy() {} -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicy() {} +func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicy(resource models.VideoOptimizationDetectionPolicy) error { + payload := map[string]any{ + "videooptimizationdetectionpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UpdateVideoOptimizationDetectionPolicy(resource models.VideoOptimizationDetectionPolicy) error { + payload := map[string]any{ + "videooptimizationdetectionpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, videoOptimizationDetectionPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UnsetVideoOptimizationDetectionPolicy(resource models.VideoOptimizationDetectionPolicy) error { + payload := map[string]any{ + "videooptimizationdetectionpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationDetectionPolicy(resource models.VideoOptimizationDetectionPolicy) error { + payload := map[string]any{ + "videooptimizationdetectionpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicy() ([]models.VideoOptimizationDetectionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.VideoOptimizationDetectionPolicy `json:"videooptimizationdetectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicy(name string) (*models.VideoOptimizationDetectionPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.VideoOptimizationDetectionPolicy `json:"videooptimizationdetectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) == 0 { + return nil, fmt.Errorf("videooptimizationdetectionpolicy not found") + } + + return &result.Policies[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} // videooptimizationdetectionpolicylabel -func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicyLabel() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicyLabel() {} -func (s *VideoOptimizationService) RenameVideoOptimizationDetectionPolicyLabel() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabel() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabel() {} -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabel() {} +func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicyLabel(resource models.VideoOptimizationDetectionPolicyLabel) error { + payload := map[string]any{ + "videooptimizationdetectionpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicyLabel(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationDetectionPolicyLabel(resource models.VideoOptimizationDetectionPolicyLabel) error { + payload := map[string]any{ + "videooptimizationdetectionpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabel() ([]models.VideoOptimizationDetectionPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLabelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.VideoOptimizationDetectionPolicyLabel `json:"videooptimizationdetectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Labels, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabel(name string) (*models.VideoOptimizationDetectionPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.VideoOptimizationDetectionPolicyLabel `json:"videooptimizationdetectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) == 0 { + return nil, fmt.Errorf("videooptimizationdetectionpolicylabel not found") + } + + return &result.Labels[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + + return 0, nil +} // videooptimizationdetectionpolicylabel_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelBinding() ([]models.VideoOptimizationDetectionPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelBinding `json:"videooptimizationdetectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelBinding(name string) (*models.VideoOptimizationDetectionPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelBinding `json:"videooptimizationdetectionpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationdetectionpolicylabel_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationdetectionpolicylabel_policybinding_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelPolicyBindingBinding() { +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelPolicyBindingBinding() ([]models.VideoOptimizationDetectionPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelPolicyBindingBinding `json:"videooptimizationdetectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelPolicyBindingBinding(name string) ([]models.VideoOptimizationDetectionPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelPolicyBindingBinding `json:"videooptimizationdetectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabelPolicyBindingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationDetectionPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelPolicyBindingBinding() {} -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabelPolicyBindingBinding() {} // videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding -func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() { +func (s *VideoOptimizationService) AddVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding(resource models.VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding) error { + payload := map[string]any{ + "videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) DeleteVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() ([]models.VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding(name string) ([]models.VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationDetectionPolicyLabelVideoOptimizationDetectionPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicylabel_videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationdetectionpolicy_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyBinding() ([]models.VideoOptimizationDetectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyBinding `json:"videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyBinding(name string) (*models.VideoOptimizationDetectionPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyBinding `json:"videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationdetectionpolicy_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationdetectionpolicy_lbvserver_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLBVServerBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLBVServerBinding() {} -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLBVServerBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyLBVServerBinding() ([]models.VideoOptimizationDetectionPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLBVServerBinding `json:"videooptimizationdetectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyLBVServerBinding(name string) ([]models.VideoOptimizationDetectionPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyLBVServerBinding `json:"videooptimizationdetectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationDetectionPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding() { +func (s *VideoOptimizationService) GetAllVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding() ([]models.VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding(name string) ([]models.VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationDetectionPolicyVideoOptimizationGlobalDetectionBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationdetectionpolicy_videooptimizationglobaldetection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationglobaldetection_binding -func (s *VideoOptimizationService) GetVideoOptimizationGlobalDetectionBinding() {} +func (s *VideoOptimizationService) GetVideoOptimizationGlobalDetectionBinding() (*models.VideoOptimizationGlobalDetectionBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalDetectionBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationGlobalDetectionBinding `json:"videooptimizationglobaldetection_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationglobaldetection_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding -func (s *VideoOptimizationService) AddVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() { +func (s *VideoOptimizationService) AddVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding(resource models.VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding) error { + payload := map[string]any{ + "videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) DeleteVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) DeleteVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) GetVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() ([]models.VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalDetectionVideoOptimizationDetectionPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationglobaldetection_videooptimizationdetectionpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationglobalpacing_binding -func (s *VideoOptimizationService) GetVideoOptimizationGlobalPacingBinding() {} +func (s *VideoOptimizationService) GetVideoOptimizationGlobalPacingBinding() (*models.VideoOptimizationGlobalPacingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalPacingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationGlobalPacingBinding `json:"videooptimizationglobalpacing_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationglobalpacing_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationglobalpacing_videooptimizationpacingpolicy_binding -func (s *VideoOptimizationService) AddVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() { +func (s *VideoOptimizationService) AddVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding(resource models.VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding) error { + payload := map[string]any{ + "videooptimizationglobalpacing_videooptimizationpacingpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationGlobalPacingVideoOptimizationPacingPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) DeleteVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) DeleteVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationGlobalPacingVideoOptimizationPacingPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) GetVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() ([]models.VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalPacingVideoOptimizationPacingPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationGlobalPacingVideoOptimizationPacingPolicyBinding() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationGlobalPacingVideoOptimizationPacingPolicyBindingURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationglobalpacing_videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationpacingaction -func (s *VideoOptimizationService) AddVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) UpdateVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) UnsetVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) RenameVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingAction() {} -func (s *VideoOptimizationService) CountVideoOptimizationPacingAction() {} +func (s *VideoOptimizationService) AddVideoOptimizationPacingAction(resource models.VideoOptimizationPacingAction) error { + payload := map[string]any{ + "videooptimizationpacingaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationPacingAction(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingActionURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UpdateVideoOptimizationPacingAction(resource models.VideoOptimizationPacingAction) error { + payload := map[string]any{ + "videooptimizationpacingaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, videoOptimizationPacingActionURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UnsetVideoOptimizationPacingAction(resource models.VideoOptimizationPacingAction) error { + payload := map[string]any{ + "videooptimizationpacingaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingActionURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationPacingAction(resource models.VideoOptimizationPacingAction) error { + payload := map[string]any{ + "videooptimizationpacingaction": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingActionURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingAction() ([]models.VideoOptimizationPacingAction, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.VideoOptimizationPacingAction `json:"videooptimizationpacingaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Actions, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingAction(name string) (*models.VideoOptimizationPacingAction, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingActionURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Actions []models.VideoOptimizationPacingAction `json:"videooptimizationpacingaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) == 0 { + return nil, fmt.Errorf("videooptimizationpacingaction not found") + } + + return &result.Actions[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationPacingAction() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingActionURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Actions []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingaction"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Actions) > 0 { + return result.Actions[0].Count, nil + } + + return 0, nil +} // videooptimizationpacingpolicy -func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) UpdateVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) UnsetVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) RenameVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicy() {} -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicy() {} +func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicy(resource models.VideoOptimizationPacingPolicy) error { + payload := map[string]any{ + "videooptimizationpacingpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicy(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UpdateVideoOptimizationPacingPolicy(resource models.VideoOptimizationPacingPolicy) error { + payload := map[string]any{ + "videooptimizationpacingpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, videoOptimizationPacingPolicyURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UnsetVideoOptimizationPacingPolicy(resource models.VideoOptimizationPacingPolicy) error { + payload := map[string]any{ + "videooptimizationpacingpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationPacingPolicy(resource models.VideoOptimizationPacingPolicy) error { + payload := map[string]any{ + "videooptimizationpacingpolicy": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicy() ([]models.VideoOptimizationPacingPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.VideoOptimizationPacingPolicy `json:"videooptimizationpacingpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Policies, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicy(name string) (*models.VideoOptimizationPacingPolicy, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Policies []models.VideoOptimizationPacingPolicy `json:"videooptimizationpacingpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) == 0 { + return nil, fmt.Errorf("videooptimizationpacingpolicy not found") + } + + return &result.Policies[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicy() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Policies []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Policies) > 0 { + return result.Policies[0].Count, nil + } + + return 0, nil +} // videooptimizationpacingpolicylabel -func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicyLabel() {} -func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicyLabel() {} -func (s *VideoOptimizationService) RenameVideoOptimizationPacingPolicyLabel() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabel() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabel() {} -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabel() {} +func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicyLabel(resource models.VideoOptimizationPacingPolicyLabel) error { + payload := map[string]any{ + "videooptimizationpacingpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyLabelURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicyLabel(name string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) RenameVideoOptimizationPacingPolicyLabel(resource models.VideoOptimizationPacingPolicyLabel) error { + payload := map[string]any{ + "videooptimizationpacingpolicylabel": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyLabelURL+"?action=rename", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabel() ([]models.VideoOptimizationPacingPolicyLabel, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLabelURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.VideoOptimizationPacingPolicyLabel `json:"videooptimizationpacingpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Labels, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabel(name string) (*models.VideoOptimizationPacingPolicyLabel, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Labels []models.VideoOptimizationPacingPolicyLabel `json:"videooptimizationpacingpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) == 0 { + return nil, fmt.Errorf("videooptimizationpacingpolicylabel not found") + } + + return &result.Labels[0], nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabel() (float64, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLabelURL+"?count=yes", nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Labels []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicylabel"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Labels) > 0 { + return result.Labels[0].Count, nil + } + + return 0, nil +} // videooptimizationpacingpolicylabel_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelBinding() ([]models.VideoOptimizationPacingPolicyLabelBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLabelBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelBinding `json:"videooptimizationpacingpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelBinding(name string) (*models.VideoOptimizationPacingPolicyLabelBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelBinding `json:"videooptimizationpacingpolicylabel_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationpacingpolicylabel_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationpacingpolicylabel_policybinding_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelPolicyBindingBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelPolicyBindingBinding() {} -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabelPolicyBindingBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelPolicyBindingBinding() ([]models.VideoOptimizationPacingPolicyLabelPolicyBindingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLabelPolicyBindingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelPolicyBindingBinding `json:"videooptimizationpacingpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelPolicyBindingBinding(name string) ([]models.VideoOptimizationPacingPolicyLabelPolicyBindingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelPolicyBindingBinding `json:"videooptimizationpacingpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabelPolicyBindingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationPacingPolicyLabelPolicyBindingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicylabel_policybinding_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding -func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() { +func (s *VideoOptimizationService) AddVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding(resource models.VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding) error { + payload := map[string]any{ + "videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) DeleteVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding(name string, args string) error { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL, url.PathEscape(name)) + if args != "" { + reqURL += "?args=" + url.QueryEscape(args) + } + req, err := s.client.NewRequest(http.MethodDelete, reqURL, nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err } -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() ([]models.VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding(name string) ([]models.VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationPacingPolicyLabelVideoOptimizationPacingPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicylabel_videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationpacingpolicy_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyBinding() ([]models.VideoOptimizationPacingPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyBinding `json:"videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyBinding(name string) (*models.VideoOptimizationPacingPolicyBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyBinding `json:"videooptimizationpacingpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) == 0 { + return nil, fmt.Errorf("videooptimizationpacingpolicy_binding not found") + } + + return &result.Bindings[0], nil +} // videooptimizationpacingpolicy_lbvserver_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLBVServerBinding() {} -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLBVServerBinding() {} -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLBVServerBinding() {} +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyLBVServerBinding() ([]models.VideoOptimizationPacingPolicyLBVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyLBVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLBVServerBinding `json:"videooptimizationpacingpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyLBVServerBinding(name string) ([]models.VideoOptimizationPacingPolicyLBVServerBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyLBVServerBinding `json:"videooptimizationpacingpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil +} + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyLBVServerBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationPacingPolicyLBVServerBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicy_lbvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil +} // videooptimizationpacingpolicy_videooptimizationglobalpacing_binding -func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding() { +func (s *VideoOptimizationService) GetAllVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding() ([]models.VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationPacingPolicyVideoOptimizationGlobalPacingBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding() { + +func (s *VideoOptimizationService) GetVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding(name string) ([]models.VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding, error) { + reqURL := fmt.Sprintf("%s/%s", videoOptimizationPacingPolicyVideoOptimizationGlobalPacingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Bindings []models.VideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Bindings, nil } -func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding() { + +func (s *VideoOptimizationService) CountVideoOptimizationPacingPolicyVideoOptimizationGlobalPacingBinding(name string) (float64, error) { + reqURL := fmt.Sprintf("%s/%s?count=yes", videoOptimizationPacingPolicyVideoOptimizationGlobalPacingBindingURL, url.PathEscape(name)) + req, err := s.client.NewRequest(http.MethodGet, reqURL, nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Bindings []struct { + Count float64 `json:"__count"` + } `json:"videooptimizationpacingpolicy_videooptimizationglobalpacing_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Bindings) > 0 { + return result.Bindings[0].Count, nil + } + + return 0, nil } // videooptimizationparameter -func (s *VideoOptimizationService) UpdateVideoOptimizationParameter() {} -func (s *VideoOptimizationService) UnsetVideoOptimizationParameter() {} -func (s *VideoOptimizationService) GetAllVideoOptimizationParameter() {} +func (s *VideoOptimizationService) UpdateVideoOptimizationParameter(resource models.VideoOptimizationParameter) error { + payload := map[string]any{ + "videooptimizationparameter": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPut, videoOptimizationParameterURL, bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) UnsetVideoOptimizationParameter(resource models.VideoOptimizationParameter) error { + payload := map[string]any{ + "videooptimizationparameter": resource, + } + body, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal payload: %w", err) + } + + req, err := s.client.NewRequest(http.MethodPost, videoOptimizationParameterURL+"?action=unset", bytes.NewBuffer(body)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VideoOptimizationService) GetAllVideoOptimizationParameter() (*models.VideoOptimizationParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, videoOptimizationParameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Parameters []models.VideoOptimizationParameter `json:"videooptimizationparameter"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Parameters) == 0 { + return nil, fmt.Errorf("videooptimizationparameter not found") + } + + return &result.Parameters[0], nil +} diff --git a/nitrogo/vpn.go b/nitrogo/vpn.go index 3582784..7f5f0e6 100644 --- a/nitrogo/vpn.go +++ b/nitrogo/vpn.go @@ -1,5 +1,14 @@ package nitrogo +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + + "github.com/AdamJCrawford/NitroGo/nitrogo/models" +) + const ( vpnAlwaysOnProfileURL = "/nitro/v1/config/vpnalwaysonprofile" vpnClientlessAccessPolicyURL = "/nitro/v1/config/vpnclientlessaccesspolicy" @@ -139,725 +148,9914 @@ type VPNService struct { } // vpnalwaysonprofile -func (s *VPNService) AddVPNAlwaysOnProfile() {} -func (s *VPNService) DeleteVPNAlwaysOnProfile() {} -func (s *VPNService) UpdateVPNAlwaysOnProfile() {} -func (s *VPNService) UnsetVPNAlwaysOnProfile() {} -func (s *VPNService) GetAllVPNAlwaysOnProfile() {} -func (s *VPNService) GetVPNAlwaysOnProfile() {} -func (s *VPNService) CountVPNAlwaysOnProfile() {} +func (s *VPNService) AddVPNAlwaysOnProfile(resource models.VPNAlwaysOnProfile) error { + payload := map[string]any{"vpnalwaysonprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnAlwaysOnProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNAlwaysOnProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnAlwaysOnProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNAlwaysOnProfile(resource models.VPNAlwaysOnProfile) error { + payload := map[string]any{"vpnalwaysonprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnAlwaysOnProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNAlwaysOnProfile(resource models.VPNAlwaysOnProfile) error { + payload := map[string]any{"vpnalwaysonprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnAlwaysOnProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNAlwaysOnProfile() ([]models.VPNAlwaysOnProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnAlwaysOnProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNAlwaysOnProfile `json:"vpnalwaysonprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNAlwaysOnProfile(name string) (*models.VPNAlwaysOnProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnAlwaysOnProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNAlwaysOnProfile `json:"vpnalwaysonprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNAlwaysOnProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnAlwaysOnProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNAlwaysOnProfile `json:"vpnalwaysonprofile"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // vpnclientlessaccesspolicy -func (s *VPNService) AddVPNClientLessAccessPolicy() {} -func (s *VPNService) DeleteVPNClientLessAccessPolicy() {} -func (s *VPNService) UpdateVPNClientLessAccessPolicy() {} -func (s *VPNService) GetAllVPNClientLessAccessPolicy() {} -func (s *VPNService) GetVPNClientLessAccessPolicy() {} -func (s *VPNService) CountVPNClientLessAccessPolicy() {} +func (s *VPNService) AddVPNClientLessAccessPolicy(resource models.VPNClientlessAccessPolicy) error { + payload := map[string]any{"vpnclientlessaccesspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnClientlessAccessPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNClientLessAccessPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnClientlessAccessPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNClientLessAccessPolicy(resource models.VPNClientlessAccessPolicy) error { + payload := map[string]any{"vpnclientlessaccesspolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnClientlessAccessPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNClientLessAccessPolicy() ([]models.VPNClientlessAccessPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnClientlessAccessPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicy `json:"vpnclientlessaccesspolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNClientLessAccessPolicy(name string) (*models.VPNClientlessAccessPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnClientlessAccessPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicy `json:"vpnclientlessaccesspolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNClientLessAccessPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnClientlessAccessPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicy `json:"vpnclientlessaccesspolicy"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // vpnclientlessaccesspolicy_binding -func (s *VPNService) GetAllVPNClientLessAccessPolicyBinding() {} -func (s *VPNService) GetVPNClientLessAccessPolicyBinding() {} +func (s *VPNService) GetAllVPNClientLessAccessPolicyBinding() ([]models.VPNClientlessAccessPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnClientlessAccessPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyBinding `json:"vpnclientlessaccesspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNClientLessAccessPolicyBinding(name string) (*models.VPNClientlessAccessPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnClientlessAccessPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyBinding `json:"vpnclientlessaccesspolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} // vpnclientlessaccesspolicy_vpnglobal_binding -func (s *VPNService) GetAllVPNClientLessAccessPolicyVPNGlobalBinding() {} -func (s *VPNService) GetVPNClientLessAccessPolicyVPNGlobalBinding() {} -func (s *VPNService) CountVPNClientLessAccessPolicyVPNGlobalBinding() {} +func (s *VPNService) GetAllVPNClientLessAccessPolicyVPNGlobalBinding() ([]models.VPNClientlessAccessPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnClientlessAccessPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNGlobalBinding `json:"vpnclientlessaccesspolicy_vpnglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNClientLessAccessPolicyVPNGlobalBinding(name string) (*models.VPNClientlessAccessPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnClientlessAccessPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNGlobalBinding `json:"vpnclientlessaccesspolicy_vpnglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNClientLessAccessPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnClientlessAccessPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNGlobalBinding `json:"vpnclientlessaccesspolicy_vpnglobal_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // vpnclientlessaccesspolicy_vpnvserver_binding -func (s *VPNService) GetAllVPNClientLessAccessPolicyVPNVServerBinding() {} -func (s *VPNService) GetVPNClientLessAccessPolicyVPNVServerBinding() {} -func (s *VPNService) CountVPNClientLessAccessPolicyVPNVServerBinding() {} +func (s *VPNService) GetAllVPNClientLessAccessPolicyVPNVServerBinding() ([]models.VPNClientlessAccessPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnClientlessAccessPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNVServerBinding `json:"vpnclientlessaccesspolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNClientLessAccessPolicyVPNVServerBinding(name string) (*models.VPNClientlessAccessPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnClientlessAccessPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNVServerBinding `json:"vpnclientlessaccesspolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNClientLessAccessPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnClientlessAccessPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNClientlessAccessPolicyVPNVServerBinding `json:"vpnclientlessaccesspolicy_vpnvserver_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} // vpnclientlessaccessprofile -func (s *VPNService) AddVPNClientLessAccessProfile() {} -func (s *VPNService) DeleteVPNClientLessAccessProfile() {} -func (s *VPNService) UpdateVPNClientLessAccessProfile() {} -func (s *VPNService) UnsetVPNClientLessAccessProfile() {} -func (s *VPNService) GetAllVPNClientLessAccessProfile() {} -func (s *VPNService) GetVPNClientLessAccessProfile() {} -func (s *VPNService) CountVPNClientLessAccessProfile() {} +func (s *VPNService) AddVPNClientLessAccessProfile(resource models.VPNClientlessAccessProfile) error { + payload := map[string]any{"vpnclientlessaccessprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnepaprofile -func (s *VPNService) AddVPNEPAProfile() {} -func (s *VPNService) DeleteVPNEPAProfile() {} -func (s *VPNService) GetAllVPNEPAProfile() {} -func (s *VPNService) GetVPNEPAProfile() {} -func (s *VPNService) CountVPNEPAProfile() {} + req, err := s.client.NewRequest(http.MethodPost, vpnClientlessAccessProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpneula -func (s *VPNService) AddVPNEULA() {} -func (s *VPNService) DeleteVPNEULA() {} -func (s *VPNService) GetAllVPNEULA() {} -func (s *VPNService) GetVPNEULA() {} -func (s *VPNService) CountVPNEULA() {} + _, err = s.client.Do(req) + return err +} -// vpnformssoaction -func (s *VPNService) AddVPNFormSSOAction() {} -func (s *VPNService) DeleteVPNFormSSOAction() {} -func (s *VPNService) UpdateVPNFormSSOAction() {} -func (s *VPNService) UnsetVPNFormSSOAction() {} -func (s *VPNService) GetAllVPNFormSSOAction() {} -func (s *VPNService) GetVPNFormSSOAction() {} -func (s *VPNService) CountVPNFormSSOAction() {} +func (s *VPNService) DeleteVPNClientLessAccessProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnClientlessAccessProfileURL, name), nil) + if err != nil { + return err + } -// vpnglobal_appcontroller_binding -func (s *VPNService) AddVPNGlobalAppControllerBinding() {} -func (s *VPNService) DeleteVPNGlobalAppControllerBinding() {} -func (s *VPNService) GetVPNGlobalAppControllerBinding() {} -func (s *VPNService) CountVPNGlobalAppControllerBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnglobal_auditnslogpolicy_binding -func (s *VPNService) AddVPNGlobalAuditNSLogPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuditNSLogPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuditNSLogPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuditNSLogPolicyBinding() {} +func (s *VPNService) UpdateVPNClientLessAccessProfile(resource models.VPNClientlessAccessProfile) error { + payload := map[string]any{"vpnclientlessaccessprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnglobal_auditsyslogpolicy_binding -func (s *VPNService) AddVPNGlobalAuditSyslogPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuditSyslogPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuditSyslogPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuditSyslogPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPut, vpnClientlessAccessProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpnglobal_authenticationcertpolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationCertPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationCertPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationCertPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationCertPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnglobal_authenticationldappolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationLDAPPolicyBinding() {} +func (s *VPNService) UnsetVPNClientLessAccessProfile(resource models.VPNClientlessAccessProfile) error { + payload := map[string]any{"vpnclientlessaccessprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnglobal_authenticationlocalpolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationLocalPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationLocalPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationLocalPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationLocalPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnClientlessAccessProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } -// vpnglobal_authenticationnegotiatepolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationNegotiatePolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnglobal_authenticationpolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationPolicyBinding() {} +func (s *VPNService) GetAllVPNClientLessAccessProfile() ([]models.VPNClientlessAccessProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnClientlessAccessProfileURL, nil) + if err != nil { + return nil, err + } -// vpnglobal_authenticationradiuspolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationRADIUSPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnglobal_authenticationsamlpolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) GetVPNGlobalAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) CountVPNGlobalAuthenticationSAMLPolicyBinding() {} + var result struct { + Data []models.VPNClientlessAccessProfile `json:"vpnclientlessaccessprofile"` + } -// vpnglobal_authenticationtacacspolicy_binding -func (s *VPNService) AddVPNGlobalAuthenticationTACACSPolicy() {} -func (s *VPNService) DeleteVPNGlobalAuthenticationTACACSPolicy() {} -func (s *VPNService) GetVPNGlobalAuthenticationTACACSPolicy() {} -func (s *VPNService) CountVPNGlobalAuthenticationTACACSPolicy() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnglobal_binding -func (s *VPNService) GetVPNGlobalBinding() {} + return result.Data, nil +} -// vpnglobal_domain_binding -func (s *VPNService) AddVPNGlobalDomainBinding() {} -func (s *VPNService) DeleteVPNGlobalDomainBinding() {} -func (s *VPNService) GetVPNGlobalDomainBinding() {} -func (s *VPNService) CountVPNGlobalDomainBinding() {} +func (s *VPNService) GetVPNClientLessAccessProfile(name string) (*models.VPNClientlessAccessProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnClientlessAccessProfileURL, name), nil) + if err != nil { + return nil, err + } -// vpnglobal_intranetip6_binding -func (s *VPNService) AddVPNGlobalIntranetIP6Binding() {} -func (s *VPNService) DeleteVPNGlobalIntranetIP6Binding() {} -func (s *VPNService) GetVPNGlobalIntranetIP6Binding() {} -func (s *VPNService) CountVPNGlobalIntranetIP6Binding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnglobal_intranetip_binding -func (s *VPNService) AddVPNGlobalIntranetIPBinding() {} -func (s *VPNService) DeleteVPNGlobalIntranetIPBinding() {} -func (s *VPNService) GetVPNGlobalIntranetIPBinding() {} -func (s *VPNService) CountVPNGlobalIntranetIPBinding() {} + var result struct { + Data []models.VPNClientlessAccessProfile `json:"vpnclientlessaccessprofile"` + } -// vpnglobal_sharefileserver_binding -func (s *VPNService) AddVPNGlobalShareFileServerBinding() {} -func (s *VPNService) DeleteVPNGlobalShareFileServerBinding() {} -func (s *VPNService) GetVPNGlobalShareFileServerBinding() {} -func (s *VPNService) CountVPNGlobalShareFileServerBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnglobal_sslcertkey_binding -func (s *VPNService) AddVPNGlobalSSLCertKeyBinding() {} -func (s *VPNService) DeleteVPNGlobalSSLCertKeyBinding() {} -func (s *VPNService) GetVPNGlobalSSLCertKeyBinding() {} -func (s *VPNService) CountVPNGlobalSSLCertKeyBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vpnglobal_staserver_binding -func (s *VPNService) AddVPNGlobalSTAServerBinding() {} -func (s *VPNService) DeleteVPNGlobalSTAServerBinding() {} -func (s *VPNService) GetVPNGlobalSTAServerBinding() {} -func (s *VPNService) CountVPNGlobalSTAServerBinding() {} + return &result.Data[0], nil +} -// vpnglobal_vpnclientlessaccesspolicy_binding -func (s *VPNService) AddVPNGlobalVPNClientLessAccessPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNClientLessAccessPolicyBinding() {} -func (s *VPNService) GetVPNGlobalVPNClientLessAccessPolicyBinding() {} -func (s *VPNService) CountVPNGlobalVPNClientLessAccessPolicyBinding() {} +func (s *VPNService) CountVPNClientLessAccessProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnClientlessAccessProfileURL), nil) + if err != nil { + return 0, err + } -// vpnglobal_vpneula_binding -func (s *VPNService) AddVPNGlobalVPNEULABinding() {} -func (s *VPNService) DeleteVPNGlobalVPNEULABinding() {} -func (s *VPNService) GetVPNGlobalVPNEULABinding() {} -func (s *VPNService) CountVPNGlobalVPNEULABinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// vpnglobal_vpnintranetapplication_binding -func (s *VPNService) AddVPNGlobalVPNIntranetApplicationBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNIntranetApplicationBinding() {} -func (s *VPNService) GetVPNGlobalVPNIntranetApplicationBinding() {} -func (s *VPNService) CountVPNGlobalVPNIntranetApplicationBinding() {} + var result struct { + Data []models.VPNClientlessAccessProfile `json:"vpnclientlessaccessprofile"` + } -// vpnglobal_vpnnexthopserver_binding -func (s *VPNService) AddVPNGlobalVPNNextHopServerBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNNextHopServerBinding() {} -func (s *VPNService) GetVPNGlobalVPNNextHopServerBinding() {} -func (s *VPNService) CountVPNGlobalVPNNextHopServerBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnglobal_vpnportaltheme_binding -func (s *VPNService) AddVPNGlobalVPNPortalThemeBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNPortalThemeBinding() {} -func (s *VPNService) GetVPNGlobalVPNPortalThemeBinding() {} -func (s *VPNService) CountVPNGlobalVPNPortalThemeBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// vpnglobal_vpnsessionpolcy_binding -func (s *VPNService) AddVPNGlobalVPNSessionPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNSessionPolicyBinding() {} -func (s *VPNService) GetVPNGlobalVPNSessionPolicyBinding() {} -func (s *VPNService) CountVPNGlobalVPNSessionPolicyBinding() {} +// vpnepaprofile +func (s *VPNService) AddVPNEPAProfile(resource models.VPNEPAProfile) error { + payload := map[string]any{"vpnepaprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnglobal_vpntrafficpolicy_binding -func (s *VPNService) AddVPNGlobalVPNTrafficPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNTrafficPolicyBinding() {} -func (s *VPNService) GetVPNGlobalVPNTrafficPolicyBinding() {} -func (s *VPNService) CountVPNGlobalVPNTrafficPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, vpnEPAProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpnglobal_vpnurlpolicy_binding -func (s *VPNService) AddVPNGlobalVPNURLPolicyBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNURLPolicyBinding() {} -func (s *VPNService) GetVPNGlobalVPNURLPolicyBinding() {} -func (s *VPNService) CountVPNGlobalVPNURLPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnglobal_vpnurl_binding -func (s *VPNService) AddVPNGlobalVPNURLBinding() {} -func (s *VPNService) DeleteVPNGlobalVPNURLBinding() {} -func (s *VPNService) GetVPNGlobalVPNURLBinding() {} -func (s *VPNService) CountVPNGlobalVPNURLBinding() {} +func (s *VPNService) DeleteVPNEPAProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnEPAProfileURL, name), nil) + if err != nil { + return err + } -// vpnicaconnection -func (s *VPNService) KillVPNICAConnection() {} -func (s *VPNService) GetAllVPNICAConnection() {} -func (s *VPNService) CountVPNICAConnection() {} + _, err = s.client.Do(req) + return err +} -// vpnicadtlsconnection -func (s *VPNService) GetAllVPNICADTLSConnection() {} -func (s *VPNService) CountVPNICADTLSConnection() {} +func (s *VPNService) GetAllVPNEPAProfile() ([]models.VPNEPAProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnEPAProfileURL, nil) + if err != nil { + return nil, err + } -// vpnintranetapplication -func (s *VPNService) AddVPNIntranetApplication() {} -func (s *VPNService) DeleteVPNIntranetApplication() {} -func (s *VPNService) GetAllVPNIntranetApplication() {} -func (s *VPNService) GetVPNIntranetApplication() {} -func (s *VPNService) CountVPNIntranetApplication() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnnexthopserver -func (s *VPNService) AddVPNNextHopServer() {} -func (s *VPNService) DeleteVPNNextHopServer() {} -func (s *VPNService) GetAllVPNNextHopServer() {} -func (s *VPNService) GetVPNNextHopServer() {} -func (s *VPNService) CountVPNNextHopServer() {} + var result struct { + Data []models.VPNEPAProfile `json:"vpnepaprofile"` + } -// vpnparameter -func (s *VPNService) UpdateVPNParameter() {} -func (s *VPNService) UnsetVPNParameter() {} -func (s *VPNService) GetAllVPNParameter() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnpcoipconnection -func (s *VPNService) KillVPNPCoIPConnection() {} -func (s *VPNService) GetAllVPNPCoIPConnection() {} -func (s *VPNService) CountVPNPCoIPConnection() {} + return result.Data, nil +} -// vpnpcoipprofile -func (s *VPNService) AddVPNCoIPProfile() {} -func (s *VPNService) DeleteVPNCoIPProfile() {} -func (s *VPNService) UpdateVPNCoIPProfile() {} -func (s *VPNService) UnsetVPNCoIPProfile() {} -func (s *VPNService) GetAllVPNCoIPProfile() {} -func (s *VPNService) GetVPNCoIPProfile() {} -func (s *VPNService) CountVPNCoIPProfile() {} +func (s *VPNService) GetVPNEPAProfile(name string) (*models.VPNEPAProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnEPAProfileURL, name), nil) + if err != nil { + return nil, err + } -// vpnpcoipvserverprofile -func (s *VPNService) AddVPNPCoIPVServerProfile() {} -func (s *VPNService) DeleteVPNPCoIPVServerProfile() {} -func (s *VPNService) UpdateVPNPCoIPVServerProfile() {} -func (s *VPNService) UnsetVPNPCoIPVServerProfile() {} -func (s *VPNService) GetAllVPNPCoIPVServerProfile() {} -func (s *VPNService) GetVPNPCoIPVServerProfile() {} -func (s *VPNService) CountVPNPCoIPVServerProfile() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnportaltheme -func (s *VPNService) AddVPNPortalTheme() {} -func (s *VPNService) DeleteVPNPortalTheme() {} -func (s *VPNService) GetAllVPNPortalTheme() {} -func (s *VPNService) GetVPNPortalTheme() {} -func (s *VPNService) CountVPNPortalTheme() {} + var result struct { + Data []models.VPNEPAProfile `json:"vpnepaprofile"` + } -// vpnsamlssoprofile -func (s *VPNService) AddVPNSAMLSSOProfile() {} -func (s *VPNService) DeleteVPNSAMLSSOProfile() {} -func (s *VPNService) UpdateVPNSAMLSSOProfile() {} -func (s *VPNService) UnsetVPNSAMLSSOProfile() {} -func (s *VPNService) GetAllVPNSAMLSSOProfile() {} -func (s *VPNService) GetVPNSAMLSSOProfile() {} -func (s *VPNService) CountVPNSAMLSSOProfile() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnsessionaction -func (s *VPNService) AddVPNSessionAction() {} -func (s *VPNService) DeleteVPNSessionAction() {} -func (s *VPNService) UpdateVPNSessionAction() {} -func (s *VPNService) UnsetVPNSessionAction() {} -func (s *VPNService) GetAllVPNSessionAction() {} -func (s *VPNService) GetVPNSessionAction() {} -func (s *VPNService) CountVPNSessionAction() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vpnsessionpolicy -func (s *VPNService) AddVPNSessionPolicy() {} -func (s *VPNService) DeleteVPNSessionPolicy() {} -func (s *VPNService) UpdateVPNSessionPolicy() {} -func (s *VPNService) UnsetVPNSessionPolicy() {} -func (s *VPNService) GetAllVPNSessionPolicy() {} -func (s *VPNService) GetVPNSessionPolicy() {} -func (s *VPNService) CountVPNSessionPolicy() {} + return &result.Data[0], nil +} -// vpnsesisonpolicy_aaagroup_binding -func (s *VPNService) GetAllVPNSessionPolicyAAAGroupBinding() {} -func (s *VPNService) GetVPNSessionPolicyAAAGroupBinding() {} -func (s *VPNService) CountVPNSessionPolicyAAAGroupBinding() {} +func (s *VPNService) CountVPNEPAProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnEPAProfileURL), nil) + if err != nil { + return 0, err + } -// vpnsessionpolicy_aaauser_binding -func (s *VPNService) GetAllVPNSessionPolicyAAAUserBinding() {} -func (s *VPNService) GetVPNSessionPolicyAAAUserBinding() {} -func (s *VPNService) CountVPNSessionPolicyAAAUserBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// vpnsessionpolicy_binding -func (s *VPNService) GetAllVPNSessionPolicyBinding() {} -func (s *VPNService) GetVPNSessionPolicyBinding() {} + var result struct { + Data []models.VPNEPAProfile `json:"vpnepaprofile"` + } -// vpnsessionpolicy_vpnglobal_binding -func (s *VPNService) GetAllVPNSessionPolicyVPNGlobalBinding() {} -func (s *VPNService) GetVPNSessionPolicyVPNGlobalBinding() {} -func (s *VPNService) CountVPNSessionPolicyVPNGlobalBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnsessionpolicy_vpnvserver_binding -func (s *VPNService) GetAllVPNSessionPolicyVPNVServerBinding() {} -func (s *VPNService) GetVPNSessionPolicyVPNVServerBinding() {} -func (s *VPNService) CountVPNSessionPolicyVPNVServerBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// vpnsfconfig -func (s *VPNService) GetAllVPNSFConfig() {} -func (s *VPNService) CountVPNSFConfig() {} +// vpneula +func (s *VPNService) AddVPNEULA(resource models.VPNEULA) error { + payload := map[string]any{"vpneula": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnstoreinfo -func (s *VPNService) GetAllVPNStoreInfo() {} -func (s *VPNService) CountVPNStoreInfo() {} + req, err := s.client.NewRequest(http.MethodPost, vpnEULAURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpntrafficaction -func (s *VPNService) AddVPNTrafficAction() {} -func (s *VPNService) DeleteVPNTrafficAction() {} -func (s *VPNService) UpdateVPNTrafficAction() {} -func (s *VPNService) UnsetVPNTrafficAction() {} -func (s *VPNService) GetAllVPNTrafficAction() {} -func (s *VPNService) GetVPNTrafficAction() {} -func (s *VPNService) CountVPNTrafficAction() {} + _, err = s.client.Do(req) + return err +} -// vpntrafficpolicy -func (s *VPNService) AddVPNTrafficPolicy() {} -func (s *VPNService) DeleteVPNTrafficPolicy() {} -func (s *VPNService) UpdateVPNTrafficPolicy() {} -func (s *VPNService) UnsetVPNTrafficPolicy() {} -func (s *VPNService) GetAllVPNTrafficPolicy() {} -func (s *VPNService) GetVPNTrafficPolicy() {} -func (s *VPNService) CountVPNTrafficPolicy() {} +func (s *VPNService) DeleteVPNEULA(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnEULAURL, name), nil) + if err != nil { + return err + } -// vpntrafficpolicy_aaagroup_binding -func (s *VPNService) GetAllVPNTrafficPolicyAAAGroupBinding() {} -func (s *VPNService) GetVPNTrafficPolicyAAAGroupBinding() {} -func (s *VPNService) CountVPNTrafficPolicyAAAGroupBinding() {} + _, err = s.client.Do(req) + return err +} -// vpntrafficpolicy_aaauser_binding -func (s *VPNService) GetAllVPNTrafficPolicyAAAUserBinding() {} -func (s *VPNService) GetVPNTrafficPolicyAAAUserBinding() {} -func (s *VPNService) CountVPNTrafficPolicyAAAUserBinding() {} +func (s *VPNService) GetAllVPNEULA() ([]models.VPNEULA, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnEULAURL, nil) + if err != nil { + return nil, err + } -// vpntrafficpolicy_binding -func (s *VPNService) GetAllVPNTrafficPolicyBinding() {} -func (s *VPNService) GetVPNTrafficPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpntrafficpolicy_vpnglobal_binding -func (s *VPNService) GetAllVPNTrafficPolicyVPNGlobalBinding() {} -func (s *VPNService) GetVPNTrafficPolicyVPNGlobalBinding() {} -func (s *VPNService) CountVPNTrafficPolicyVPNGlobalBinding() {} + var result struct { + Data []models.VPNEULA `json:"vpneula"` + } -// vpntrafficpolicy_vpnvserver_binding -func (s *VPNService) GetAllVPNTrafficPolicyVPNVServerBinding() {} -func (s *VPNService) GetVPNTrafficPolicyVPNVServerBinding() {} -func (s *VPNService) CountVPNTrafficPolicyVPNVServerBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnurl -func (s *VPNService) AddVPNURL() {} -func (s *VPNService) DeleteVPNURL() {} -func (s *VPNService) UpdateVPNURL() {} -func (s *VPNService) UnsetVPNURL() {} -func (s *VPNService) GetAllVPNURL() {} -func (s *VPNService) GetVPNURL() {} -func (s *VPNService) CountVPNURL() {} + return result.Data, nil +} -// vpnurlaction -func (s *VPNService) AddVPNURLAction() {} -func (s *VPNService) DeleteVPNURLAction() {} -func (s *VPNService) UpdateVPNURLAction() {} -func (s *VPNService) UnsetVPNURLAction() {} -func (s *VPNService) RenameVPNURLAction() {} -func (s *VPNService) GetAllVPNURLAction() {} -func (s *VPNService) GetVPNURLAction() {} -func (s *VPNService) CountVPNURLAction() {} +func (s *VPNService) GetVPNEULA(name string) (*models.VPNEULA, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnEULAURL, name), nil) + if err != nil { + return nil, err + } -// vpnurlpolicy -func (s *VPNService) AddVPNURLPolicy() {} -func (s *VPNService) DeleteVPNURLPolicy() {} -func (s *VPNService) UpdateVPNURLPolicy() {} -func (s *VPNService) UnsetVPNURLPolicy() {} -func (s *VPNService) RenameVPNURLPolicy() {} -func (s *VPNService) GetAllVPNURLPolicy() {} -func (s *VPNService) GetVPNURLPolicy() {} -func (s *VPNService) CountVPNURLPolicy() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnurlpolicy_aaagroup_binding -func (s *VPNService) GetAllVPNURLPolicyAAAGroupBinding() {} -func (s *VPNService) GetVPNURLPolicyAAAGroupBinding() {} -func (s *VPNService) CountVPNURLPolicyAAAGroupBinding() {} + var result struct { + Data []models.VPNEULA `json:"vpneula"` + } -// vpnurlpolicy_aaauser_binding -func (s *VPNService) GetAllVPNURLPolicyAAAUserBinding() {} -func (s *VPNService) GetVPNURLPolicyAAAUserBinding() {} -func (s *VPNService) CountVPNURLPolicyAAAUserBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnurlpolicy_binding -func (s *VPNService) GetAllVPNURLPolicyBinding() {} -func (s *VPNService) GetVPNURLPolicyBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vpnurlpolicy_vpnglobal_binding -func (s *VPNService) GetAllVPNURLPolicyVPNGlobalBinding() {} -func (s *VPNService) GetVPNURLPolicyVPNGlobalBinding() {} -func (s *VPNService) CountVPNURLPolicyVPNGlobalBinding() {} + return &result.Data[0], nil +} -// vpnurlpolicy_vpnvserver_binding -func (s *VPNService) GetAllVPNURLPolicyVPNVServerBinding() {} -func (s *VPNService) GetVPNURLPolicyVPNVServerBinding() {} -func (s *VPNService) CountVPNURLPolicyVPNVServerBinding() {} +func (s *VPNService) CountVPNEULA() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnEULAURL), nil) + if err != nil { + return 0, err + } -// vpnvserver -func (s *VPNService) AddVPNVServer() {} -func (s *VPNService) DeleteVPNVServer() {} -func (s *VPNService) UpdateVPNVServer() {} -func (s *VPNService) UnsetVPNVServer() {} -func (s *VPNService) EnableVPNVServer() {} -func (s *VPNService) DisableVPNVServer() {} -func (s *VPNService) RenameVPNVServer() {} -func (s *VPNService) CheckVPNVServer() {} -func (s *VPNService) GetAllVPNVServer() {} -func (s *VPNService) GetVPNVServer() {} -func (s *VPNService) CountVPNVServer() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// vpnvserver_aaapreauthenticationpolicy_binding -func (s *VPNService) AddVPNVServerAAAPreauthenticationPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAAAPreauthenticationPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAAAPreauthenticationPolicyBinding() {} -func (s *VPNService) GetVPNVServerAAAPreauthenticationPolicyBinding() {} -func (s *VPNService) CountVPNVServerAAAPreauthenticationPolicyBinding() {} + var result struct { + Data []models.VPNEULA `json:"vpneula"` + } -// vpnvserver_analyticsprofile_binding -func (s *VPNService) AddVPNVServerAnalyticsProfileBinding() {} -func (s *VPNService) DeleteVPNVServerAnalyticsProfileBinding() {} -func (s *VPNService) GetAllVPNVServerAnalyticsProfileBinding() {} -func (s *VPNService) GetVPNVServerAnalyticsProfileBinding() {} -func (s *VPNService) CountVPNVServerAnalyticsProfileBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnvserver_appcontroller_binding -func (s *VPNService) AddVPNVServerAppControllerBinding() {} -func (s *VPNService) DeleteVPNVServerAppControllerBinding() {} -func (s *VPNService) GetAllVPNVServerAppControllerBinding() {} -func (s *VPNService) GetVPNVServerAppControllerBinding() {} -func (s *VPNService) CountVPNVServerAppControllerBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// vpnvserver_appflowpolicy_binding -func (s *VPNService) AddVPNVServerAppFlowPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAppFlowPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAppFlowPolicyBinding() {} -func (s *VPNService) GetVPNVServerAppFlowPolicyBinding() {} -func (s *VPNService) CountVPNVServerAppFlowPolicyBinding() {} +// vpnformssoaction +func (s *VPNService) AddVPNFormSSOAction(resource models.VPNFormSSOAction) error { + payload := map[string]any{"vpnformssoaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnvserver_auditnslogpolicy_binding -func (s *VPNService) AddVPNVServerAuditNSLogPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuditNSLogPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuditNSLogPolicyBinding() {} -func (s *VPNService) VPNVServerAuditNSLogPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuditNSLogPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, vpnFormSSOActionURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpnvserver_auditsyslogpolicy_binding -func (s *VPNService) AddVPNVServerAuditSyslogPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuditSyslogPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuditSyslogPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuditSyslogPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuditSyslogPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_authenticationcertpolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationCertPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationCertPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationCertPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationCertPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationCertPolicyBinding() {} +func (s *VPNService) DeleteVPNFormSSOAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnFormSSOActionURL, name), nil) + if err != nil { + return err + } -// vpnvserver_authenticationfapolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationFAPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationFAPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationFAPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationFAPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationFAPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_authenticationldappolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationLDAPPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationLDAPPolicyBinding() {} +func (s *VPNService) UpdateVPNFormSSOAction(resource models.VPNFormSSOAction) error { + payload := map[string]any{"vpnformssoaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnvserver_authenticationlocalpolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationLocalPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationLocalPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationLocalPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationLocalPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationLocalPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPut, vpnFormSSOActionURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpnvserver_authenticationloginschemapolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationLoginSchemaPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationLoginSchemaPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_authenticationnegotiatepolcy_binding -func (s *VPNService) AddVPNVServerAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationNegotiatePolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationNegotiatePolicyBinding() {} +func (s *VPNService) UnsetVPNFormSSOAction(resource models.VPNFormSSOAction) error { + payload := map[string]any{"vpnformssoaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnvserver_authenticationoauthidppolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationOAuthIDPPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationOAuthIDPPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationOAuthIDPPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationOAuthIDPPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationOAuthIDPPolicyBinding() {} + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnFormSSOActionURL), bytes.NewReader(data)) + if err != nil { + return err + } -// vpnvserver_authenticationpolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationPolicyBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_authenticationradiuspolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationRADIUSPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationRADIUSPolicyBinding() {} +func (s *VPNService) GetAllVPNFormSSOAction() ([]models.VPNFormSSOAction, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnFormSSOActionURL, nil) + if err != nil { + return nil, err + } -// vpnvserver_authenticationsamlidppolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationSAMLIDPPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationSAMLIDPPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationSAMLIDPPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationSAMLIDPPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationSAMLIDPPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnvserver_authenticationsamlpolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationSAMLPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationSAMLPolicyBinding() {} + var result struct { + Data []models.VPNFormSSOAction `json:"vpnformssoaction"` + } -// vpnvserver_authenticationtacacspolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationTACACSPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationTACACSPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationTACACSPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationTACACSPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationTACACSPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnvserver_authenticationwebauthpolicy_binding -func (s *VPNService) AddVPNVServerAuthenticationWebAuthPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerAuthenticationWebAuthPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerAuthenticationWebAuthPolicyBinding() {} -func (s *VPNService) GetVPNVServerAuthenticationWebAuthPolicyBinding() {} -func (s *VPNService) CountVPNVServerAuthenticationWebAuthPolicyBinding() {} + return result.Data, nil +} -// vpnvserver_binding -func (s *VPNService) GetAllPVNVServerBinding() {} -func (s *VPNService) GetPVNVServerBinding() {} +func (s *VPNService) GetVPNFormSSOAction(name string) (*models.VPNFormSSOAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnFormSSOActionURL, name), nil) + if err != nil { + return nil, err + } -// vpnvserver_cachepolicy_binding -func (s *VPNService) AddVPNVServerCachePolicyBinding() {} -func (s *VPNService) DeleteVPNVServerCachePolicyBinding() {} -func (s *VPNService) GetAllVPNVServerCachePolicyBinding() {} -func (s *VPNService) GetVPNVServerCachePolicyBinding() {} -func (s *VPNService) CountVPNVServerCachePolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnvserver_cspolicy_binding -func (s *VPNService) AddVPNVServerCSPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerCSPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerCSPolicyBinding() {} -func (s *VPNService) GetVPNVServerCSPolicyBinding() {} -func (s *VPNService) CountVPNVServerCSPolicyBinding() {} + var result struct { + Data []models.VPNFormSSOAction `json:"vpnformssoaction"` + } -// vpnvserver_feopolicy_binding -func (s *VPNService) AddVPNVServerFEOPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerFEOPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerFEOPolicyBinding() {} -func (s *VPNService) GetVPNVServerFEOPolicyBinding() {} -func (s *VPNService) CountVPNVServerFEOPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnvserver_icapolicy_binding -func (s *VPNService) AddVPNVServerICAPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerICAPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerICAPolicyBinding() {} -func (s *VPNService) GetVPNVServerICAPolicyBinding() {} -func (s *VPNService) CountVPNVServerICAPolicyBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } -// vpnvserver_intranetip6_binding -func (s *VPNService) AddVPNVServerIntranetIP6Binding() {} -func (s *VPNService) DeleteVPNVServerIntranetIP6Binding() {} -func (s *VPNService) GetAllVPNVServerIntranetIP6Binding() {} -func (s *VPNService) GetVPNVServerIntranetIP6Binding() {} -func (s *VPNService) CountVPNVServerIntranetIP6Binding() {} + return &result.Data[0], nil +} -// vpnvserver_intranetip_binding -func (s *VPNService) AddVPNVServerIntranetIPBinding() {} -func (s *VPNService) DeleteVPNVServerIntranetIPBinding() {} -func (s *VPNService) GetAllVPNVServerIntranetIPBinding() {} -func (s *VPNService) GetVPNVServerIntranetIPBinding() {} -func (s *VPNService) CountVPNVServerIntranetIPBinding() {} +func (s *VPNService) CountVPNFormSSOAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnFormSSOActionURL), nil) + if err != nil { + return 0, err + } -// vpnvserver_responderpolicy_binding -func (s *VPNService) AddVPNVServerResponderPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerResponderPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerResponderPolicyBinding() {} -func (s *VPNService) GetVPNVServerResponderPolicyBinding() {} -func (s *VPNService) CountVPNVServerResponderPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } -// vpnvserver_rewritepolicy_binding -func (s *VPNService) AddVPNVServerRewritePolicyBinding() {} -func (s *VPNService) DeleteVPNVServerRewritePolicyBinding() {} -func (s *VPNService) GetAllVPNVServerRewritePolicyBinding() {} -func (s *VPNService) GetVPNVServerRewritePolicyBinding() {} -func (s *VPNService) CountVPNVServerRewritePolicyBinding() {} + var result struct { + Data []models.VPNFormSSOAction `json:"vpnformssoaction"` + } -// vpnvserver_sharefileserver_binding -func (s *VPNService) AddVPNVServerShareFileServerBinding() {} -func (s *VPNService) DeleteVPNVServerShareFileServerBinding() {} -func (s *VPNService) GetAllVPNVServerShareFileServerBinding() {} -func (s *VPNService) GetVPNVServerShareFileServerBinding() {} -func (s *VPNService) CountVPNVServerShareFileServerBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnvserver_staserver_binding -func (s *VPNService) AddVPNVServerSTAServerBinding() {} -func (s *VPNService) DeleteVPNVServerSTAServerBinding() {} -func (s *VPNService) GetAllVPNVServerSTAServerBinding() {} -func (s *VPNService) GetVPNVServerSTAServerBinding() {} -func (s *VPNService) CountVPNVServerSTAServerBinding() {} + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} -// vpnvserver_vpnclientlessaccesspolicy_binding -func (s *VPNService) AddVPNVServerVPNClientlessAccessPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerVPNClientlessAccessPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerVPNClientlessAccessPolicyBinding() {} -func (s *VPNService) GetVPNVServerVPNClientlessAccessPolicyBinding() {} -func (s *VPNService) CountVPNVServerVPNClientlessAccessPolicyBinding() {} +// vpnglobal_appcontroller_binding +func (s *VPNService) AddVPNGlobalAppControllerBinding(resource models.VPNGlobalAppControllerBinding) error { + payload := map[string]any{"vpnglobal_appcontroller_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } -// vpnvserver_vpnepaprofile_binding -func (s *VPNService) AddVPNVServerVPNEPAProfileBinding() {} -func (s *VPNService) DeleteVPNVServerVPNEPAProfileBinding() {} -func (s *VPNService) GetAllVPNVServerVPNEPAProfileBinding() {} -func (s *VPNService) GetVPNVServerVPNEPAProfileBinding() {} -func (s *VPNService) CountVPNVServerVPNEPAProfileBinding() {} + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAppControllerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } -// vpnvserver_vpneula_binding -func (s *VPNService) AddVPNVServerVPNEULABinding() {} -func (s *VPNService) DeleteVPNVServerVPNEULABinding() {} -func (s *VPNService) GetAllVPNVServerVPNEULABinding() {} -func (s *VPNService) GetVPNVServerVPNEULABinding() {} -func (s *VPNService) CountVPNVServerVPNEULABinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_vpnintranetapplication_binding -func (s *VPNService) AddVPNVServerVPNIntranetApplicationBinding() {} -func (s *VPNService) DeleteVPNVServerVPNIntranetApplicationBinding() {} -func (s *VPNService) GetAllVPNVServerVPNIntranetApplicationBinding() {} -func (s *VPNService) GetVPNVServerVPNIntranetApplicationBinding() {} -func (s *VPNService) CountVPNVServerVPNIntranetApplicationBinding() {} +func (s *VPNService) DeleteVPNGlobalAppControllerBinding(appcontroller string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAppControllerBindingURL, appcontroller), nil) + if err != nil { + return err + } -// vpnvserver_vpnnexthopserver_binding -func (s *VPNService) AddVPNVServerVPNNextHopServerBinding() {} -func (s *VPNService) DeleteVPNVServerVPNNextHopServerBinding() {} -func (s *VPNService) GetAllVPNVServerVPNNextHopServerBinding() {} -func (s *VPNService) GetVPNVServerVPNNextHopServerBinding() {} -func (s *VPNService) CountVPNVServerVPNNextHopServerBinding() {} + _, err = s.client.Do(req) + return err +} -// vpnvserver_vpnportaltheme_binding -func (s *VPNService) AddVPNVServerVPNPortalThemeBinding() {} -func (s *VPNService) DeleteVPNVServerVPNPortalThemeBinding() {} -func (s *VPNService) GetAllVPNVServerVPNPortalThemeBinding() {} -func (s *VPNService) GetVPNVServerVPNPortalThemeBinding() {} -func (s *VPNService) CountVPNVServerVPNPortalThemeBinding() {} +func (s *VPNService) GetVPNGlobalAppControllerBinding(name string) (*models.VPNGlobalAppControllerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnGlobalAppControllerBindingURL, name), nil) + if err != nil { + return nil, err + } -// vpnvserver_vpnsessionpolicy_binding -func (s *VPNService) AddVPNVServerVPNSessionPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerVPNSessionPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerVPNSessionPolicyBinding() {} -func (s *VPNService) GetVPNVServerVPNSessionPolicyBinding() {} -func (s *VPNService) CountVPNVServerVPNSessionPolicyBinding() {} + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } -// vpnvserver_vpntrafficpolicy_binding -func (s *VPNService) AddVPNVServerVPNTrafficPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerVPNTrafficPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerVPNTrafficPolicyBinding() {} -func (s *VPNService) GetVPNVServerVPNTrafficPolicyBinding() {} -func (s *VPNService) CountVPNVServerVPNTrafficPolicyBinding() {} + var result struct { + Data []models.VPNGlobalAppControllerBinding `json:"vpnglobal_appcontroller_binding"` + } -// vpnvserver_vpnurlpolicy_binding -func (s *VPNService) AddVPNVServerVPNURLPolicyBinding() {} -func (s *VPNService) DeleteVPNVServerVPNURLPolicyBinding() {} -func (s *VPNService) GetAllVPNVServerVPNURLPolicyBinding() {} -func (s *VPNService) GetVPNVServerVPNURLPolicyBinding() {} -func (s *VPNService) CountVPNVServerVPNURLPolicyBinding() {} + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } -// vpnvserver_vpnurl_binding -func (s *VPNService) AddVPNVServerVPNURLBinding() {} -func (s *VPNService) DeleteVPNVServerVPNURLBinding() {} -func (s *VPNService) GetAllVPNVServerVPNURLBinding() {} -func (s *VPNService) GetVPNVServerVPNURLBinding() {} -func (s *VPNService) CountVPNVServerVPNURLBinding() {} + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNGlobalAppControllerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAppControllerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAppControllerBinding `json:"vpnglobal_appcontroller_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vpnglobal_auditnslogpolicy_binding +func (s *VPNService) AddVPNGlobalAuditNSLogPolicyBinding(resource models.VPNGlobalAuditNSLogPolicyBinding) error { + payload := map[string]any{"vpnglobal_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuditNSLogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuditNSLogPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuditNSLogPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuditNSLogPolicyBinding(name string) (*models.VPNGlobalAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnGlobalAuditNSLogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuditNSLogPolicyBinding `json:"vpnglobal_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNGlobalAuditNSLogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuditNSLogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuditNSLogPolicyBinding `json:"vpnglobal_auditnslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vpnglobal_auditsyslogpolicy_binding +func (s *VPNService) AddVPNGlobalAuditSyslogPolicyBinding(resource models.VPNGlobalAuditSyslogPolicyBinding) error { + payload := map[string]any{"vpnglobal_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuditSyslogPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuditSyslogPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuditSyslogPolicyBinding(name string) (*models.VPNGlobalAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnGlobalAuditSyslogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuditSyslogPolicyBinding `json:"vpnglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("resource not found") + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNGlobalAuditSyslogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuditSyslogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuditSyslogPolicyBinding `json:"vpnglobal_auditsyslogpolicy_binding"` + } + + err = json.Unmarshal(resp, &result) + if err != nil { + return 0, fmt.Errorf("failed to unmarshal: %w", err) + } + + if len(result.Data) > 0 { + return int(result.Data[0].Count), nil + } + return 0, fmt.Errorf("failed to parse count") +} + +// vpnglobal_authenticationcertpolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationCertPolicyBinding(resource models.VPNGlobalAuthenticationCertPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationcertpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationCertPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationCertPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationCertPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationCertPolicyBinding() ([]models.VPNGlobalAuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationCertPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationCertPolicyBinding `json:"vpnglobal_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationCertPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationCertPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationCertPolicyBinding `json:"vpnglobal_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationldappolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationLDAPPolicyBinding(resource models.VPNGlobalAuthenticationLDAPPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationldappolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationLDAPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationLDAPPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationLDAPPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationLDAPPolicyBinding() ([]models.VPNGlobalAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationLDAPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationLDAPPolicyBinding `json:"vpnglobal_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationLDAPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationLDAPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationLDAPPolicyBinding `json:"vpnglobal_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationlocalpolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationLocalPolicyBinding(resource models.VPNGlobalAuthenticationLocalPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationlocalpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationLocalPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationLocalPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationLocalPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationLocalPolicyBinding() ([]models.VPNGlobalAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationLocalPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationLocalPolicyBinding `json:"vpnglobal_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationLocalPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationLocalPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationLocalPolicyBinding `json:"vpnglobal_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationnegotiatepolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationNegotiatePolicyBinding(resource models.VPNGlobalAuthenticationNegotiatePolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationnegotiatepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationNegotiatePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationNegotiatePolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationNegotiatePolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationNegotiatePolicyBinding() ([]models.VPNGlobalAuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationNegotiatePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationNegotiatePolicyBinding `json:"vpnglobal_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationNegotiatePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationNegotiatePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationNegotiatePolicyBinding `json:"vpnglobal_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationpolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationPolicyBinding(resource models.VPNGlobalAuthenticationPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationPolicyBinding() ([]models.VPNGlobalAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationPolicyBinding `json:"vpnglobal_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationPolicyBinding `json:"vpnglobal_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationradiuspolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationRADIUSPolicyBinding(resource models.VPNGlobalAuthenticationRADIUSPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationradiuspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationRADIUSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationRADIUSPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationRADIUSPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationRADIUSPolicyBinding() ([]models.VPNGlobalAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationRADIUSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationRADIUSPolicyBinding `json:"vpnglobal_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationRADIUSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationRADIUSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationRADIUSPolicyBinding `json:"vpnglobal_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationsamlpolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationSAMLPolicyBinding(resource models.VPNGlobalAuthenticationSAMLPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationsamlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationSAMLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationSAMLPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationSAMLPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationSAMLPolicyBinding() ([]models.VPNGlobalAuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationSAMLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationSAMLPolicyBinding `json:"vpnglobal_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationSAMLPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationSAMLPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationSAMLPolicyBinding `json:"vpnglobal_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_authenticationtacacspolicy_binding +func (s *VPNService) AddVPNGlobalAuthenticationTACACSPolicy(resource models.VPNGlobalAuthenticationTACACSPolicyBinding) error { + payload := map[string]any{"vpnglobal_authenticationtacacspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalAuthenticationTACACSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalAuthenticationTACACSPolicy(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalAuthenticationTACACSPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalAuthenticationTACACSPolicy() ([]models.VPNGlobalAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalAuthenticationTACACSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationTACACSPolicyBinding `json:"vpnglobal_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalAuthenticationTACACSPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalAuthenticationTACACSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalAuthenticationTACACSPolicyBinding `json:"vpnglobal_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_binding +func (s *VPNService) GetVPNGlobalBinding() (*models.VPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalBinding `json:"vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("no vpnglobal_binding found") + } + + return &result.Data[0], nil +} + +// vpnglobal_domain_binding +func (s *VPNService) AddVPNGlobalDomainBinding(resource models.VPNGlobalDomainBinding) error { + payload := map[string]any{"vpnglobal_domain_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalDomainBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalDomainBinding(intranetdomain string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalDomainBindingURL, intranetdomain), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalDomainBinding() ([]models.VPNGlobalDomainBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalDomainBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalDomainBinding `json:"vpnglobal_domain_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalDomainBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalDomainBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalDomainBinding `json:"vpnglobal_domain_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_intranetip6_binding +func (s *VPNService) AddVPNGlobalIntranetIP6Binding(resource models.VPNGlobalIntranetIP6Binding) error { + payload := map[string]any{"vpnglobal_intranetip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalIntranetIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalIntranetIP6Binding(intranetip6 string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalIntranetIP6BindingURL, intranetip6), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalIntranetIP6Binding() ([]models.VPNGlobalIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalIntranetIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalIntranetIP6Binding `json:"vpnglobal_intranetip6_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalIntranetIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalIntranetIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalIntranetIP6Binding `json:"vpnglobal_intranetip6_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_intranetip_binding +func (s *VPNService) AddVPNGlobalIntranetIPBinding(resource models.VPNGlobalIntranetIPBinding) error { + payload := map[string]any{"vpnglobal_intranetip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalIntranetIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalIntranetIPBinding(intranetip string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalIntranetIPBindingURL, intranetip), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalIntranetIPBinding() ([]models.VPNGlobalIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalIntranetIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalIntranetIPBinding `json:"vpnglobal_intranetip_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalIntranetIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalIntranetIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalIntranetIPBinding `json:"vpnglobal_intranetip_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_sharefileserver_binding +func (s *VPNService) AddVPNGlobalShareFileServerBinding(resource models.VPNGlobalShareFileServerBinding) error { + payload := map[string]any{"vpnglobal_sharefileserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalShareFileServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalShareFileServerBinding(sharefile string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalShareFileServerBindingURL, sharefile), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalShareFileServerBinding() ([]models.VPNGlobalShareFileServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalShareFileServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalShareFileServerBinding `json:"vpnglobal_sharefileserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalShareFileServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalShareFileServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalShareFileServerBinding `json:"vpnglobal_sharefileserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_sslcertkey_binding +func (s *VPNService) AddVPNGlobalSSLCertKeyBinding(resource models.VPNGlobalSSLCertKeyBinding) error { + payload := map[string]any{"vpnglobal_sslcertkey_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalSSLCertKeyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalSSLCertKeyBinding(certkeyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalSSLCertKeyBindingURL, certkeyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalSSLCertKeyBinding() ([]models.VPNGlobalSSLCertKeyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalSSLCertKeyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalSSLCertKeyBinding `json:"vpnglobal_sslcertkey_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalSSLCertKeyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalSSLCertKeyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalSSLCertKeyBinding `json:"vpnglobal_sslcertkey_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_staserver_binding +func (s *VPNService) AddVPNGlobalSTAServerBinding(resource models.VPNGlobalSTAServerBinding) error { + payload := map[string]any{"vpnglobal_staserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalSTAServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalSTAServerBinding(staserver string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalSTAServerBindingURL, staserver), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalSTAServerBinding() ([]models.VPNGlobalSTAServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalSTAServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalSTAServerBinding `json:"vpnglobal_staserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalSTAServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalSTAServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalSTAServerBinding `json:"vpnglobal_staserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnclientlessaccesspolicy_binding +func (s *VPNService) AddVPNGlobalVPNClientLessAccessPolicyBinding(resource models.VPNGlobalVPNClientlessAccessPolicyBinding) error { + payload := map[string]any{"vpnglobal_vpnclientlessaccesspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNClientlessAccessPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNClientLessAccessPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNClientlessAccessPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNClientLessAccessPolicyBinding() ([]models.VPNGlobalVPNClientlessAccessPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNClientlessAccessPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNClientlessAccessPolicyBinding `json:"vpnglobal_vpnclientlessaccesspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNClientLessAccessPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNClientlessAccessPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNClientlessAccessPolicyBinding `json:"vpnglobal_vpnclientlessaccesspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpneula_binding +func (s *VPNService) AddVPNGlobalVPNEULABinding(resource models.VPNGlobalVPNEULABinding) error { + payload := map[string]any{"vpnglobal_vpneula_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNEULABindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNEULABinding(eula string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNEULABindingURL, eula), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNEULABinding() ([]models.VPNGlobalVPNEULABinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNEULABindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNEULABinding `json:"vpnglobal_vpneula_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNEULABinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNEULABindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNEULABinding `json:"vpnglobal_vpneula_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnintranetapplication_binding +func (s *VPNService) AddVPNGlobalVPNIntranetApplicationBinding(resource models.VPNGlobalVPNIntranetApplicationBinding) error { + payload := map[string]any{"vpnglobal_vpnintranetapplication_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNIntranetApplicationBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNIntranetApplicationBinding(intranetapplication string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNIntranetApplicationBindingURL, intranetapplication), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNIntranetApplicationBinding() ([]models.VPNGlobalVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNIntranetApplicationBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNIntranetApplicationBinding `json:"vpnglobal_vpnintranetapplication_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNIntranetApplicationBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNIntranetApplicationBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNIntranetApplicationBinding `json:"vpnglobal_vpnintranetapplication_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnnexthopserver_binding +func (s *VPNService) AddVPNGlobalVPNNextHopServerBinding(resource models.VPNGlobalVPNNextHopServerBinding) error { + payload := map[string]any{"vpnglobal_vpnnexthopserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNNextHopServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNNextHopServerBinding(nexthopserver string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNNextHopServerBindingURL, nexthopserver), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNNextHopServerBinding() ([]models.VPNGlobalVPNNextHopServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNNextHopServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNNextHopServerBinding `json:"vpnglobal_vpnnexthopserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNNextHopServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNNextHopServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNNextHopServerBinding `json:"vpnglobal_vpnnexthopserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnportaltheme_binding +func (s *VPNService) AddVPNGlobalVPNPortalThemeBinding(resource models.VPNGlobalVPNPortalThemeBinding) error { + payload := map[string]any{"vpnglobal_vpnportaltheme_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNPortalThemeBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNPortalThemeBinding(portaltheme string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNPortalThemeBindingURL, portaltheme), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNPortalThemeBinding() ([]models.VPNGlobalVPNPortalThemeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNPortalThemeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNPortalThemeBinding `json:"vpnglobal_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNPortalThemeBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNPortalThemeBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNPortalThemeBinding `json:"vpnglobal_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnsessionpolcy_binding +func (s *VPNService) AddVPNGlobalVPNSessionPolicyBinding(resource models.VPNGlobalVPNSessionPolicyBinding) error { + payload := map[string]any{"vpnglobal_vpnsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNSessionPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNSessionPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNSessionPolicyBinding() ([]models.VPNGlobalVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNSessionPolicyBinding `json:"vpnglobal_vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNSessionPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNSessionPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNSessionPolicyBinding `json:"vpnglobal_vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpntrafficpolicy_binding +func (s *VPNService) AddVPNGlobalVPNTrafficPolicyBinding(resource models.VPNGlobalVPNTrafficPolicyBinding) error { + payload := map[string]any{"vpnglobal_vpntrafficpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNTrafficPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNTrafficPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNTrafficPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNTrafficPolicyBinding() ([]models.VPNGlobalVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNTrafficPolicyBinding `json:"vpnglobal_vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNTrafficPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNTrafficPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNTrafficPolicyBinding `json:"vpnglobal_vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnurlpolicy_binding +func (s *VPNService) AddVPNGlobalVPNURLPolicyBinding(resource models.VPNGlobalVPNURLPolicyBinding) error { + payload := map[string]any{"vpnglobal_vpnurlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNURLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNURLPolicyBinding(policyname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNURLPolicyBindingURL, policyname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNURLPolicyBinding() ([]models.VPNGlobalVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNURLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNURLPolicyBinding `json:"vpnglobal_vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNURLPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNURLPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNURLPolicyBinding `json:"vpnglobal_vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnglobal_vpnurl_binding +func (s *VPNService) AddVPNGlobalVPNURLBinding(resource models.VPNGlobalVPNURLBinding) error { + payload := map[string]any{"vpnglobal_vpnurl_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnGlobalVPNURLBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNGlobalVPNURLBinding(urlname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnGlobalVPNURLBindingURL, urlname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetVPNGlobalVPNURLBinding() ([]models.VPNGlobalVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnGlobalVPNURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNGlobalVPNURLBinding `json:"vpnglobal_vpnurl_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNGlobalVPNURLBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnGlobalVPNURLBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNGlobalVPNURLBinding `json:"vpnglobal_vpnurl_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnicaconnection +func (s *VPNService) KillVPNICAConnection(resource models.VPNICAConnection) error { + payload := map[string]any{"vpnicaconnection": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=kill", vpnICAConnectionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNICAConnection() ([]models.VPNICAConnection, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnICAConnectionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNICAConnection `json:"vpnicaconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNICAConnection() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnICAConnectionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNICAConnection `json:"vpnicaconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnicadtlsconnection +func (s *VPNService) GetAllVPNICADTLSConnection() ([]models.VPNICADTLSConnection, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnICADTLSConnectionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNICADTLSConnection `json:"vpnicadtlsconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNICADTLSConnection() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnICADTLSConnectionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNICADTLSConnection `json:"vpnicadtlsconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnintranetapplication +func (s *VPNService) AddVPNIntranetApplication(resource models.VPNIntranetApplication) error { + payload := map[string]any{"vpnintranetapplication": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnIntranetApplicationURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNIntranetApplication(intranetapplication string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnIntranetApplicationURL, intranetapplication), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNIntranetApplication() ([]models.VPNIntranetApplication, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnIntranetApplicationURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNIntranetApplication `json:"vpnintranetapplication"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNIntranetApplication(intranetapplication string) (*models.VPNIntranetApplication, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnIntranetApplicationURL, intranetapplication), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNIntranetApplication `json:"vpnintranetapplication"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnintranetapplication %s not found", intranetapplication) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNIntranetApplication() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnIntranetApplicationURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNIntranetApplication `json:"vpnintranetapplication"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnnexthopserver +func (s *VPNService) AddVPNNextHopServer(resource models.VPNNextHopServer) error { + payload := map[string]any{"vpnnexthopserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnNextHopServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNNextHopServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnNextHopServerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNNextHopServer() ([]models.VPNNextHopServer, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnNextHopServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNNextHopServer `json:"vpnnexthopserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNNextHopServer(name string) (*models.VPNNextHopServer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnNextHopServerURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNNextHopServer `json:"vpnnexthopserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnnexthopserver %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNNextHopServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnNextHopServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNNextHopServer `json:"vpnnexthopserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnparameter +func (s *VPNService) UpdateVPNParameter(resource models.VPNParameter) error { + payload := map[string]any{"vpnparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnParameterURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNParameter(resource models.VPNParameter) error { + payload := map[string]any{"vpnparameter": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnParameterURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNParameter() (*models.VPNParameter, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnParameterURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNParameter `json:"vpnparameter"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnparameter not found") + } + + return &result.Data[0], nil +} + +// vpnpcoipconnection +func (s *VPNService) KillVPNPCoIPConnection(resource models.VPNPCoIPConnection) error { + payload := map[string]any{"vpnpcoipconnection": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=kill", vpnPCoIPConnectionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNPCoIPConnection() ([]models.VPNPCoIPConnection, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnPCoIPConnectionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPCoIPConnection `json:"vpnpcoipconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNPCoIPConnection() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnPCoIPConnectionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNPCoIPConnection `json:"vpnpcoipconnection"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnpcoipprofile +func (s *VPNService) AddVPNPCoIPProfile(resource models.VPNPCoIPProfile) error { + payload := map[string]any{"vpnpcoipprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnPCoIPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNPCoIPProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnPCoIPProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNPCoIPProfile(resource models.VPNPCoIPProfile) error { + payload := map[string]any{"vpnpcoipprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnPCoIPProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNPCoIPProfile(resource models.VPNPCoIPProfile) error { + payload := map[string]any{"vpnpcoipprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnPCoIPProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNPCoIPProfile() ([]models.VPNPCoIPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnPCoIPProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPCoIPProfile `json:"vpnpcoipprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNPCoIPProfile(name string) (*models.VPNPCoIPProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnPCoIPProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPCoIPProfile `json:"vpnpcoipprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnpcoipprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNPCoIPProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnPCoIPProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNPCoIPProfile `json:"vpnpcoipprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnpcoipvserverprofile +func (s *VPNService) AddVPNPCoIPVServerProfile(resource models.VPNPCoIPVServerProfile) error { + payload := map[string]any{"vpnpcoipvserverprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnPCoIPVServerProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNPCoIPVServerProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnPCoIPVServerProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNPCoIPVServerProfile(resource models.VPNPCoIPVServerProfile) error { + payload := map[string]any{"vpnpcoipvserverprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnPCoIPVServerProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNPCoIPVServerProfile(resource models.VPNPCoIPVServerProfile) error { + payload := map[string]any{"vpnpcoipvserverprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnPCoIPVServerProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNPCoIPVServerProfile() ([]models.VPNPCoIPVServerProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnPCoIPVServerProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPCoIPVServerProfile `json:"vpnpcoipvserverprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNPCoIPVServerProfile(name string) (*models.VPNPCoIPVServerProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnPCoIPVServerProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPCoIPVServerProfile `json:"vpnpcoipvserverprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnpcoipvserverprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNPCoIPVServerProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnPCoIPVServerProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNPCoIPVServerProfile `json:"vpnpcoipvserverprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnportaltheme +func (s *VPNService) AddVPNPortalTheme(resource models.VPNPortalTheme) error { + payload := map[string]any{"vpnportaltheme": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnPortalThemeURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNPortalTheme(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnPortalThemeURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNPortalTheme() ([]models.VPNPortalTheme, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnPortalThemeURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPortalTheme `json:"vpnportaltheme"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNPortalTheme(name string) (*models.VPNPortalTheme, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnPortalThemeURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNPortalTheme `json:"vpnportaltheme"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnportaltheme %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNPortalTheme() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnPortalThemeURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNPortalTheme `json:"vpnportaltheme"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsamlssoprofile +func (s *VPNService) AddVPNSAMLSSOProfile(resource models.VPNSAMLSSOProfile) error { + payload := map[string]any{"vpnsamlssoprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnSAMLSSOProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNSAMLSSOProfile(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnSAMLSSOProfileURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNSAMLSSOProfile(resource models.VPNSAMLSSOProfile) error { + payload := map[string]any{"vpnsamlssoprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnSAMLSSOProfileURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNSAMLSSOProfile(resource models.VPNSAMLSSOProfile) error { + payload := map[string]any{"vpnsamlssoprofile": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnSAMLSSOProfileURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNSAMLSSOProfile() ([]models.VPNSAMLSSOProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSAMLSSOProfileURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSAMLSSOProfile `json:"vpnsamlssoprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSAMLSSOProfile(name string) (*models.VPNSAMLSSOProfile, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSAMLSSOProfileURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSAMLSSOProfile `json:"vpnsamlssoprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsamlssoprofile %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSAMLSSOProfile() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSAMLSSOProfileURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSAMLSSOProfile `json:"vpnsamlssoprofile"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsessionaction +func (s *VPNService) AddVPNSessionAction(resource models.VPNSessionAction) error { + payload := map[string]any{"vpnsessionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnSessionActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNSessionAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnSessionActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNSessionAction(resource models.VPNSessionAction) error { + payload := map[string]any{"vpnsessionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnSessionActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNSessionAction(resource models.VPNSessionAction) error { + payload := map[string]any{"vpnsessionaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnSessionActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNSessionAction() ([]models.VPNSessionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionAction `json:"vpnsessionaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionAction(name string) (*models.VPNSessionAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionAction `json:"vpnsessionaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionAction `json:"vpnsessionaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsessionpolicy +func (s *VPNService) AddVPNSessionPolicy(resource models.VPNSessionPolicy) error { + payload := map[string]any{"vpnsessionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnSessionPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNSessionPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnSessionPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNSessionPolicy(resource models.VPNSessionPolicy) error { + payload := map[string]any{"vpnsessionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnSessionPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNSessionPolicy(resource models.VPNSessionPolicy) error { + payload := map[string]any{"vpnsessionpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnSessionPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNSessionPolicy() ([]models.VPNSessionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicy `json:"vpnsessionpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicy(name string) (*models.VPNSessionPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicy `json:"vpnsessionpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionPolicy `json:"vpnsessionpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsesisonpolicy_aaagroup_binding +func (s *VPNService) GetAllVPNSessionPolicyAAAGroupBinding() ([]models.VPNSessionPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAGroupBinding `json:"vpnsessionpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicyAAAGroupBinding(name string) (*models.VPNSessionPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyAAAGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAGroupBinding `json:"vpnsessionpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy_aaagroup_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionPolicyAAAGroupBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionPolicyAAAGroupBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAGroupBinding `json:"vpnsessionpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsessionpolicy_aaauser_binding +func (s *VPNService) GetAllVPNSessionPolicyAAAUserBinding() ([]models.VPNSessionPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAUserBinding `json:"vpnsessionpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicyAAAUserBinding(name string) (*models.VPNSessionPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyAAAUserBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAUserBinding `json:"vpnsessionpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy_aaauser_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionPolicyAAAUserBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionPolicyAAAUserBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionPolicyAAAUserBinding `json:"vpnsessionpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsessionpolicy_binding +func (s *VPNService) GetAllVPNSessionPolicyBinding() ([]models.VPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyBinding `json:"vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicyBinding(name string) (*models.VPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyBinding `json:"vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// vpnsessionpolicy_vpnglobal_binding +func (s *VPNService) GetAllVPNSessionPolicyVPNGlobalBinding() ([]models.VPNSessionPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNGlobalBinding `json:"vpnsessionpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicyVPNGlobalBinding(name string) (*models.VPNSessionPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNGlobalBinding `json:"vpnsessionpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNGlobalBinding `json:"vpnsessionpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsessionpolicy_vpnvserver_binding +func (s *VPNService) GetAllVPNSessionPolicyVPNVServerBinding() ([]models.VPNSessionPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSessionPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNVServerBinding `json:"vpnsessionpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNSessionPolicyVPNVServerBinding(name string) (*models.VPNSessionPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnSessionPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNVServerBinding `json:"vpnsessionpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnsessionpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNSessionPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSessionPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSessionPolicyVPNVServerBinding `json:"vpnsessionpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnsfconfig +func (s *VPNService) GetAllVPNSFConfig() ([]models.VPNSFConfig, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnSFConfigURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNSFConfig `json:"vpnsfconfig"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNSFConfig() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnSFConfigURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNSFConfig `json:"vpnsfconfig"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnstoreinfo +func (s *VPNService) GetAllVPNStoreInfo() ([]models.VPNStoreInfo, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnStoreInfoURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNStoreInfo `json:"vpnstoreinfo"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) CountVPNStoreInfo() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnStoreInfoURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNStoreInfo `json:"vpnstoreinfo"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficaction +func (s *VPNService) AddVPNTrafficAction(resource models.VPNTrafficAction) error { + payload := map[string]any{"vpntrafficaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnTrafficActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNTrafficAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnTrafficActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNTrafficAction(resource models.VPNTrafficAction) error { + payload := map[string]any{"vpntrafficaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnTrafficActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNTrafficAction(resource models.VPNTrafficAction) error { + payload := map[string]any{"vpntrafficaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnTrafficActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNTrafficAction() ([]models.VPNTrafficAction, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficAction `json:"vpntrafficaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficAction(name string) (*models.VPNTrafficAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficAction `json:"vpntrafficaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficAction `json:"vpntrafficaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficpolicy +func (s *VPNService) AddVPNTrafficPolicy(resource models.VPNTrafficPolicy) error { + payload := map[string]any{"vpntrafficpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnTrafficPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNTrafficPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnTrafficPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNTrafficPolicy(resource models.VPNTrafficPolicy) error { + payload := map[string]any{"vpntrafficpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnTrafficPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNTrafficPolicy(resource models.VPNTrafficPolicy) error { + payload := map[string]any{"vpntrafficpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnTrafficPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNTrafficPolicy() ([]models.VPNTrafficPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicy `json:"vpntrafficpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicy(name string) (*models.VPNTrafficPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicy `json:"vpntrafficpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficPolicy `json:"vpntrafficpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficpolicy_aaagroup_binding +func (s *VPNService) GetAllVPNTrafficPolicyAAAGroupBinding() ([]models.VPNTrafficPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAGroupBinding `json:"vpntrafficpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicyAAAGroupBinding(name string) (*models.VPNTrafficPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyAAAGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAGroupBinding `json:"vpntrafficpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy_aaagroup_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficPolicyAAAGroupBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficPolicyAAAGroupBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAGroupBinding `json:"vpntrafficpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficpolicy_aaauser_binding +func (s *VPNService) GetAllVPNTrafficPolicyAAAUserBinding() ([]models.VPNTrafficPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAUserBinding `json:"vpntrafficpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicyAAAUserBinding(name string) (*models.VPNTrafficPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyAAAUserBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAUserBinding `json:"vpntrafficpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy_aaauser_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficPolicyAAAUserBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficPolicyAAAUserBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficPolicyAAAUserBinding `json:"vpntrafficpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficpolicy_binding +func (s *VPNService) GetAllVPNTrafficPolicyBinding() ([]models.VPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyBinding `json:"vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicyBinding(name string) (*models.VPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyBinding `json:"vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// vpntrafficpolicy_vpnglobal_binding +func (s *VPNService) GetAllVPNTrafficPolicyVPNGlobalBinding() ([]models.VPNTrafficPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNGlobalBinding `json:"vpntrafficpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicyVPNGlobalBinding(name string) (*models.VPNTrafficPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNGlobalBinding `json:"vpntrafficpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNGlobalBinding `json:"vpntrafficpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpntrafficpolicy_vpnvserver_binding +func (s *VPNService) GetAllVPNTrafficPolicyVPNVServerBinding() ([]models.VPNTrafficPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnTrafficPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNVServerBinding `json:"vpntrafficpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNTrafficPolicyVPNVServerBinding(name string) (*models.VPNTrafficPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnTrafficPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNVServerBinding `json:"vpntrafficpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpntrafficpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNTrafficPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnTrafficPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNTrafficPolicyVPNVServerBinding `json:"vpntrafficpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurl +func (s *VPNService) AddVPNURL(resource models.VPNURL) error { + payload := map[string]any{"vpnurl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnURLURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNURL(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnURLURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNURL(resource models.VPNURL) error { + payload := map[string]any{"vpnurl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnURLURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNURL(resource models.VPNURL) error { + payload := map[string]any{"vpnurl": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnURLURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNURL() ([]models.VPNURL, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURL `json:"vpnurl"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURL(name string) (*models.VPNURL, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURL `json:"vpnurl"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurl %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURL() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURL `json:"vpnurl"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlaction +func (s *VPNService) AddVPNURLAction(resource models.VPNURLAction) error { + payload := map[string]any{"vpnurlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnURLActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNURLAction(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnURLActionURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNURLAction(resource models.VPNURLAction) error { + payload := map[string]any{"vpnurlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnURLActionURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNURLAction(resource models.VPNURLAction) error { + payload := map[string]any{"vpnurlaction": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnURLActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) RenameVPNURLAction(name string, newname string) error { + payload := map[string]any{ + "vpnurlaction": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", vpnURLActionURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNURLAction() ([]models.VPNURLAction, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLActionURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLAction `json:"vpnurlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLAction(name string) (*models.VPNURLAction, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLActionURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLAction `json:"vpnurlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlaction %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLAction() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLActionURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLAction `json:"vpnurlaction"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlpolicy +func (s *VPNService) AddVPNURLPolicy(resource models.VPNURLPolicy) error { + payload := map[string]any{"vpnurlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnURLPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNURLPolicy(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnURLPolicyURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNURLPolicy(resource models.VPNURLPolicy) error { + payload := map[string]any{"vpnurlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnURLPolicyURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNURLPolicy(resource models.VPNURLPolicy) error { + payload := map[string]any{"vpnurlpolicy": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnURLPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) RenameVPNURLPolicy(name string, newname string) error { + payload := map[string]any{ + "vpnurlpolicy": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", vpnURLPolicyURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNURLPolicy() ([]models.VPNURLPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicy `json:"vpnurlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicy(name string) (*models.VPNURLPolicy, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicy `json:"vpnurlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLPolicy() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLPolicyURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLPolicy `json:"vpnurlpolicy"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlpolicy_aaagroup_binding +func (s *VPNService) GetAllVPNURLPolicyAAAGroupBinding() ([]models.VPNURLPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyAAAGroupBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyAAAGroupBinding `json:"vpnurlpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicyAAAGroupBinding(name string) (*models.VPNURLPolicyAAAGroupBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyAAAGroupBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyAAAGroupBinding `json:"vpnurlpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy_aaagroup_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLPolicyAAAGroupBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLPolicyAAAGroupBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLPolicyAAAGroupBinding `json:"vpnurlpolicy_aaagroup_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlpolicy_aaauser_binding +func (s *VPNService) GetAllVPNURLPolicyAAAUserBinding() ([]models.VPNURLPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyAAAUserBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyAAAUserBinding `json:"vpnurlpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicyAAAUserBinding(name string) (*models.VPNURLPolicyAAAUserBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyAAAUserBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyAAAUserBinding `json:"vpnurlpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy_aaauser_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLPolicyAAAUserBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLPolicyAAAUserBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLPolicyAAAUserBinding `json:"vpnurlpolicy_aaauser_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlpolicy_binding +func (s *VPNService) GetAllVPNURLPolicyBinding() ([]models.VPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyBinding `json:"vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicyBinding(name string) (*models.VPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyBinding `json:"vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// vpnurlpolicy_vpnglobal_binding +func (s *VPNService) GetAllVPNURLPolicyVPNGlobalBinding() ([]models.VPNURLPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyVPNGlobalBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyVPNGlobalBinding `json:"vpnurlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicyVPNGlobalBinding(name string) (*models.VPNURLPolicyVPNGlobalBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyVPNGlobalBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyVPNGlobalBinding `json:"vpnurlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy_vpnglobal_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLPolicyVPNGlobalBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLPolicyVPNGlobalBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLPolicyVPNGlobalBinding `json:"vpnurlpolicy_vpnglobal_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnurlpolicy_vpnvserver_binding +func (s *VPNService) GetAllVPNURLPolicyVPNVServerBinding() ([]models.VPNURLPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnURLPolicyVPNVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyVPNVServerBinding `json:"vpnurlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNURLPolicyVPNVServerBinding(name string) (*models.VPNURLPolicyVPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnURLPolicyVPNVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNURLPolicyVPNVServerBinding `json:"vpnurlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnurlpolicy_vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNURLPolicyVPNVServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnURLPolicyVPNVServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNURLPolicyVPNVServerBinding `json:"vpnurlpolicy_vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver +func (s *VPNService) AddVPNVServer(resource models.VPNVServer) error { + payload := map[string]any{"vpnvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServer(name string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s", vpnVServerURL, name), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UpdateVPNVServer(resource models.VPNVServer) error { + payload := map[string]any{"vpnvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPut, vpnVServerURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) UnsetVPNVServer(resource models.VPNVServer) error { + payload := map[string]any{"vpnvserver": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=unset", vpnVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) EnableVPNVServer(name string) error { + payload := map[string]any{"vpnvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=enable", vpnVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DisableVPNVServer(name string) error { + payload := map[string]any{"vpnvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=disable", vpnVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) RenameVPNVServer(name string, newname string) error { + payload := map[string]any{ + "vpnvserver": map[string]any{ + "name": name, + "newname": newname, + }, + } + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=rename", vpnVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) CheckVPNVServer(name string) error { + payload := map[string]any{"vpnvserver": map[string]string{"name": name}} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, fmt.Sprintf("%s?action=check", vpnVServerURL), bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServer() ([]models.VPNVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServer `json:"vpnvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServer(name string) (*models.VPNVServer, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServer `json:"vpnvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServer() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServer `json:"vpnvserver"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_aaapreauthenticationpolicy_binding +func (s *VPNService) AddVPNVServerAAAPreauthenticationPolicyBinding(resource models.VPNVServerAAAPreauthenticationPolicyBinding) error { + payload := map[string]any{"vpnvserver_aaapreauthenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAAAPreauthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAAAPreauthenticationPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAAAPreauthenticationPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAAAPreauthenticationPolicyBinding() ([]models.VPNVServerAAAPreauthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAAAPreauthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAAAPreauthenticationPolicyBinding `json:"vpnvserver_aaapreauthenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAAAPreauthenticationPolicyBinding(name string) (*models.VPNVServerAAAPreauthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAAAPreauthenticationPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAAAPreauthenticationPolicyBinding `json:"vpnvserver_aaapreauthenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_aaapreauthenticationpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAAAPreauthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAAAPreauthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAAAPreauthenticationPolicyBinding `json:"vpnvserver_aaapreauthenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_analyticsprofile_binding +func (s *VPNService) AddVPNVServerAnalyticsProfileBinding(resource models.VPNVServerAnalyticsProfileBinding) error { + payload := map[string]any{"vpnvserver_analyticsprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAnalyticsProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAnalyticsProfileBinding(name string, analyticsprofile string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=analyticsprofile:%s", vpnVServerAnalyticsProfileBindingURL, name, analyticsprofile), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAnalyticsProfileBinding() ([]models.VPNVServerAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAnalyticsProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAnalyticsProfileBinding `json:"vpnvserver_analyticsprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAnalyticsProfileBinding(name string) (*models.VPNVServerAnalyticsProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAnalyticsProfileBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAnalyticsProfileBinding `json:"vpnvserver_analyticsprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_analyticsprofile_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAnalyticsProfileBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAnalyticsProfileBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAnalyticsProfileBinding `json:"vpnvserver_analyticsprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_appcontroller_binding +func (s *VPNService) AddVPNVServerAppControllerBinding(resource models.VPNVServerAppControllerBinding) error { + payload := map[string]any{"vpnvserver_appcontroller_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAppControllerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAppControllerBinding(name string, appcontroller string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=appcontroller:%s", vpnVServerAppControllerBindingURL, name, appcontroller), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAppControllerBinding() ([]models.VPNVServerAppControllerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAppControllerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAppControllerBinding `json:"vpnvserver_appcontroller_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAppControllerBinding(name string) (*models.VPNVServerAppControllerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAppControllerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAppControllerBinding `json:"vpnvserver_appcontroller_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_appcontroller_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAppControllerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAppControllerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAppControllerBinding `json:"vpnvserver_appcontroller_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_appflowpolicy_binding +func (s *VPNService) AddVPNVServerAppFlowPolicyBinding(resource models.VPNVServerAppFlowPolicyBinding) error { + payload := map[string]any{"vpnvserver_appflowpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAppFlowPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAppFlowPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAppFlowPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAppFlowPolicyBinding() ([]models.VPNVServerAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAppFlowPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAppFlowPolicyBinding `json:"vpnvserver_appflowpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAppFlowPolicyBinding(name string) (*models.VPNVServerAppFlowPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAppFlowPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAppFlowPolicyBinding `json:"vpnvserver_appflowpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_appflowpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAppFlowPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAppFlowPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAppFlowPolicyBinding `json:"vpnvserver_appflowpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_auditnslogpolicy_binding +func (s *VPNService) AddVPNVServerAuditNSLogPolicyBinding(resource models.VPNVServerAuditNSLogPolicyBinding) error { + payload := map[string]any{"vpnvserver_auditnslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuditNSLogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuditNSLogPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuditNSLogPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuditNSLogPolicyBinding() ([]models.VPNVServerAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuditNSLogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuditNSLogPolicyBinding `json:"vpnvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuditNSLogPolicyBinding(name string) (*models.VPNVServerAuditNSLogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuditNSLogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuditNSLogPolicyBinding `json:"vpnvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_auditnslogpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuditNSLogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuditNSLogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuditNSLogPolicyBinding `json:"vpnvserver_auditnslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_auditsyslogpolicy_binding +func (s *VPNService) AddVPNVServerAuditSyslogPolicyBinding(resource models.VPNVServerAuditSyslogPolicyBinding) error { + payload := map[string]any{"vpnvserver_auditsyslogpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuditSyslogPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuditSyslogPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuditSyslogPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuditSyslogPolicyBinding() ([]models.VPNVServerAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuditSyslogPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuditSyslogPolicyBinding `json:"vpnvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuditSyslogPolicyBinding(name string) (*models.VPNVServerAuditSyslogPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuditSyslogPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuditSyslogPolicyBinding `json:"vpnvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_auditsyslogpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuditSyslogPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuditSyslogPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuditSyslogPolicyBinding `json:"vpnvserver_auditsyslogpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationcertpolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationCertPolicyBinding(resource models.VPNVServerAuthenticationCertPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationcertpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationCertPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationCertPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationCertPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationCertPolicyBinding() ([]models.VPNVServerAuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationCertPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationCertPolicyBinding `json:"vpnvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationCertPolicyBinding(name string) (*models.VPNVServerAuthenticationCertPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationCertPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationCertPolicyBinding `json:"vpnvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationcertpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationCertPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationCertPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationCertPolicyBinding `json:"vpnvserver_authenticationcertpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationfapolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationFAPolicyBinding(resource models.VPNVServerAuthenticationDFAPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationdfapolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationFAPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationFAPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationFAPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationFAPolicyBinding() ([]models.VPNVServerAuthenticationDFAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationFAPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationDFAPolicyBinding `json:"vpnvserver_authenticationdfapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationFAPolicyBinding(name string) (*models.VPNVServerAuthenticationDFAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationFAPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationDFAPolicyBinding `json:"vpnvserver_authenticationdfapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationfapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationFAPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationFAPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationDFAPolicyBinding `json:"vpnvserver_authenticationdfapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationldappolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationLDAPPolicyBinding(resource models.VPNVServerAuthenticationLDAPPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationldappolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationLDAPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationLDAPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationLDAPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationLDAPPolicyBinding() ([]models.VPNVServerAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationLDAPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLDAPPolicyBinding `json:"vpnvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationLDAPPolicyBinding(name string) (*models.VPNVServerAuthenticationLDAPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationLDAPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLDAPPolicyBinding `json:"vpnvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationldappolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationLDAPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationLDAPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLDAPPolicyBinding `json:"vpnvserver_authenticationldappolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationlocalpolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationLocalPolicyBinding(resource models.VPNVServerAuthenticationLocalPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationlocalpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationLocalPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationLocalPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationLocalPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationLocalPolicyBinding() ([]models.VPNVServerAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationLocalPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLocalPolicyBinding `json:"vpnvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationLocalPolicyBinding(name string) (*models.VPNVServerAuthenticationLocalPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationLocalPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLocalPolicyBinding `json:"vpnvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationlocalpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationLocalPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationLocalPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLocalPolicyBinding `json:"vpnvserver_authenticationlocalpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationloginschemapolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationLoginSchemaPolicyBinding(resource models.VPNVServerAuthenticationLoginSchemaPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationloginschemapolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationLoginSchemaPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationLoginSchemaPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationLoginSchemaPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationLoginSchemaPolicyBinding() ([]models.VPNVServerAuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationLoginSchemaPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLoginSchemaPolicyBinding `json:"vpnvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationLoginSchemaPolicyBinding(name string) (*models.VPNVServerAuthenticationLoginSchemaPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationLoginSchemaPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLoginSchemaPolicyBinding `json:"vpnvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationloginschemapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationLoginSchemaPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationLoginSchemaPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationLoginSchemaPolicyBinding `json:"vpnvserver_authenticationloginschemapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationnegotiatepolcy_binding +func (s *VPNService) AddVPNVServerAuthenticationNegotiatePolicyBinding(resource models.VPNVServerAuthenticationNegotiatePolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationnegotiatepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationNegotiatePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationNegotiatePolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationNegotiatePolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationNegotiatePolicyBinding() ([]models.VPNVServerAuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationNegotiatePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationNegotiatePolicyBinding `json:"vpnvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationNegotiatePolicyBinding(name string) (*models.VPNVServerAuthenticationNegotiatePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationNegotiatePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationNegotiatePolicyBinding `json:"vpnvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationnegotiatepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationNegotiatePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationNegotiatePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationNegotiatePolicyBinding `json:"vpnvserver_authenticationnegotiatepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationoauthidppolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationOAuthIDPPolicyBinding(resource models.VPNVServerAuthenticationOAuthIDPPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationoauthidppolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationOAuthIDPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationOAuthIDPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationOAuthIDPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationOAuthIDPPolicyBinding() ([]models.VPNVServerAuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationOAuthIDPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationOAuthIDPPolicyBinding `json:"vpnvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationOAuthIDPPolicyBinding(name string) (*models.VPNVServerAuthenticationOAuthIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationOAuthIDPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationOAuthIDPPolicyBinding `json:"vpnvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationoauthidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationOAuthIDPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationOAuthIDPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationOAuthIDPPolicyBinding `json:"vpnvserver_authenticationoauthidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationpolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationPolicyBinding(resource models.VPNVServerAuthenticationPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationPolicyBinding() ([]models.VPNVServerAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationPolicyBinding `json:"vpnvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationPolicyBinding(name string) (*models.VPNVServerAuthenticationPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationPolicyBinding `json:"vpnvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationPolicyBinding `json:"vpnvserver_authenticationpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationradiuspolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationRADIUSPolicyBinding(resource models.VPNVServerAuthenticationRADIUSPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationradiuspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationRADIUSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationRADIUSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationRADIUSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationRADIUSPolicyBinding() ([]models.VPNVServerAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationRADIUSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationRADIUSPolicyBinding `json:"vpnvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationRADIUSPolicyBinding(name string) (*models.VPNVServerAuthenticationRADIUSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationRADIUSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationRADIUSPolicyBinding `json:"vpnvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationradiuspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationRADIUSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationRADIUSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationRADIUSPolicyBinding `json:"vpnvserver_authenticationradiuspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationsamlidppolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationSAMLIDPPolicyBinding(resource models.VPNVServerAuthenticationSAMLIDPPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationsamlidppolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationSAMLIDPPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationSAMLIDPPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationSAMLIDPPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationSAMLIDPPolicyBinding() ([]models.VPNVServerAuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationSAMLIDPPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLIDPPolicyBinding `json:"vpnvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationSAMLIDPPolicyBinding(name string) (*models.VPNVServerAuthenticationSAMLIDPPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationSAMLIDPPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLIDPPolicyBinding `json:"vpnvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationsamlidppolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationSAMLIDPPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationSAMLIDPPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLIDPPolicyBinding `json:"vpnvserver_authenticationsamlidppolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationsamlpolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationSAMLPolicyBinding(resource models.VPNVServerAuthenticationSAMLPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationsamlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationSAMLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationSAMLPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationSAMLPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationSAMLPolicyBinding() ([]models.VPNVServerAuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationSAMLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLPolicyBinding `json:"vpnvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationSAMLPolicyBinding(name string) (*models.VPNVServerAuthenticationSAMLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationSAMLPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLPolicyBinding `json:"vpnvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationsamlpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationSAMLPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationSAMLPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationSAMLPolicyBinding `json:"vpnvserver_authenticationsamlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationtacacspolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationTACACSPolicyBinding(resource models.VPNVServerAuthenticationTACACSPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationtacacspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationTACACSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationTACACSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationTACACSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationTACACSPolicyBinding() ([]models.VPNVServerAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationTACACSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationTACACSPolicyBinding `json:"vpnvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationTACACSPolicyBinding(name string) (*models.VPNVServerAuthenticationTACACSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationTACACSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationTACACSPolicyBinding `json:"vpnvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationtacacspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationTACACSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationTACACSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationTACACSPolicyBinding `json:"vpnvserver_authenticationtacacspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_authenticationwebauthpolicy_binding +func (s *VPNService) AddVPNVServerAuthenticationWebAuthPolicyBinding(resource models.VPNVServerAuthenticationWebAuthPolicyBinding) error { + payload := map[string]any{"vpnvserver_authenticationwebauthpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerAuthenticationWebAuthPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerAuthenticationWebAuthPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerAuthenticationWebAuthPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerAuthenticationWebAuthPolicyBinding() ([]models.VPNVServerAuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerAuthenticationWebAuthPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationWebAuthPolicyBinding `json:"vpnvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerAuthenticationWebAuthPolicyBinding(name string) (*models.VPNVServerAuthenticationWebAuthPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerAuthenticationWebAuthPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerAuthenticationWebAuthPolicyBinding `json:"vpnvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_authenticationwebauthpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerAuthenticationWebAuthPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerAuthenticationWebAuthPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerAuthenticationWebAuthPolicyBinding `json:"vpnvserver_authenticationwebauthpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_binding +func (s *VPNService) GetAllVPNVServerBinding() ([]models.VPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerBinding `json:"vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerBinding(name string) (*models.VPNVServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerBinding `json:"vpnvserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +// vpnvserver_cachepolicy_binding +func (s *VPNService) AddVPNVServerCachePolicyBinding(resource models.VPNVServerCachePolicyBinding) error { + payload := map[string]any{"vpnvserver_cachepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerCachePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerCachePolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerCachePolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerCachePolicyBinding() ([]models.VPNVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerCachePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerCachePolicyBinding `json:"vpnvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerCachePolicyBinding(name string) (*models.VPNVServerCachePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerCachePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerCachePolicyBinding `json:"vpnvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_cachepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerCachePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerCachePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerCachePolicyBinding `json:"vpnvserver_cachepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_cspolicy_binding +func (s *VPNService) AddVPNVServerCSPolicyBinding(resource models.VPNVServerCSPolicyBinding) error { + payload := map[string]any{"vpnvserver_cspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerCSPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerCSPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerCSPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerCSPolicyBinding() ([]models.VPNVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerCSPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerCSPolicyBinding `json:"vpnvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerCSPolicyBinding(name string) (*models.VPNVServerCSPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerCSPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerCSPolicyBinding `json:"vpnvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_cspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerCSPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerCSPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerCSPolicyBinding `json:"vpnvserver_cspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_feopolicy_binding +func (s *VPNService) AddVPNVServerFEOPolicyBinding(resource models.VPNVServerFEOPolicyBinding) error { + payload := map[string]any{"vpnvserver_feopolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerFEOPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerFEOPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerFEOPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerFEOPolicyBinding() ([]models.VPNVServerFEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerFEOPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerFEOPolicyBinding `json:"vpnvserver_feopolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerFEOPolicyBinding(name string) (*models.VPNVServerFEOPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerFEOPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerFEOPolicyBinding `json:"vpnvserver_feopolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_feopolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} +func (s *VPNService) CountVPNVServerFEOPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerFEOPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerFEOPolicyBinding `json:"vpnvserver_feopolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_icapolicy_binding +func (s *VPNService) AddVPNVServerICAPolicyBinding(resource models.VPNVServerICAPolicyBinding) error { + payload := map[string]any{"vpnvserver_icapolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerICAPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerICAPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerICAPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerICAPolicyBinding() ([]models.VPNVServerICAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerICAPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerICAPolicyBinding `json:"vpnvserver_icapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerICAPolicyBinding(name string) (*models.VPNVServerICAPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerICAPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerICAPolicyBinding `json:"vpnvserver_icapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_icapolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerICAPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerICAPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerICAPolicyBinding `json:"vpnvserver_icapolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_intranetip6_binding +func (s *VPNService) AddVPNVServerIntranetIP6Binding(resource models.VPNVServerIntranetIP6Binding) error { + payload := map[string]any{"vpnvserver_intranetip6_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerIntranetIP6BindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerIntranetIP6Binding(name string, intranetip6 string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=intranetip6:%s", vpnVServerIntranetIP6BindingURL, name, intranetip6), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerIntranetIP6Binding() ([]models.VPNVServerIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerIntranetIP6BindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerIntranetIP6Binding `json:"vpnvserver_intranetip6_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerIntranetIP6Binding(name string) (*models.VPNVServerIntranetIP6Binding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerIntranetIP6BindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerIntranetIP6Binding `json:"vpnvserver_intranetip6_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_intranetip6_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerIntranetIP6Binding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerIntranetIP6BindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerIntranetIP6Binding `json:"vpnvserver_intranetip6_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_intranetip_binding +func (s *VPNService) AddVPNVServerIntranetIPBinding(resource models.VPNVServerIntranetIPBinding) error { + payload := map[string]any{"vpnvserver_intranetip_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerIntranetIPBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerIntranetIPBinding(name string, intranetip string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=intranetip:%s", vpnVServerIntranetIPBindingURL, name, intranetip), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerIntranetIPBinding() ([]models.VPNVServerIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerIntranetIPBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerIntranetIPBinding `json:"vpnvserver_intranetip_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerIntranetIPBinding(name string) (*models.VPNVServerIntranetIPBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerIntranetIPBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerIntranetIPBinding `json:"vpnvserver_intranetip_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_intranetip_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerIntranetIPBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerIntranetIPBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerIntranetIPBinding `json:"vpnvserver_intranetip_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_responderpolicy_binding +func (s *VPNService) AddVPNVServerResponderPolicyBinding(resource models.VPNVServerResponderPolicyBinding) error { + payload := map[string]any{"vpnvserver_responderpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerResponderPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerResponderPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerResponderPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerResponderPolicyBinding() ([]models.VPNVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerResponderPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerResponderPolicyBinding `json:"vpnvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerResponderPolicyBinding(name string) (*models.VPNVServerResponderPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerResponderPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerResponderPolicyBinding `json:"vpnvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_responderpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerResponderPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerResponderPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerResponderPolicyBinding `json:"vpnvserver_responderpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_rewritepolicy_binding +func (s *VPNService) AddVPNVServerRewritePolicyBinding(resource models.VPNVServerRewritePolicyBinding) error { + payload := map[string]any{"vpnvserver_rewritepolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerRewritePolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerRewritePolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerRewritePolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerRewritePolicyBinding() ([]models.VPNVServerRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerRewritePolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerRewritePolicyBinding `json:"vpnvserver_rewritepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerRewritePolicyBinding(name string) (*models.VPNVServerRewritePolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerRewritePolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerRewritePolicyBinding `json:"vpnvserver_rewritepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_rewritepolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerRewritePolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerRewritePolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerRewritePolicyBinding `json:"vpnvserver_rewritepolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_sharefileserver_binding +func (s *VPNService) AddVPNVServerShareFileServerBinding(resource models.VPNVServerShareFileServerBinding) error { + payload := map[string]any{"vpnvserver_sharefileserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerShareFileServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerShareFileServerBinding(name string, sharefile string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=sharefile:%s", vpnVServerShareFileServerBindingURL, name, sharefile), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerShareFileServerBinding() ([]models.VPNVServerShareFileServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerShareFileServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerShareFileServerBinding `json:"vpnvserver_sharefileserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerShareFileServerBinding(name string) (*models.VPNVServerShareFileServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerShareFileServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerShareFileServerBinding `json:"vpnvserver_sharefileserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_sharefileserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerShareFileServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerShareFileServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerShareFileServerBinding `json:"vpnvserver_sharefileserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_staserver_binding +func (s *VPNService) AddVPNVServerSTAServerBinding(resource models.VPNVServerSTAServerBinding) error { + payload := map[string]any{"vpnvserver_staserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerSTAServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerSTAServerBinding(name string, staserver string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=staserver:%s", vpnVServerSTAServerBindingURL, name, staserver), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerSTAServerBinding() ([]models.VPNVServerSTAServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerSTAServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerSTAServerBinding `json:"vpnvserver_staserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerSTAServerBinding(name string) (*models.VPNVServerSTAServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerSTAServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerSTAServerBinding `json:"vpnvserver_staserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_staserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerSTAServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerSTAServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerSTAServerBinding `json:"vpnvserver_staserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnclientlessaccesspolicy_binding +func (s *VPNService) AddVPNVServerVPNClientlessAccessPolicyBinding(resource models.VPNVServerVPNClientlessAccessPolicyBinding) error { + payload := map[string]any{"vpnvserver_vpnclientlessaccesspolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNClientlessAccessPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNClientlessAccessPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerVPNClientlessAccessPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNClientlessAccessPolicyBinding() ([]models.VPNVServerVPNClientlessAccessPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNClientlessAccessPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNClientlessAccessPolicyBinding `json:"vpnvserver_vpnclientlessaccesspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNClientlessAccessPolicyBinding(name string) (*models.VPNVServerVPNClientlessAccessPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNClientlessAccessPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNClientlessAccessPolicyBinding `json:"vpnvserver_vpnclientlessaccesspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnclientlessaccesspolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNClientlessAccessPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNClientlessAccessPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNClientlessAccessPolicyBinding `json:"vpnvserver_vpnclientlessaccesspolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnepaprofile_binding +func (s *VPNService) AddVPNVServerVPNEPAProfileBinding(resource models.VPNVServerVPNEPAProfileBinding) error { + payload := map[string]any{"vpnvserver_vpnepaprofile_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNEPAProfileBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNEPAProfileBinding(name string, epaprofile string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=epaprofile:%s", vpnVServerVPNEPAProfileBindingURL, name, epaprofile), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNEPAProfileBinding() ([]models.VPNVServerVPNEPAProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNEPAProfileBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNEPAProfileBinding `json:"vpnvserver_vpnepaprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNEPAProfileBinding(name string) (*models.VPNVServerVPNEPAProfileBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNEPAProfileBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNEPAProfileBinding `json:"vpnvserver_vpnepaprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnepaprofile_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNEPAProfileBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNEPAProfileBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNEPAProfileBinding `json:"vpnvserver_vpnepaprofile_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpneula_binding +func (s *VPNService) AddVPNVServerVPNEULABinding(resource models.VPNVServerVPNEULABinding) error { + payload := map[string]any{"vpnvserver_vpneula_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNEULABindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNEULABinding(name string, eula string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=eula:%s", vpnVServerVPNEULABindingURL, name, eula), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNEULABinding() ([]models.VPNVServerVPNEULABinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNEULABindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNEULABinding `json:"vpnvserver_vpneula_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNEULABinding(name string) (*models.VPNVServerVPNEULABinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNEULABindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNEULABinding `json:"vpnvserver_vpneula_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpneula_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNEULABinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNEULABindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNEULABinding `json:"vpnvserver_vpneula_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnintranetapplication_binding +func (s *VPNService) AddVPNVServerVPNIntranetApplicationBinding(resource models.VPNVServerVPNIntranetApplicationBinding) error { + payload := map[string]any{"vpnvserver_vpnintranetapplication_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNIntranetApplicationBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNIntranetApplicationBinding(name string, intranetapplication string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=intranetapplication:%s", vpnVServerVPNIntranetApplicationBindingURL, name, intranetapplication), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNIntranetApplicationBinding() ([]models.VPNVServerVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNIntranetApplicationBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNIntranetApplicationBinding `json:"vpnvserver_vpnintranetapplication_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNIntranetApplicationBinding(name string) (*models.VPNVServerVPNIntranetApplicationBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNIntranetApplicationBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNIntranetApplicationBinding `json:"vpnvserver_vpnintranetapplication_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnintranetapplication_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNIntranetApplicationBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNIntranetApplicationBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNIntranetApplicationBinding `json:"vpnvserver_vpnintranetapplication_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnnexthopserver_binding +func (s *VPNService) AddVPNVServerVPNNextHopServerBinding(resource models.VPNVServerVPNNextHopServerBinding) error { + payload := map[string]any{"vpnvserver_vpnnexthopserver_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNNextHopServerBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNNextHopServerBinding(name string, nexthopserver string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=nexthopserver:%s", vpnVServerVPNNextHopServerBindingURL, name, nexthopserver), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNNextHopServerBinding() ([]models.VPNVServerVPNNextHopServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNNextHopServerBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNNextHopServerBinding `json:"vpnvserver_vpnnexthopserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNNextHopServerBinding(name string) (*models.VPNVServerVPNNextHopServerBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNNextHopServerBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNNextHopServerBinding `json:"vpnvserver_vpnnexthopserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnnexthopserver_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNNextHopServerBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNNextHopServerBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNNextHopServerBinding `json:"vpnvserver_vpnnexthopserver_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnportaltheme_binding +func (s *VPNService) AddVPNVServerVPNPortalThemeBinding(resource models.VPNVServerVPNPortalThemeBinding) error { + payload := map[string]any{"vpnvserver_vpnportaltheme_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNPortalThemeBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNPortalThemeBinding(name string, portaltheme string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=portaltheme:%s", vpnVServerVPNPortalThemeBindingURL, name, portaltheme), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNPortalThemeBinding() ([]models.VPNVServerVPNPortalThemeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNPortalThemeBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNPortalThemeBinding `json:"vpnvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNPortalThemeBinding(name string) (*models.VPNVServerVPNPortalThemeBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNPortalThemeBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNPortalThemeBinding `json:"vpnvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnportaltheme_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNPortalThemeBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNPortalThemeBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNPortalThemeBinding `json:"vpnvserver_vpnportaltheme_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnsessionpolicy_binding +func (s *VPNService) AddVPNVServerVPNSessionPolicyBinding(resource models.VPNVServerVPNSessionPolicyBinding) error { + payload := map[string]any{"vpnvserver_vpnsessionpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNSessionPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNSessionPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerVPNSessionPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNSessionPolicyBinding() ([]models.VPNVServerVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNSessionPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNSessionPolicyBinding `json:"vpnvserver_vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNSessionPolicyBinding(name string) (*models.VPNVServerVPNSessionPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNSessionPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNSessionPolicyBinding `json:"vpnvserver_vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnsessionpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNSessionPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNSessionPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNSessionPolicyBinding `json:"vpnvserver_vpnsessionpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpntrafficpolicy_binding +func (s *VPNService) AddVPNVServerVPNTrafficPolicyBinding(resource models.VPNVServerVPNTrafficPolicyBinding) error { + payload := map[string]any{"vpnvserver_vpntrafficpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNTrafficPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNTrafficPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerVPNTrafficPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNTrafficPolicyBinding() ([]models.VPNVServerVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNTrafficPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNTrafficPolicyBinding `json:"vpnvserver_vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNTrafficPolicyBinding(name string) (*models.VPNVServerVPNTrafficPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNTrafficPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNTrafficPolicyBinding `json:"vpnvserver_vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpntrafficpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNTrafficPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNTrafficPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNTrafficPolicyBinding `json:"vpnvserver_vpntrafficpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnurlpolicy_binding +func (s *VPNService) AddVPNVServerVPNURLPolicyBinding(resource models.VPNVServerVPNURLPolicyBinding) error { + payload := map[string]any{"vpnvserver_vpnurlpolicy_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNURLPolicyBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNURLPolicyBinding(name string, policy string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=policy:%s", vpnVServerVPNURLPolicyBindingURL, name, policy), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNURLPolicyBinding() ([]models.VPNVServerVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNURLPolicyBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNURLPolicyBinding `json:"vpnvserver_vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNURLPolicyBinding(name string) (*models.VPNVServerVPNURLPolicyBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNURLPolicyBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNURLPolicyBinding `json:"vpnvserver_vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnurlpolicy_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNURLPolicyBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNURLPolicyBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNURLPolicyBinding `json:"vpnvserver_vpnurlpolicy_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +} + +// vpnvserver_vpnurl_binding +func (s *VPNService) AddVPNVServerVPNURLBinding(resource models.VPNVServerVPNURLBinding) error { + payload := map[string]any{"vpnvserver_vpnurl_binding": resource} + data, err := json.Marshal(payload) + if err != nil { + return err + } + + req, err := s.client.NewRequest(http.MethodPost, vpnVServerVPNURLBindingURL, bytes.NewReader(data)) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) DeleteVPNVServerVPNURLBinding(name string, urlname string) error { + req, err := s.client.NewRequest(http.MethodDelete, fmt.Sprintf("%s/%s?args=urlname:%s", vpnVServerVPNURLBindingURL, name, urlname), nil) + if err != nil { + return err + } + + _, err = s.client.Do(req) + return err +} + +func (s *VPNService) GetAllVPNVServerVPNURLBinding() ([]models.VPNVServerVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, vpnVServerVPNURLBindingURL, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNURLBinding `json:"vpnvserver_vpnurl_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + return result.Data, nil +} + +func (s *VPNService) GetVPNVServerVPNURLBinding(name string) (*models.VPNVServerVPNURLBinding, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s", vpnVServerVPNURLBindingURL, name), nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(req) + if err != nil { + return nil, err + } + + var result struct { + Data []models.VPNVServerVPNURLBinding `json:"vpnvserver_vpnurl_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return nil, err + } + + if len(result.Data) == 0 { + return nil, fmt.Errorf("vpnvserver_vpnurl_binding %s not found", name) + } + + return &result.Data[0], nil +} + +func (s *VPNService) CountVPNVServerVPNURLBinding() (int, error) { + req, err := s.client.NewRequest(http.MethodGet, fmt.Sprintf("%s?count=yes", vpnVServerVPNURLBindingURL), nil) + if err != nil { + return 0, err + } + + resp, err := s.client.Do(req) + if err != nil { + return 0, err + } + + var result struct { + Data []models.VPNVServerVPNURLBinding `json:"vpnvserver_vpnurl_binding"` + } + if err := json.Unmarshal(resp, &result); err != nil { + return 0, err + } + + if len(result.Data) == 0 { + return 0, nil + } + + return int(result.Data[0].Count), nil +}